Henri Verbeet : wined3d: Check the return values for some wgl calls.

Alexandre Julliard julliard at winehq.org
Wed Jul 15 09:46:27 CDT 2009


Module: wine
Branch: master
Commit: ae8e8ac73f05a4070c85c1b2f43409f197410362
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ae8e8ac73f05a4070c85c1b2f43409f197410362

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Jul 15 12:21:17 2009 +0200

wined3d: Check the return values for some wgl calls.

---

 dlls/wined3d/context.c |   16 ++++++++++++++--
 dlls/wined3d/directx.c |    7 ++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 577f235..1fd7ea2 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -944,7 +944,15 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
     }
 
     ctx = pwglCreateContext(hdc);
-    if(This->numContexts) pwglShareLists(This->contexts[0]->glCtx, ctx);
+    if (This->numContexts)
+    {
+        if (!pwglShareLists(This->contexts[0]->glCtx, ctx))
+        {
+            DWORD err = GetLastError();
+            ERR("wglShareLists(%p, %p) failed, last error %#x.\n",
+                    This->contexts[0]->glCtx, ctx, err);
+        }
+    }
 
     if(!ctx) {
         ERR("Failed to create a WGL context\n");
@@ -957,7 +965,11 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
     ret = AddContextToArray(This, win_handle, hdc, ctx, pbuffer);
     if(!ret) {
         ERR("Failed to add the newly created context to the context list\n");
-        pwglDeleteContext(ctx);
+        if (!pwglDeleteContext(ctx))
+        {
+            DWORD err = GetLastError();
+            ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, err);
+        }
         if(create_pbuffer) {
             GL_EXTCALL(wglReleasePbufferDCARB(pbuffer, hdc));
             GL_EXTCALL(wglDestroyPbufferARB(pbuffer));
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 1ba7ca5..f296cbe 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -213,7 +213,12 @@ static void WineD3D_ReleaseFakeGLContext(struct wined3d_fake_gl_ctx *ctx)
         ERR_(d3d_caps)("Failed to disable fake GL context.\n");
     }
 
-    pwglDeleteContext(ctx->gl_ctx);
+    if (!pwglDeleteContext(ctx->gl_ctx))
+    {
+        DWORD err = GetLastError();
+        ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx->gl_ctx, err);
+    }
+
     ReleaseDC(ctx->wnd, ctx->dc);
     DestroyWindow(ctx->wnd);
 }




More information about the wine-cvs mailing list