From: Tor Lillqvist Date: Thu, 16 Dec 1999 20:29:12 +0000 (+0000) Subject: Use FormatMessage to translate system error codes into textual messages. X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=bc5baaa76d80ae3682d9ce46e6131a6935491015;p=dana%2Fcg-glib.git Use FormatMessage to translate system error codes into textual messages. 1999-12-16 Tor Lillqvist * gmodule/gmodule-win32.c: Use FormatMessage to translate system error codes into textual messages. --- diff --git a/ChangeLog b/ChangeLog index ba135d34..e43e7397 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index ba135d34..e43e7397 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ba135d34..e43e7397 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index ba135d34..e43e7397 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index ba135d34..e43e7397 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ba135d34..e43e7397 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ba135d34..e43e7397 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ba135d34..e43e7397 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +1999-12-16 Tor Lillqvist + + * gmodule/gmodule-win32.c: Use FormatMessage to translate system + error codes into textual messages. + 1999-11-25 Sebastian Wilhelmi * glib.h (G_TRYLOCK): This of course should return TRUE in a diff --git a/gmodule/gmodule-win32.c b/gmodule/gmodule-win32.c index 623398cf..792a6b06 100644 --- a/gmodule/gmodule-win32.c +++ b/gmodule/gmodule-win32.c @@ -43,7 +43,8 @@ _g_module_open (const gchar *file_name, if (!handle) { char error[100]; - sprintf (error, "Error code %d", GetLastError ()); + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (), + 0, error, sizeof (error), NULL); g_module_set_error (error); } @@ -59,7 +60,8 @@ _g_module_self (void) if (!handle) { char error[100]; - sprintf (error, "Error code %d", GetLastError ()); + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (), + 0, error, sizeof (error), NULL); g_module_set_error (error); } @@ -73,7 +75,8 @@ _g_module_close (gpointer handle, if (!FreeLibrary (handle)) { char error[100]; - sprintf (error, "Error code %d", GetLastError ()); + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (), + 0, error, sizeof (error), NULL); g_module_set_error (error); } } @@ -88,7 +91,8 @@ _g_module_symbol (gpointer handle, if (!p) { char error[100]; - sprintf (error, "Error code %d", GetLastError ()); + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (), + 0, error, sizeof (error), NULL); g_module_set_error (error); } return p;