Author: greatlrd
Date: Sun Dec 3 02:04:11 2006
New Revision: 25021
URL:
http://svn.reactos.org/svn/reactos?rev=25021&view=rev
Log:
bug fixed some more info getting same as ms ddraw when you execute DirectDrawCreateEx
fixed some comment in main.c, Comment why memory does not being fill to zero in lest
windows 2000 after you play with directdraw.
Modified:
trunk/reactos/dll/directx/ddraw/main.c
trunk/reactos/dll/directx/ddraw/startup.c
Modified: trunk/reactos/dll/directx/ddraw/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main.c?r…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main.c Sun Dec 3 02:04:11 2006
@@ -33,9 +33,14 @@
DirectDrawCreate (LPGUID lpGUID,
LPDIRECTDRAW* lplpDD,
LPUNKNOWN pUnkOuter)
-{
+{
+ /*
+ remove this when UML digram are in place
+ this api is finish and is working as it should
+ */
DX_WINDBG_trace();
+ /* check the pointer if it vaild to read from */
if (IsBadWritePtr( lplpDD, sizeof( LPVOID )) )
{
return DDERR_INVALIDPARAMS;
@@ -44,10 +49,11 @@
/* check see if pUnkOuter is null or not */
if (pUnkOuter)
{
- /* we do not use same error code as MS, ms use CLASS_E_NOAGGREGATION */
- return CLASS_E_NOAGGREGATION;
+ /* we are using same error code as MS*/
+ return CLASS_E_NOAGGREGATION;
}
+ /* Create our DirectDraw interface */
return Create_DirectDraw (lpGUID, lplpDD, &IID_IDirectDraw7, FALSE);
}
@@ -63,8 +69,13 @@
REFIID id,
LPUNKNOWN pUnkOuter)
{
+ /*
+ remove this when UML digram are in place
+ this api is finish and is working as it should
+ */
DX_WINDBG_trace();
+ /* check the pointer if it vaild to read from */
if (IsBadWritePtr( lplpDD, sizeof( LPVOID )) )
{
return DDERR_INVALIDPARAMS;
@@ -73,7 +84,7 @@
/* check see if pUnkOuter is null or not */
if (pUnkOuter)
{
- /* we do not use same error code as MS, ms use CLASS_E_NOAGGREGATION */
+ /* we are using same error code as MS*/
return CLASS_E_NOAGGREGATION;
}
@@ -83,6 +94,7 @@
return DDERR_INVALIDPARAMS;
}
+ /* Create our DirectDraw interface */
return Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, TRUE);
}
Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Sun Dec 3 02:04:11 2006
@@ -942,9 +942,43 @@
return DDERR_OUTOFMEMORY;
}
+
+ /*
+ We need manual fill this struct member we can not trust on
+ the heap zero the struct if you play to much with directdraw
+ in Windows 2000. This is a small workaround of one of directdraw
+ bugs
+ */
+
+ /*
+ FIXME
+ read dwAppHackFlags flag from the system register instead for hard code it
+ */
+ This->lpLcl->dwAppHackFlags = 0;
+ This->lpLcl->dwErrorMode = 0;
+ This->lpLcl->dwHotTracking = 0;
+ This->lpLcl->dwIMEState = 0;
+ This->lpLcl->dwLocalFlags = DDRAWILCL_DIRECTDRAW7;
+ This->lpLcl->dwLocalRefCnt = 0;
+ This->lpLcl->dwObsolete1 = 0;
+ This->lpLcl->dwPreferredMode = 0;
+ This->lpLcl->dwProcessId = 0;
+ This->lpLcl->dwUnused0 = 0;
+ This->lpLcl->hD3DInstance = NULL;
+ This->lpLcl->hDC = 0;
+ This->lpLcl->hDDVxd = 0;
+ This->lpLcl->hFocusWnd = 0;
+ This->lpLcl->hGammaCalibrator = 0;
+ This->lpLcl->hWnd = 0;
+ This->lpLcl->hWndPopup = 0;
+ This->lpLcl->lpCB = NULL;
+ This->lpLcl->lpDDCB = NULL;
+ This->lpLcl->lpDDMore = 0;
+ This->lpLcl->lpGammaCalibrator = 0;
This->lpLcl->lpGbl = &ddgbl;
- This->lpLcl->dwLocalRefCnt = 0;
- This->lpLcl->dwLocalFlags = DDRAWILCL_DIRECTDRAW7;
+ This->lpLcl->lpPrimary = NULL;
+ This->lpLcl->pD3DIUnknown = NULL;
+ This->lpLcl->pUnkOuter = NULL;
*pIface = (LPDIRECTDRAW)This;
@@ -955,7 +989,7 @@
if (StartDirectDraw((LPDIRECTDRAW*)This, pGUID) == DD_OK);
{
-
+ This->lpLcl->hDD = ddgbl.hDD;
return DD_OK;
}