ddrawex: Implement a wrapper around IDirectDraw.

This allows us to cleanly implement the differences between ddraw.dll and
ddrawex.dll without private functions and if checks if an object was created
by ddraw or ddrawex. A similar wrapper will be added for IDirectDrawSurface.
This commit is contained in:
Stefan Dösinger 2009-01-09 12:23:17 +01:00 committed by Alexandre Julliard
parent 8eff8acc46
commit efcecb9b99
4 changed files with 1506 additions and 32 deletions

View File

@ -6,6 +6,7 @@ MODULE = ddrawex.dll
IMPORTS = dxguid uuid ddraw ole32 advapi32 kernel32 IMPORTS = dxguid uuid ddraw ole32 advapi32 kernel32
C_SRCS = \ C_SRCS = \
ddraw.c \
main.c \ main.c \
regsvr.c regsvr.c

1484
dlls/ddrawex/ddraw.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -55,7 +55,7 @@ typedef struct
/****************************************************************************** /******************************************************************************
* DirectDrawFactopry implementation * DirectDrawFactory implementation
******************************************************************************/ ******************************************************************************/
typedef struct typedef struct
{ {
@ -63,4 +63,23 @@ typedef struct
LONG ref; LONG ref;
} IDirectDrawFactoryImpl; } IDirectDrawFactoryImpl;
HRESULT WINAPI IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface,
GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter,
IDirectDraw **ppDirectDraw);
/******************************************************************************
* IDirectDraw wrapper implementation
******************************************************************************/
typedef struct
{
const IDirectDrawVtbl *IDirectDraw_Vtbl;
const IDirectDraw2Vtbl *IDirectDraw2_Vtbl;
const IDirectDraw3Vtbl *IDirectDraw3_Vtbl;
const IDirectDraw4Vtbl *IDirectDraw4_Vtbl;
LONG ref;
/* The interface we're forwarding to */
IDirectDraw4 *parent;
} IDirectDrawImpl;
#endif /* __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H */ #endif /* __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H */

View File

@ -33,7 +33,7 @@
#include "initguid.h" #include "initguid.h"
#include "ddrawex_private.h" #include "ddrawex_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ddraw); WINE_DEFAULT_DEBUG_CHANNEL(ddrawex);
/******************************************************************************* /*******************************************************************************
@ -194,36 +194,6 @@ IDirectDrawFactoryImpl_Release(IDirectDrawFactory *iface)
return ref; return ref;
} }
/*******************************************************************************
* IDirectDrawFactoryImpl_CreateDirectDraw
*******************************************************************************/
static HRESULT WINAPI
IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface,
GUID * pGUID,
HWND hWnd,
DWORD dwCoopLevelFlags,
DWORD dwReserved,
IUnknown *pUnkOuter,
IDirectDraw **ppDirectDraw)
{
HRESULT hr;
TRACE("\n");
hr = DirectDrawCreateEx(pGUID, (void**)ppDirectDraw, &IID_IDirectDraw3, pUnkOuter);
if (FAILED(hr))
return hr;
hr = IDirectDraw_SetCooperativeLevel(*ppDirectDraw, hWnd, dwCoopLevelFlags);
if (FAILED(hr))
IDirectDraw_Release(*ppDirectDraw);
return hr;
}
/******************************************************************************* /*******************************************************************************
* IDirectDrawFactoryImpl_DirectDrawEnumerate * IDirectDrawFactoryImpl_DirectDrawEnumerate
*******************************************************************************/ *******************************************************************************/