ole32: Use proper helpers for iface calls.
This commit is contained in:
parent
5a31c1a881
commit
153b94b3c5
|
@ -629,14 +629,13 @@ HRESULT WINAPI CreateAntiMoniker(IMoniker **ppmk)
|
|||
(void**)ppmk);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI AntiMonikerCF_QueryInterface(LPCLASSFACTORY iface,
|
||||
REFIID riid, LPVOID *ppv)
|
||||
static HRESULT WINAPI AntiMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -816,14 +816,13 @@ HRESULT ClassMoniker_CreateFromDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LP
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClassMonikerCF_QueryInterface(LPCLASSFACTORY iface,
|
||||
REFIID riid, LPVOID *ppv)
|
||||
static HRESULT WINAPI ClassMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -720,7 +720,7 @@ static HRESULT WINAPI COMCAT_IClassFactory_QueryInterface(
|
|||
IsEqualGUID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppvObj = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -732,7 +732,7 @@ DWORD apartment_release(struct apartment *apt)
|
|||
* apartment, which it must do. */
|
||||
assert(list_empty(&apt->stubmgrs));
|
||||
|
||||
if (apt->filter) IUnknown_Release(apt->filter);
|
||||
if (apt->filter) IMessageFilter_Release(apt->filter);
|
||||
|
||||
/* free as many unused libraries as possible... */
|
||||
apartment_freeunusedlibraries(apt, 0);
|
||||
|
@ -1254,7 +1254,7 @@ static void COM_TlsDestroy(void)
|
|||
if (info->apt) apartment_release(info->apt);
|
||||
if (info->errorinfo) IErrorInfo_Release(info->errorinfo);
|
||||
if (info->state) IUnknown_Release(info->state);
|
||||
if (info->spy) IUnknown_Release(info->spy);
|
||||
if (info->spy) IInitializeSpy_Release(info->spy);
|
||||
if (info->context_token) IObjContext_Release(info->context_token);
|
||||
HeapFree(GetProcessHeap(), 0, info);
|
||||
NtCurrentTeb()->ReservedForOle = NULL;
|
||||
|
@ -1313,7 +1313,7 @@ HRESULT WINAPI CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cook
|
|||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
hr = IUnknown_QueryInterface(spy, &IID_IInitializeSpy, (void **) &info->spy);
|
||||
hr = IInitializeSpy_QueryInterface(spy, &IID_IInitializeSpy, (void **) &info->spy);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
cookie->QuadPart = (DWORD_PTR)spy;
|
||||
|
@ -1345,7 +1345,7 @@ HRESULT WINAPI CoRevokeInitializeSpy(ULARGE_INTEGER cookie)
|
|||
if (!info || !info->spy || cookie.QuadPart != (DWORD_PTR)info->spy)
|
||||
return E_INVALIDARG;
|
||||
|
||||
IUnknown_Release(info->spy);
|
||||
IInitializeSpy_Release(info->spy);
|
||||
info->spy = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -1968,14 +1968,13 @@ MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkComm
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI CompositeMonikerCF_QueryInterface(LPCLASSFACTORY iface,
|
||||
REFIID riid, LPVOID *ppv)
|
||||
static HRESULT WINAPI CompositeMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -2151,7 +2151,7 @@ static void WINAPI DataCache_OnDataChange(IAdviseSink *iface, FORMATETC *fmt, ST
|
|||
{
|
||||
DataCache *This = impl_from_IAdviseSink(iface);
|
||||
TRACE("(%p)->(%s, %p)\n", This, debugstr_formatetc(fmt), med);
|
||||
IOleCache_SetData(&This->IOleCache2_iface, fmt, med, FALSE);
|
||||
IOleCache2_SetData(&This->IOleCache2_iface, fmt, med, FALSE);
|
||||
}
|
||||
|
||||
static void WINAPI DataCache_OnViewChange(IAdviseSink *iface, DWORD aspect, LONG index)
|
||||
|
|
|
@ -231,7 +231,7 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
|
|||
}
|
||||
else if (This->inproc_server && This->pOleDelegate)
|
||||
{
|
||||
return IUnknown_QueryInterface(This->pOleDelegate, riid, ppvObject);
|
||||
return IOleObject_QueryInterface(This->pOleDelegate, riid, ppvObject);
|
||||
}
|
||||
|
||||
/* Check that we obtained an interface. */
|
||||
|
|
|
@ -1555,7 +1555,7 @@ static HRESULT WINAPI FileMonikerCF_QueryInterface(LPCLASSFACTORY iface,
|
|||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -358,7 +358,7 @@ static HRESULT WINAPI FTMarshalCF_QueryInterface(LPCLASSFACTORY iface,
|
|||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -457,7 +457,7 @@ HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy)
|
|||
|
||||
EnterCriticalSection(&IMalloc32_SpyCS);
|
||||
|
||||
if (SUCCEEDED(IUnknown_QueryInterface(pMallocSpy, &IID_IMallocSpy, (LPVOID*)&pSpy))) {
|
||||
if (SUCCEEDED(IMallocSpy_QueryInterface(pMallocSpy, &IID_IMallocSpy, (void**)&pSpy))) {
|
||||
Malloc32.pSpy = pSpy;
|
||||
hres = S_OK;
|
||||
}
|
||||
|
|
|
@ -952,14 +952,13 @@ HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, IMoni
|
|||
(void**)ppmk);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ItemMonikerCF_QueryInterface(LPCLASSFACTORY iface,
|
||||
REFIID riid, LPVOID *ppv)
|
||||
static HRESULT WINAPI ItemMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -1175,13 +1175,13 @@ typedef struct _StdMarshalImpl
|
|||
} StdMarshalImpl;
|
||||
|
||||
static HRESULT WINAPI
|
||||
StdMarshalImpl_QueryInterface(LPMARSHAL iface, REFIID riid, LPVOID *ppv)
|
||||
StdMarshalImpl_QueryInterface(IMarshal *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IMarshal, riid))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IMarshal_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
FIXME("No interface for %s.\n", debugstr_guid(riid));
|
||||
|
|
|
@ -192,7 +192,7 @@ static void rot_entry_delete(struct rot_entry *rot_entry)
|
|||
if (hr == S_OK)
|
||||
{
|
||||
CoReleaseMarshalData(stream);
|
||||
IUnknown_Release(stream);
|
||||
IStream_Release(stream);
|
||||
}
|
||||
}
|
||||
MIDL_user_free(moniker);
|
||||
|
@ -205,7 +205,7 @@ static void rot_entry_delete(struct rot_entry *rot_entry)
|
|||
if (hr == S_OK)
|
||||
{
|
||||
CoReleaseMarshalData(stream);
|
||||
IUnknown_Release(stream);
|
||||
IStream_Release(stream);
|
||||
}
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, rot_entry->object);
|
||||
|
|
|
@ -975,7 +975,7 @@ static HRESULT WINAPI EnumOLEVERB_QueryInterface(
|
|||
if (IsEqualIID(riid, &IID_IUnknown) ||
|
||||
IsEqualIID(riid, &IID_IEnumOLEVERB))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
IEnumOLEVERB_AddRef(iface);
|
||||
*ppv = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -1333,10 +1333,7 @@ HRESULT WINAPI OleLoad(
|
|||
/*
|
||||
* Initialize the object with its IPersistStorage interface.
|
||||
*/
|
||||
hres = IOleObject_QueryInterface(pUnk,
|
||||
&IID_IPersistStorage,
|
||||
(void**)&persistStorage);
|
||||
|
||||
hres = IUnknown_QueryInterface(pUnk, &IID_IPersistStorage, (void**)&persistStorage);
|
||||
if (SUCCEEDED(hres))
|
||||
{
|
||||
hres = IPersistStorage_Load(persistStorage, pStg);
|
||||
|
@ -2939,7 +2936,7 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */
|
|||
case VT_STORAGE:
|
||||
case VT_STORED_OBJECT:
|
||||
if (pvar->u.pStream)
|
||||
IUnknown_Release(pvar->u.pStream);
|
||||
IStream_Release(pvar->u.pStream);
|
||||
break;
|
||||
case VT_CLSID:
|
||||
case VT_LPSTR:
|
||||
|
|
|
@ -96,7 +96,7 @@ static HRESULT WINAPI EnumSTATDATA_QueryInterface(IEnumSTATDATA *iface, REFIID r
|
|||
if (IsEqualIID(riid, &IID_IUnknown) ||
|
||||
IsEqualIID(riid, &IID_IEnumSTATDATA))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
IEnumSTATDATA_AddRef(iface);
|
||||
*ppv = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -596,7 +596,7 @@ static HRESULT WINAPI PointerMonikerCF_QueryInterface(LPCLASSFACTORY iface,
|
|||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -459,13 +459,13 @@ void RPC_UnregisterAllChannelHooks(void)
|
|||
|
||||
/* RPC Channel Buffer Functions */
|
||||
|
||||
static HRESULT WINAPI RpcChannelBuffer_QueryInterface(LPRPCCHANNELBUFFER iface, REFIID riid, LPVOID *ppv)
|
||||
static HRESULT WINAPI RpcChannelBuffer_QueryInterface(IRpcChannelBuffer *iface, REFIID riid, LPVOID *ppv)
|
||||
{
|
||||
*ppv = NULL;
|
||||
if (IsEqualIID(riid,&IID_IRpcChannelBuffer) || IsEqualIID(riid,&IID_IUnknown))
|
||||
{
|
||||
*ppv = iface;
|
||||
IUnknown_AddRef(iface);
|
||||
IRpcChannelBuffer_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
|
|
|
@ -119,7 +119,7 @@ static void stub_manager_delete_ifstub(struct stub_manager *m, struct ifstub *if
|
|||
|
||||
RPC_UnregisterInterface(&ifstub->iid);
|
||||
|
||||
if (ifstub->stubbuffer) IUnknown_Release(ifstub->stubbuffer);
|
||||
if (ifstub->stubbuffer) IRpcStubBuffer_Release(ifstub->stubbuffer);
|
||||
IUnknown_Release(ifstub->iface);
|
||||
IRpcChannelBuffer_Release(ifstub->chan);
|
||||
|
||||
|
|
Loading…
Reference in New Issue