Module: wine Branch: master Commit: 02972b5347300118c0b491c8e1ead036dafe2e4a URL: https://gitlab.winehq.org/wine/wine/-/commit/02972b5347300118c0b491c8e1ead03...
Author: Alexandre Julliard julliard@winehq.org Date: Sat Nov 12 21:15:17 2022 +0100
winemac: Use RtlGetLastWin32Error() instead of GetLastError().
---
dlls/winemac.drv/clipboard.c | 4 ++-- dlls/winemac.drv/dllmain.c | 4 ++-- dlls/winemac.drv/mouse.c | 2 +- dlls/winemac.drv/systray.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c index af8d99b59a3..4e6f4ac44ca 100644 --- a/dlls/winemac.drv/clipboard.c +++ b/dlls/winemac.drv/clipboard.c @@ -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; diff --git a/dlls/winemac.drv/dllmain.c b/dlls/winemac.drv/dllmain.c index 083c539dd26..7a1481f7c48 100644 --- a/dlls/winemac.drv/dllmain.c +++ b/dlls/winemac.drv/dllmain.c @@ -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", diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index 3f79dda2073..6dd90978a93 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -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()); } } diff --git a/dlls/winemac.drv/systray.c b/dlls/winemac.drv/systray.c index 9d660d0287e..8b3452e7540 100644 --- a/dlls/winemac.drv/systray.c +++ b/dlls/winemac.drv/systray.c @@ -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);