mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix some error checking for DireactDrawCreate and DireactDrawCreateEx, we checking if the param is right or not.
svn path=/trunk/; revision=17206
This commit is contained in:
parent
a3abeb83af
commit
079265d1a7
1 changed files with 23 additions and 8 deletions
|
@ -15,10 +15,7 @@
|
|||
|
||||
HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
|
||||
IUnknown* pUnkOuter, BOOL ex)
|
||||
{
|
||||
if (pUnkOuter!=NULL)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
{
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
||||
|
||||
if (This == NULL)
|
||||
|
@ -32,15 +29,33 @@ HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
|
|||
}
|
||||
|
||||
HRESULT WINAPI DirectDrawCreate (LPGUID lpGUID, LPDIRECTDRAW* lplpDD, LPUNKNOWN pUnkOuter)
|
||||
{
|
||||
{
|
||||
|
||||
/* check see if pUnkOuter is null or not */
|
||||
if (!pUnkOuter)
|
||||
{
|
||||
/* we do not use same error code as MS, ms use 0x8004110 */
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
return Create_DirectDraw (lpGUID, lplpDD, pUnkOuter, FALSE);
|
||||
}
|
||||
|
||||
HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID* lplpDD, REFIID iid, LPUNKNOWN pUnkOuter)
|
||||
{
|
||||
if (!IsEqualGUID(iid, &IID_IDirectDraw7))
|
||||
return DDERR_INVALIDPARAMS;
|
||||
{
|
||||
/* check see if pUnkOuter is null or not */
|
||||
if (!pUnkOuter)
|
||||
{
|
||||
/* we do not use same error code as MS, ms use 0x8004110 */
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
/* Is it a DirectDraw 7 Request or not */
|
||||
if (!IsEqualGUID(iid, &IID_IDirectDraw7))
|
||||
{
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
return Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, pUnkOuter, TRUE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue