diff --git a/dll/opengl/opengl32/opengl32.h b/dll/opengl/opengl32/opengl32.h index 0395fe00a66..ac5cb88ef83 100644 --- a/dll/opengl/opengl32/opengl32.h +++ b/dll/opengl/opengl32/opengl32.h @@ -21,51 +21,13 @@ #include #endif +#define NTOS_MODE_USER +#include + #include #include "icd.h" -/* *$%$£^§! headers inclusion */ -static __inline -BOOLEAN -RemoveEntryList( - _In_ PLIST_ENTRY Entry) -{ - PLIST_ENTRY OldFlink; - PLIST_ENTRY OldBlink; - - OldFlink = Entry->Flink; - OldBlink = Entry->Blink; - OldFlink->Blink = OldBlink; - OldBlink->Flink = OldFlink; - return (OldFlink == OldBlink); -} - -static __inline -VOID -InsertTailList( - _In_ PLIST_ENTRY ListHead, - _In_ PLIST_ENTRY Entry -) -{ - PLIST_ENTRY OldBlink; - OldBlink = ListHead->Blink; - Entry->Flink = ListHead; - Entry->Blink = OldBlink; - OldBlink->Flink = Entry; - ListHead->Blink = Entry; -} - - -static __inline -VOID -InitializeListHead( - _Inout_ PLIST_ENTRY ListHead -) -{ - ListHead->Flink = ListHead->Blink = ListHead; -} - extern LIST_ENTRY ContextListHead; struct wgl_context diff --git a/dll/opengl/opengl32/wgl.c b/dll/opengl/opengl32/wgl.c index 2beee39c263..b495b354deb 100644 --- a/dll/opengl/opengl32/wgl.c +++ b/dll/opengl/opengl32/wgl.c @@ -437,11 +437,11 @@ HGLRC WINAPI wglCreateContext(HDC hdc) context->icd_data = dc_data->icd_data; context->pixelformat = dc_data->pixelformat; context->thread_id = 0; + context->magic = 'GLRC'; /* Insert into the list */ InsertTailList(&ContextListHead, &context->ListEntry); - context->magic = 'GLRC'; TRACE("Success!\n"); return (HGLRC)context; } @@ -504,9 +504,11 @@ HGLRC WINAPI wglCreateLayerContext(HDC hdc, int iLayerPlane) context->icd_data = dc_data->icd_data; context->pixelformat = dc_data->pixelformat; context->thread_id = 0; - context->magic = 'GLRC'; + /* Insert into the list */ + InsertTailList(&ContextListHead, &context->ListEntry); + release_dc_data(dc_data); return (HGLRC)context; }