typedef struct
{
- const IHlinkBrowseContextVtbl *lpVtbl;
+ IHlinkBrowseContext IHlinkBrowseContext_iface;
LONG ref;
HLBWINFO* BrowseWindowInfo;
IHlink* CurrentPage;
} HlinkBCImpl;
+static inline HlinkBCImpl *impl_from_IHlinkBrowseContext(IHlinkBrowseContext *iface)
+{
+ return CONTAINING_RECORD(iface, HlinkBCImpl, IHlinkBrowseContext_iface);
+}
+
HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid,
LPVOID *ppv)
return E_OUTOFMEMORY;
hl->ref = 1;
- hl->lpVtbl = &hlvt;
+ hl->IHlinkBrowseContext_iface.lpVtbl = &hlvt;
*ppv = hl;
return S_OK;
static HRESULT WINAPI IHlinkBC_fnQueryInterface( IHlinkBrowseContext *iface,
REFIID riid, LPVOID* ppvObj)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE ("(%p)->(%s,%p)\n", This, debugstr_guid (riid), ppvObj);
if (IsEqualIID(riid, &IID_IUnknown) ||
static ULONG WINAPI IHlinkBC_fnAddRef (IHlinkBrowseContext* iface)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
ULONG refCount = InterlockedIncrement(&This->ref);
TRACE("(%p)->(count=%u)\n", This, refCount - 1);
static ULONG WINAPI IHlinkBC_fnRelease (IHlinkBrowseContext* iface)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
ULONG refCount = InterlockedDecrement(&This->ref);
TRACE("(%p)->(count=%u)\n", This, refCount + 1);
DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister)
{
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 *composite;
IRunningObjectTable *ROT;
{
HRESULT r = S_OK;
IRunningObjectTable *ROT;
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
FIXME("(%p)->(%i)\n", This, dwRegister);
static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface,
HLBWINFO *phlbwi)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE("(%p)->(%p)\n", This, phlbwi);
if(!phlbwi)
static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface,
HLBWINFO *phlbwi)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE("(%p)->(%p)\n", This, phlbwi);
if(!phlbwi)
static HRESULT WINAPI IHlinkBC_SetInitialHlink(IHlinkBrowseContext* iface,
IMoniker *pimkTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
FIXME("(%p)->(%p %s %s)\n", This, pimkTarget,
debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName));
DWORD grfHLNF, IMoniker* pmkTarget, LPCWSTR pwzLocation, LPCWSTR
pwzFriendlyName, ULONG *puHLID)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
FIXME("(%p)->(%i %p %s %s %p)\n", This, grfHLNF, pmkTarget,
debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), puHLID);
static HRESULT WINAPI IHlinkBC_GetHlink( IHlinkBrowseContext* iface,
ULONG uHLID, IHlink** ppihl)
{
- HlinkBCImpl *This = (HlinkBCImpl*)iface;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
TRACE("(%p)->(%x %p)\n", This, uHLID, ppihl);