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