opengl32: Hack to make sure winex11 is loaded before getting function pointers.

This commit is contained in:
Alexandre Julliard 2006-11-10 12:37:04 +01:00
parent 3d73173fe1
commit 879da0436a
1 changed files with 8 additions and 5 deletions

View File

@ -621,19 +621,22 @@ void internal_glGetIntegerv(GLenum pname, GLint* params) {
creating a rendering context.... */ creating a rendering context.... */
static BOOL process_attach(void) static BOOL process_attach(void)
{ {
HMODULE mod = GetModuleHandleA( "winex11.drv" ); HMODULE mod_x11, mod_gdi32;
HMODULE mod_gdi32 = GetModuleHandleA( "gdi32.dll" );
DWORD size = sizeof(internal_gl_disabled_extensions); DWORD size = sizeof(internal_gl_disabled_extensions);
HKEY hkey = 0; 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"); ERR("X11DRV or GDI32 not loaded. Cannot create default context.\n");
return FALSE; return FALSE;
} }
wine_tsx11_lock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_lock" ); wine_tsx11_lock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_lock" );
wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_unlock" ); wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod_x11, "wine_tsx11_unlock" );
wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress"); wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress");