On Thursday 06 October 2005 09:38, Vitaliy Margolen wrote:
> Thursday, October 6, 2005, 1:31:09 AM, Raphael wrote:
> > Hi,
> >  Changelog:
> >   - fix 3487: don't crash if pDDSD is NULL on DirectDrawSurface::Lock
> > Regards,
> > Raphael
> > +    if (NULL == lpddsd) {
> > +      DPRINTF("(null)\n");
> >      } else {
>
> Please don't use DPFINTF

Why ? I use DPRINTF as all used by all ddraw-utils traces

> > +      if (lpddsd->>dwSize >= sizeof(DDSURFACEDESC2)) {
> > +        DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
> > +      } else {
>
> And follow the same indentation style (4 spaces):

emacs is my friend :)

> Vitaliy Margolen

Regards,
Raphael
? ddraw.dll.dbg.c
? ddraw.spec.def
Index: ddraw_utils.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw_utils.c,v
retrieving revision 1.1
diff -u -r1.1 ddraw_utils.c
--- ddraw_utils.c	31 May 2005 09:32:44 -0000	1.1
+++ ddraw_utils.c	6 Oct 2005 21:56:05 -0000
@@ -640,14 +640,17 @@
         };
 #undef STRUCT
 
-    if (lpddsd->dwSize >= sizeof(DDSURFACEDESC2)) {
-        DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
+    if (NULL == lpddsd) {
+        DPRINTF("(null)\n");
     } else {
-        DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps, 1);
+      if (lpddsd->dwSize >= sizeof(DDSURFACEDESC2)) {
+          DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
+      } else {
+          DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps, 1);
+      }
+      DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members,
+			 sizeof(members)/sizeof(members[0]));
     }
-                                                  
-    DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members,
-                       sizeof(members)/sizeof(members[0]));
 }
 
 void DDRAW_dump_cooperativelevel(DWORD cooplevel)
Index: surface_main.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/surface_main.c,v
retrieving revision 1.5
diff -u -r1.5 surface_main.c
--- surface_main.c	12 Sep 2005 14:12:47 -0000	1.5
+++ surface_main.c	6 Oct 2005 21:56:05 -0000
@@ -1093,6 +1093,12 @@
 	    WARN(" - unsupported locking flag : "); DDRAW_dump_lockflag(flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY));
 	}
     }
+    if (NULL != h) {
+        return DDERR_INVALIDPARAMS;
+    }
+    if (NULL == pDDSD) {
+        return DDERR_INVALIDPARAMS; /** really ? */
+    }
 
     /* If the surface is already locked, return busy */
     if (This->locked) {

Attachment: pgpIgVghRpWG6.pgp
Description: PGP signature



Reply via email to