PATCH: Initialize the DDCAPS structure of the DDRAW object

Christian Costa titan.costa at wanadoo.fr
Mon Aug 5 09:01:40 CDT 2002


This patch set the DDCAPS dwSize member of the DDRAW object.
This makes GetCaps to correctly copy (with DD_STRUCT_COPY_BYSIZE)
the strucure to the application.

Modified files :
dlls/ddraw/ddraw/hal.c

Changelog :
Initialize the DDCAPS structure of the DDRAW object at creation

Christian

-------------- next part --------------
Index: hal.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw/hal.c,v
retrieving revision 1.6
diff -u -r1.6 hal.c
--- hal.c	31 May 2002 23:25:45 -0000	1.6
+++ hal.c	5 Aug 2002 13:25:52 -0000
@@ -391,6 +391,9 @@
      * CoCreateInstanced then Initialized. */
     This->private = (HAL_DirectDrawImpl *)(This+1);
 
+    /* Initialize the DDCAPS structure */
+    This->caps.dwSize = sizeof(This->caps);
+
     hr = HAL_DirectDraw_Construct(This, ex);
     if (FAILED(hr))
 	HeapFree(GetProcessHeap(), 0, This);
@@ -412,6 +415,9 @@
     This->private = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
 			      sizeof(HAL_DirectDrawImpl));
     if (This->private == NULL) return E_OUTOFMEMORY;
+
+    /* Initialize the DDCAPS structure */
+    This->caps.dwSize = sizeof(This->caps);
 
     hr = HAL_DirectDraw_Construct(This, TRUE); /* XXX ex? */
     if (FAILED(hr))


More information about the wine-patches mailing list