Commit 8d959c99 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msdmo: Use an iface instead of a vtbl pointer in IEnumDMOImpl.

parent 41dce7cf
......@@ -85,7 +85,7 @@ static const WCHAR szToGuidFmt[] =
typedef struct
{
const IEnumDMOVtbl *lpVtbl;
IEnumDMO IEnumDMO_iface;
LONG ref;
DWORD index;
const GUID* guidCategory;
......@@ -97,6 +97,11 @@ typedef struct
HKEY hkey;
} IEnumDMOImpl;
static inline IEnumDMOImpl *impl_from_IEnumDMO(IEnumDMO *iface)
{
return CONTAINING_RECORD(iface, IEnumDMOImpl, IEnumDMO_iface);
}
static HRESULT read_types(HKEY root, LPCWSTR key, ULONG *supplied, ULONG requested, DMO_PARTIAL_MEDIATYPE* types);
static const IEnumDMOVtbl edmovt;
......@@ -332,7 +337,7 @@ lend:
*/
static BOOL IEnumDMO_Destructor(IEnumDMO* iface)
{
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
TRACE("%p\n", This);
......@@ -366,7 +371,7 @@ static IEnumDMO * IEnumDMO_Constructor(
if (lpedmo)
{
lpedmo->ref = 1;
lpedmo->lpVtbl = &edmovt;
lpedmo->IEnumDMO_iface.lpVtbl = &edmovt;
lpedmo->index = -1;
lpedmo->guidCategory = guidCategory;
lpedmo->dwFlags = dwFlags;
......@@ -430,7 +435,7 @@ lerr:
*/
static ULONG WINAPI IEnumDMO_fnAddRef(IEnumDMO * iface)
{
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
return InterlockedIncrement(&This->ref);
}
......@@ -443,7 +448,7 @@ static HRESULT WINAPI IEnumDMO_fnQueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
*ppvObj = NULL;
......@@ -467,7 +472,7 @@ static HRESULT WINAPI IEnumDMO_fnQueryInterface(
*/
static ULONG WINAPI IEnumDMO_fnRelease(IEnumDMO * iface)
{
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
ULONG refCount = InterlockedDecrement(&This->ref);
if (!refCount)
......@@ -499,7 +504,7 @@ static HRESULT WINAPI IEnumDMO_fnNext(
UINT count = 0;
HRESULT hres = S_OK;
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
TRACE("--> (%p) %d %p %p %p\n", iface, cItemsToFetch, pCLSID, Names, pcItemsFetched);
......@@ -638,7 +643,7 @@ static HRESULT WINAPI IEnumDMO_fnNext(
*/
static HRESULT WINAPI IEnumDMO_fnSkip(IEnumDMO * iface, DWORD cItemsToSkip)
{
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
This->index += cItemsToSkip;
......@@ -651,7 +656,7 @@ static HRESULT WINAPI IEnumDMO_fnSkip(IEnumDMO * iface, DWORD cItemsToSkip)
*/
static HRESULT WINAPI IEnumDMO_fnReset(IEnumDMO * iface)
{
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
This->index = -1;
......@@ -664,7 +669,7 @@ static HRESULT WINAPI IEnumDMO_fnReset(IEnumDMO * iface)
*/
static HRESULT WINAPI IEnumDMO_fnClone(IEnumDMO * iface, IEnumDMO **ppEnum)
{
IEnumDMOImpl *This = (IEnumDMOImpl *)iface;
IEnumDMOImpl *This = impl_from_IEnumDMO(iface);
FIXME("(%p)->() to (%p)->() E_NOTIMPL\n", This, ppEnum);
......
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