Module: wine Branch: master Commit: 879da0436aa1f235f9bc5eb84efa765578e33db1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=879da0436aa1f235f9bc5eb84e...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Nov 10 12:37:04 2006 +0100
opengl32: Hack to make sure winex11 is loaded before getting function pointers.
---
dlls/opengl32/wgl.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 419f6c8..bc5014a 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -621,19 +621,22 @@ #endif creating a rendering context.... */ static BOOL process_attach(void) { - HMODULE mod = GetModuleHandleA( "winex11.drv" ); - HMODULE mod_gdi32 = GetModuleHandleA( "gdi32.dll" ); + HMODULE mod_x11, mod_gdi32; DWORD size = sizeof(internal_gl_disabled_extensions); HKEY hkey = 0;
- if (!mod || !mod_gdi32) + GetDesktopWindow(); /* make sure winex11 is loaded (FIXME) */ + mod_x11 = GetModuleHandleA( "winex11.drv" ); + mod_gdi32 = GetModuleHandleA( "gdi32.dll" ); + + if (!mod_x11 || !mod_gdi32) { ERR("X11DRV or GDI32 not loaded. Cannot create default context.\n"); return FALSE; }
- wine_tsx11_lock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_lock" ); - wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_unlock" ); + wine_tsx11_lock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_lock" ); + wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_unlock" );
wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress");