Commit 425dd093 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

hlink: Use an iface instead of a vtbl pointer in HlinkBCImpl.

parent 5ca32152
...@@ -28,12 +28,17 @@ static const IHlinkBrowseContextVtbl hlvt; ...@@ -28,12 +28,17 @@ static const IHlinkBrowseContextVtbl hlvt;
typedef struct typedef struct
{ {
const IHlinkBrowseContextVtbl *lpVtbl; IHlinkBrowseContext IHlinkBrowseContext_iface;
LONG ref; LONG ref;
HLBWINFO* BrowseWindowInfo; HLBWINFO* BrowseWindowInfo;
IHlink* CurrentPage; IHlink* CurrentPage;
} HlinkBCImpl; } HlinkBCImpl;
static inline HlinkBCImpl *impl_from_IHlinkBrowseContext(IHlinkBrowseContext *iface)
{
return CONTAINING_RECORD(iface, HlinkBCImpl, IHlinkBrowseContext_iface);
}
HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid, HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid,
LPVOID *ppv) LPVOID *ppv)
...@@ -51,7 +56,7 @@ HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid, ...@@ -51,7 +56,7 @@ HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid,
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
hl->ref = 1; hl->ref = 1;
hl->lpVtbl = &hlvt; hl->IHlinkBrowseContext_iface.lpVtbl = &hlvt;
*ppv = hl; *ppv = hl;
return S_OK; return S_OK;
...@@ -60,7 +65,7 @@ HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid, ...@@ -60,7 +65,7 @@ HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid,
static HRESULT WINAPI IHlinkBC_fnQueryInterface( IHlinkBrowseContext *iface, static HRESULT WINAPI IHlinkBC_fnQueryInterface( IHlinkBrowseContext *iface,
REFIID riid, LPVOID* ppvObj) REFIID riid, LPVOID* ppvObj)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE ("(%p)->(%s,%p)\n", This, debugstr_guid (riid), ppvObj); TRACE ("(%p)->(%s,%p)\n", This, debugstr_guid (riid), ppvObj);
if (IsEqualIID(riid, &IID_IUnknown) || if (IsEqualIID(riid, &IID_IUnknown) ||
...@@ -77,7 +82,7 @@ static HRESULT WINAPI IHlinkBC_fnQueryInterface( IHlinkBrowseContext *iface, ...@@ -77,7 +82,7 @@ static HRESULT WINAPI IHlinkBC_fnQueryInterface( IHlinkBrowseContext *iface,
static ULONG WINAPI IHlinkBC_fnAddRef (IHlinkBrowseContext* iface) static ULONG WINAPI IHlinkBC_fnAddRef (IHlinkBrowseContext* iface)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
ULONG refCount = InterlockedIncrement(&This->ref); ULONG refCount = InterlockedIncrement(&This->ref);
TRACE("(%p)->(count=%u)\n", This, refCount - 1); TRACE("(%p)->(count=%u)\n", This, refCount - 1);
...@@ -87,7 +92,7 @@ static ULONG WINAPI IHlinkBC_fnAddRef (IHlinkBrowseContext* iface) ...@@ -87,7 +92,7 @@ static ULONG WINAPI IHlinkBC_fnAddRef (IHlinkBrowseContext* iface)
static ULONG WINAPI IHlinkBC_fnRelease (IHlinkBrowseContext* iface) static ULONG WINAPI IHlinkBC_fnRelease (IHlinkBrowseContext* iface)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
ULONG refCount = InterlockedDecrement(&This->ref); ULONG refCount = InterlockedDecrement(&This->ref);
TRACE("(%p)->(count=%u)\n", This, refCount + 1); TRACE("(%p)->(count=%u)\n", This, refCount + 1);
...@@ -106,7 +111,7 @@ static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface, ...@@ -106,7 +111,7 @@ static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister) DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister)
{ {
static const WCHAR szIdent[] = {'W','I','N','E','H','L','I','N','K',0}; static const WCHAR szIdent[] = {'W','I','N','E','H','L','I','N','K',0};
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
IMoniker *mon; IMoniker *mon;
IMoniker *composite; IMoniker *composite;
IRunningObjectTable *ROT; IRunningObjectTable *ROT;
...@@ -138,7 +143,7 @@ static HRESULT WINAPI IHlinkBC_Revoke(IHlinkBrowseContext* iface, ...@@ -138,7 +143,7 @@ static HRESULT WINAPI IHlinkBC_Revoke(IHlinkBrowseContext* iface,
{ {
HRESULT r = S_OK; HRESULT r = S_OK;
IRunningObjectTable *ROT; IRunningObjectTable *ROT;
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
FIXME("(%p)->(%i)\n", This, dwRegister); FIXME("(%p)->(%i)\n", This, dwRegister);
...@@ -152,7 +157,7 @@ static HRESULT WINAPI IHlinkBC_Revoke(IHlinkBrowseContext* iface, ...@@ -152,7 +157,7 @@ static HRESULT WINAPI IHlinkBC_Revoke(IHlinkBrowseContext* iface,
static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface, static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface,
HLBWINFO *phlbwi) HLBWINFO *phlbwi)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE("(%p)->(%p)\n", This, phlbwi); TRACE("(%p)->(%p)\n", This, phlbwi);
if(!phlbwi) if(!phlbwi)
...@@ -168,7 +173,7 @@ static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface, ...@@ -168,7 +173,7 @@ static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface,
static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface, static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface,
HLBWINFO *phlbwi) HLBWINFO *phlbwi)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE("(%p)->(%p)\n", This, phlbwi); TRACE("(%p)->(%p)\n", This, phlbwi);
if(!phlbwi) if(!phlbwi)
...@@ -185,7 +190,7 @@ static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface, ...@@ -185,7 +190,7 @@ static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface,
static HRESULT WINAPI IHlinkBC_SetInitialHlink(IHlinkBrowseContext* iface, static HRESULT WINAPI IHlinkBC_SetInitialHlink(IHlinkBrowseContext* iface,
IMoniker *pimkTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName) IMoniker *pimkTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
FIXME("(%p)->(%p %s %s)\n", This, pimkTarget, FIXME("(%p)->(%p %s %s)\n", This, pimkTarget,
debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName)); debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName));
...@@ -203,7 +208,7 @@ static HRESULT WINAPI IHlinkBC_OnNavigateHlink(IHlinkBrowseContext *iface, ...@@ -203,7 +208,7 @@ static HRESULT WINAPI IHlinkBC_OnNavigateHlink(IHlinkBrowseContext *iface,
DWORD grfHLNF, IMoniker* pmkTarget, LPCWSTR pwzLocation, LPCWSTR DWORD grfHLNF, IMoniker* pmkTarget, LPCWSTR pwzLocation, LPCWSTR
pwzFriendlyName, ULONG *puHLID) pwzFriendlyName, ULONG *puHLID)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
FIXME("(%p)->(%i %p %s %s %p)\n", This, grfHLNF, pmkTarget, FIXME("(%p)->(%i %p %s %s %p)\n", This, grfHLNF, pmkTarget,
debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), puHLID); debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), puHLID);
...@@ -236,7 +241,7 @@ static HRESULT WINAPI IHlinkBC_QueryHlink( IHlinkBrowseContext* iface, ...@@ -236,7 +241,7 @@ static HRESULT WINAPI IHlinkBC_QueryHlink( IHlinkBrowseContext* iface,
static HRESULT WINAPI IHlinkBC_GetHlink( IHlinkBrowseContext* iface, static HRESULT WINAPI IHlinkBC_GetHlink( IHlinkBrowseContext* iface,
ULONG uHLID, IHlink** ppihl) ULONG uHLID, IHlink** ppihl)
{ {
HlinkBCImpl *This = (HlinkBCImpl*)iface; HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE("(%p)->(%x %p)\n", This, uHLID, ppihl); TRACE("(%p)->(%x %p)\n", This, uHLID, ppihl);
......
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