[OPENGL32]
[reactos.git] / dll / opengl / opengl32 / wgl.c
index 701cc19..a8547c1 100644 (file)
@@ -79,7 +79,7 @@ get_dc_data(HDC hdc)
         data->nb_icd_formats = data->icd_data->DrvDescribePixelFormat(hdc, 0, 0, NULL);
     else
         data->nb_icd_formats = 0;
-    TRACE("ICD %S has %u formats for HDC %x.\n", data->icd_data->DriverName, data->nb_icd_formats, hdc);
+    TRACE("ICD %S has %u formats for HDC %x.\n", data->icd_data ? data->icd_data->DriverName : NULL, data->nb_icd_formats, hdc);
     data->nb_sw_formats = sw_DescribePixelFormat(hdc, 0, 0, NULL);
     data->next = dc_data_list;
     dc_data_list = data;
@@ -379,7 +379,7 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
     struct wgl_context* context;
     DHGLRC dhglrc;
     
-    TRACE("Creating context for %p, format %i\n", hdc);
+    TRACE("Creating context for %p.\n", hdc);
     
     if(!dc_data)
     {
@@ -696,7 +696,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
                 ERR("DrvSetContext failed!\n");
                 /* revert */
                 InterlockedExchange(&ctx->thread_id, 0);
-                IntSetCurrentDispatchTable(&StubTable.glDispatchTable);
+                IntSetCurrentDispatchTable(NULL);
                 SetLastError(ERROR_INVALID_PARAMETER);
                 return FALSE;
             }
@@ -728,8 +728,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
         InterlockedExchange(&old_ctx->thread_id, 0);
         /* Unset it */
         IntMakeCurrent(NULL, NULL, NULL);
-        /* Reset the no-op table */
-        set_api_table(&StubTable);
+        IntSetCurrentDispatchTable(NULL);
         /* Test conformance (extreme cases) */
         return hglrc == NULL;
     }
@@ -927,6 +926,6 @@ IntDeleteAllContexts(void)
     {
         context = CONTAINING_RECORD(Entry, struct wgl_context, ListEntry);
         wglDeleteContext((HGLRC)context);
-        Entry = ContextListHead.Flink;
+        Entry = Entry->Flink;
     }
 }