Commit 1d6b3e14 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent cc0ac7b4
......@@ -2392,6 +2392,14 @@ ULONG WINAPI RtlNtStatusToDosError( NTSTATUS status )
}
/**********************************************************************
* RtlGetLastWin32Error (ntdll.so)
*/
DWORD WINAPI RtlGetLastWin32Error(void)
{
return NtCurrentTeb()->LastErrorValue;
}
/**********************************************************************
* RtlSetLastWin32Error (ntdll.so)
*/
void WINAPI RtlSetLastWin32Error( DWORD err )
......
......@@ -56,7 +56,7 @@ static struct list formats_to_free = LIST_INIT( formats_to_free );
static const char *debugstr_format( UINT id )
{
WCHAR buffer[256];
DWORD le = GetLastError();
DWORD le = RtlGetLastWin32Error();
BOOL r = NtUserGetClipboardFormatName( id, buffer, ARRAYSIZE(buffer) );
RtlSetLastWin32Error(le);
......
......@@ -2213,7 +2213,7 @@ static void SPY_GetWndName( SPY_INSTANCE *sp_e )
const char *debugstr_msg_name( UINT msg, HWND hWnd )
{
SPY_INSTANCE ext_sp_e;
DWORD save_error = GetLastError();
DWORD save_error = RtlGetLastWin32Error();
ext_sp_e.msgnum = msg;
ext_sp_e.msg_hwnd = hWnd;
......@@ -2504,7 +2504,7 @@ static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter)
/* for CUSTOMDRAW, dump all the data for TOOLBARs */
if (pnmh->code == NM_CUSTOMDRAW) {
/* save and restore error code over the next call */
save_error = GetLastError();
save_error = RtlGetLastWin32Error();
NtUserGetClassName( pnmh->hwndFrom, FALSE, &str );
RtlSetLastWin32Error(save_error);
if (wcscmp(TOOLBARCLASSNAMEW, from_class) == 0)
......@@ -2597,7 +2597,7 @@ void spy_enter_message( INT iFlag, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
{
SPY_INSTANCE sp_e;
int indent;
DWORD save_error = GetLastError();
DWORD save_error = RtlGetLastWin32Error();
if (!spy_init() || exclude_msg(msg)) return;
......@@ -2652,7 +2652,7 @@ void spy_exit_message( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
{
SPY_INSTANCE sp_e;
int indent;
DWORD save_error = GetLastError();
DWORD save_error = RtlGetLastWin32Error();
if (!TRACE_ON(message) || exclude_msg(msg) ||
(exclude_dwp() && iFlag == SPY_RESULT_DEFWND))
......
......@@ -852,7 +852,7 @@ BOOL is_window_enabled( HWND hwnd )
RtlSetLastWin32Error( NO_ERROR );
ret = get_window_long( hwnd, GWL_STYLE );
if (!ret && GetLastError() != NO_ERROR) return FALSE;
if (!ret && RtlGetLastWin32Error() != NO_ERROR) return FALSE;
return !(ret & WS_DISABLED);
}
......@@ -4879,7 +4879,7 @@ static WND *create_window_handle( HWND parent, HWND owner, UNICODE_STRING *name,
if (!handle)
{
WARN( "error %d creating window\n", GetLastError() );
WARN( "error %d creating window\n", RtlGetLastWin32Error() );
return NULL;
}
......
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