From c89fb41f802e6870e5d440d89f3eac5ee9c74b6f Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Mon, 23 Nov 2009 20:18:54 +0100 Subject: [PATCH] opengl32: Fix wglCreateContextAttribsARB test on nvidia. --- dlls/opengl32/tests/opengl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 47096858bd1..b2d8e185c88 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -551,6 +551,8 @@ static void test_dc(HWND hwnd, HDC hdc) } } +/* Nvidia converts win32 error codes to (0xc007 << 16) | win32_error_code */ +#define NVIDIA_HRESULT_FROM_WIN32(x) (HRESULT_FROM_WIN32(x) | 0x40000000) static void test_opengl3(HDC hdc) { /* Try to create a context compatible with OpenGL 1.x; 1.0-2.1 is allowed */ @@ -571,7 +573,7 @@ static void test_opengl3(HDC hdc) ok(gl3Ctx == 0, "pwglCreateContextAttribsARB using an invalid HDC passed\n"); error = GetLastError(); todo_wine ok(error == ERROR_DC_NOT_FOUND || - broken(HRESULT_FROM_WIN32(ERROR_INVALID_DATA)), /* Nvidia Vista + Win7 */ + broken(error == NVIDIA_HRESULT_FROM_WIN32(ERROR_INVALID_DATA)), /* Nvidia Vista + Win7 */ "Expected ERROR_DC_NOT_FOUND, got error=%x\n", error); wglDeleteContext(gl3Ctx); } @@ -585,7 +587,7 @@ static void test_opengl3(HDC hdc) error = GetLastError(); /* The Nvidia implementation seems to return hresults instead of win32 error codes */ todo_wine ok(error == ERROR_INVALID_OPERATION || - error == 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); } -- 2.11.4.GIT