mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 13:10:28 +00:00
winex11.drv: Make wglMakeCurrent return the correct error when the drawable is invalid.
This commit is contained in:
parent
77679c4e9c
commit
716df1c2d2
@ -956,7 +956,7 @@ static void test_destroy(HDC oldhdc)
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = wglMakeCurrent(dc, ctx);
|
||||
err = GetLastError();
|
||||
todo_wine ok(!ret && err == ERROR_INVALID_HANDLE,
|
||||
ok(!ret && err == ERROR_INVALID_HANDLE,
|
||||
"Unexpected behavior when making context current, ret %d, last error %#x.\n", ret, err);
|
||||
|
||||
ok(wglGetCurrentContext() == ctx, "Wrong current context.\n");
|
||||
@ -977,7 +977,7 @@ static void test_destroy(HDC oldhdc)
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = wglMakeCurrent(dc, ctx);
|
||||
err = GetLastError();
|
||||
todo_wine ok(!ret && err == ERROR_INVALID_HANDLE,
|
||||
ok(!ret && err == ERROR_INVALID_HANDLE,
|
||||
"Unexpected behavior when making context current, ret %d, last error %#x.\n", ret, err);
|
||||
|
||||
ok(wglGetCurrentContext() == NULL, "Wrong current context.\n");
|
||||
@ -989,7 +989,7 @@ static void test_destroy(HDC oldhdc)
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = wglMakeCurrent(dc, ctx);
|
||||
err = GetLastError();
|
||||
todo_wine ok(!ret && err == ERROR_INVALID_HANDLE,
|
||||
ok(!ret && err == ERROR_INVALID_HANDLE,
|
||||
"Unexpected behavior when making context current, ret %d, last error %#x.\n", ret, err);
|
||||
|
||||
ok(wglGetCurrentContext() == oldctx, "Wrong current context.\n");
|
||||
|
@ -1896,6 +1896,12 @@ BOOL CDECL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) {
|
||||
ret = pglXMakeCurrent(gdi_display, None, NULL);
|
||||
NtCurrentTeb()->glContext = NULL;
|
||||
}
|
||||
else if (!physDev->current_pf)
|
||||
{
|
||||
WARN("Trying to use an invalid drawable\n");
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
ret = FALSE;
|
||||
}
|
||||
else if (ctx->fmt->iPixelFormat != physDev->current_pf)
|
||||
{
|
||||
WARN( "mismatched pixel format hdc %p %u ctx %p %u\n",
|
||||
|
Loading…
Reference in New Issue
Block a user