Commit 1dfedae9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard
Browse files

win32u: Use RtlSetLastWin32Error.

parent 2f0c2684
......@@ -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)
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 )))
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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