mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
registrybackend: do not accept 0 as a windows error
We might end up removing from the error stack the wrong error and this might be missleading
This commit is contained in:
parent
bad7e4a114
commit
bc85dee6b3
@ -211,8 +211,7 @@ g_message_win32_error (DWORD result_code,
|
|||||||
gint pos;
|
gint pos;
|
||||||
gchar win32_message[1024];
|
gchar win32_message[1024];
|
||||||
|
|
||||||
if (result_code == 0)
|
g_return_if_fail (result_code != 0);
|
||||||
result_code = GetLastError ();
|
|
||||||
|
|
||||||
va_start (va, format);
|
va_start (va, format);
|
||||||
pos = g_vsnprintf (win32_message, 512, format, va);
|
pos = g_vsnprintf (win32_message, 512, format, va);
|
||||||
@ -1705,7 +1704,7 @@ watch_start (GRegistryBackend *self)
|
|||||||
watch->message_received_event = CreateEvent (NULL, FALSE, FALSE, NULL);
|
watch->message_received_event = CreateEvent (NULL, FALSE, FALSE, NULL);
|
||||||
if (watch->message_sent_event == NULL || watch->message_received_event == NULL)
|
if (watch->message_sent_event == NULL || watch->message_received_event == NULL)
|
||||||
{
|
{
|
||||||
g_message_win32_error (0, "gregistrybackend: Failed to create sync objects.");
|
g_message_win32_error (GetLastError (), "gregistrybackend: Failed to create sync objects.");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1713,7 +1712,7 @@ watch_start (GRegistryBackend *self)
|
|||||||
watch->thread = CreateThread (NULL, 1024, watch_thread_function, watch, 0, NULL);
|
watch->thread = CreateThread (NULL, 1024, watch_thread_function, watch, 0, NULL);
|
||||||
if (watch->thread == NULL)
|
if (watch->thread == NULL)
|
||||||
{
|
{
|
||||||
g_message_win32_error (0, "gregistrybackend: Failed to create notify watch thread.");
|
g_message_win32_error (GetLastError (), "gregistrybackend: Failed to create notify watch thread.");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user