Commit 02972b53 authored by Alexandre Julliard's avatar Alexandre Julliard

winemac: Use RtlGetLastWin32Error() instead of GetLastError().

parent 191b8d01
......@@ -285,7 +285,7 @@ static WINE_CLIPFORMAT *insert_clipboard_format(UINT id, CFStringRef type)
if (!NtUserGetClipboardFormatName(format->format_id, buffer, ARRAY_SIZE(buffer)))
{
WARN("failed to get name for format %s; error 0x%08x\n", debugstr_format(format->format_id), GetLastError());
WARN("failed to get name for format %s; error 0x%08x\n", debugstr_format(format->format_id), RtlGetLastWin32Error());
free(format);
return NULL;
}
......@@ -1428,7 +1428,7 @@ static UINT *get_clipboard_formats(UINT *size)
if (!(ids = malloc(*size * sizeof(*ids)))) return NULL;
if (NtUserGetUpdatedClipboardFormats(ids, *size, size)) break;
free(ids);
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return NULL;
if (RtlGetLastWin32Error() != ERROR_INSUFFICIENT_BUFFER) return NULL;
}
register_win32_formats(ids, *size);
return ids;
......
......@@ -138,7 +138,7 @@ static void CALLBACK quit_callback(HWND hwnd, UINT msg, ULONG_PTR data, LRESULT
quit_callback, (ULONG_PTR)qi))
{
WARN("failed to send WM_ENDSESSION to win %p; error 0x%08x\n",
qi->wins[i], GetLastError());
qi->wins[i], RtlGetLastWin32Error());
quit_callback(qi->wins[i], WM_ENDSESSION, (ULONG_PTR)qi, 0);
}
}
......@@ -197,7 +197,7 @@ NTSTATUS WINAPI macdrv_app_quit_request(void *arg, ULONG size)
if (!SendMessageCallbackW(qi->wins[i], WM_QUERYENDSESSION, 0, qi->flags,
quit_callback, (ULONG_PTR)qi))
{
DWORD error = GetLastError();
DWORD error = RtlGetLastWin32Error();
BOOL invalid = (error == ERROR_INVALID_WINDOW_HANDLE);
if (invalid)
TRACE("failed to send WM_QUERYENDSESSION to win %p because it's invalid; assuming success\n",
......
......@@ -957,6 +957,6 @@ void macdrv_release_capture(HWND hwnd, const macdrv_event *event)
{
NtUserReleaseCapture();
if (!NtUserPostMessage(capture, WM_CANCELMODE, 0, 0))
WARN("failed to post WM_CANCELMODE; error 0x%08x\n", GetLastError());
WARN("failed to post WM_CANCELMODE; error 0x%08x\n", RtlGetLastWin32Error());
}
}
......@@ -298,7 +298,7 @@ static BOOL notify_owner(struct tray_icon *icon, UINT msg, int x, int y)
TRACE("posting msg 0x%04x to hwnd %p id 0x%x\n", msg, icon->owner, icon->id);
if (!NtUserMessageCall(icon->owner, icon->callback_message, wp, lp,
0, NtUserSendNotifyMessage, FALSE) &&
(GetLastError() == ERROR_INVALID_WINDOW_HANDLE))
(RtlGetLastWin32Error() == ERROR_INVALID_WINDOW_HANDLE))
{
WARN("window %p was destroyed, removing icon 0x%x\n", icon->owner, icon->id);
delete_icon(icon);
......@@ -343,7 +343,7 @@ void macdrv_status_item_mouse_button(const macdrv_event *event)
msg += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
if (!send_message(icon->owner, WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS, 0, 0) &&
GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
RtlGetLastWin32Error() == ERROR_INVALID_WINDOW_HANDLE)
{
WARN("window %p was destroyed, removing icon 0x%x\n", icon->owner, icon->id);
delete_icon(icon);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment