Commit 1579ab0e authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

winex11.drv: Set last error to ERROR_BUSY when attempting to delete a…

winex11.drv: Set last error to ERROR_BUSY when attempting to delete a cross-thread context in wglDeleteContext.
parent c4a8de92
......@@ -590,13 +590,16 @@ struct wgl_thread_param
HANDLE test_finished;
HGLRC hglrc;
BOOL hglrc_deleted;
DWORD last_error;
};
static DWORD WINAPI wgl_thread(void *param)
{
struct wgl_thread_param *p = param;
SetLastError(0xdeadbeef);
p->hglrc_deleted = wglDeleteContext(p->hglrc);
p->last_error = GetLastError();
SetEvent(p->test_finished);
return 0;
......@@ -638,6 +641,7 @@ static void test_deletecontext(HDC hdc)
{
WaitForSingleObject(thread_handle, INFINITE);
ok(thread_params.hglrc_deleted == FALSE, "Attempt to delete WGL context from another thread passed but should fail!\n");
ok(thread_params.last_error == ERROR_BUSY, "Expected last error to be ERROR_BUSY, got %u\n", thread_params.last_error);
}
CloseHandle(thread_params.test_finished);
......
......@@ -1793,6 +1793,7 @@ BOOL CDECL X11DRV_wglDeleteContext(HGLRC hglrc)
if (ctx->tid != 0 && ctx->tid != GetCurrentThreadId())
{
TRACE("Cannot delete context=%p because it is current in another thread.\n", ctx);
SetLastError(ERROR_BUSY);
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment