Commit 8165b584 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

- Make the interfaces that should be supported by the data cache

explicit so their is no confusion in this file as to what it should be implementing and what this object should implement. - Delegate some IOleObject methods to the server IOleObject if it is running.
parent a5e59421
...@@ -174,13 +174,16 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface( ...@@ -174,13 +174,16 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
*ppvObject = (IDataObject*)&This->lpvtblIDataObject; *ppvObject = (IDataObject*)&This->lpvtblIDataObject;
else if (IsEqualIID(&IID_IRunnableObject, riid)) else if (IsEqualIID(&IID_IRunnableObject, riid))
*ppvObject = (IRunnableObject*)&This->lpvtblIRunnableObject; *ppvObject = (IRunnableObject*)&This->lpvtblIRunnableObject;
else else if (IsEqualIID(&IID_IPersist, riid) ||
IsEqualIID(&IID_IPersistStorage, riid) ||
IsEqualIID(&IID_IViewObject, riid) ||
IsEqualIID(&IID_IViewObject2, riid) ||
IsEqualIID(&IID_IOleCache, riid) ||
IsEqualIID(&IID_IOleCache2, riid))
{ {
/* HRESULT hr = IUnknown_QueryInterface(This->dataCache, riid, ppvObject);
* Blind aggregate the data cache to "inherit" it's interfaces. if (FAILED(hr)) FIXME("interface %s not implemented by data cache\n", debugstr_guid(riid));
*/ return hr;
if (IUnknown_QueryInterface(This->dataCache, riid, ppvObject) == S_OK)
return S_OK;
} }
/* Check that we obtained an interface. */ /* Check that we obtained an interface. */
...@@ -511,10 +514,17 @@ static HRESULT WINAPI DefaultHandler_EnumVerbs( ...@@ -511,10 +514,17 @@ static HRESULT WINAPI DefaultHandler_EnumVerbs(
IEnumOLEVERB** ppEnumOleVerb) IEnumOLEVERB** ppEnumOleVerb)
{ {
DefaultHandler *This = impl_from_IOleObject(iface); DefaultHandler *This = impl_from_IOleObject(iface);
HRESULT hr = OLE_S_USEREG;
TRACE("(%p, %p)\n", iface, ppEnumOleVerb); TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
return OleRegEnumVerbs(&This->clsid, ppEnumOleVerb); if (This->pOleDelegate)
hr = IOleObject_EnumVerbs(This->pOleDelegate, ppEnumOleVerb);
if (hr == OLE_S_USEREG)
return OleRegEnumVerbs(&This->clsid, ppEnumOleVerb);
else
return hr;
} }
static HRESULT WINAPI DefaultHandler_Update( static HRESULT WINAPI DefaultHandler_Update(
...@@ -554,6 +564,9 @@ static HRESULT WINAPI DefaultHandler_GetUserClassID( ...@@ -554,6 +564,9 @@ static HRESULT WINAPI DefaultHandler_GetUserClassID(
TRACE("(%p, %p)\n", iface, pClsid); TRACE("(%p, %p)\n", iface, pClsid);
if (This->pOleDelegate)
return IOleObject_GetUserClassID(This->pOleDelegate, pClsid);
/* Sanity check. */ /* Sanity check. */
if (!pClsid) if (!pClsid)
return E_POINTER; return E_POINTER;
...@@ -754,6 +767,9 @@ static HRESULT WINAPI DefaultHandler_GetMiscStatus( ...@@ -754,6 +767,9 @@ static HRESULT WINAPI DefaultHandler_GetMiscStatus(
TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus); TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
if (This->pOleDelegate)
return IOleObject_GetMiscStatus(This->pOleDelegate, dwAspect, pdwStatus);
hres = OleRegGetMiscStatus(&This->clsid, dwAspect, pdwStatus); hres = OleRegGetMiscStatus(&This->clsid, dwAspect, pdwStatus);
if (FAILED(hres)) if (FAILED(hres))
...@@ -910,12 +926,20 @@ static HRESULT WINAPI DefaultHandler_QueryGetData( ...@@ -910,12 +926,20 @@ static HRESULT WINAPI DefaultHandler_QueryGetData(
*/ */
static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
IDataObject* iface, IDataObject* iface,
LPFORMATETC pformatectIn, LPFORMATETC pformatetcIn,
LPFORMATETC pformatetcOut) LPFORMATETC pformatetcOut)
{ {
FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut); DefaultHandler *This = impl_from_IDataObject(iface);
IDataObject *pDataObject;
HRESULT hr;
return OLE_E_NOTRUNNING; TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut);
if (!This->pOleDelegate)
return OLE_E_NOTRUNNING;
hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject, (void **)&pDataObject);
return IDataObject_GetCanonicalFormatEtc(pDataObject, pformatetcIn, pformatetcOut);
} }
/************************************************************************ /************************************************************************
...@@ -932,11 +956,10 @@ static HRESULT WINAPI DefaultHandler_SetData( ...@@ -932,11 +956,10 @@ static HRESULT WINAPI DefaultHandler_SetData(
STGMEDIUM* pmedium, STGMEDIUM* pmedium,
BOOL fRelease) BOOL fRelease)
{ {
DefaultHandler *This = impl_from_IDataObject(iface);
IDataObject* cacheDataObject = NULL; IDataObject* cacheDataObject = NULL;
HRESULT hres; HRESULT hres;
DefaultHandler *This = impl_from_IDataObject(iface);
TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease); TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
hres = IUnknown_QueryInterface(This->dataCache, hres = IUnknown_QueryInterface(This->dataCache,
......
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