Commit be5bb185 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

ole32: Use an iface instead of a vtbl pointer in EnumOLEVERB.

parent b194b778
...@@ -812,13 +812,18 @@ static HRESULT EnumOLEVERB_Construct(HKEY hkeyVerb, ULONG index, IEnumOLEVERB ** ...@@ -812,13 +812,18 @@ static HRESULT EnumOLEVERB_Construct(HKEY hkeyVerb, ULONG index, IEnumOLEVERB **
typedef struct typedef struct
{ {
const IEnumOLEVERBVtbl *lpvtbl; IEnumOLEVERB IEnumOLEVERB_iface;
LONG ref; LONG ref;
HKEY hkeyVerb; HKEY hkeyVerb;
ULONG index; ULONG index;
} EnumOLEVERB; } EnumOLEVERB;
static inline EnumOLEVERB *impl_from_IEnumOLEVERB(IEnumOLEVERB *iface)
{
return CONTAINING_RECORD(iface, EnumOLEVERB, IEnumOLEVERB_iface);
}
static HRESULT WINAPI EnumOLEVERB_QueryInterface( static HRESULT WINAPI EnumOLEVERB_QueryInterface(
IEnumOLEVERB *iface, REFIID riid, void **ppv) IEnumOLEVERB *iface, REFIID riid, void **ppv)
{ {
...@@ -836,7 +841,7 @@ static HRESULT WINAPI EnumOLEVERB_QueryInterface( ...@@ -836,7 +841,7 @@ static HRESULT WINAPI EnumOLEVERB_QueryInterface(
static ULONG WINAPI EnumOLEVERB_AddRef( static ULONG WINAPI EnumOLEVERB_AddRef(
IEnumOLEVERB *iface) IEnumOLEVERB *iface)
{ {
EnumOLEVERB *This = (EnumOLEVERB *)iface; EnumOLEVERB *This = impl_from_IEnumOLEVERB(iface);
TRACE("()\n"); TRACE("()\n");
return InterlockedIncrement(&This->ref); return InterlockedIncrement(&This->ref);
} }
...@@ -844,7 +849,7 @@ static ULONG WINAPI EnumOLEVERB_AddRef( ...@@ -844,7 +849,7 @@ static ULONG WINAPI EnumOLEVERB_AddRef(
static ULONG WINAPI EnumOLEVERB_Release( static ULONG WINAPI EnumOLEVERB_Release(
IEnumOLEVERB *iface) IEnumOLEVERB *iface)
{ {
EnumOLEVERB *This = (EnumOLEVERB *)iface; EnumOLEVERB *This = impl_from_IEnumOLEVERB(iface);
LONG refs = InterlockedDecrement(&This->ref); LONG refs = InterlockedDecrement(&This->ref);
TRACE("()\n"); TRACE("()\n");
if (!refs) if (!refs)
...@@ -859,7 +864,7 @@ static HRESULT WINAPI EnumOLEVERB_Next( ...@@ -859,7 +864,7 @@ static HRESULT WINAPI EnumOLEVERB_Next(
IEnumOLEVERB *iface, ULONG celt, LPOLEVERB rgelt, IEnumOLEVERB *iface, ULONG celt, LPOLEVERB rgelt,
ULONG *pceltFetched) ULONG *pceltFetched)
{ {
EnumOLEVERB *This = (EnumOLEVERB *)iface; EnumOLEVERB *This = impl_from_IEnumOLEVERB(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched); TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
...@@ -946,7 +951,7 @@ static HRESULT WINAPI EnumOLEVERB_Next( ...@@ -946,7 +951,7 @@ static HRESULT WINAPI EnumOLEVERB_Next(
static HRESULT WINAPI EnumOLEVERB_Skip( static HRESULT WINAPI EnumOLEVERB_Skip(
IEnumOLEVERB *iface, ULONG celt) IEnumOLEVERB *iface, ULONG celt)
{ {
EnumOLEVERB *This = (EnumOLEVERB *)iface; EnumOLEVERB *This = impl_from_IEnumOLEVERB(iface);
TRACE("(%d)\n", celt); TRACE("(%d)\n", celt);
...@@ -957,7 +962,7 @@ static HRESULT WINAPI EnumOLEVERB_Skip( ...@@ -957,7 +962,7 @@ static HRESULT WINAPI EnumOLEVERB_Skip(
static HRESULT WINAPI EnumOLEVERB_Reset( static HRESULT WINAPI EnumOLEVERB_Reset(
IEnumOLEVERB *iface) IEnumOLEVERB *iface)
{ {
EnumOLEVERB *This = (EnumOLEVERB *)iface; EnumOLEVERB *This = impl_from_IEnumOLEVERB(iface);
TRACE("()\n"); TRACE("()\n");
...@@ -969,7 +974,7 @@ static HRESULT WINAPI EnumOLEVERB_Clone( ...@@ -969,7 +974,7 @@ static HRESULT WINAPI EnumOLEVERB_Clone(
IEnumOLEVERB *iface, IEnumOLEVERB *iface,
IEnumOLEVERB **ppenum) IEnumOLEVERB **ppenum)
{ {
EnumOLEVERB *This = (EnumOLEVERB *)iface; EnumOLEVERB *This = impl_from_IEnumOLEVERB(iface);
HKEY hkeyVerb; HKEY hkeyVerb;
TRACE("(%p)\n", ppenum); TRACE("(%p)\n", ppenum);
if (!DuplicateHandle(GetCurrentProcess(), This->hkeyVerb, GetCurrentProcess(), (HANDLE *)&hkeyVerb, 0, FALSE, DUPLICATE_SAME_ACCESS)) if (!DuplicateHandle(GetCurrentProcess(), This->hkeyVerb, GetCurrentProcess(), (HANDLE *)&hkeyVerb, 0, FALSE, DUPLICATE_SAME_ACCESS))
...@@ -996,12 +1001,12 @@ static HRESULT EnumOLEVERB_Construct(HKEY hkeyVerb, ULONG index, IEnumOLEVERB ** ...@@ -996,12 +1001,12 @@ static HRESULT EnumOLEVERB_Construct(HKEY hkeyVerb, ULONG index, IEnumOLEVERB **
RegCloseKey(hkeyVerb); RegCloseKey(hkeyVerb);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
This->lpvtbl = &EnumOLEVERB_VTable; This->IEnumOLEVERB_iface.lpVtbl = &EnumOLEVERB_VTable;
This->ref = 1; This->ref = 1;
This->index = index; This->index = index;
This->hkeyVerb = hkeyVerb; This->hkeyVerb = hkeyVerb;
*ppenum = (IEnumOLEVERB *)&This->lpvtbl; *ppenum = &This->IEnumOLEVERB_iface;
return S_OK; return S_OK;
} }
/*********************************************************************** /***********************************************************************
......
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