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. 

svn path=/trunk/; revision=25021
This commit is contained in:
Magnus Olsen 2006-12-02 23:04:11 +00:00
parent 8b4c009bfb
commit 073d96842d
2 changed files with 53 additions and 7 deletions

View file

@ -33,9 +33,14 @@ WINAPI
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 @@ DirectDrawCreate (LPGUID lpGUID,
/* 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 @@ DirectDrawCreateEx(LPGUID lpGUID,
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 @@ DirectDrawCreateEx(LPGUID lpGUID,
/* 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 @@ DirectDrawCreateEx(LPGUID lpGUID,
return DDERR_INVALIDPARAMS;
}
/* Create our DirectDraw interface */
return Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, TRUE);
}

View file

@ -942,9 +942,43 @@ Create_DirectDraw (LPGUID pGUID,
return DDERR_OUTOFMEMORY;
}
This->lpLcl->lpGbl = &ddgbl;
This->lpLcl->dwLocalRefCnt = 0;
/*
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->lpPrimary = NULL;
This->lpLcl->pD3DIUnknown = NULL;
This->lpLcl->pUnkOuter = NULL;
*pIface = (LPDIRECTDRAW)This;
@ -955,7 +989,7 @@ Create_DirectDraw (LPGUID pGUID,
if (StartDirectDraw((LPDIRECTDRAW*)This, pGUID) == DD_OK);
{
This->lpLcl->hDD = ddgbl.hDD;
return DD_OK;
}