[(try 2) 1/3] wined3d: Don't call wglMakeCurrent(NULL, NULL) in context_set_current() if the current context is NULL.

Rico Schüller kgbricola at web.de
Sat Sep 19 05:13:15 CDT 2009


Hi,

this patch series fixes a bug which happens on windows with wined3d. 
There a second call to wglMakeCurrent(NULL, NULL) fails, which will in 
one case result in an early return in context_set_current(), which 
doesn't set the the current context to NULL in such a case, but frees 
the variable. So on the next call to context_set_current() (e.g. from 
WineD3D_CreateFakeGLContext()) the memory in old->... could be some 
other random memory and the app could crash.

try 2 improvements:
- moved the check from winex11.drv to gdi32 (because we don't need any 
X11 functionality)
- order of patches changed

The first patch fixes the behaviour in wined3d. The second one adds the 
fix in gdi32 to change the behaviour to the one on xp. The third patch 
adds a test case to opengl32/tests.

Cheers
Rico


---
  dlls/wined3d/context.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 251cc7ce2e94ec2535051ab71c97638f4c6bb30e.diff
Type: text/x-patch
Size: 418 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090919/16405407/attachment.bin>


More information about the wine-patches mailing list