4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS kernel
6 * FILE: lib/ddraw/ddraw.c
7 * PURPOSE: DirectDraw Library
8 * PROGRAMMER: Magnus Olsen (greatlrd)
16 HRESULT WINAPI
Create_DirectDraw (LPGUID pGUID
, LPDIRECTDRAW
* pIface
, REFIID id
, BOOL ex
)
18 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectDrawImpl
));
23 ZeroMemory(This
,sizeof(IDirectDrawImpl
));
25 This
->lpVtbl
= &DirectDraw7_Vtable
;
26 This
->lpVtbl_v1
= &DDRAW_IDirectDraw_VTable
;
27 This
->lpVtbl_v2
= &DDRAW_IDirectDraw2_VTable
;
28 This
->lpVtbl_v4
= &DDRAW_IDirectDraw4_VTable
;
30 This
->DirectDrawGlobal
.dwRefCnt
= 1;
31 *pIface
= (LPDIRECTDRAW
)This
;
33 if(This
->lpVtbl
->QueryInterface ((LPDIRECTDRAW7
)This
, id
, (void**)&pIface
) != S_OK
)
34 return DDERR_INVALIDPARAMS
;
36 return This
->lpVtbl
->Initialize ((LPDIRECTDRAW7
)This
, pGUID
);
39 HRESULT WINAPI
DirectDrawCreate (LPGUID lpGUID
, LPDIRECTDRAW
* lplpDD
, LPUNKNOWN pUnkOuter
)
41 /* check see if pUnkOuter is null or not */
44 /* we do not use same error code as MS, ms use 0x8004110 */
45 return DDERR_INVALIDPARAMS
;
48 return Create_DirectDraw (lpGUID
, lplpDD
, &IID_IDirectDraw
, FALSE
);
51 HRESULT WINAPI
DirectDrawCreateEx(LPGUID lpGUID
, LPVOID
* lplpDD
, REFIID id
, LPUNKNOWN pUnkOuter
)
53 /* check see if pUnkOuter is null or not */
56 /* we do not use same error code as MS, ms use 0x8004110 */
57 return DDERR_INVALIDPARAMS
;
60 /* Is it a DirectDraw 7 Request or not */
61 if (!IsEqualGUID(id
, &IID_IDirectDraw7
))
63 return DDERR_INVALIDPARAMS
;
66 return Create_DirectDraw (lpGUID
, (LPDIRECTDRAW
*)lplpDD
, id
, TRUE
);
69 HRESULT WINAPI
DirectDrawEnumerateA(
70 LPDDENUMCALLBACKA lpCallback
,
78 HRESULT WINAPI
DirectDrawEnumerateW(
79 LPDDENUMCALLBACKW lpCallback
,
86 HRESULT WINAPI
DirectDrawEnumerateExA(
87 LPDDENUMCALLBACKEXA lpCallback
,
95 HRESULT WINAPI
DirectDrawEnumerateExW(
96 LPDDENUMCALLBACKEXW lpCallback
,