[ddraw/dsurface/main.c] LPRECT parameters for Main_DirectDrawSurface_Lock

Andreas Eckstein andreas.eckstein at gmx.net
Mon Feb 14 21:07:15 CST 2005


Good morning, wine devs!

When playing Icewind Dale II (using wine-20050111), the game sometimes 
crashed with these messages:

   trace:ddraw:Main_DirectDrawSurface_Lock     lprect: 0x0-0x0
   err:ddraw:Main_DirectDrawSurface_Lock  Invalid values in LPRECT !!!

or, on another occasion:

   trace:ddraw:Main_DirectDrawSurface_Lock     lprect: 0x0-2x0
   err:ddraw:Main_DirectDrawSurface_Lock  Invalid values in LPRECT !!!

As you notice, the game tries to lock a surface with width and/or height 
equal to zero. Frankly I have no idea what the expected behavior is in 
this case, however playing the critical passages on Windows worked 
without crash. A quick patch to let Main_DirectDrawSurface_Lock not 
choke on zero-width or -height LPRECTs solved the problem with wine. 
Since I don't plan to dig into wine hacking any time soon, could someone 
merge it into cvs for me (if the new behavior of the function is 
acceptable, that is)? Thanks in advance!

Andreas Eckstein

---

The patch:

--- dlls/ddraw/dsurface/main.c    2005-01-09 18:35:44.000000000 +0100
+++ dlls/ddraw/dsurface/main.c    2005-02-14 21:03:36.511738080 +0100
@@ -1111,8 +1111,8 @@
        (prect->left < 0) ||
        (prect->bottom < 0) ||
        (prect->right < 0) ||
-        (prect->left >= prect->right) ||
-        (prect->top >= prect->bottom) ||
+        (prect->left > prect->right) ||
+        (prect->top > prect->bottom) ||
        (prect->left >= This->surface_desc.dwWidth) ||
        (prect->right > This->surface_desc.dwWidth) ||
        (prect->top >= This->surface_desc.dwHeight) ||




More information about the wine-devel mailing list