- do not pass private data to the application but a copy of it
- add some more traces
This commit is contained in:
parent
fd1d4b7c2b
commit
dfd1153f1d
|
@ -874,18 +874,23 @@ Main_DirectDraw_EnumExistingSurfaces(IDirectDrawImpl *This, DWORD dwFlags,
|
|||
|| (nomatch != Main_DirectDraw_DDSD_Match(lpDDSD2,
|
||||
&surf->surface_desc)))
|
||||
{
|
||||
LPDIRECTDRAWSURFACE7 surface = ICOM_INTERFACE(surf,
|
||||
IDirectDrawSurface7);
|
||||
LPDIRECTDRAWSURFACE7 isurf = ICOM_INTERFACE(surf, IDirectDrawSurface7);
|
||||
DDSURFACEDESC2 desc;
|
||||
|
||||
/* BOGUS! Violates COM rules, but MSDN says so. */
|
||||
IDirectDrawSurface7_AddRef(surface);
|
||||
if (TRACE_ON(ddraw)) {
|
||||
TRACE(" => enumerating surface %p (priv. %p) with description:\n", isurf, surf);
|
||||
DDRAW_dump_surface_desc(&surf->surface_desc);
|
||||
}
|
||||
|
||||
if (callback(surface, &surf->surface_desc, context)
|
||||
== DDENUMRET_CANCEL)
|
||||
IDirectDrawSurface7_AddRef(isurf);
|
||||
|
||||
desc = surf->surface_desc;
|
||||
if (callback(isurf, &desc, context) == DDENUMRET_CANCEL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE(" end of enumeration.\n");
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
@ -921,7 +926,10 @@ Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7 iface, DWORD dwFlags,
|
|||
IDirectDrawImpl *This = (IDirectDrawImpl *)iface;
|
||||
TRACE("(%p)->(0x%lx, %p, %p, %p)\n", iface, dwFlags, lpDDSD2, context,
|
||||
callback);
|
||||
|
||||
if (TRACE_ON(ddraw)) {
|
||||
TRACE(" flags: "); DDRAW_dump_DDENUMSURFACES(dwFlags);
|
||||
}
|
||||
|
||||
if (callback == NULL)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
|
|
|
@ -415,6 +415,7 @@ extern void DDRAW_dump_cooperativelevel(DWORD cooplevel);
|
|||
extern void DDRAW_dump_lockflag(DWORD lockflag);
|
||||
extern void DDRAW_dump_DDCOLORKEY(const DDCOLORKEY *in);
|
||||
extern void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps);
|
||||
extern void DDRAW_dump_DDENUMSURFACES(DWORD flagmask);
|
||||
extern void DDRAW_dump_surface_to_disk(IDirectDrawSurfaceImpl *surface, FILE *f, int scale) ;
|
||||
|
||||
/* Used for generic dumping */
|
||||
|
|
|
@ -838,6 +838,19 @@ void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) {
|
|||
DPRINTF(" - ddsCaps : "); DDRAW_dump_DDSCAPS2(&lpcaps->ddsCaps); DPRINTF("\n");
|
||||
}
|
||||
|
||||
void DDRAW_dump_DDENUMSURFACES(DWORD flagmask)
|
||||
{
|
||||
static const flag_info flags[] =
|
||||
{
|
||||
FE(DDENUMSURFACES_ALL),
|
||||
FE(DDENUMSURFACES_MATCH),
|
||||
FE(DDENUMSURFACES_NOMATCH),
|
||||
FE(DDENUMSURFACES_CANBECREATED),
|
||||
FE(DDENUMSURFACES_DOESEXIST)
|
||||
};
|
||||
DDRAW_dump_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0]));
|
||||
}
|
||||
|
||||
/* Debug function that can be helpful to debug various surface-related problems */
|
||||
static int get_shift(DWORD color_mask) {
|
||||
int shift = 0;
|
||||
|
|
Loading…
Reference in New Issue