Commit 40213ae2 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

browseui: Use an iface instead of a vtbl pointer in ACLShellSource.

parent 9a0f38e2
...@@ -43,11 +43,16 @@ ...@@ -43,11 +43,16 @@
WINE_DEFAULT_DEBUG_CHANNEL(browseui); WINE_DEFAULT_DEBUG_CHANNEL(browseui);
typedef struct tagACLMulti { typedef struct tagACLMulti {
const IACList2Vtbl *acl2Vtbl; IACList2 IACList2_iface;
LONG refCount; LONG refCount;
DWORD dwOptions; DWORD dwOptions;
} ACLShellSource; } ACLShellSource;
static inline ACLShellSource *impl_from_IACList2(IACList2 *iface)
{
return CONTAINING_RECORD(iface, ACLShellSource, IACList2_iface);
}
static void ACLShellSource_Destructor(ACLShellSource *This) static void ACLShellSource_Destructor(ACLShellSource *This)
{ {
TRACE("destroying %p\n", This); TRACE("destroying %p\n", This);
...@@ -56,7 +61,7 @@ static void ACLShellSource_Destructor(ACLShellSource *This) ...@@ -56,7 +61,7 @@ static void ACLShellSource_Destructor(ACLShellSource *This)
static HRESULT WINAPI ACLShellSource_QueryInterface(IACList2 *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI ACLShellSource_QueryInterface(IACList2 *iface, REFIID iid, LPVOID *ppvOut)
{ {
ACLShellSource *This = (ACLShellSource *)iface; ACLShellSource *This = impl_from_IACList2(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IACList2) || if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IACList2) ||
...@@ -77,13 +82,13 @@ static HRESULT WINAPI ACLShellSource_QueryInterface(IACList2 *iface, REFIID iid, ...@@ -77,13 +82,13 @@ static HRESULT WINAPI ACLShellSource_QueryInterface(IACList2 *iface, REFIID iid,
static ULONG WINAPI ACLShellSource_AddRef(IACList2 *iface) static ULONG WINAPI ACLShellSource_AddRef(IACList2 *iface)
{ {
ACLShellSource *This = (ACLShellSource *)iface; ACLShellSource *This = impl_from_IACList2(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI ACLShellSource_Release(IACList2 *iface) static ULONG WINAPI ACLShellSource_Release(IACList2 *iface)
{ {
ACLShellSource *This = (ACLShellSource *)iface; ACLShellSource *This = impl_from_IACList2(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
...@@ -94,7 +99,7 @@ static ULONG WINAPI ACLShellSource_Release(IACList2 *iface) ...@@ -94,7 +99,7 @@ static ULONG WINAPI ACLShellSource_Release(IACList2 *iface)
static HRESULT WINAPI ACLShellSource_Expand(IACList2 *iface, LPCWSTR wstr) static HRESULT WINAPI ACLShellSource_Expand(IACList2 *iface, LPCWSTR wstr)
{ {
ACLShellSource *This = (ACLShellSource *)iface; ACLShellSource *This = impl_from_IACList2(iface);
FIXME("STUB:(%p) %s\n",This,debugstr_w(wstr)); FIXME("STUB:(%p) %s\n",This,debugstr_w(wstr));
return E_NOTIMPL; return E_NOTIMPL;
} }
...@@ -103,7 +108,7 @@ static HRESULT WINAPI ACLShellSource_Expand(IACList2 *iface, LPCWSTR wstr) ...@@ -103,7 +108,7 @@ static HRESULT WINAPI ACLShellSource_Expand(IACList2 *iface, LPCWSTR wstr)
static HRESULT WINAPI ACLShellSource_GetOptions(IACList2 *iface, static HRESULT WINAPI ACLShellSource_GetOptions(IACList2 *iface,
DWORD *pdwFlag) DWORD *pdwFlag)
{ {
ACLShellSource *This = (ACLShellSource *)iface; ACLShellSource *This = impl_from_IACList2(iface);
*pdwFlag = This->dwOptions; *pdwFlag = This->dwOptions;
return S_OK; return S_OK;
} }
...@@ -111,7 +116,7 @@ static HRESULT WINAPI ACLShellSource_GetOptions(IACList2 *iface, ...@@ -111,7 +116,7 @@ static HRESULT WINAPI ACLShellSource_GetOptions(IACList2 *iface,
static HRESULT WINAPI ACLShellSource_SetOptions(IACList2 *iface, static HRESULT WINAPI ACLShellSource_SetOptions(IACList2 *iface,
DWORD dwFlag) DWORD dwFlag)
{ {
ACLShellSource *This = (ACLShellSource *)iface; ACLShellSource *This = impl_from_IACList2(iface);
This->dwOptions = dwFlag; This->dwOptions = dwFlag;
return S_OK; return S_OK;
} }
...@@ -138,7 +143,7 @@ HRESULT ACLShellSource_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) ...@@ -138,7 +143,7 @@ HRESULT ACLShellSource_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->acl2Vtbl = &ACLMulti_ACList2Vtbl; This->IACList2_iface.lpVtbl = &ACLMulti_ACList2Vtbl;
This->refCount = 1; This->refCount = 1;
TRACE("returning %p\n", This); TRACE("returning %p\n", This);
......
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