opengl32: Set last error on invalid share in wglCreateContextAttribsARB.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ed4271fae9
commit
37ee3870a2
@ -898,11 +898,12 @@ static void test_opengl3(HDC hdc)
|
|||||||
{
|
{
|
||||||
HGLRC gl3Ctx;
|
HGLRC gl3Ctx;
|
||||||
DWORD error;
|
DWORD error;
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
gl3Ctx = pwglCreateContextAttribsARB(hdc, (HGLRC)0xdeadbeef, 0);
|
gl3Ctx = pwglCreateContextAttribsARB(hdc, (HGLRC)0xdeadbeef, 0);
|
||||||
ok(gl3Ctx == 0, "pwglCreateContextAttribsARB using an invalid shareList passed\n");
|
ok(gl3Ctx == 0, "pwglCreateContextAttribsARB using an invalid shareList passed\n");
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
/* The Nvidia implementation seems to return hresults instead of win32 error codes */
|
/* The Nvidia implementation seems to return hresults instead of win32 error codes */
|
||||||
todo_wine ok(error == ERROR_INVALID_OPERATION ||
|
ok(error == ERROR_INVALID_OPERATION ||
|
||||||
error == NVIDIA_HRESULT_FROM_WIN32(ERROR_INVALID_OPERATION), "Expected ERROR_INVALID_OPERATION, got error=%x\n", error);
|
error == NVIDIA_HRESULT_FROM_WIN32(ERROR_INVALID_OPERATION), "Expected ERROR_INVALID_OPERATION, got error=%x\n", error);
|
||||||
wglDeleteContext(gl3Ctx);
|
wglDeleteContext(gl3Ctx);
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,11 @@ HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attrib
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!funcs->ext.p_wglCreateContextAttribsARB) return 0;
|
if (!funcs->ext.p_wglCreateContextAttribsARB) return 0;
|
||||||
if (share && !(share_ptr = get_handle_ptr( share, HANDLE_CONTEXT ))) return 0;
|
if (share && !(share_ptr = get_handle_ptr( share, HANDLE_CONTEXT )))
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_INVALID_OPERATION );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if ((drv_ctx = funcs->ext.p_wglCreateContextAttribsARB( hdc,
|
if ((drv_ctx = funcs->ext.p_wglCreateContextAttribsARB( hdc,
|
||||||
share_ptr ? share_ptr->u.context->drv_ctx : NULL, attribs )))
|
share_ptr ? share_ptr->u.context->drv_ctx : NULL, attribs )))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user