mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 12:55:48 +01:00
Don't call FormatMessage() etc here. Call g_win32_error_message() instead
2008-09-12 Tor Lillqvist <tml@novell.com> * gwin32appinfo.c (g_win32_app_info_launch): Don't call FormatMessage() etc here. Call g_win32_error_message() instead which already does all that. Besides, the code was broken as it called the default "A" version of FormatMessage() but still thought it produced a wide string. svn path=/trunk/; revision=7472
This commit is contained in:
parent
b6d834a588
commit
654822b9be
@ -1,3 +1,11 @@
|
|||||||
|
2008-09-12 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* gwin32appinfo.c (g_win32_app_info_launch): Don't call
|
||||||
|
FormatMessage() etc here. Call g_win32_error_message() instead
|
||||||
|
which already does all that. Besides, the code was broken as it
|
||||||
|
called the default "A" version of FormatMessage() but still
|
||||||
|
thought it produced a wide string.
|
||||||
|
|
||||||
2008-09-12 Michael Natterer <mitch@imendio.com>
|
2008-09-12 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
* gfileinfo.c (g_file_info_get_content_type): remove dangling 's'
|
* gfileinfo.c (g_file_info_get_content_type): remove dangling 's'
|
||||||
|
@ -295,23 +295,10 @@ g_win32_app_info_launch (GAppInfo *appinfo,
|
|||||||
|
|
||||||
if (!ShellExecuteExW (&exec_info))
|
if (!ShellExecuteExW (&exec_info))
|
||||||
{
|
{
|
||||||
DWORD last_error;
|
char *message_utf8 = g_win32_error_message (GetLastError ());
|
||||||
LPVOID message;
|
|
||||||
char *message_utf8;
|
|
||||||
|
|
||||||
last_error = GetLastError ();
|
|
||||||
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
|
||||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
|
||||||
NULL,
|
|
||||||
last_error,
|
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
|
||||||
(LPTSTR) &message,
|
|
||||||
0, NULL );
|
|
||||||
|
|
||||||
message_utf8 = g_utf16_to_utf8 (message, -1, NULL, NULL, NULL);
|
|
||||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Error launching application: %s"), message_utf8);
|
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Error launching application: %s"), message_utf8);
|
||||||
g_free (message_utf8);
|
g_free (message_utf8);
|
||||||
LocalFree (message);
|
|
||||||
|
|
||||||
g_free (wfilename);
|
g_free (wfilename);
|
||||||
RegCloseKey (class_key);
|
RegCloseKey (class_key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user