From: Jacek Caban jacek@codeweavers.com
--- dlls/win32u/bitblt.c | 8 +-- dlls/win32u/bitmap.c | 12 ++--- dlls/win32u/class.c | 24 ++++----- dlls/win32u/clipboard.c | 14 ++--- dlls/win32u/cursoricon.c | 6 +-- dlls/win32u/dc.c | 6 +-- dlls/win32u/dce.c | 6 +-- dlls/win32u/defwnd.c | 4 +- dlls/win32u/dib.c | 10 ++-- dlls/win32u/driver.c | 4 +- dlls/win32u/font.c | 16 +++--- dlls/win32u/gdiobj.c | 2 +- dlls/win32u/hook.c | 16 +++--- dlls/win32u/imm.c | 4 +- dlls/win32u/input.c | 32 +++++------ dlls/win32u/menu.c | 38 ++++++------- dlls/win32u/message.c | 32 +++++------ dlls/win32u/painting.c | 2 +- dlls/win32u/path.c | 28 +++++----- dlls/win32u/pen.c | 4 +- dlls/win32u/rawinput.c | 44 +++++++-------- dlls/win32u/spy.c | 8 +-- dlls/win32u/sysparams.c | 16 +++--- dlls/win32u/win32u_private.h | 2 +- dlls/win32u/window.c | 100 +++++++++++++++++------------------ dlls/win32u/winstation.c | 18 +++---- 26 files changed, 228 insertions(+), 228 deletions(-)
diff --git a/dlls/win32u/bitblt.c b/dlls/win32u/bitblt.c index 302a3ef77eb..84e1c4eb059 100644 --- a/dlls/win32u/bitblt.c +++ b/dlls/win32u/bitblt.c @@ -360,7 +360,7 @@ BOOL CDECL nulldrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
if (bits.free) bits.free( &bits ); done: - if (err) SetLastError( err ); + if (err) RtlSetLastWin32Error( err ); return !err; }
@@ -997,14 +997,14 @@ BOOL WINAPI NtGdiAlphaBlend( HDC hdcDst, int xDst, int yDst, int widthDst, int h src.height > dcSrc->device_rect.bottom - dcSrc->attr->vis_rect.top - src.y))) { WARN( "Invalid src coords: (%d,%d), size %dx%d\n", src.x, src.y, src.width, src.height ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); ret = FALSE; } else if (dst.log_width < 0 || dst.log_height < 0) { WARN( "Invalid dst coords: (%d,%d), size %dx%d\n", dst.log_x, dst.log_y, dst.log_width, dst.log_height ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); ret = FALSE; } else if (dcSrc == dcDst && src.x + src.width > dst.x && src.x < dst.x + dst.width && @@ -1012,7 +1012,7 @@ BOOL WINAPI NtGdiAlphaBlend( HDC hdcDst, int xDst, int yDst, int widthDst, int h { WARN( "Overlapping coords: (%d,%d), %dx%d and (%d,%d), %dx%d\n", src.x, src.y, src.width, src.height, dst.x, dst.y, dst.width, dst.height ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); ret = FALSE; } else if (!ret) diff --git a/dlls/win32u/bitmap.c b/dlls/win32u/bitmap.c index 5d93ee69ee0..a02708dc8de 100644 --- a/dlls/win32u/bitmap.c +++ b/dlls/win32u/bitmap.c @@ -104,7 +104,7 @@ HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes,
if (width > 0x7ffffff || height > 0x7ffffff) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
@@ -119,7 +119,7 @@ HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes, if (planes != 1) { FIXME("planes = %d\n", planes); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return NULL; }
@@ -133,7 +133,7 @@ HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes, else { WARN("Invalid bmBitsPixel %d, returning ERROR_INVALID_PARAMETER\n", bpp); - SetLastError(ERROR_INVALID_PARAMETER); + RtlSetLastWin32Error(ERROR_INVALID_PARAMETER); return NULL; }
@@ -142,14 +142,14 @@ HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes, /* Check for overflow (dib_stride itself must be ok because of the constraint on bm.bmWidth above). */ if (dib_stride != size / height) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
/* Create the BITMAPOBJ */ if (!(bmpobj = calloc( 1, sizeof(*bmpobj) ))) { - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY ); return 0; }
@@ -163,7 +163,7 @@ HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes, if (!bmpobj->dib.dsBm.bmBits) { free( bmpobj ); - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY ); return 0; }
diff --git a/dlls/win32u/class.c b/dlls/win32u/class.c index 19009fc5c0a..f8a7e67ddd1 100644 --- a/dlls/win32u/class.c +++ b/dlls/win32u/class.c @@ -321,11 +321,11 @@ static CLASS *get_class_ptr( HWND hwnd, BOOL write_access ) /* modifying classes in other processes is not allowed */ if (ptr == WND_DESKTOP || is_window( hwnd )) { - SetLastError( ERROR_ACCESS_DENIED ); + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); return NULL; } } - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return NULL; }
@@ -411,7 +411,7 @@ ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *nam if (wc->cbSize != sizeof(*wc) || wc->cbClsExtra < 0 || wc->cbWndExtra < 0 || (!is_builtin && wc->hInstance == user32_module)) /* we can't register a class for user32 */ { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } if (!(instance = wc->hInstance)) instance = NtCurrentTeb()->Peb->ImageBaseAddress; @@ -586,7 +586,7 @@ ULONG WINAPI NtUserGetAtomName( ATOM atom, UNICODE_STRING *name )
if (name->MaximumLength < sizeof(WCHAR)) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); return 0; }
@@ -608,7 +608,7 @@ INT WINAPI NtUserGetClassName( HWND hwnd, BOOL real, UNICODE_STRING *name )
if (name->MaximumLength <= sizeof(WCHAR)) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); return 0; }
@@ -823,10 +823,10 @@ static ULONG_PTR set_class_long( HWND hwnd, INT offset, LONG_PTR newval, UINT si } break; case GCL_CBCLSEXTRA: /* cannot change this one */ - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); break; default: - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); break; } release_class_ptr( class ); @@ -906,7 +906,7 @@ static ULONG_PTR get_class_long_size( HWND hwnd, INT offset, UINT size, BOOL ans case GCLP_WNDPROC: case GCLP_MENUNAME: FIXME( "offset %d not supported on other process window %p\n", offset, hwnd ); - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); break; case GCL_STYLE: retvalue = reply->old_style; @@ -936,7 +936,7 @@ static ULONG_PTR get_class_long_size( HWND hwnd, INT offset, UINT size, BOOL ans memcpy( &retvalue, &reply->old_extra_value, sizeof(ULONG_PTR) ); } - else SetLastError( ERROR_INVALID_INDEX ); + else RtlSetLastWin32Error( ERROR_INVALID_INDEX ); break; } } @@ -959,7 +959,7 @@ static ULONG_PTR get_class_long_size( HWND hwnd, INT offset, UINT size, BOOL ans memcpy( &retvalue, (char *)(class + 1) + offset, sizeof(ULONG_PTR) ); } else - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); release_class_ptr( class ); return retvalue; } @@ -1000,7 +1000,7 @@ static ULONG_PTR get_class_long_size( HWND hwnd, INT offset, UINT size, BOOL ans retvalue = class->atomName; break; default: - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); break; } release_class_ptr( class ); @@ -1044,7 +1044,7 @@ WORD get_class_word( HWND hwnd, INT offset ) if (offset <= class->cbClsExtra - sizeof(WORD)) memcpy( &retvalue, (char *)(class + 1) + offset, sizeof(retvalue) ); else - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); release_class_ptr( class ); return retvalue; } diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c index 0ddbc62f444..d91d4339493 100644 --- a/dlls/win32u/clipboard.c +++ b/dlls/win32u/clipboard.c @@ -58,7 +58,7 @@ static const char *debugstr_format( UINT id ) WCHAR buffer[256]; DWORD le = GetLastError(); BOOL r = NtUserGetClipboardFormatName( id, buffer, ARRAYSIZE(buffer) ); - SetLastError(le); + RtlSetLastWin32Error(le);
if (r) return wine_dbg_sprintf( "%04x %s", id, debugstr_w(buffer) ); @@ -304,7 +304,7 @@ BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *ou
if (!out_size) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return FALSE; }
@@ -319,7 +319,7 @@ BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *ou SERVER_END_REQ;
TRACE( "%p %u returning %u formats, ret %u\n", formats, size, *out_size, ret ); - if (!ret && !formats && *out_size) SetLastError( ERROR_NOACCESS ); + if (!ret && !formats && *out_size) RtlSetLastWin32Error( ERROR_NOACCESS ); return ret; }
@@ -354,7 +354,7 @@ INT WINAPI NtUserGetClipboardFormatName( UINT format, WCHAR *buffer, INT maxlen if (format < MAXINTATOM || format > 0xffff) return 0; if (maxlen <= 0) { - SetLastError( ERROR_MORE_DATA ); + RtlSetLastWin32Error( ERROR_MORE_DATA ); return 0; } if (!set_ntstatus( NtQueryInformationAtom( format, AtomBasicInformation, @@ -449,7 +449,7 @@ BOOL WINAPI NtUserChangeClipboardChain( HWND hwnd, HWND next ) if (status == STATUS_PENDING) return !send_message( viewer, WM_CHANGECBCHAIN, (WPARAM)hwnd, (LPARAM)next );
- if (status) SetLastError( RtlNtStatusToDosError( status )); + if (status) RtlSetLastWin32Error( RtlNtStatusToDosError( status )); return !status; }
@@ -498,7 +498,7 @@ UINT enum_clipboard_formats( UINT format ) if (!wine_server_call_err( req )) { ret = reply->format; - SetLastError( ERROR_SUCCESS ); + RtlSetLastWin32Error( ERROR_SUCCESS ); } } SERVER_END_REQ; @@ -721,7 +721,7 @@ HANDLE WINAPI NtUserGetClipboardData( UINT format, struct get_clipboard_params * if (status == STATUS_OBJECT_NAME_NOT_FOUND) return 0; /* no such format */ if (status) { - SetLastError( RtlNtStatusToDosError( status )); + RtlSetLastWin32Error( RtlNtStatusToDosError( status )); TRACE( "%s error %08x\n", debugstr_format( format ), status ); return 0; } diff --git a/dlls/win32u/cursoricon.c b/dlls/win32u/cursoricon.c index eaafd07e190..31fc97bc7cd 100644 --- a/dlls/win32u/cursoricon.c +++ b/dlls/win32u/cursoricon.c @@ -334,7 +334,7 @@ BOOL WINAPI NtUserSetCursorIconData( HCURSOR cursor, UNICODE_STRING *module, UNI { /* already initialized */ release_user_handle_ptr( obj ); - SetLastError( ERROR_INVALID_CURSOR_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_CURSOR_HANDLE ); return FALSE; }
@@ -454,7 +454,7 @@ BOOL WINAPI NtUserGetIconSize( HICON handle, UINT step, LONG *width, LONG *heigh
if (!(obj = get_icon_frame_ptr( handle, step ))) { - SetLastError( ERROR_INVALID_CURSOR_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_CURSOR_HANDLE ); return FALSE; }
@@ -559,7 +559,7 @@ BOOL WINAPI NtUserGetIconInfo( HICON icon, ICONINFO *info, UNICODE_STRING *modul
if (!(obj = get_icon_ptr( icon ))) { - SetLastError( ERROR_INVALID_CURSOR_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_CURSOR_HANDLE ); return FALSE; } if (!(frame_obj = get_icon_frame_ptr( icon, 0 ))) diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index a8c651dd28f..60229bb2f89 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -79,7 +79,7 @@ static inline DC *get_dc_obj( HDC hdc ) return dc; default: GDI_ReleaseObj( hdc ); - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return NULL; } } @@ -1246,7 +1246,7 @@ BOOL WINAPI NtGdiGetDeviceGammaRamp( HDC hdc, void *ptr ) PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetDeviceGammaRamp ); ret = physdev->funcs->pGetDeviceGammaRamp( physdev, ptr ); } - else SetLastError( ERROR_INVALID_PARAMETER ); + else RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); release_dc_ptr( dc ); } return ret; @@ -1348,7 +1348,7 @@ BOOL WINAPI NtGdiSetDeviceGammaRamp( HDC hdc, void *ptr ) if (check_gamma_ramps(ptr)) ret = physdev->funcs->pSetDeviceGammaRamp( physdev, ptr ); } - else SetLastError( ERROR_INVALID_PARAMETER ); + else RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); release_dc_ptr( dc ); } return ret; diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 9041b5bbaaf..0c25fdcf61b 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1060,7 +1060,7 @@ static HRGN get_update_region( HWND hwnd, UINT *flags, HWND *child ) { if (!(data = malloc( sizeof(*data) + size - 1 ))) { - SetLastError( ERROR_OUTOFMEMORY ); + RtlSetLastWin32Error( ERROR_OUTOFMEMORY ); return 0; }
@@ -1087,7 +1087,7 @@ static HRGN get_update_region( HWND hwnd, UINT *flags, HWND *child ) free( data ); } while (status == STATUS_BUFFER_OVERFLOW);
- if (status) SetLastError( RtlNtStatusToDosError(status) ); + if (status) RtlSetLastWin32Error( RtlNtStatusToDosError(status) ); return hrgn; }
@@ -1582,7 +1582,7 @@ BOOL WINAPI NtUserInvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase ) { if (!hwnd) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; }
diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index a409ad4a1e0..3d3a40ac9e4 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -2973,14 +2973,14 @@ BOOL WINAPI NtUserGetTitleBarInfo( HWND hwnd, TITLEBARINFO *info )
if (!info) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return FALSE; }
if (info->cbSize != sizeof(TITLEBARINFO)) { TRACE( "Invalid TITLEBARINFO size: %d\n", info->cbSize ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
diff --git a/dlls/win32u/dib.c b/dlls/win32u/dib.c index e7a5a50e201..b2d7cacf137 100644 --- a/dlls/win32u/dib.c +++ b/dlls/win32u/dib.c @@ -625,7 +625,7 @@ INT WINAPI NtGdiStretchDIBitsInternal( HDC hdc, INT xDst, INT yDst, INT widthDst if (!bits) return 0; if (!bitmapinfo_from_user_bitmapinfo( info, bmi, coloruse, TRUE )) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
@@ -677,7 +677,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
if (!bitmapinfo_from_user_bitmapinfo( src_info, info, coloruse, TRUE ) || coloruse > DIB_PAL_COLORS) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } if (src_info->bmiHeader.biCompression == BI_BITFIELDS) @@ -685,7 +685,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, DWORD *masks = (DWORD *)src_info->bmiColors; if (!masks[0] || !masks[1] || !masks[2]) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } } @@ -900,7 +900,7 @@ INT WINAPI NtGdiSetDIBitsToDeviceInternal( HDC hdc, INT xDest, INT yDest, DWORD if (!bits) return 0; if (!bitmapinfo_from_user_bitmapinfo( info, bmi, coloruse, TRUE )) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
@@ -1227,7 +1227,7 @@ INT WINAPI NtGdiGetDIBitsInternal( HDC hdc, HBITMAP hbitmap, UINT startscan, UIN
if (!(dc = get_dc_ptr( hdc ))) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } update_dc( dc ); diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index f70d4a7b455..36d08afff8a 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -312,7 +312,7 @@ static INT CDECL nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
static BOOL CDECL nulldrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp ) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -516,7 +516,7 @@ static void CDECL nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
static BOOL CDECL nulldrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp ) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 5bf59903308..5ea89c9220e 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -1914,7 +1914,7 @@ static struct gdi_font *get_font_from_handle( DWORD handle ) struct font_handle_entry *entry = handle_entry( handle );
if (entry) return entry->font; - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return NULL; }
@@ -4524,7 +4524,7 @@ HFONT WINAPI NtGdiHfontCreate( const void *logfont, ULONG size, ULONG type, } else if (size != sizeof(LOGFONTW)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } else plf = logfont; @@ -5870,7 +5870,7 @@ BOOL CDECL __wine_get_file_outline_text_metric( const WCHAR *path, OUTLINETEXTME
done: if (font) free_gdi_font( font ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -5887,7 +5887,7 @@ DWORD WINAPI NtGdiGetKerningPairs( HDC hdc, DWORD count, KERNINGPAIR *kern_pair
if (!count && kern_pair) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
@@ -5912,7 +5912,7 @@ DWORD WINAPI NtGdiGetKerningPairs( HDC hdc, DWORD count, KERNINGPAIR *kern_pair * * NOTES * - * Calls SetLastError() + * Calls RtlSetLastWin32Error() * */ DWORD WINAPI NtGdiGetFontData( HDC hdc, DWORD table, DWORD offset, void *buffer, DWORD length ) @@ -6382,7 +6382,7 @@ HANDLE WINAPI NtGdiAddFontMemResourceEx( void *ptr, DWORD size, void *dv, ULONG
if (!ptr || !size || !count) { - SetLastError(ERROR_INVALID_PARAMETER); + RtlSetLastWin32Error(ERROR_INVALID_PARAMETER); return NULL; } if (!font_funcs) return NULL; @@ -6537,7 +6537,7 @@ BOOL WINAPI NtGdiGetFontFileData( DWORD instance_id, DWORD file_index, UINT64 *o if (size != GDI_ERROR && size >= buff_size && *offset <= size - buff_size) ret = font_funcs->get_font_data( font, tag, *offset, buff, buff_size ) != GDI_ERROR; else - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); } pthread_mutex_unlock( &font_lock ); return ret; @@ -6565,7 +6565,7 @@ BOOL WINAPI NtGdiGetFontFileInfo( DWORD instance_id, DWORD file_index, struct fo lstrcpyW( info->path, font->file ); ret = TRUE; } - else SetLastError( ERROR_INSUFFICIENT_BUFFER ); + else RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); }
pthread_mutex_unlock( &font_lock ); diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index e42d076bc5b..881c76ee165 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -943,7 +943,7 @@ INT WINAPI NtGdiExtGetObjectW( HGDIOBJ handle, INT count, void *buffer ) if (funcs && funcs->pGetObjectW) { if (buffer && ((ULONG_PTR)buffer >> 16) == 0) /* catch apps getting argument order wrong */ - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); else result = funcs->pGetObjectW( handle, count, buffer ); } diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index dcf2bb9f865..0f4ec338b77 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -78,7 +78,7 @@ HHOOK WINAPI NtUserSetWindowsHookEx( HINSTANCE inst, UNICODE_STRING *module, DWO
if (!proc) { - SetLastError( ERROR_INVALID_FILTER_PROC ); + RtlSetLastWin32Error( ERROR_INVALID_FILTER_PROC ); return 0; }
@@ -91,7 +91,7 @@ HHOOK WINAPI NtUserSetWindowsHookEx( HINSTANCE inst, UNICODE_STRING *module, DWO id == WH_SYSMSGFILTER) { /* these can only be global */ - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } } @@ -100,7 +100,7 @@ HHOOK WINAPI NtUserSetWindowsHookEx( HINSTANCE inst, UNICODE_STRING *module, DWO if (id == WH_KEYBOARD_LL || id == WH_MOUSE_LL) inst = 0; else if (!inst) { - SetLastError( ERROR_HOOK_NEEDS_HMOD ); + RtlSetLastWin32Error( ERROR_HOOK_NEEDS_HMOD ); return 0; } } @@ -148,7 +148,7 @@ BOOL WINAPI NtUserUnhookWindowsHookEx( HHOOK handle ) if (!status) get_user_thread_info()->active_hooks = reply->active_hooks; } SERVER_END_REQ; - if (status == STATUS_INVALID_HANDLE) SetLastError( ERROR_INVALID_HOOK_HANDLE ); + if (status == STATUS_INVALID_HANDLE) RtlSetLastWin32Error( ERROR_INVALID_HOOK_HANDLE ); return !status; }
@@ -168,7 +168,7 @@ BOOL unhook_windows_hook( INT id, HOOKPROC proc ) if (!status) get_user_thread_info()->active_hooks = reply->active_hooks; } SERVER_END_REQ; - if (status == STATUS_INVALID_HANDLE) SetLastError( ERROR_INVALID_HOOK_HANDLE ); + if (status == STATUS_INVALID_HANDLE) RtlSetLastWin32Error( ERROR_INVALID_HOOK_HANDLE ); return !status; }
@@ -395,13 +395,13 @@ HWINEVENTHOOK WINAPI NtUserSetWinEventHook( DWORD event_min, DWORD event_max, HM
if ((flags & WINEVENT_INCONTEXT) && !inst) { - SetLastError(ERROR_HOOK_NEEDS_HMOD); + RtlSetLastWin32Error(ERROR_HOOK_NEEDS_HMOD); return 0; }
if (event_min > event_max) { - SetLastError(ERROR_INVALID_HOOK_FILTER); + RtlSetLastWin32Error(ERROR_INVALID_HOOK_FILTER); return 0; }
@@ -471,7 +471,7 @@ void WINAPI NtUserNotifyWinEvent( DWORD event, HWND hwnd, LONG object_id, LONG c
if (!hwnd) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return; }
diff --git a/dlls/win32u/imm.c b/dlls/win32u/imm.c index 1b78a12a803..9e22385731f 100644 --- a/dlls/win32u/imm.c +++ b/dlls/win32u/imm.c @@ -58,7 +58,7 @@ static struct imc *get_imc_ptr( HIMC handle ) struct imc *imc = get_user_handle_ptr( handle, NTUSER_OBJ_IMC ); if (imc && imc != OBJ_OTHER_PROCESS) return imc; WARN( "invalid handle %p\n", handle ); - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return NULL; }
@@ -224,7 +224,7 @@ HIMC get_window_input_context( HWND hwnd )
if (!(win = get_win_ptr( hwnd )) || win == WND_OTHER_PROCESS || win == WND_DESKTOP) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; }
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index c41a41c605a..19233af4418 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -134,19 +134,19 @@ UINT WINAPI NtUserSendInput( UINT count, INPUT *inputs, int size )
if (size != sizeof(INPUT)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
if (!count) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
if (!inputs) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return 0; }
@@ -163,13 +163,13 @@ UINT WINAPI NtUserSendInput( UINT count, INPUT *inputs, int size ) status = send_hardware_message( 0, &input, NULL, SEND_HWMSG_INJECTED ); break; case INPUT_HARDWARE: - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); return 0; }
if (status) { - SetLastError( RtlNtStatusToDosError(status) ); + RtlSetLastWin32Error( RtlNtStatusToDosError(status) ); break; } } @@ -340,7 +340,7 @@ DWORD WINAPI NtUserGetQueueStatus( UINT flags )
if (flags & ~(QS_ALLINPUT | QS_ALLPOSTMESSAGE | QS_SMRESULT)) { - SetLastError( ERROR_INVALID_FLAGS ); + RtlSetLastWin32Error( ERROR_INVALID_FLAGS ); return 0; }
@@ -908,7 +908,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
if (layout == (HKL)HKL_NEXT || layout == (HKL)HKL_PREV) { - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); FIXME_(keyboard)( "HKL_NEXT and HKL_PREV not supported\n" ); return 0; } @@ -1002,7 +1002,7 @@ BOOL WINAPI NtUserGetKeyboardLayoutName( WCHAR *name )
if (!name) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return FALSE; }
@@ -1127,20 +1127,20 @@ int WINAPI NtUserGetMouseMovePointsEx( UINT size, MOUSEMOVEPOINT *ptin, MOUSEMOV
if ((size != sizeof(MOUSEMOVEPOINT)) || (count < 0) || (count > ARRAY_SIZE( positions ))) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return -1; }
if (!ptin || (!ptout && count)) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return -1; }
if (resolution != GMMP_USE_DISPLAY_POINTS) { FIXME( "only GMMP_USE_DISPLAY_POINTS is supported for now\n" ); - SetLastError( ERROR_POINT_NOT_FOUND ); + RtlSetLastWin32Error( ERROR_POINT_NOT_FOUND ); return -1; }
@@ -1160,7 +1160,7 @@ int WINAPI NtUserGetMouseMovePointsEx( UINT size, MOUSEMOVEPOINT *ptin, MOUSEMOV
if (i == ARRAY_SIZE( positions )) { - SetLastError( ERROR_POINT_NOT_FOUND ); + RtlSetLastWin32Error( ERROR_POINT_NOT_FOUND ); return -1; }
@@ -1320,7 +1320,7 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info ) if (info->cbSize != sizeof(TRACKMOUSEEVENT)) { WARN( "wrong size %u\n", info->cbSize ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -1333,7 +1333,7 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info )
if (!is_window( info->hwndTrack )) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; }
@@ -1713,7 +1713,7 @@ HWND WINAPI NtUserSetActiveWindow( HWND hwnd ) hwnd = get_full_window_handle( hwnd ); if (!is_window( hwnd )) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; }
@@ -1742,7 +1742,7 @@ HWND WINAPI NtUserSetFocus( HWND hwnd ) hwnd = get_full_window_handle( hwnd ); if (!is_window( hwnd )) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; } if (hwnd == previous) return previous; /* nothing to do */ diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index 53dcf3ced8e..ff11fbb804a 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -200,7 +200,7 @@ HACCEL WINAPI NtUserCreateAcceleratorTable( ACCEL *table, INT count )
if (count < 1) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } accel = malloc( FIELD_OFFSET( struct accelerator, table[count] )); @@ -344,7 +344,7 @@ BOOL is_menu( HMENU handle ) is_menu = menu != NULL; release_menu_ptr( menu );
- if (!is_menu) SetLastError( ERROR_INVALID_MENU_HANDLE ); + if (!is_menu) RtlSetLastWin32Error( ERROR_INVALID_MENU_HANDLE ); return is_menu; }
@@ -861,13 +861,13 @@ BOOL WINAPI NtUserThunkedMenuInfo( HMENU menu, const MENUINFO *info )
if (!info) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return FALSE; }
if (!set_menu_info( menu, info )) { - SetLastError( ERROR_INVALID_MENU_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_MENU_HANDLE ); return FALSE; }
@@ -889,7 +889,7 @@ BOOL get_menu_info( HMENU handle, MENUINFO *info )
if (!info || info->cbSize != sizeof(MENUINFO) || !(menu = grab_menu_ptr( handle ))) { - SetLastError( ERROR_INVALID_PARAMETER); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER); return FALSE; }
@@ -970,7 +970,7 @@ static BOOL set_menu_item_info( struct menu_item *menu, const MENUITEMINFOW *inf struct menu *submenu = grab_menu_ptr( menu->hSubMenu ); if (!submenu) { - SetLastError( ERROR_INVALID_PARAMETER); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER); return FALSE; } if (menu_depth( submenu, 0 ) > MAXMENUDEPTH) @@ -1045,7 +1045,7 @@ static BOOL get_menu_item_info( HMENU handle, UINT id, UINT flags, MENUITEMINFOW
if (!info || info->cbSize != sizeof(*info)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -1054,7 +1054,7 @@ static BOOL get_menu_item_info( HMENU handle, UINT id, UINT flags, MENUITEMINFOW TRACE( "%s\n", debugstr_menuitem( item )); if (!menu) { - SetLastError( ERROR_MENU_ITEM_NOT_FOUND); + RtlSetLastWin32Error( ERROR_MENU_ITEM_NOT_FOUND); return FALSE; }
@@ -1065,7 +1065,7 @@ static BOOL get_menu_item_info( HMENU handle, UINT id, UINT flags, MENUITEMINFOW release_menu_ptr( menu ); WARN( "invalid combination of fMask bits used\n" ); /* this does not happen on Win9x/ME */ - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -1290,7 +1290,7 @@ UINT WINAPI NtUserThunkedMenuItemInfo( HMENU handle, UINT pos, UINT flags, UINT case NtUserInsertMenuItem: if (!info || info->cbSize != sizeof(*info)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -1309,7 +1309,7 @@ UINT WINAPI NtUserThunkedMenuItemInfo( HMENU handle, UINT pos, UINT flags, UINT case NtUserSetMenuItemInfo: if (!info || info->cbSize != sizeof(*info)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -3315,7 +3315,7 @@ static BOOL init_popup( HWND owner, HMENU hmenu, UINT flags ) /* store the owner for DrawItem */ if (!is_window( owner )) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; } menu->hwndOwner = owner; @@ -4087,7 +4087,7 @@ static BOOL track_menu( HMENU hmenu, UINT flags, int x, int y, HWND hwnd, const if (!(menu = unsafe_menu_ptr( hmenu ))) { WARN( "Invalid menu handle %p\n", hmenu ); - SetLastError( ERROR_INVALID_MENU_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_MENU_HANDLE ); return FALSE; }
@@ -4338,7 +4338,7 @@ static BOOL track_menu( HMENU hmenu, UINT flags, int x, int y, HWND hwnd, const } }
- SetLastError( ERROR_SUCCESS ); + RtlSetLastWin32Error( ERROR_SUCCESS ); /* The return value is only used by NtUserTrackPopupMenuEx */ if (!(flags & TPM_RETURNCMD)) return TRUE; if (executed_menu_id == -1) executed_menu_id = 0; @@ -4486,13 +4486,13 @@ BOOL WINAPI NtUserTrackPopupMenuEx( HMENU handle, UINT flags, INT x, INT y, HWND
if (!(menu = unsafe_menu_ptr( handle ))) { - SetLastError( ERROR_INVALID_MENU_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_MENU_HANDLE ); return FALSE; }
if (is_window(menu->hWnd)) { - SetLastError( ERROR_POPUP_ALREADY_ACTIVE ); + RtlSetLastWin32Error( ERROR_POPUP_ALREADY_ACTIVE ); return FALSE; }
@@ -4522,7 +4522,7 @@ BOOL WINAPI NtUserTrackPopupMenuEx( HMENU handle, UINT flags, INT x, INT y, HWND send_message( hwnd, WM_UNINITMENUPOPUP, (WPARAM)handle, MAKELPARAM( 0, IS_SYSTEM_MENU( menu ))); } - SetLastError( 0 ); + RtlSetLastWin32Error( 0 ); }
return ret; @@ -4574,7 +4574,7 @@ BOOL WINAPI NtUserGetMenuBarInfo( HWND hwnd, LONG id, LONG item, MENUBARINFO *in if (class_atom != POPUPMENU_CLASS_ATOM) { WARN("called on invalid window: %d\n", class_atom); - SetLastError(ERROR_INVALID_MENU_HANDLE); + RtlSetLastWin32Error(ERROR_INVALID_MENU_HANDLE); return FALSE; }
@@ -4595,7 +4595,7 @@ BOOL WINAPI NtUserGetMenuBarInfo( HWND hwnd, LONG id, LONG item, MENUBARINFO *in
if (info->cbSize != sizeof(MENUBARINFO)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 33170147aa9..746238bfc5c 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -1147,7 +1147,7 @@ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info )
if (info->cbSize != sizeof(*info)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -1692,7 +1692,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, } if (res != STATUS_BUFFER_OVERFLOW) { - SetLastError( RtlNtStatusToDosError(res) ); + RtlSetLastWin32Error( RtlNtStatusToDosError(res) ); return -1; } if (!(buffer = malloc( buffer_size ))) return -1; @@ -1959,7 +1959,7 @@ static DWORD wait_message( DWORD count, const HANDLE *handles, DWORD timeout, DW mask, flags ); if (HIWORD(ret)) /* is it an error code? */ { - SetLastError( RtlNtStatusToDosError(ret) ); + RtlSetLastWin32Error( RtlNtStatusToDosError(ret) ); ret = WAIT_FAILED; } if (ret == WAIT_TIMEOUT && !count && !timeout) NtYieldExecution(); @@ -2029,7 +2029,7 @@ DWORD WINAPI NtUserMsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handl
if (count > MAXIMUM_WAIT_OBJECTS-1) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return WAIT_FAILED; }
@@ -2123,7 +2123,7 @@ BOOL WINAPI NtUserPeekMessage( MSG *msg_out, HWND hwnd, UINT first, UINT last, U * (back to the program) inside the message handling itself. */ if (!msg_out) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return FALSE; } *msg_out = msg; @@ -2242,9 +2242,9 @@ static BOOL put_message_in_queue( const struct send_message_info *info, size_t * { if (res == STATUS_INVALID_PARAMETER) /* FIXME: find a STATUS_ value for this one */ - SetLastError( ERROR_INVALID_THREAD_ID ); + RtlSetLastWin32Error( ERROR_INVALID_THREAD_ID ); else - SetLastError( RtlNtStatusToDosError(res) ); + RtlSetLastWin32Error( RtlNtStatusToDosError(res) ); } } SERVER_END_REQ; @@ -2326,7 +2326,7 @@ static LRESULT retrieve_reply( const struct send_message_info *info, info->lparam, *result, status );
/* MSDN states that last error is 0 on timeout, but at least NT4 returns ERROR_TIMEOUT */ - if (status) SetLastError( RtlNtStatusToDosError(status) ); + if (status) RtlSetLastWin32Error( RtlNtStatusToDosError(status) ); return !status; }
@@ -2547,8 +2547,8 @@ LRESULT WINAPI NtUserDispatchMessage( const MSG *msg ) if (init_window_call_params( ¶ms, msg->hwnd, msg->message, msg->wParam, msg->lParam, &retval, FALSE, WMCHAR_MAP_DISPATCHMESSAGE )) dispatch_win_proc_params( ¶ms, sizeof(params) ); - else if (!is_window( msg->hwnd )) SetLastError( ERROR_INVALID_WINDOW_HANDLE ); - else SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + else if (!is_window( msg->hwnd )) RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); + else RtlSetLastWin32Error( ERROR_MESSAGE_SYNC_ONLY );
spy_exit_message( SPY_RESULT_OK, msg->hwnd, msg->message, retval, msg->wParam, msg->lParam );
@@ -2821,7 +2821,7 @@ static BOOL send_notify_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
if (is_pointer_message( msg, wparam )) { - SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + RtlSetLastWin32Error( ERROR_MESSAGE_SYNC_ONLY ); return FALSE; }
@@ -2845,7 +2845,7 @@ static BOOL send_message_callback( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
if (is_pointer_message( msg, wparam )) { - SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + RtlSetLastWin32Error( ERROR_MESSAGE_SYNC_ONLY ); return FALSE; }
@@ -2872,7 +2872,7 @@ BOOL WINAPI NtUserPostMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam
if (is_pointer_message( msg, wparam )) { - SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + RtlSetLastWin32Error( ERROR_MESSAGE_SYNC_ONLY ); return FALSE; }
@@ -2907,7 +2907,7 @@ BOOL WINAPI NtUserPostThreadMessage( DWORD thread, UINT msg, WPARAM wparam, LPAR
if (is_pointer_message( msg, wparam )) { - SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + RtlSetLastWin32Error( ERROR_MESSAGE_SYNC_ONLY ); return FALSE; } if (is_exiting_thread( thread )) return TRUE; @@ -2970,8 +2970,8 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa if (init_window_call_params( result_info, hwnd, msg, wparam, lparam, NULL, ansi, WMCHAR_MAP_DISPATCHMESSAGE )) return TRUE; - if (!is_window( hwnd )) SetLastError( ERROR_INVALID_WINDOW_HANDLE ); - else SetLastError( ERROR_MESSAGE_SYNC_ONLY ); + if (!is_window( hwnd )) RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); + else RtlSetLastWin32Error( ERROR_MESSAGE_SYNC_ONLY ); return FALSE;
case NtUserSpyEnter: diff --git a/dlls/win32u/painting.c b/dlls/win32u/painting.c index 9b973eeb757..e274561d546 100644 --- a/dlls/win32u/painting.c +++ b/dlls/win32u/painting.c @@ -891,7 +891,7 @@ BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
if (!vert_array || !nvert || !grad_array || !ngrad || mode > GRADIENT_FILL_TRIANGLE) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; } for (i = 0; i < ngrad * (mode == GRADIENT_FILL_TRIANGLE ? 3 : 2); i++) diff --git a/dlls/win32u/path.c b/dlls/win32u/path.c index 0032ee1a5ab..e4b6f82cf95 100644 --- a/dlls/win32u/path.c +++ b/dlls/win32u/path.c @@ -116,7 +116,7 @@ static struct gdi_path *alloc_gdi_path( int count )
if (!path) { - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } count = max( NUM_ENTRIES_INITIAL, count ); @@ -126,7 +126,7 @@ static struct gdi_path *alloc_gdi_path( int count ) if (!path->points) { free( path ); - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } path->flags = (BYTE *)(path->points + count); @@ -542,7 +542,7 @@ struct gdi_path *get_gdi_flat_path( DC *dc, HRGN *rgn ) dc->path = NULL; if (ret && rgn) *rgn = path_to_region( ret, dc->attr->poly_fill_mode ); } - else SetLastError( ERROR_CAN_NOT_COMPLETE ); + else RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE );
return ret; } @@ -638,7 +638,7 @@ INT WINAPI NtGdiGetPath( HDC hdc, POINT *points, BYTE *types, INT size )
if (!dc->path) { - SetLastError( ERROR_CAN_NOT_COMPLETE ); + RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE ); } else if (size == 0) { @@ -646,7 +646,7 @@ INT WINAPI NtGdiGetPath( HDC hdc, POINT *points, BYTE *types, INT size ) } else if (size < dc->path->count) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); } else { @@ -658,7 +658,7 @@ INT WINAPI NtGdiGetPath( HDC hdc, POINT *points, BYTE *types, INT size ) ret = dc->path->count; else /* FIXME: Is this the correct value? */ - SetLastError( ERROR_CAN_NOT_COMPLETE ); + RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE ); }
release_dc_ptr( dc ); @@ -688,7 +688,7 @@ HRGN WINAPI NtGdiPathToRegion( HDC hdc ) free_gdi_path( path ); } } - else SetLastError( ERROR_CAN_NOT_COMPLETE ); + else RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE );
release_dc_ptr( dc ); return ret; @@ -1598,7 +1598,7 @@ BOOL WINAPI NtGdiFlattenPath( HDC hdc )
if (!(dc = get_dc_ptr( hdc ))) return FALSE;
- if (!dc->path) SetLastError( ERROR_CAN_NOT_COMPLETE ); + if (!dc->path) RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE ); else if ((path = PATH_FlattenPath( dc->path ))) { free_gdi_path( dc->path ); @@ -1623,7 +1623,7 @@ static struct gdi_path *PATH_WidenPath(DC *dc)
size = NtGdiExtGetObjectW( dc->hPen, 0, NULL ); if (!size) { - SetLastError(ERROR_CAN_NOT_COMPLETE); + RtlSetLastWin32Error(ERROR_CAN_NOT_COMPLETE); return NULL; }
@@ -1640,7 +1640,7 @@ static struct gdi_path *PATH_WidenPath(DC *dc) penStyle = elp->elpPenStyle; break; default: - SetLastError(ERROR_CAN_NOT_COMPLETE); + RtlSetLastWin32Error(ERROR_CAN_NOT_COMPLETE); free( elp ); return NULL; } @@ -1654,7 +1654,7 @@ static struct gdi_path *PATH_WidenPath(DC *dc)
/* The function cannot apply to cosmetic pens */ if(obj_type == OBJ_EXTPEN && penType == PS_COSMETIC) { - SetLastError(ERROR_CAN_NOT_COMPLETE); + RtlSetLastWin32Error(ERROR_CAN_NOT_COMPLETE); return NULL; }
@@ -1948,7 +1948,7 @@ BOOL WINAPI NtGdiWidenPath( HDC hdc )
if (!(dc = get_dc_ptr( hdc ))) return FALSE;
- if (!dc->path) SetLastError( ERROR_CAN_NOT_COMPLETE ); + if (!dc->path) RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE ); else if ((path = PATH_WidenPath( dc ))) { free_gdi_path( dc->path ); @@ -1988,7 +1988,7 @@ BOOL CDECL nulldrv_BeginPath( PHYSDEV dev )
BOOL CDECL nulldrv_EndPath( PHYSDEV dev ) { - SetLastError( ERROR_CAN_NOT_COMPLETE ); + RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE ); return FALSE; }
@@ -2003,7 +2003,7 @@ BOOL CDECL nulldrv_AbortPath( PHYSDEV dev )
BOOL CDECL nulldrv_CloseFigure( PHYSDEV dev ) { - SetLastError( ERROR_CAN_NOT_COMPLETE ); + RtlSetLastWin32Error( ERROR_CAN_NOT_COMPLETE ); return FALSE; }
diff --git a/dlls/win32u/pen.c b/dlls/win32u/pen.c index af371108c46..551c4438f3c 100644 --- a/dlls/win32u/pen.c +++ b/dlls/win32u/pen.c @@ -156,7 +156,7 @@ HPEN WINAPI NtGdiExtCreatePen( DWORD style, DWORD width, ULONG brush_style, ULON break;
default: - SetLastError(ERROR_INVALID_PARAMETER); + RtlSetLastWin32Error(ERROR_INVALID_PARAMETER); return 0; }
@@ -196,7 +196,7 @@ HPEN WINAPI NtGdiExtCreatePen( DWORD style, DWORD width, ULONG brush_style, ULON
invalid: free( penPtr ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index cf150b60a8c..8795ebbba00 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -485,13 +485,13 @@ UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *device_list, UINT *
if (size != sizeof(*device_list)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return ~0u; }
if (!device_count) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return ~0u; }
@@ -521,7 +521,7 @@ UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *device_list, UINT *
if (*device_count < count) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); *device_count = count; return ~0u; } @@ -543,13 +543,13 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data
if (!data_size) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return ~0u; } if (command != RIDI_DEVICENAME && command != RIDI_DEVICEINFO && command != RIDI_PREPARSEDDATA) { FIXME( "Command %#x not implemented!\n", command ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return ~0u; }
@@ -558,7 +558,7 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data if (!(device = find_device_from_handle( handle ))) { pthread_mutex_unlock( &rawinput_mutex ); - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return ~0u; }
@@ -597,7 +597,7 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data
if (data_len < len) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); return ~0u; }
@@ -624,13 +624,13 @@ UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT heade if (header_size != sizeof(RAWINPUTHEADER)) { WARN( "Invalid structure size %u.\n", header_size ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return ~0u; }
if (!data_size) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return ~0u; }
@@ -690,7 +690,7 @@ UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT heade
if (next_size && *data_size <= next_size) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); *data_size = next_size; count = ~0u; } @@ -713,20 +713,20 @@ UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data,
if (!(thread_data = get_rawinput_thread_data())) { - SetLastError( ERROR_OUTOFMEMORY ); + RtlSetLastWin32Error( ERROR_OUTOFMEMORY ); return ~0u; }
if (!rawinput || thread_data->hw_id != (UINT_PTR)rawinput) { - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return ~0u; }
if (header_size != sizeof(RAWINPUTHEADER)) { WARN( "Invalid structure size %u.\n", header_size ); - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return ~0u; }
@@ -741,7 +741,7 @@ UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data, break;
default: - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return ~0u; }
@@ -753,7 +753,7 @@ UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data,
if (*data_size < size) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); return ~0u; } memcpy( data, thread_data->buffer, size ); @@ -830,7 +830,7 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d
if (device_size != sizeof(RAWINPUTDEVICE)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -841,13 +841,13 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d
if ((devices[i].dwFlags & RIDEV_INPUTSINK) && !devices[i].hwndTarget) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
if ((devices[i].dwFlags & RIDEV_REMOVE) && devices[i].hwndTarget) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -867,7 +867,7 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d if (!(new_registered_devices = realloc( registered_devices, size ))) { pthread_mutex_unlock( &rawinput_mutex ); - SetLastError( ERROR_OUTOFMEMORY ); + RtlSetLastWin32Error( ERROR_OUTOFMEMORY ); return FALSE; }
@@ -878,7 +878,7 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d else if (!(server_devices = malloc( device_count * sizeof(*server_devices) ))) { pthread_mutex_unlock( &rawinput_mutex ); - SetLastError( ERROR_OUTOFMEMORY ); + RtlSetLastWin32Error( ERROR_OUTOFMEMORY ); return FALSE; }
@@ -915,7 +915,7 @@ UINT WINAPI NtUserGetRegisteredRawInputDevices( RAWINPUTDEVICE *devices, UINT *d
if (device_size != sizeof(RAWINPUTDEVICE) || !device_count || (devices && !*device_count)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return ~0u; }
@@ -932,7 +932,7 @@ UINT WINAPI NtUserGetRegisteredRawInputDevices( RAWINPUTDEVICE *devices, UINT *d
if (capacity < size) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); return ~0u; }
diff --git a/dlls/win32u/spy.c b/dlls/win32u/spy.c index ce05dfa1bff..05d740eb883 100644 --- a/dlls/win32u/spy.c +++ b/dlls/win32u/spy.c @@ -2221,7 +2221,7 @@ const char *debugstr_msg_name( UINT msg, HWND hWnd ) ext_sp_e.wParam = 0; ext_sp_e.wnd_class[0] = 0; SPY_GetMsgStuff(&ext_sp_e); - SetLastError( save_error ); + RtlSetLastWin32Error( save_error ); return wine_dbg_sprintf("%s", ext_sp_e.msg_name); }
@@ -2506,7 +2506,7 @@ static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter) /* save and restore error code over the next call */ save_error = GetLastError(); NtUserGetClassName( pnmh->hwndFrom, FALSE, &str ); - SetLastError(save_error); + RtlSetLastWin32Error(save_error); if (wcscmp(TOOLBARCLASSNAMEW, from_class) == 0) dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR); } else if ( pnmh->code >= HDN_ENDDRAG @@ -2640,7 +2640,7 @@ void spy_enter_message( INT iFlag, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP break; } set_indent_level( indent + SPY_INDENT_UNIT ); - SetLastError( save_error ); + RtlSetLastWin32Error( save_error ); }
@@ -2685,5 +2685,5 @@ void spy_exit_message( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn, SPY_DumpStructure(&sp_e, FALSE); break; } - SetLastError( save_error ); + RtlSetLastWin32Error( save_error ); } diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ef2462e6540..33ff35eb21a 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1682,7 +1682,7 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT
if (val == DPI_AWARENESS_INVALID) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } if (!(prev = info->dpi_awareness)) @@ -2303,7 +2303,7 @@ BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info )
unlock_display_devices(); WARN( "invalid handle %p\n", handle ); - SetLastError( ERROR_INVALID_MONITOR_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_MONITOR_HANDLE ); return FALSE; }
@@ -2422,12 +2422,12 @@ BOOL WINAPI NtUserGetDpiForMonitor( HMONITOR monitor, UINT type, UINT *x, UINT * { if (type > 2) { - SetLastError( ERROR_BAD_ARGUMENTS ); + RtlSetLastWin32Error( ERROR_BAD_ARGUMENTS ); return FALSE; } if (!x || !y) { - SetLastError( ERROR_INVALID_ADDRESS ); + RtlSetLastWin32Error( ERROR_INVALID_ADDRESS ); return FALSE; } switch (get_thread_dpi_awareness()) @@ -3538,7 +3538,7 @@ BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr, break; } default: - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); break; } return ret; @@ -3580,7 +3580,7 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \ } \ } \ - SetLastError( ERROR_INVALID_SPI_VALUE ); \ + RtlSetLastWin32Error( ERROR_INVALID_SPI_VALUE ); \ ret = FALSE; \ break #define WINE_SPI_WARN(x) \ @@ -4387,7 +4387,7 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w } default: FIXME( "Unknown action: %u\n", action ); - SetLastError( ERROR_INVALID_SPI_VALUE ); + RtlSetLastWin32Error( ERROR_INVALID_SPI_VALUE ); ret = FALSE; break; } @@ -4863,7 +4863,7 @@ BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown case NTUSER_DPI_PER_UNAWARE_GDISCALED: break; default: - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index eb215519643..fbd6c4fccad 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -436,7 +436,7 @@ extern const struct user_driver_funcs *user_driver DECLSPEC_HIDDEN;
static inline BOOL set_ntstatus( NTSTATUS status ) { - if (status) SetLastError( RtlNtStatusToDosError( status )); + if (status) RtlSetLastWin32Error( RtlNtStatusToDosError( status )); return !status; }
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 2a4edeee656..6e41bc8d27f 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -320,7 +320,7 @@ DWORD get_window_thread( HWND hwnd, DWORD *process )
if (!(ptr = get_win_ptr( hwnd ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE); return 0; }
@@ -355,7 +355,7 @@ HWND get_parent( HWND hwnd )
if (!(win = get_win_ptr( hwnd ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; } if (win == WND_DESKTOP) return 0; @@ -403,7 +403,7 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent )
if (is_broadcast(hwnd) || is_broadcast(parent)) { - SetLastError(ERROR_INVALID_PARAMETER); + RtlSetLastWin32Error(ERROR_INVALID_PARAMETER); return 0; }
@@ -413,14 +413,14 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent )
if (!is_window( parent )) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; }
/* Some applications try to set a child as a parent */ if (is_child( hwnd, parent )) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
@@ -429,7 +429,7 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent )
if (full_handle == parent) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; }
@@ -492,7 +492,7 @@ HWND get_window_relative( HWND hwnd, UINT rel ) WND *win = get_win_ptr( hwnd ); if (!win) { - SetLastError( ERROR_INVALID_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return 0; } if (win == WND_DESKTOP) return 0; @@ -666,7 +666,7 @@ HWND WINAPI NtUserGetAncestor( HWND hwnd, UINT type ) case GA_PARENT: if (!(win = get_win_ptr( hwnd ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; } if (win == WND_DESKTOP) return 0; @@ -818,7 +818,7 @@ BOOL enable_window( HWND hwnd, BOOL enable )
if (is_broadcast(hwnd)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -850,7 +850,7 @@ BOOL is_window_enabled( HWND hwnd ) { LONG ret;
- SetLastError( NO_ERROR ); + RtlSetLastWin32Error( NO_ERROR ); ret = get_window_long( hwnd, GWL_STYLE ); if (!ret && GetLastError() != NO_ERROR) return FALSE; return !(ret & WS_DISABLED); @@ -864,7 +864,7 @@ DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd )
if (!(win = get_win_ptr( hwnd ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; } if (win == WND_DESKTOP) return DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE; @@ -893,7 +893,7 @@ UINT get_dpi_for_window( HWND hwnd )
if (!(win = get_win_ptr( hwnd ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; } if (win == WND_DESKTOP) @@ -985,7 +985,7 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans
if (!(win = get_win_ptr( hwnd ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; }
@@ -1004,10 +1004,10 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans case GWLP_HINSTANCE: return 0; case GWLP_WNDPROC: - SetLastError( ERROR_ACCESS_DENIED ); + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); return 0; } - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); return 0; }
@@ -1015,7 +1015,7 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans { if (offset == GWLP_WNDPROC) { - SetLastError( ERROR_ACCESS_DENIED ); + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); return 0; } SERVER_START_REQ( set_window_info ) @@ -1035,7 +1035,7 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans case GWLP_USERDATA: retval = reply->old_user_data; break; default: if (offset >= 0) retval = get_win_data( &reply->old_extra_value, size ); - else SetLastError( ERROR_INVALID_INDEX ); + else RtlSetLastWin32Error( ERROR_INVALID_INDEX ); break; } } @@ -1052,7 +1052,7 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans { WARN("Invalid offset %d\n", offset ); release_win_ptr( win ); - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); return 0; } retval = get_win_data( (char *)win->wExtra + offset, size ); @@ -1083,7 +1083,7 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans break; default: WARN("Unknown offset %d\n", offset ); - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); break; } release_win_ptr( win ); @@ -1115,7 +1115,7 @@ static WORD get_window_word( HWND hwnd, INT offset ) if (offset < 0) { WARN("Invalid offset %d\n", offset ); - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); return 0; } break; @@ -1226,31 +1226,31 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO
if (is_broadcast(hwnd)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
if (!(win = get_win_ptr( hwnd ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; } if (win == WND_DESKTOP) { /* can't change anything on the desktop window */ - SetLastError( ERROR_ACCESS_DENIED ); + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); return 0; } if (win == WND_OTHER_PROCESS) { if (offset == GWLP_WNDPROC) { - SetLastError( ERROR_ACCESS_DENIED ); + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); return 0; } if (offset > 32767 || offset < -32767) { - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); return 0; } return send_message( hwnd, WM_WINE_SETWINDOWLONG, MAKEWPARAM( offset, size ), newval ); @@ -1329,7 +1329,7 @@ LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOO { WARN("Invalid offset %d\n", offset ); release_win_ptr( win ); - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); return 0; } else if (get_win_data( (char *)win->wExtra + offset, size ) == newval) @@ -1451,7 +1451,7 @@ WORD WINAPI NtUserSetWindowWord( HWND hwnd, INT offset, WORD newval ) if (offset < 0) { WARN("Invalid offset %d\n", offset ); - SetLastError( ERROR_INVALID_INDEX ); + RtlSetLastWin32Error( ERROR_INVALID_INDEX ); return 0; } break; @@ -1578,7 +1578,7 @@ BOOL get_window_rects( HWND hwnd, enum coords_relative relative, RECT *window_re
if (!win) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; } if (win == WND_DESKTOP) @@ -1971,7 +1971,7 @@ int WINAPI NtUserGetWindowRgnEx( HWND hwnd, HRGN hrgn, UINT unk ) { if (!(data = malloc( sizeof(*data) + size - 1 ))) { - SetLastError( ERROR_OUTOFMEMORY ); + RtlSetLastWin32Error( ERROR_OUTOFMEMORY ); return ERROR; } SERVER_START_REQ( get_window_region ) @@ -2137,7 +2137,7 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_ !(get_window_long( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED) || NtUserGetLayeredWindowAttributes( hwnd, NULL, NULL, NULL )) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -2157,12 +2157,12 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_ offset.cy = size->cy - (window_rect.bottom - window_rect.top); if (size->cx <= 0 || size->cy <= 0) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; } if ((flags & ULW_EX_NORESIZE) && (offset.cx || offset.cy)) { - SetLastError( ERROR_INCORRECT_SIZE ); + RtlSetLastWin32Error( ERROR_INCORRECT_SIZE ); return FALSE; } client_rect.right += offset.cx; @@ -2747,7 +2747,7 @@ static BOOL get_windows_offset( HWND hwnd_from, HWND hwnd_to, UINT dpi, BOOL *mi { if (!(win = get_win_ptr( hwnd_from ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; } if (win == WND_OTHER_PROCESS) goto other_process; @@ -2783,7 +2783,7 @@ static BOOL get_windows_offset( HWND hwnd_from, HWND hwnd_to, UINT dpi, BOOL *mi { if (!(win = get_win_ptr( hwnd_to ))) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; } if (win == WND_OTHER_PROCESS) goto other_process; @@ -2847,7 +2847,7 @@ BOOL client_to_screen( HWND hwnd, POINT *pt )
if (!hwnd) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; }
@@ -2866,7 +2866,7 @@ BOOL screen_to_client( HWND hwnd, POINT *pt )
if (!hwnd) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; } if (!get_windows_offset( 0, hwnd, get_thread_dpi(), &mirrored, &offset )) return FALSE; @@ -3195,7 +3195,7 @@ static BOOL fixup_swp_flags( WINDOWPOS *winpos, const RECT *old_window_rect, int
if (!win || win == WND_OTHER_PROCESS) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; } winpos->hwnd = win->obj.handle; /* make it a full handle */ @@ -3496,7 +3496,7 @@ BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT
if (is_broadcast( hwnd )) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -3539,7 +3539,7 @@ HDWP begin_defer_window_pos( INT count )
if (count < 0) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } /* Windows allows zero count, in which case it allocates context for 8 moves */ @@ -3580,7 +3580,7 @@ HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND after, winpos.hwnd = get_full_window_handle( hwnd ); if (is_desktop_window( winpos.hwnd ) || !is_window( winpos.hwnd )) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; }
@@ -4393,7 +4393,7 @@ BOOL WINAPI NtUserShowWindowAsync( HWND hwnd, INT cmd )
if (is_broadcast(hwnd)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; }
@@ -4413,7 +4413,7 @@ BOOL WINAPI NtUserShowWindow( HWND hwnd, INT cmd )
if (is_broadcast(hwnd)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; } if ((full_handle = is_current_thread_window( hwnd ))) @@ -4475,13 +4475,13 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
if (!info) { - SetLastError( ERROR_NOACCESS ); + RtlSetLastWin32Error( ERROR_NOACCESS ); return FALSE; }
if (!info->hwnd || info->cbSize != sizeof(FLASHWINFO) || !is_window( info->hwnd )) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; } FIXME( "%p - semi-stub\n", info ); @@ -4566,7 +4566,7 @@ HICON WINAPI NtUserInternalGetWindowIcon( HWND hwnd, UINT type )
if (!win) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return 0; } if (win == WND_OTHER_PROCESS || win == WND_DESKTOP) @@ -4590,7 +4590,7 @@ HICON WINAPI NtUserInternalGetWindowIcon( HWND hwnd, UINT type ) break;
default: - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); release_win_ptr( win ); return 0; } @@ -4746,7 +4746,7 @@ BOOL WINAPI NtUserDestroyWindow( HWND hwnd )
if (!(hwnd = is_current_thread_window( hwnd )) || is_desktop_window( hwnd )) { - SetLastError( ERROR_ACCESS_DENIED ); + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); return FALSE; }
@@ -4920,7 +4920,7 @@ static WND *create_window_handle( HWND parent, HWND owner, UNICODE_STRING *name, wine_server_call( req ); } SERVER_END_REQ; - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY ); return NULL; }
@@ -5114,7 +5114,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, if ((cs.style & (WS_CHILD|WS_POPUP)) == WS_CHILD) { WARN( "No parent for child window\n" ); - SetLastError( ERROR_TLW_WITH_WSCHILD ); + RtlSetLastWin32Error( ERROR_TLW_WITH_WSCHILD ); return 0; /* WS_CHILD needs a parent, but WS_POPUP doesn't */ }
@@ -5369,7 +5369,7 @@ static void *get_dialog_info( HWND hwnd )
if (!(win = get_win_ptr( hwnd )) || win == WND_OTHER_PROCESS || win == WND_DESKTOP) { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + RtlSetLastWin32Error( ERROR_INVALID_WINDOW_HANDLE ); return NULL; }
diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c index d3eb145b7c5..e606047a79c 100644 --- a/dlls/win32u/winstation.c +++ b/dlls/win32u/winstation.c @@ -50,7 +50,7 @@ HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK a
if (attr->ObjectName->Length >= MAX_PATH * sizeof(WCHAR)) { - SetLastError( ERROR_FILENAME_EXCED_RANGE ); + RtlSetLastWin32Error( ERROR_FILENAME_EXCED_RANGE ); return 0; }
@@ -145,12 +145,12 @@ HDESK WINAPI NtUserCreateDesktopEx( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *dev
if ((device && device->Length) || devmode) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return 0; } if (attr->ObjectName->Length >= MAX_PATH * sizeof(WCHAR)) { - SetLastError( ERROR_FILENAME_EXCED_RANGE ); + RtlSetLastWin32Error( ERROR_FILENAME_EXCED_RANGE ); return 0; } SERVER_START_REQ( create_desktop ) @@ -174,7 +174,7 @@ HDESK WINAPI NtUserOpenDesktop( OBJECT_ATTRIBUTES *attr, DWORD flags, ACCESS_MAS HANDLE ret = 0; if (attr->ObjectName->Length >= MAX_PATH * sizeof(WCHAR)) { - SetLastError( ERROR_FILENAME_EXCED_RANGE ); + RtlSetLastWin32Error( ERROR_FILENAME_EXCED_RANGE ); return 0; } SERVER_START_REQ( open_desktop ) @@ -289,7 +289,7 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, if (needed) *needed = sizeof(*obj_flags); if (len < sizeof(*obj_flags)) { - SetLastError( ERROR_BUFFER_OVERFLOW ); + RtlSetLastWin32Error( ERROR_BUFFER_OVERFLOW ); return FALSE; } SERVER_START_REQ( set_user_object_info ) @@ -319,7 +319,7 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, if (needed) *needed = size; if (len < size) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); ret = FALSE; } else memcpy( info, reply->is_desktop ? desktopW : window_stationW, size ); @@ -345,7 +345,7 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, if (needed) *needed = size; if (len < size) { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); + RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER ); ret = FALSE; } else memcpy( info, buffer, size ); @@ -359,7 +359,7 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, FIXME( "not supported index %d\n", index ); /* fall through */ default: - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; } } @@ -374,7 +374,7 @@ BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DW
if (index != UOI_FLAGS || !info || len < sizeof(*obj_flags)) { - SetLastError( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); return FALSE; } /* FIXME: inherit flag */