summaryrefslogtreecommitdiff
path: root/gmodule
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>1999-12-16 20:29:12 +0000
committerTor Lillqvist <tml@src.gnome.org>1999-12-16 20:29:12 +0000
commitbc5baaa76d80ae3682d9ce46e6131a6935491015 (patch)
tree14e9bc8517e34792bc1e4916ee961856bde250bf /gmodule
parentd1bbb7f07fb237a8df5519bed4c7fb424f69d2ae (diff)
downloadglib-bc5baaa76d80ae3682d9ce46e6131a6935491015.tar.gz
Use FormatMessage to translate system error codes into textual messages.
1999-12-16 Tor Lillqvist <tml@iki.fi> * gmodule/gmodule-win32.c: Use FormatMessage to translate system error codes into textual messages.
Diffstat (limited to 'gmodule')
-rw-r--r--gmodule/gmodule-win32.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gmodule/gmodule-win32.c b/gmodule/gmodule-win32.c
index 623398cfc..792a6b06d 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;