Patch for opengl32.dll.so

Bertrand Coconnier bcoconni at club-internet.fr
Thu Nov 2 13:01:51 CST 2006


Roderick Colenbrander wrote :
> Compared to 0.9.23 I changed the way wglGetIntegerv is loaded before it was directly loaded using GetProcAddress from winex11.drv now it is still loaded from winex11.drv but then using wglGetProcAddress from gdi32. At wine startup (I'm not sure at which stage but I believe directly when you use gdi stuff or perhaps even earlier) winex11.drv is initialized and during this initialization my opengl code is initialized aswell. I wonder what causes the race as I haven't seen it happening for other users yet. I want to avoid a patch like yours as I plan to do similar things for some other functions.
> 
> Perhaps something goes wrong in wglGetProcAddress itself. Try running wine using: WINEDEBUG=+wgl,+opengl wine wow.exe -opengl &> log. If it is correct you'll see some opengl information (gl version, loading of extensions) before stuff happens in opengl32.dll.

I have attached the log file that you have requested. I think it makes 
everything clear : the cause of the failure appears at the very beginning (line 
2), X11DRV_wglGetProcAddress fails to load 'wglGetIntegerv'. This error is 
generated by process_attach(). The log file also shows that the OpenGL 
initialization occurs *after* process_attach() is called.

The sequence is :

1. process_attach() is called => X11DRV_wglGetProcAddress() returns NULL since 
OpenGL has not been initialized (error on line 2 of the log file)
2. X11DRV is initialized
3. internal_glGetIntegerv is called and fails since wine_wgl.p_wglGetIntegerv is 
NULL.

So internal_glGetIntegerv() is called after X11DRV startup (which is the 
expected behaviour) but it uses a pointer that has been set *before* X11DRV 
startup, hence the failure.

Bertrand.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.bz2
Type: application/octet-stream
Size: 3422 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20061102/e1091447/log.obj


More information about the wine-devel mailing list