Commit a8616b7f authored by Ričardas Barkauskas's avatar Ričardas Barkauskas Committed by Alexandre Julliard

ddraw: Use unsafe_impl_from_IDirectDrawPalette for application provided interfaces.

parent 07decea8
......@@ -369,6 +369,8 @@ struct IDirectDrawPaletteImpl
IUnknown *ifaceToRelease;
};
IDirectDrawPaletteImpl *unsafe_impl_from_IDirectDrawPalette(IDirectDrawPalette *iface) DECLSPEC_HIDDEN;
HRESULT ddraw_palette_init(IDirectDrawPaletteImpl *palette,
IDirectDrawImpl *ddraw, DWORD flags, PALETTEENTRY *entries) DECLSPEC_HIDDEN;
......
......@@ -258,6 +258,13 @@ static const struct IDirectDrawPaletteVtbl ddraw_palette_vtbl =
IDirectDrawPaletteImpl_SetEntries
};
IDirectDrawPaletteImpl *unsafe_impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
{
if (!iface) return NULL;
assert(iface->lpVtbl == &ddraw_palette_vtbl);
return CONTAINING_RECORD(iface, IDirectDrawPaletteImpl, lpVtbl);
}
HRESULT ddraw_palette_init(IDirectDrawPaletteImpl *palette,
IDirectDrawImpl *ddraw, DWORD flags, PALETTEENTRY *entries)
{
......
......@@ -4288,7 +4288,7 @@ static HRESULT WINAPI ddraw_surface7_SetPalette(IDirectDrawSurface7 *iface, IDir
IDirectDrawSurfaceImpl *This = impl_from_IDirectDrawSurface7(iface);
IDirectDrawPalette *oldPal;
IDirectDrawSurfaceImpl *surf;
IDirectDrawPaletteImpl *PalImpl = (IDirectDrawPaletteImpl *)Pal;
IDirectDrawPaletteImpl *PalImpl = unsafe_impl_from_IDirectDrawPalette(Pal);
HRESULT hr;
TRACE("iface %p, palette %p.\n", iface, Pal);
......
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