[ros-diffs] [greatlrd] 26857: Thx DrFred notice I did take wrong struct at alloc, I also comment up the code bit.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Mon May 21 20:49:29 CEST 2007


Author: greatlrd
Date: Mon May 21 22:49:28 2007
New Revision: 26857

URL: http://svn.reactos.org/svn/reactos?rev=26857&view=rev
Log:
Thx DrFred notice I did take wrong struct at alloc, I also comment up the code bit. 

Modified:
    trunk/reactos/dll/directx/ddraw/startup.c

Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.c?rev=26857&r1=26856&r2=26857&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Mon May 21 22:49:28 2007
@@ -60,7 +60,6 @@
             DX_STUB_str("DDERR_OUTOFMEMORY");
             return DDERR_OUTOFMEMORY;
         }
-        This->lpLcl->lpGbl = &ddgbl;
     }
     else
     {
@@ -68,6 +67,7 @@
         /* We got the DirectDraw interface alloc and we need create the link */
         LPDDRAWI_DIRECTDRAW_INT  newThis;
 
+        /* step 1.Alloc the new  DDRAWI_DIRECTDRAW_INT for the lnking */
         newThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
         if (newThis == NULL)
         {
@@ -75,7 +75,7 @@
             return DDERR_OUTOFMEMORY;
         }
 
-        /* we need check the GUID lpGUID what type it is */
+        /* step 2 check if it not DDCREATE_HARDWAREONLY we got if so we fail */
         if (pGUID != (LPGUID)DDCREATE_HARDWAREONLY)
         {
             if (pGUID !=NULL)
@@ -85,22 +85,23 @@
                 return DDERR_INVALIDDIRECTDRAWGUID;
             }
         }
+
+        /* step 3 do the link the old interface are store in the new one */
         newThis->lpLink = This;
 
-        newThis->lpLcl = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
+        /* step 4 we need create new local directdraw struct for the new linked interface */
+        newThis->lpLcl = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_LCL));
         if (newThis->lpLcl == NULL)
         {
             This = newThis;
             DX_STUB_str("DDERR_OUTOFMEMORY");
             return DDERR_OUTOFMEMORY;
         }
-        RtlCopyMemory(newThis->lpLcl, This->lpLcl, sizeof(DDRAWI_DIRECTDRAW_LCL));
 
         This = newThis;
-
-        DX_STUB_str("here\n");
-
-    }
+    }
+
+    This->lpLcl->lpGbl = &ddgbl;
 
     *pIface = (LPDIRECTDRAW)This;
 
@@ -111,8 +112,6 @@
 
         if (StartDirectDraw((LPDIRECTDRAW)This, pGUID, FALSE) == DD_OK);
         {
-            DX_STUB_str("here");
-
             /*
             RtlZeroMemory(&wnd_class, sizeof(wnd_class));
             wnd_class.style = CS_HREDRAW | CS_VREDRAW;




More information about the Ros-diffs mailing list