mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[OPENGL32] Misc refactoring and a bugfix for Nvidia OpenGL ICD (#8656)
* [OPENGL32] Use NDK definitions for list functions * [OPENGL32] wglCreateLayerContext: Insert an entry into context list Fixes a crash when wglDeleteContext is called on layer context.
This commit is contained in:
@@ -21,51 +21,13 @@
|
||||
#include <pstypes.h>
|
||||
#endif
|
||||
|
||||
#define NTOS_MODE_USER
|
||||
#include <rtlfuncs.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user