winex11: Use RtlSetLastWin32Error.

This commit is contained in:
Jacek Caban 2022-08-09 21:49:57 +02:00 committed by Alexandre Julliard
parent 1dfedae903
commit 131de4bb8d
8 changed files with 34 additions and 34 deletions

View file

@ -162,7 +162,7 @@ static BOOL X11DRV_desktop_get_modes( ULONG_PTR id, DWORD flags, DEVMODEW **new_
/* Allocate memory for modes in different color depths */
if (!(modes = calloc( (ARRAY_SIZE(screen_sizes) + 2) * DEPTH_COUNT, sizeof(*modes))) )
{
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY );
return FALSE;
}

View file

@ -91,7 +91,7 @@ static BOOL nores_get_modes(ULONG_PTR id, DWORD flags, DEVMODEW **new_modes, UIN
modes = calloc(1, sizeof(*modes));
if (!modes)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY );
return FALSE;
}
@ -350,7 +350,7 @@ BOOL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DW
{
pthread_mutex_unlock( &settings_mutex );
WARN("handler:%s device:%s mode index:%#x not found.\n", settings_handler.name, wine_dbgstr_w(name), n);
SetLastError(ERROR_NO_MORE_FILES);
RtlSetLastWin32Error( ERROR_NO_MORE_FILES );
return FALSE;
}

View file

@ -1736,7 +1736,7 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size,
if (*size < required)
{
*size = required;
SetLastError( ERROR_INSUFFICIENT_BUFFER );
RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER );
return FALSE;
}
if (filename)

View file

@ -1857,14 +1857,14 @@ BOOL X11DRV_ActivateKeyboardLayout(HKL hkl, UINT flags)
if (flags & KLF_SETFORPROCESS)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED );
FIXME("KLF_SETFORPROCESS not supported\n");
return FALSE;
}
if (!match_x11_keyboard_layout(hkl))
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED );
FIXME("setting keyboard of different locales not supported\n");
return FALSE;
}

View file

@ -1739,7 +1739,7 @@ static struct wgl_context * WINAPI glxdrv_wglCreateContext( HDC hdc )
if (!(gl = get_gl_drawable( NtUserWindowFromDC( hdc ), hdc )))
{
SetLastError( ERROR_INVALID_PIXEL_FORMAT );
RtlSetLastWin32Error( ERROR_INVALID_PIXEL_FORMAT );
return NULL;
}
@ -1833,7 +1833,7 @@ static BOOL WINAPI glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx)
if (ctx->fmt != gl->format)
{
WARN( "mismatched pixel format hdc %p %p ctx %p %p\n", hdc, gl->format, ctx, ctx->fmt );
SetLastError( ERROR_INVALID_PIXEL_FORMAT );
RtlSetLastWin32Error( ERROR_INVALID_PIXEL_FORMAT );
goto done;
}
@ -1854,7 +1854,7 @@ static BOOL WINAPI glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx)
}
pthread_mutex_unlock( &context_mutex );
}
SetLastError( ERROR_INVALID_HANDLE );
RtlSetLastWin32Error( ERROR_INVALID_HANDLE );
done:
release_gl_drawable( gl );
@ -1900,7 +1900,7 @@ static BOOL X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct
}
pthread_mutex_unlock( &context_mutex );
}
SetLastError( ERROR_INVALID_HANDLE );
RtlSetLastWin32Error( ERROR_INVALID_HANDLE );
done:
release_gl_drawable( read_gl );
release_gl_drawable( draw_gl );
@ -2027,7 +2027,7 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wg
if (!(gl = get_gl_drawable( NtUserWindowFromDC( hdc ), hdc )))
{
SetLastError( ERROR_INVALID_PIXEL_FORMAT );
RtlSetLastWin32Error( ERROR_INVALID_PIXEL_FORMAT );
return NULL;
}
@ -2143,13 +2143,13 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
fmt = get_pixel_format(gdi_display, iPixelFormat, TRUE /* Offscreen */);
if(!fmt) {
ERR("(%p): invalid pixel format %d\n", hdc, iPixelFormat);
SetLastError(ERROR_INVALID_PIXEL_FORMAT);
RtlSetLastWin32Error(ERROR_INVALID_PIXEL_FORMAT);
return NULL;
}
object = calloc( 1, sizeof(*object) );
if (NULL == object) {
SetLastError(ERROR_NO_SYSTEM_RESOURCES);
RtlSetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
return NULL;
}
object->width = iWidth;
@ -2177,7 +2177,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
object->use_render_texture = 0;
} else {
if (!use_render_texture_emulation) {
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
goto create_failed;
}
switch (attr_v) {
@ -2221,7 +2221,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
break;
default:
ERR("Unknown texture format: %x\n", attr_v);
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
goto create_failed;
}
}
@ -2236,13 +2236,13 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
object->texture_target = 0;
} else {
if (!use_render_texture_emulation) {
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
goto create_failed;
}
switch (attr_v) {
case WGL_TEXTURE_CUBE_MAP_ARB: {
if (iWidth != iHeight) {
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
goto create_failed;
}
object->texture_target = GL_TEXTURE_CUBE_MAP;
@ -2251,7 +2251,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
}
case WGL_TEXTURE_1D_ARB: {
if (1 != iHeight) {
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
goto create_failed;
}
object->texture_target = GL_TEXTURE_1D;
@ -2270,7 +2270,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
}
default:
ERR("Unknown texture target: %x\n", attr_v);
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
goto create_failed;
}
}
@ -2282,7 +2282,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
attr_v = *piAttribList;
TRACE("WGL_render_texture Attribute: WGL_MIPMAP_TEXTURE_ARB as %x\n", attr_v);
if (!use_render_texture_emulation) {
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
goto create_failed;
}
break;
@ -2294,7 +2294,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
PUSH1(attribs, None);
if (!(object->gl = calloc( 1, sizeof(*object->gl) )))
{
SetLastError(ERROR_NO_SYSTEM_RESOURCES);
RtlSetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
goto create_failed;
}
object->gl->type = DC_GL_PBUFFER;
@ -2305,7 +2305,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
TRACE("new Pbuffer drawable as %p (%lx)\n", object->gl, object->gl->drawable);
if (!object->gl->drawable) {
free( object->gl );
SetLastError(ERROR_NO_SYSTEM_RESOURCES);
RtlSetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
goto create_failed; /* unexpected error */
}
pthread_mutex_lock( &context_mutex );
@ -2400,7 +2400,7 @@ static BOOL X11DRV_wglQueryPbufferARB( struct wgl_pbuffer *object, int iAttribut
*piValue = WGL_NO_TEXTURE_ARB;
} else {
if (!use_render_texture_emulation) {
SetLastError(ERROR_INVALID_HANDLE);
RtlSetLastWin32Error(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
switch(object->use_render_texture) {
@ -2434,7 +2434,7 @@ static BOOL X11DRV_wglQueryPbufferARB( struct wgl_pbuffer *object, int iAttribut
*piValue = WGL_NO_TEXTURE_ARB;
} else {
if (!use_render_texture_emulation) {
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
return GL_FALSE;
}
switch (object->texture_target) {
@ -2496,7 +2496,7 @@ static BOOL X11DRV_wglSetPbufferAttribARB( struct wgl_pbuffer *object, const int
WARN("(%p, %p): alpha-testing, report any problem\n", object, piAttribList);
if (!object->use_render_texture) {
SetLastError(ERROR_INVALID_HANDLE);
RtlSetLastWin32Error(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
if (use_render_texture_emulation) {
@ -2976,7 +2976,7 @@ static BOOL X11DRV_wglBindTexImageARB( struct wgl_pbuffer *object, int iBuffer )
TRACE("(%p, %d)\n", object, iBuffer);
if (!object->use_render_texture) {
SetLastError(ERROR_INVALID_HANDLE);
RtlSetLastWin32Error(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
@ -3036,7 +3036,7 @@ static BOOL X11DRV_wglReleaseTexImageARB( struct wgl_pbuffer *object, int iBuffe
TRACE("(%p, %d)\n", object, iBuffer);
if (!object->use_render_texture) {
SetLastError(ERROR_INVALID_HANDLE);
RtlSetLastWin32Error(ERROR_INVALID_HANDLE);
return GL_FALSE;
}
if (use_render_texture_emulation) {
@ -3102,13 +3102,13 @@ static BOOL X11DRV_wglSwapIntervalEXT(int interval)
*/
if (interval < 0 && !has_swap_control_tear)
{
SetLastError(ERROR_INVALID_DATA);
RtlSetLastWin32Error(ERROR_INVALID_DATA);
return FALSE;
}
if (!(gl = get_gl_drawable( NtUserWindowFromDC( ctx->hdc ), ctx->hdc )))
{
SetLastError(ERROR_DC_NOT_FOUND);
RtlSetLastWin32Error(ERROR_DC_NOT_FOUND);
return FALSE;
}
@ -3118,7 +3118,7 @@ static BOOL X11DRV_wglSwapIntervalEXT(int interval)
if (ret)
gl->swap_interval = interval;
else
SetLastError(ERROR_DC_NOT_FOUND);
RtlSetLastWin32Error(ERROR_DC_NOT_FOUND);
pthread_mutex_unlock( &context_mutex );
release_gl_drawable(gl);
@ -3334,7 +3334,7 @@ static BOOL WINAPI glxdrv_wglSwapBuffers( HDC hdc )
if (!(gl = get_gl_drawable( NtUserWindowFromDC( hdc ), hdc )))
{
SetLastError( ERROR_INVALID_HANDLE );
RtlSetLastWin32Error( ERROR_INVALID_HANDLE );
return FALSE;
}

View file

@ -204,7 +204,7 @@ static BOOL xrandr10_get_modes( ULONG_PTR id, DWORD flags, DEVMODEW **new_modes,
modes = calloc( mode_count * DEPTH_COUNT, sizeof(*modes) + sizeof(SizeID) );
if (!modes)
{
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY );
return FALSE;
}

View file

@ -1941,7 +1941,7 @@ static BOOL CDECL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *
if ((blendfn.AlphaFormat & AC_SRC_ALPHA) && physdev_src->format != WXR_FORMAT_A8R8G8B8)
{
SetLastError( ERROR_INVALID_PARAMETER );
RtlSetLastWin32Error( ERROR_INVALID_PARAMETER );
return FALSE;
}

View file

@ -140,7 +140,7 @@ static BOOL xf86vm_get_modes(ULONG_PTR id, DWORD flags, DEVMODEW **new_modes, UI
ptr = calloc(1, size);
if (!ptr)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY );
return FALSE;
}