ddraw: Avoid LPDDSURFACEDESC.

This commit is contained in:
Henri Verbeet 2012-12-07 00:07:05 +01:00 committed by Alexandre Julliard
parent 9a7bb01a95
commit b1186d71c2
5 changed files with 32 additions and 26 deletions

View File

@ -36,7 +36,7 @@ static WNDCLASS wc;
static HWND hwnd, hwnd2;
static int modes_cnt;
static int modes_size;
static LPDDSURFACEDESC modes;
static DDSURFACEDESC *modes;
static RECT rect_before_create;
static RECT rect_after_delete;
static int modes16bpp_cnt;
@ -292,7 +292,7 @@ static void test_DirectDrawEnumerateExW(void)
ok(ret == DDERR_UNSUPPORTED, "Expected DDERR_UNSUPPORTED, got %d\n", ret);
}
static void adddisplaymode(LPDDSURFACEDESC lpddsd)
static void adddisplaymode(DDSURFACEDESC *lpddsd)
{
if (!modes)
modes = HeapAlloc(GetProcessHeap(), 0, (modes_size = 2) * sizeof(DDSURFACEDESC));
@ -309,7 +309,7 @@ static void flushdisplaymodes(void)
modes_cnt = modes_size = 0;
}
static HRESULT WINAPI enummodescallback(LPDDSURFACEDESC lpddsd, LPVOID lpContext)
static HRESULT WINAPI enummodescallback(DDSURFACEDESC *lpddsd, void *lpContext)
{
trace("Width = %i, Height = %i, bpp = %i, Refresh Rate = %i, Pitch = %i, flags =%02X\n",
lpddsd->dwWidth, lpddsd->dwHeight, U1(lpddsd->ddpfPixelFormat).dwRGBBitCount,
@ -338,7 +338,7 @@ static HRESULT WINAPI enummodescallback(LPDDSURFACEDESC lpddsd, LPVOID lpContext
return DDENUMRET_OK;
}
static HRESULT WINAPI enummodescallback_16bit(LPDDSURFACEDESC lpddsd, LPVOID lpContext)
static HRESULT WINAPI enummodescallback_16bit(DDSURFACEDESC *lpddsd, void *lpContext)
{
trace("Width = %i, Height = %i, bpp = %i, Refresh Rate = %i, Pitch = %i, flags =%02X\n",
lpddsd->dwWidth, lpddsd->dwHeight, U1(lpddsd->ddpfPixelFormat).dwRGBBitCount,
@ -376,7 +376,7 @@ static HRESULT WINAPI enummodescallback_16bit(LPDDSURFACEDESC lpddsd, LPVOID lpC
return DDENUMRET_OK;
}
static HRESULT WINAPI enummodescallback_count(LPDDSURFACEDESC lpddsd, LPVOID lpContext)
static HRESULT WINAPI enummodescallback_count(DDSURFACEDESC *lpddsd, void *lpContext)
{
ok(lpddsd->dwFlags == (DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT|DDSD_PITCH|DDSD_REFRESHRATE),
"Wrong surface description flags %02X\n", lpddsd->dwFlags);

View File

@ -1341,7 +1341,7 @@ out:
ptr = ((D3DTRIANGLE*)(ptr))+1;\
} while (0)
static HRESULT CALLBACK TextureFormatEnumCallback(LPDDSURFACEDESC lpDDSD, LPVOID lpContext)
static HRESULT CALLBACK TextureFormatEnumCallback(DDSURFACEDESC *lpDDSD, void *lpContext)
{
if (lpDDSD->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
*(BOOL*)lpContext = TRUE;

View File

@ -72,7 +72,7 @@ typedef LONG D3DFIXED;
#define D3DENUMRET_OK DDENUMRET_OK
typedef HRESULT (CALLBACK *LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
typedef HRESULT (CALLBACK *LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
typedef HRESULT (CALLBACK *LPD3DENUMTEXTUREFORMATSCALLBACK)(DDSURFACEDESC *surface_desc, void *ctx);
typedef HRESULT (CALLBACK *LPD3DENUMPIXELFORMATSCALLBACK)(DDPIXELFORMAT *format, void *ctx);
#ifndef DX_SHARED_DEFINES

View File

@ -1058,7 +1058,7 @@ typedef BOOL (CALLBACK *LPDDENUMCALLBACKA)(GUID *, LPSTR, LPSTR, LPVOID);
typedef BOOL (CALLBACK *LPDDENUMCALLBACKW)(GUID *, LPWSTR, LPWSTR, LPVOID);
DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACK)
typedef HRESULT (CALLBACK *LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
typedef HRESULT (CALLBACK *LPDDENUMMODESCALLBACK)(DDSURFACEDESC *desc, void *ctx);
typedef HRESULT (CALLBACK *LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
typedef HRESULT (CALLBACK *LPDDENUMSURFACESCALLBACK)(struct IDirectDrawSurface *surface,
DDSURFACEDESC *surface_desc, void *ctx);
@ -1329,11 +1329,13 @@ DECLARE_INTERFACE_(IDirectDraw,IUnknown)
struct IDirectDrawSurface **surface, IUnknown *outer) PURE;
STDMETHOD(DuplicateSurface)(THIS_ struct IDirectDrawSurface *src_surface,
struct IDirectDrawSurface **dst_surface) PURE;
STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
STDMETHOD(EnumDisplayModes)(THIS_ DWORD flags, DDSURFACEDESC *surface_desc,
void *ctx, LPDDENUMMODESCALLBACK cb) PURE;
STDMETHOD(EnumSurfaces)(THIS_ DWORD flags, DDSURFACEDESC *surface_desc,
void *ctx, LPDDENUMSURFACESCALLBACK cb) PURE;
STDMETHOD(FlipToGDISurface)(THIS) PURE;
STDMETHOD(GetCaps)(THIS_ DDCAPS *driver_caps, DDCAPS *hel_caps) PURE;
STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
STDMETHOD(GetDisplayMode)(THIS_ DDSURFACEDESC *surface_desc) PURE;
STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
STDMETHOD(GetGDISurface)(THIS_ struct IDirectDrawSurface **surface) PURE;
STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
@ -1439,11 +1441,13 @@ DECLARE_INTERFACE_(IDirectDraw2,IUnknown)
struct IDirectDrawSurface **surface, IUnknown *outer) PURE;
/*1c*/ STDMETHOD(DuplicateSurface)(THIS_ struct IDirectDrawSurface *src_surface,
struct IDirectDrawSurface **dst_surface) PURE;
/*20*/ STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
/*24*/ STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
/*20*/ STDMETHOD(EnumDisplayModes)(THIS_ DWORD flags, DDSURFACEDESC *surface_desc,
void *ctx, LPDDENUMMODESCALLBACK cb) PURE;
/*24*/ STDMETHOD(EnumSurfaces)(THIS_ DWORD flags, DDSURFACEDESC *surface_desc,
void *ctx, LPDDENUMSURFACESCALLBACK cb) PURE;
/*28*/ STDMETHOD(FlipToGDISurface)(THIS) PURE;
/*2c*/ STDMETHOD(GetCaps)(THIS_ DDCAPS *driver_caps, DDCAPS *hel_caps) PURE;
/*30*/ STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
/*30*/ STDMETHOD(GetDisplayMode)(THIS_ DDSURFACEDESC *surface_desc) PURE;
/*34*/ STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
/*38*/ STDMETHOD(GetGDISurface)(THIS_ struct IDirectDrawSurface **surface) PURE;
/*3c*/ STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
@ -1537,11 +1541,13 @@ DECLARE_INTERFACE_(IDirectDraw3,IUnknown)
struct IDirectDrawSurface **surface, IUnknown *outer) PURE;
/*1c*/ STDMETHOD(DuplicateSurface)(THIS_ struct IDirectDrawSurface *src_surface,
struct IDirectDrawSurface **dst_surface) PURE;
/*20*/ STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
/*24*/ STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
/*20*/ STDMETHOD(EnumDisplayModes)(THIS_ DWORD flags, DDSURFACEDESC *surface_desc,
void *ctx, LPDDENUMMODESCALLBACK cb) PURE;
/*24*/ STDMETHOD(EnumSurfaces)(THIS_ DWORD flags, DDSURFACEDESC *surface_desc,
void *ctx, LPDDENUMSURFACESCALLBACK cb) PURE;
/*28*/ STDMETHOD(FlipToGDISurface)(THIS) PURE;
/*2c*/ STDMETHOD(GetCaps)(THIS_ DDCAPS *driver_caps, DDCAPS *hel_caps) PURE;
/*30*/ STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
/*30*/ STDMETHOD(GetDisplayMode)(THIS_ DDSURFACEDESC *surface_desc) PURE;
/*34*/ STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
/*38*/ STDMETHOD(GetGDISurface)(THIS_ struct IDirectDrawSurface **surface) PURE;
/*3c*/ STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
@ -1892,10 +1898,10 @@ DECLARE_INTERFACE_(IDirectDrawSurface,IUnknown)
/*4c*/ STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
/*50*/ STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
/*54*/ STDMETHOD(GetPixelFormat)(THIS_ DDPIXELFORMAT *format) PURE;
/*58*/ STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
/*58*/ STDMETHOD(GetSurfaceDesc)(THIS_ DDSURFACEDESC *surface_desc) 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;
/*64*/ STDMETHOD(Lock)(THIS_ RECT *rect, DDSURFACEDESC *surface_desc, DWORD flags, HANDLE event) PURE;
/*68*/ STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
/*6c*/ STDMETHOD(Restore)(THIS) PURE;
/*70*/ STDMETHOD(SetClipper)(THIS_ IDirectDrawClipper *clipper) PURE;
@ -2026,10 +2032,10 @@ DECLARE_INTERFACE_(IDirectDrawSurface2,IUnknown)
STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
STDMETHOD(GetPixelFormat)(THIS_ DDPIXELFORMAT *format) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ DDSURFACEDESC *surface_desc) 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(Lock)(THIS_ RECT *rect, DDSURFACEDESC *surface_desc, DWORD flags, HANDLE event) PURE;
STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
STDMETHOD(Restore)(THIS) PURE;
STDMETHOD(SetClipper)(THIS_ IDirectDrawClipper *clipper) PURE;
@ -2172,10 +2178,10 @@ DECLARE_INTERFACE_(IDirectDrawSurface3,IUnknown)
STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
STDMETHOD(GetPalette)(THIS_ IDirectDrawPalette **palette) PURE;
STDMETHOD(GetPixelFormat)(THIS_ DDPIXELFORMAT *format) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ DDSURFACEDESC *surface_desc) 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(Lock)(THIS_ RECT *rect, DDSURFACEDESC *surface_desc, DWORD flags, HANDLE event) PURE;
STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
STDMETHOD(Restore)(THIS) PURE;
STDMETHOD(SetClipper)(THIS_ IDirectDrawClipper *clipper) PURE;
@ -2192,7 +2198,7 @@ DECLARE_INTERFACE_(IDirectDrawSurface3,IUnknown)
STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
/* added in v3 */
STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE;
STDMETHOD(SetSurfaceDesc)(THIS_ DDSURFACEDESC *surface_desc, DWORD flags) PURE;
};
#undef INTERFACE

View File

@ -505,7 +505,7 @@ typedef struct _DDHAL_SETMODEDATA {
typedef struct _DDHAL_CREATESURFACEDATA {
LPDDRAWI_DIRECTDRAW_GBL lpDD;
LPDDSURFACEDESC lpDDSurfaceDesc;
DDSURFACEDESC *lpDDSurfaceDesc;
LPDDRAWI_DDRAWSURFACE_LCL * lplpSList;
DWORD dwSCnt;
HRESULT ddRVal;
@ -514,7 +514,7 @@ typedef struct _DDHAL_CREATESURFACEDATA {
typedef struct _DDHAL_CANCREATESURFACEDATA {
LPDDRAWI_DIRECTDRAW_GBL lpDD;
LPDDSURFACEDESC lpDDSurfaceDesc;
DDSURFACEDESC *lpDDSurfaceDesc;
DWORD bIsDifferentPixelFormat;
HRESULT ddRVal;
LPDDHAL_CANCREATESURFACE CanCreateSurface;