diff --git a/reactos/dll/win32/opengl32/gl.c b/reactos/dll/win32/opengl32/gl.c index 51c5c2770b4..249ed529819 100644 --- a/reactos/dll/win32/opengl32/gl.c +++ b/reactos/dll/win32/opengl32/gl.c @@ -61,6 +61,8 @@ int STDCALL glEmptyFunc56( long l1, long l2, long l3, long l4, long l5, #if defined(_M_IX86) # define FOO(x) #x + +#if __MINGW32__ # define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ __asm__(".align 4" "\n\t" \ ".globl _"#func"@"#stack "\n\t" \ @@ -68,6 +70,25 @@ __asm__(".align 4" "\n\t" \ " movl %fs:0x18, %eax" "\n\t" \ " movl 0xbe8(%eax), %eax" "\n\t" \ " jmp *"FOO((icdidx*4))"(%eax)" "\n\t"); +#else +# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ +ret STDCALL func typeargs \ +{ \ + PROC *table; \ + PROC fn; \ + if (tebidx >= 0 && 0) \ + { \ + table = (PROC *)NtCurrentTeb()->glDispatchTable; \ + fn = table[tebidx]; \ + } \ + else \ + { \ + table = (PROC *)NtCurrentTeb()->glTable; \ + fn = table[icdidx]; \ + } \ + return (ret)((ret(*)typeargs)fn)args; \ +} +#endif GLFUNCS_MACRO # undef FOO diff --git a/reactos/dll/win32/opengl32/opengl32.c b/reactos/dll/win32/opengl32/opengl32.c index 24970ede722..9be68aaa5e4 100644 --- a/reactos/dll/win32/opengl32/opengl32.c +++ b/reactos/dll/win32/opengl32/opengl32.c @@ -601,7 +601,7 @@ static DWORD OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd ) { HKEY hKey; - WCHAR subKey[1024] = OPENGL_DRIVERS_SUBKEY"\\"; + WCHAR subKey[1024] = OPENGL_DRIVERS_SUBKEY2; LONG ret; DWORD type, size; diff --git a/reactos/dll/win32/opengl32/opengl32.h b/reactos/dll/win32/opengl32/opengl32.h index 353aa41797e..0b63f2b91f6 100644 --- a/reactos/dll/win32/opengl32/opengl32.h +++ b/reactos/dll/win32/opengl32/opengl32.h @@ -23,6 +23,7 @@ extern "C" { #endif #define OPENGL_DRIVERS_SUBKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers" +#define OPENGL_DRIVERS_SUBKEY2 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers\\" /* gl function list */ #include "glfuncs.h" @@ -42,16 +43,12 @@ extern "C" { #endif /* !NDEBUG */ /* debug macros */ -#ifdef _MSC_VER -inline void DBGPRINT ( ... ) {} -#else # ifdef DEBUG_OPENGL32 ULONG DbgPrint(PCH Format,...); # include # define DBGPRINT( fmt, args... ) \ DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args ) # endif -#endif #ifndef DBGPRINT # define DBGPRINT( ... ) do {} while (0) diff --git a/reactos/dll/win32/opengl32/wgl.c b/reactos/dll/win32/opengl32/wgl.c index 105b0c4932e..4b28c163b6c 100644 --- a/reactos/dll/win32/opengl32/wgl.c +++ b/reactos/dll/win32/opengl32/wgl.c @@ -1027,7 +1027,7 @@ rosglMakeCurrent( HDC hdc, HGLRC hglrc ) DBGPRINT( "Info: Calling DrvSetContext!" ); SetLastError( ERROR_SUCCESS ); icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc, - ROSGL_SetContextCallBack ); + (void *)ROSGL_SetContextCallBack ); if (icdTable == NULL) { DBGPRINT( "Error: DrvSetContext failed (%d)\n", GetLastError() );