Commit 99daff8f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Avoid LPDIRECTDRAW.

parent 2480c939
......@@ -270,25 +270,21 @@ DDRAW_Create(const GUID *guid,
* Arguments, return values: See DDRAW_Create
*
***********************************************************************/
HRESULT WINAPI DECLSPEC_HOTPATCH
DirectDrawCreate(GUID *GUID,
LPDIRECTDRAW *DD,
IUnknown *UnkOuter)
HRESULT WINAPI DECLSPEC_HOTPATCH DirectDrawCreate(GUID *driver_guid, IDirectDraw **ddraw, IUnknown *outer)
{
HRESULT hr;
TRACE("driver_guid %s, ddraw %p, outer_unknown %p.\n",
debugstr_guid(GUID), DD, UnkOuter);
TRACE("driver_guid %s, ddraw %p, outer %p.\n",
debugstr_guid(driver_guid), ddraw, outer);
wined3d_mutex_lock();
hr = DDRAW_Create(GUID, (void **) DD, UnkOuter, &IID_IDirectDraw);
hr = DDRAW_Create(driver_guid, (void **)ddraw, outer, &IID_IDirectDraw);
wined3d_mutex_unlock();
if (SUCCEEDED(hr))
{
hr = IDirectDraw_Initialize(*DD, GUID);
if (FAILED(hr))
IDirectDraw_Release(*DD);
if (FAILED(hr = IDirectDraw_Initialize(*ddraw, driver_guid)))
IDirectDraw_Release(*ddraw);
}
return hr;
......
......@@ -29,9 +29,9 @@
#include "wine/test.h"
#include "ddraw.h"
static LPDIRECTDRAW lpDD = NULL;
static IDirectDrawSurface *lpDDSPrimary;
static IDirectDrawSurface *lpDDSBack;
static IDirectDraw *lpDD;
static WNDCLASS wc;
static HWND hwnd, hwnd2;
static int modes_cnt;
......
......@@ -31,7 +31,7 @@
static HRESULT (WINAPI *pDirectDrawCreateEx)(GUID *, void **, REFIID, IUnknown *);
static LPDIRECTDRAW lpDD = NULL;
static IDirectDraw *lpDD;
static DDCAPS ddcaps;
static BOOL CreateDirectDraw(void)
......
......@@ -21,7 +21,7 @@ import "objidl.idl";
/* trick widl into thinking that it knows the DirectDraw types
* as there is no IDL file for them (yet) */
cpp_quote("#if 0")
typedef void * LPDIRECTDRAW;
typedef void IDirectDraw;
typedef void DDSURFACEDESC,DDCAPS;
typedef DWORD RGBQUAD;
typedef LONGLONG REFERENCE_TIME;
......@@ -73,8 +73,8 @@ interface IDirectDrawVideo : IUnknown
HRESULT GetEmulatedCaps([out] DDCAPS *pCaps);
HRESULT GetSurfaceDesc([out] DDSURFACEDESC * pSurfaceDesc);
HRESULT GetFourCCCodes([out] DWORD * pCount, [out] DWORD * pCodes);
HRESULT SetDirectDraw([in] LPDIRECTDRAW pDirectDraw);
HRESULT GetDirectDraw([out] LPDIRECTDRAW * ppDirectDraw);
HRESULT SetDirectDraw([in] IDirectDraw *ddraw);
HRESULT GetDirectDraw([out] IDirectDraw **ddraw);
HRESULT GetSurfaceType([out] DWORD * pSurfaceType);
HRESULT SetDefault();
HRESULT UseScanLine([in] long UseScanLine);
......
......@@ -1235,7 +1235,7 @@ DECLARE_INTERFACE_(IDirectDrawPalette,IUnknown)
/*** IDirectDrawPalette methods ***/
STDMETHOD(GetCaps)(THIS_ LPDWORD lpdwCaps) PURE;
STDMETHOD(GetEntries)(THIS_ DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable) PURE;
STDMETHOD(Initialize)(THIS_ struct IDirectDraw *ddraw, DWORD flags, PALETTEENTRY *color_table) PURE;
STDMETHOD(SetEntries)(THIS_ DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries) PURE;
};
#undef INTERFACE
......@@ -1276,7 +1276,7 @@ DECLARE_INTERFACE_(IDirectDrawClipper,IUnknown)
/*** IDirectDrawClipper methods ***/
STDMETHOD(GetClipList)(THIS_ LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize) PURE;
STDMETHOD(GetHWnd)(THIS_ HWND *lphWnd) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags) PURE;
STDMETHOD(Initialize)(THIS_ struct IDirectDraw *ddraw, DWORD flags) PURE;
STDMETHOD(IsClipListChanged)(THIS_ BOOL *lpbChanged) PURE;
STDMETHOD(SetClipList)(THIS_ LPRGNDATA lpClipList, DWORD dwFlags) PURE;
STDMETHOD(SetHWnd)(THIS_ DWORD dwFlags, HWND hWnd) PURE;
......@@ -1893,7 +1893,7 @@ DECLARE_INTERFACE_(IDirectDrawSurface,IUnknown)
/*50*/ STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
/*54*/ STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
/*58*/ STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
/*5c*/ STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
/*5c*/ STDMETHOD(Initialize)(THIS_ IDirectDraw *ddraw, DDSURFACEDESC *surface_desc) PURE;
/*60*/ STDMETHOD(IsLost)(THIS) PURE;
/*64*/ STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
/*68*/ STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
......@@ -2027,7 +2027,7 @@ DECLARE_INTERFACE_(IDirectDrawSurface2,IUnknown)
STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ IDirectDraw *ddraw, DDSURFACEDESC *surface_desc) PURE;
STDMETHOD(IsLost)(THIS) PURE;
STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
......@@ -2173,7 +2173,7 @@ DECLARE_INTERFACE_(IDirectDrawSurface3,IUnknown)
STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ IDirectDraw *ddraw, DDSURFACEDESC *surface_desc) PURE;
STDMETHOD(IsLost)(THIS) PURE;
STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
......@@ -2324,7 +2324,7 @@ DECLARE_INTERFACE_(IDirectDrawSurface4,IUnknown)
STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ IDirectDraw *ddraw, DDSURFACEDESC2 *surface_desc) PURE;
STDMETHOD(IsLost)(THIS) PURE;
STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
......@@ -2491,7 +2491,7 @@ DECLARE_INTERFACE_(IDirectDrawSurface7,IUnknown)
STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
STDMETHOD(Initialize)(THIS_ IDirectDraw *ddraw, DDSURFACEDESC2 *surface_desc) PURE;
STDMETHOD(IsLost)(THIS) PURE;
STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
......@@ -2708,7 +2708,7 @@ DECLARE_INTERFACE_(IDirectDrawGammaControl,IUnknown)
#endif
HRESULT WINAPI DirectDrawCreate(GUID*,LPDIRECTDRAW*,IUnknown*);
HRESULT WINAPI DirectDrawCreate(GUID *driver_guid, IDirectDraw **ddraw, IUnknown *outer);
HRESULT WINAPI DirectDrawCreateEx(GUID*,LPVOID*,REFIID,IUnknown*);
HRESULT WINAPI DirectDrawCreateClipper(DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment