ReactOS 0.4.15-dev-5666-gc548b97
defaulthandler.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "ole2.h"
#include "compobj_private.h"
#include "storage32.h"
#include "wine/debug.h"
Include dependency graph for defaulthandler.c:

Go to the source code of this file.

Classes

struct  DefaultHandler
 
struct  ole_stream_header_t
 
struct  HandlerCF
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct DefaultHandler DefaultHandler
 
typedef struct HandlerCF HandlerCF
 

Enumerations

enum  storage_state { storage_state_uninitialised , storage_state_initialised , storage_state_loaded }
 
enum  object_state { object_state_not_running , object_state_running , object_state_deferred_close }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static DefaultHandlerimpl_from_IOleObject (IOleObject *iface)
 
static DefaultHandlerimpl_from_IUnknown (IUnknown *iface)
 
static DefaultHandlerimpl_from_IDataObject (IDataObject *iface)
 
static DefaultHandlerimpl_from_IRunnableObject (IRunnableObject *iface)
 
static DefaultHandlerimpl_from_IAdviseSink (IAdviseSink *iface)
 
static DefaultHandlerimpl_from_IPersistStorage (IPersistStorage *iface)
 
static void DefaultHandler_Destroy (DefaultHandler *This)
 
static BOOL object_is_running (DefaultHandler *This)
 
static void DefaultHandler_Stop (DefaultHandler *This)
 
static void start_object_call (DefaultHandler *This)
 
static void end_object_call (DefaultHandler *This)
 
static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface (IUnknown *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef (IUnknown *iface)
 
static ULONG WINAPI DefaultHandler_NDIUnknown_Release (IUnknown *iface)
 
static HRESULT WINAPI DefaultHandler_QueryInterface (IOleObject *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI DefaultHandler_AddRef (IOleObject *iface)
 
static ULONG WINAPI DefaultHandler_Release (IOleObject *iface)
 
static HRESULT WINAPI DefaultHandler_SetClientSite (IOleObject *iface, IOleClientSite *pClientSite)
 
static HRESULT WINAPI DefaultHandler_GetClientSite (IOleObject *iface, IOleClientSite **ppClientSite)
 
static HRESULT WINAPI DefaultHandler_SetHostNames (IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
 
static void release_delegates (DefaultHandler *This)
 
static HRESULT WINAPI DefaultHandler_Close (IOleObject *iface, DWORD dwSaveOption)
 
static HRESULT WINAPI DefaultHandler_SetMoniker (IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk)
 
static HRESULT WINAPI DefaultHandler_GetMoniker (IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
 
static HRESULT WINAPI DefaultHandler_InitFromData (IOleObject *iface, IDataObject *pDataObject, BOOL fCreation, DWORD dwReserved)
 
static HRESULT WINAPI DefaultHandler_GetClipboardData (IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject)
 
static HRESULT WINAPI DefaultHandler_DoVerb (IOleObject *iface, LONG iVerb, struct tagMSG *lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
 
static HRESULT WINAPI DefaultHandler_EnumVerbs (IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
 
static HRESULT WINAPI DefaultHandler_Update (IOleObject *iface)
 
static HRESULT WINAPI DefaultHandler_IsUpToDate (IOleObject *iface)
 
static HRESULT WINAPI DefaultHandler_GetUserClassID (IOleObject *iface, CLSID *pClsid)
 
static HRESULT WINAPI DefaultHandler_GetUserType (IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType)
 
static HRESULT WINAPI DefaultHandler_SetExtent (IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
 
static HRESULT WINAPI DefaultHandler_GetExtent (IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
 
static HRESULT WINAPI DefaultHandler_Advise (IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection)
 
static HRESULT WINAPI DefaultHandler_Unadvise (IOleObject *iface, DWORD dwConnection)
 
static HRESULT WINAPI DefaultHandler_EnumAdvise (IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
 
static HRESULT WINAPI DefaultHandler_GetMiscStatus (IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
 
static HRESULT WINAPI DefaultHandler_SetColorScheme (IOleObject *iface, struct tagLOGPALETTE *pLogpal)
 
static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface (IDataObject *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI DefaultHandler_IDataObject_AddRef (IDataObject *iface)
 
static ULONG WINAPI DefaultHandler_IDataObject_Release (IDataObject *iface)
 
static HRESULT WINAPI DefaultHandler_GetData (IDataObject *iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
 
static HRESULT WINAPI DefaultHandler_GetDataHere (IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
 
static HRESULT WINAPI DefaultHandler_QueryGetData (IDataObject *iface, LPFORMATETC pformatetc)
 
static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc (IDataObject *iface, LPFORMATETC pformatetcIn, LPFORMATETC pformatetcOut)
 
static HRESULT WINAPI DefaultHandler_SetData (IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
 
static HRESULT WINAPI DefaultHandler_EnumFormatEtc (IDataObject *iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
 
static HRESULT WINAPI DefaultHandler_DAdvise (IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
 
static HRESULT WINAPI DefaultHandler_DUnadvise (IDataObject *iface, DWORD dwConnection)
 
static HRESULT WINAPI DefaultHandler_EnumDAdvise (IDataObject *iface, IEnumSTATDATA **ppenumAdvise)
 
static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface (IRunnableObject *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef (IRunnableObject *iface)
 
static ULONG WINAPI DefaultHandler_IRunnableObject_Release (IRunnableObject *iface)
 
static HRESULT WINAPI DefaultHandler_GetRunningClass (IRunnableObject *iface, LPCLSID lpClsid)
 
static HRESULT WINAPI DefaultHandler_Run (IRunnableObject *iface, IBindCtx *pbc)
 
static BOOL WINAPI DefaultHandler_IsRunning (IRunnableObject *iface)
 
static HRESULT WINAPI DefaultHandler_LockRunning (IRunnableObject *iface, BOOL fLock, BOOL fLastUnlockCloses)
 
static HRESULT WINAPI DefaultHandler_SetContainedObject (IRunnableObject *iface, BOOL fContained)
 
static HRESULT WINAPI DefaultHandler_IAdviseSink_QueryInterface (IAdviseSink *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI DefaultHandler_IAdviseSink_AddRef (IAdviseSink *iface)
 
static ULONG WINAPI DefaultHandler_IAdviseSink_Release (IAdviseSink *iface)
 
static void WINAPI DefaultHandler_IAdviseSink_OnDataChange (IAdviseSink *iface, FORMATETC *pFormatetc, STGMEDIUM *pStgmed)
 
static void WINAPI DefaultHandler_IAdviseSink_OnViewChange (IAdviseSink *iface, DWORD dwAspect, LONG lindex)
 
static void WINAPI DefaultHandler_IAdviseSink_OnRename (IAdviseSink *iface, IMoniker *pmk)
 
static void WINAPI DefaultHandler_IAdviseSink_OnSave (IAdviseSink *iface)
 
static void WINAPI DefaultHandler_IAdviseSink_OnClose (IAdviseSink *iface)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_QueryInterface (IPersistStorage *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI DefaultHandler_IPersistStorage_AddRef (IPersistStorage *iface)
 
static ULONG WINAPI DefaultHandler_IPersistStorage_Release (IPersistStorage *iface)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_GetClassID (IPersistStorage *iface, CLSID *clsid)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_IsDirty (IPersistStorage *iface)
 
static HRESULT load_ole_stream (DefaultHandler *This, IStorage *storage)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_InitNew (IPersistStorage *iface, IStorage *pStg)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_Load (IPersistStorage *iface, IStorage *pStg)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_Save (IPersistStorage *iface, IStorage *pStgSave, BOOL fSameAsLoad)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_SaveCompleted (IPersistStorage *iface, IStorage *pStgNew)
 
static HRESULT WINAPI DefaultHandler_IPersistStorage_HandsOffStorage (IPersistStorage *iface)
 
static DefaultHandlerDefaultHandler_Construct (REFCLSID clsid, LPUNKNOWN pUnkOuter, DWORD flags, IClassFactory *pCF)
 
HRESULT WINAPI OleCreateEmbeddingHelper (REFCLSID clsid, LPUNKNOWN pUnkOuter, DWORD flags, IClassFactory *pCF, REFIID riid, LPVOID *ppvObj)
 
HRESULT WINAPI OleCreateDefaultHandler (REFCLSID clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
 
static HandlerCFimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI HandlerCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI HandlerCF_AddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI HandlerCF_Release (LPCLASSFACTORY iface)
 
static HRESULT WINAPI HandlerCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
 
static HRESULT WINAPI HandlerCF_LockServer (LPCLASSFACTORY iface, BOOL fLock)
 
HRESULT HandlerCF_Create (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 

Variables

static const WCHAR OleStream [] = {1,'O','l','e',0}
 
static const DWORD ole_stream_version = 0x02000001
 
static const IOleObjectVtbl DefaultHandler_IOleObject_VTable
 
static const IUnknownVtbl DefaultHandler_NDIUnknown_VTable
 
static const IDataObjectVtbl DefaultHandler_IDataObject_VTable
 
static const IRunnableObjectVtbl DefaultHandler_IRunnableObject_VTable
 
static const IAdviseSinkVtbl DefaultHandler_IAdviseSink_VTable
 
static const IPersistStorageVtbl DefaultHandler_IPersistStorage_VTable
 
static const IClassFactoryVtbl HandlerClassFactoryVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 52 of file defaulthandler.c.

Typedef Documentation

◆ DefaultHandler

Definition at line 149 of file defaulthandler.c.

◆ HandlerCF

Enumeration Type Documentation

◆ object_state

Enumerator
object_state_not_running 
object_state_running 
object_state_deferred_close 

Definition at line 74 of file defaulthandler.c.

75{
79};
@ object_state_not_running
@ object_state_deferred_close
@ object_state_running

◆ storage_state

Enumerator
storage_state_uninitialised 
storage_state_initialised 
storage_state_loaded 

Definition at line 67 of file defaulthandler.c.

68{
72};
@ storage_state_uninitialised
@ storage_state_initialised
@ storage_state_loaded

Function Documentation

◆ DefaultHandler_AddRef()

static ULONG WINAPI DefaultHandler_AddRef ( IOleObject iface)
static

Definition at line 329 of file defaulthandler.c.

331{
333
334 return IUnknown_AddRef(This->outerUnknown);
335}
static DefaultHandler * impl_from_IOleObject(IOleObject *iface)

◆ DefaultHandler_Advise()

static HRESULT WINAPI DefaultHandler_Advise ( IOleObject iface,
IAdviseSink pAdvSink,
DWORD pdwConnection 
)
static

Definition at line 914 of file defaulthandler.c.

918{
919 HRESULT hres = S_OK;
921
922 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
923
924 /* Make sure we have an advise holder before we start. */
925 if (!This->oleAdviseHolder)
926 hres = CreateOleAdviseHolder(&This->oleAdviseHolder);
927
928 if (SUCCEEDED(hres))
929 hres = IOleAdviseHolder_Advise(This->oleAdviseHolder,
930 pAdvSink,
931 pdwConnection);
932
933 return hres;
934}
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
HRESULT WINAPI CreateOleAdviseHolder(IOleAdviseHolder **ppOAHolder)
Definition: oleobj.c:875
#define TRACE(s)
Definition: solgame.cpp:4

◆ DefaultHandler_Close()

static HRESULT WINAPI DefaultHandler_Close ( IOleObject iface,
DWORD  dwSaveOption 
)
static

Definition at line 515 of file defaulthandler.c.

518{
520 HRESULT hr;
521
522 TRACE("(%d)\n", dwSaveOption);
523
525 return S_OK;
526
528 hr = IOleObject_Close(This->pOleDelegate, dwSaveOption);
530
532
533 return hr;
534}
static void DefaultHandler_Stop(DefaultHandler *This)
static BOOL object_is_running(DefaultHandler *This)
static void start_object_call(DefaultHandler *This)
static void end_object_call(DefaultHandler *This)
HRESULT hr
Definition: shlfolder.c:183

◆ DefaultHandler_Construct()

static DefaultHandler * DefaultHandler_Construct ( REFCLSID  clsid,
LPUNKNOWN  pUnkOuter,
DWORD  flags,
IClassFactory pCF 
)
static

Definition at line 2060 of file defaulthandler.c.

2065{
2067 HRESULT hr;
2068
2070
2071 if (!This)
2072 return This;
2073
2074 This->IOleObject_iface.lpVtbl = &DefaultHandler_IOleObject_VTable;
2075 This->IUnknown_iface.lpVtbl = &DefaultHandler_NDIUnknown_VTable;
2076 This->IDataObject_iface.lpVtbl = &DefaultHandler_IDataObject_VTable;
2077 This->IRunnableObject_iface.lpVtbl = &DefaultHandler_IRunnableObject_VTable;
2078 This->IAdviseSink_iface.lpVtbl = &DefaultHandler_IAdviseSink_VTable;
2079 This->IPersistStorage_iface.lpVtbl = &DefaultHandler_IPersistStorage_VTable;
2080
2081 This->inproc_server = (flags & EMBDHLP_INPROC_SERVER) != 0;
2082
2083 /*
2084 * Start with one reference count. The caller of this function
2085 * must release the interface pointer when it is done.
2086 */
2087 This->ref = 1;
2088
2089 /*
2090 * Initialize the outer unknown
2091 * We don't keep a reference on the outer unknown since, the way
2092 * aggregation works, our lifetime is at least as large as its
2093 * lifetime.
2094 */
2095 if (!pUnkOuter)
2096 pUnkOuter = &This->IUnknown_iface;
2097
2098 This->outerUnknown = pUnkOuter;
2099
2100 /*
2101 * Create a datacache object.
2102 * We aggregate with the datacache. Make sure we pass our outer
2103 * unknown as the datacache's outer unknown.
2104 */
2105 hr = CreateDataCache(This->outerUnknown,
2106 clsid,
2107 &IID_IUnknown,
2108 (void**)&This->dataCache);
2109 if(SUCCEEDED(hr))
2110 {
2111 hr = IUnknown_QueryInterface(This->dataCache, &IID_IPersistStorage, (void**)&This->dataCache_PersistStg);
2112 /* keeping a reference to This->dataCache_PersistStg causes us to keep a
2113 * reference on the outer object */
2114 if (SUCCEEDED(hr))
2115 IUnknown_Release(This->outerUnknown);
2116 else
2117 IUnknown_Release(This->dataCache);
2118 }
2119 if(FAILED(hr))
2120 {
2121 ERR("Unexpected error creating data cache\n");
2123 return NULL;
2124 }
2125
2126 This->clsid = *clsid;
2127 This->clientSite = NULL;
2128 This->oleAdviseHolder = NULL;
2129 This->dataAdviseHolder = NULL;
2130 This->containerApp = NULL;
2131 This->containerObj = NULL;
2132 This->pOleDelegate = NULL;
2133 This->pPSDelegate = NULL;
2134 This->pDataDelegate = NULL;
2135 This->object_state = object_state_not_running;
2136 This->in_call = 0;
2137
2138 This->dwAdvConn = 0;
2139 This->storage = NULL;
2140 This->storage_state = storage_state_uninitialised;
2141
2142 if (This->inproc_server && !(flags & EMBDHLP_DELAYCREATE))
2143 {
2144 HRESULT hr;
2145 This->pCFObject = NULL;
2146 if (pCF)
2147 hr = IClassFactory_CreateInstance(pCF, NULL, &IID_IOleObject, (void **)&This->pOleDelegate);
2148 else
2149 hr = CoCreateInstance(&This->clsid, NULL, CLSCTX_INPROC_SERVER,
2150 &IID_IOleObject, (void **)&This->pOleDelegate);
2151 if (SUCCEEDED(hr))
2152 hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage, (void **)&This->pPSDelegate);
2153 if (SUCCEEDED(hr))
2154 hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject, (void **)&This->pDataDelegate);
2155 if (SUCCEEDED(hr))
2156 This->object_state = object_state_running;
2157 if (FAILED(hr))
2158 WARN("object creation failed with error %08x\n", hr);
2159 }
2160 else
2161 {
2162 This->pCFObject = pCF;
2163 if (pCF) IClassFactory_AddRef(pCF);
2164 }
2165
2166 return This;
2167}
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
Definition: datacache.c:3035
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
static const IAdviseSinkVtbl DefaultHandler_IAdviseSink_VTable
static const IRunnableObjectVtbl DefaultHandler_IRunnableObject_VTable
static const IOleObjectVtbl DefaultHandler_IOleObject_VTable
static const IPersistStorageVtbl DefaultHandler_IPersistStorage_VTable
static const IUnknownVtbl DefaultHandler_NDIUnknown_VTable
static const IDataObjectVtbl DefaultHandler_IDataObject_VTable
GLbitfield flags
Definition: glext.h:7161
#define FAILED(hr)
Definition: intsafe.h:51
REFCLSID clsid
Definition: msctf.c:82
#define EMBDHLP_INPROC_SERVER
Definition: ole2.h:48
#define EMBDHLP_DELAYCREATE
Definition: ole2.h:50
const GUID IID_IDataObject
const GUID IID_IPersistStorage
const GUID IID_IOleObject

Referenced by OleCreateEmbeddingHelper().

◆ DefaultHandler_DAdvise()

static HRESULT WINAPI DefaultHandler_DAdvise ( IDataObject iface,
FORMATETC *  pformatetc,
DWORD  advf,
IAdviseSink pAdvSink,
DWORD pdwConnection 
)
static

Definition at line 1294 of file defaulthandler.c.

1300{
1301 HRESULT hres = S_OK;
1303
1304 TRACE("(%p, %p, %d, %p, %p)\n",
1305 iface, pformatetc, advf, pAdvSink, pdwConnection);
1306
1307 /* Make sure we have a data advise holder before we start. */
1308 if (!This->dataAdviseHolder)
1309 {
1310 hres = CreateDataAdviseHolder(&This->dataAdviseHolder);
1312 {
1314 DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate);
1316 }
1317 }
1318
1319 if (SUCCEEDED(hres))
1320 hres = IDataAdviseHolder_Advise(This->dataAdviseHolder,
1321 iface,
1322 pformatetc,
1323 advf,
1324 pAdvSink,
1325 pdwConnection);
1326
1327 return hres;
1328}
HRESULT DataAdviseHolder_OnConnect(IDataAdviseHolder *iface, IDataObject *pDelegate) DECLSPEC_HIDDEN
Definition: oleobj.c:806
static DefaultHandler * impl_from_IDataObject(IDataObject *iface)
HRESULT WINAPI CreateDataAdviseHolder(IDataAdviseHolder **ppDAHolder)
Definition: oleobj.c:893

◆ DefaultHandler_Destroy()

static void DefaultHandler_Destroy ( DefaultHandler This)
static

Definition at line 2169 of file defaulthandler.c.

2171{
2172 TRACE("(%p)\n", This);
2173
2174 /* AddRef/Release may be called on this object during destruction.
2175 * Prevent the object being destroyed recursively by artificially raising
2176 * the reference count. */
2177 This->ref = 10000;
2178
2179 /* release delegates */
2181
2182 HeapFree( GetProcessHeap(), 0, This->containerApp );
2183 This->containerApp = NULL;
2184 HeapFree( GetProcessHeap(), 0, This->containerObj );
2185 This->containerObj = NULL;
2186
2187 if (This->dataCache)
2188 {
2189 /* to balance out the release of dataCache_PersistStg which will result
2190 * in a reference being released from the outer unknown */
2191 IUnknown_AddRef(This->outerUnknown);
2192 IPersistStorage_Release(This->dataCache_PersistStg);
2193 IUnknown_Release(This->dataCache);
2194 This->dataCache_PersistStg = NULL;
2195 This->dataCache = NULL;
2196 }
2197
2198 if (This->clientSite)
2199 {
2200 IOleClientSite_Release(This->clientSite);
2201 This->clientSite = NULL;
2202 }
2203
2204 if (This->oleAdviseHolder)
2205 {
2206 IOleAdviseHolder_Release(This->oleAdviseHolder);
2207 This->oleAdviseHolder = NULL;
2208 }
2209
2210 if (This->dataAdviseHolder)
2211 {
2212 IDataAdviseHolder_Release(This->dataAdviseHolder);
2213 This->dataAdviseHolder = NULL;
2214 }
2215
2216 if (This->storage)
2217 {
2218 IStorage_Release(This->storage);
2219 This->storage = NULL;
2220 }
2221
2222 if (This->pCFObject)
2223 {
2224 IClassFactory_Release(This->pCFObject);
2225 This->pCFObject = NULL;
2226 }
2227
2229}

Referenced by DefaultHandler_NDIUnknown_Release().

◆ DefaultHandler_DoVerb()

static HRESULT WINAPI DefaultHandler_DoVerb ( IOleObject iface,
LONG  iVerb,
struct tagMSG lpmsg,
IOleClientSite pActiveSite,
LONG  lindex,
HWND  hwndParent,
LPCRECT  lprcPosRect 
)
static

Definition at line 663 of file defaulthandler.c.

671{
673 IRunnableObject *pRunnableObj = &This->IRunnableObject_iface;
674 HRESULT hr;
675
676 TRACE("(%d, %p, %p, %d, %p, %s)\n", iVerb, lpmsg, pActiveSite, lindex, hwndParent, wine_dbgstr_rect(lprcPosRect));
677
678 hr = IRunnableObject_Run(pRunnableObj, NULL);
679 if (FAILED(hr)) return hr;
680
682 hr = IOleObject_DoVerb(This->pOleDelegate, iVerb, lpmsg, pActiveSite,
683 lindex, hwndParent, lprcPosRect);
685
686 return hr;
687}
static HWND hwndParent
Definition: cryptui.c:300
static __inline const char * wine_dbgstr_rect(const RECT *rect)
Definition: debug.h:219

◆ DefaultHandler_DUnadvise()

static HRESULT WINAPI DefaultHandler_DUnadvise ( IDataObject iface,
DWORD  dwConnection 
)
static

Definition at line 1338 of file defaulthandler.c.

1341{
1343
1344 TRACE("(%p, %d)\n", iface, dwConnection);
1345
1346 /*
1347 * If we don't have a data advise holder yet, it means that
1348 * we don't have any connections..
1349 */
1350 if (!This->dataAdviseHolder)
1351 return OLE_E_NOCONNECTION;
1352
1353 return IDataAdviseHolder_Unadvise(This->dataAdviseHolder,
1354 dwConnection);
1355}
#define OLE_E_NOCONNECTION
Definition: winerror.h:2618

◆ DefaultHandler_EnumAdvise()

static HRESULT WINAPI DefaultHandler_EnumAdvise ( IOleObject iface,
IEnumSTATDATA **  ppenumAdvise 
)
static

Definition at line 971 of file defaulthandler.c.

974{
976
977 TRACE("(%p, %p)\n", iface, ppenumAdvise);
978
979 if (!ppenumAdvise)
980 return E_POINTER;
981
982 *ppenumAdvise = NULL;
983
984 if (!This->oleAdviseHolder)
985 return S_OK;
986
987 return IOleAdviseHolder_EnumAdvise(This->oleAdviseHolder, ppenumAdvise);
988}
#define E_POINTER
Definition: winerror.h:2365

◆ DefaultHandler_EnumDAdvise()

static HRESULT WINAPI DefaultHandler_EnumDAdvise ( IDataObject iface,
IEnumSTATDATA **  ppenumAdvise 
)
static

Definition at line 1365 of file defaulthandler.c.

1368{
1370
1371 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1372
1373 if (!ppenumAdvise)
1374 return E_POINTER;
1375
1376 *ppenumAdvise = NULL;
1377
1378 /* If we have a data advise holder object, delegate. */
1379 if (This->dataAdviseHolder)
1380 return IDataAdviseHolder_EnumAdvise(This->dataAdviseHolder,
1381 ppenumAdvise);
1382
1383 return S_OK;
1384}

◆ DefaultHandler_EnumFormatEtc()

static HRESULT WINAPI DefaultHandler_EnumFormatEtc ( IDataObject iface,
DWORD  dwDirection,
IEnumFORMATETC **  ppenumFormatEtc 
)
static

Definition at line 1274 of file defaulthandler.c.

1278{
1280
1281 TRACE("(%p, %x, %p)\n", iface, dwDirection, ppenumFormatEtc);
1282
1283 return OleRegEnumFormatEtc(&This->clsid, dwDirection, ppenumFormatEtc);
1284}
HRESULT WINAPI DECLSPEC_HOTPATCH OleRegEnumFormatEtc(REFCLSID clsid, DWORD dwDirection, LPENUMFORMATETC *ppenumFormatetc)
Definition: ole2stubs.c:75

◆ DefaultHandler_EnumVerbs()

static HRESULT WINAPI DefaultHandler_EnumVerbs ( IOleObject iface,
IEnumOLEVERB **  ppEnumOleVerb 
)
static

Definition at line 697 of file defaulthandler.c.

700{
703
704 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
705
707 {
709 hr = IOleObject_EnumVerbs(This->pOleDelegate, ppEnumOleVerb);
711 }
712
713 if (hr == OLE_S_USEREG)
714 return OleRegEnumVerbs(&This->clsid, ppEnumOleVerb);
715 else
716 return hr;
717}
HRESULT WINAPI OleRegEnumVerbs(REFCLSID clsid, LPENUMOLEVERB *ppenum)
Definition: ole2.c:1125
#define OLE_S_USEREG
Definition: winerror.h:2608

◆ DefaultHandler_GetCanonicalFormatEtc()

static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc ( IDataObject iface,
LPFORMATETC  pformatetcIn,
LPFORMATETC  pformatetcOut 
)
static

Definition at line 1209 of file defaulthandler.c.

1213{
1215 HRESULT hr;
1216
1217 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut);
1218
1219 if (!object_is_running( This ))
1220 return OLE_E_NOTRUNNING;
1221
1223 hr = IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut);
1225
1226 return hr;
1227}
#define OLE_E_NOTRUNNING
Definition: winerror.h:2619

◆ DefaultHandler_GetClientSite()

static HRESULT WINAPI DefaultHandler_GetClientSite ( IOleObject iface,
IOleClientSite **  ppClientSite 
)
static

Definition at line 397 of file defaulthandler.c.

400{
402
403 if (!ppClientSite)
404 return E_POINTER;
405
406 *ppClientSite = This->clientSite;
407
408 if (This->clientSite)
409 IOleClientSite_AddRef(This->clientSite);
410
411 return S_OK;
412}

◆ DefaultHandler_GetClipboardData()

static HRESULT WINAPI DefaultHandler_GetClipboardData ( IOleObject iface,
DWORD  dwReserved,
IDataObject **  ppDataObject 
)
static

Definition at line 641 of file defaulthandler.c.

645{
648
649 TRACE("(%p, %d, %p)\n",
650 iface, dwReserved, ppDataObject);
651
653 {
655 hr = IOleObject_GetClipboardData(This->pOleDelegate, dwReserved,
656 ppDataObject);
658 }
659
660 return hr;
661}
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ DefaultHandler_GetData()

static HRESULT WINAPI DefaultHandler_GetData ( IDataObject iface,
LPFORMATETC  pformatetcIn,
STGMEDIUM *  pmedium 
)
static

Definition at line 1103 of file defaulthandler.c.

1107{
1108 IDataObject* cacheDataObject = NULL;
1109 HRESULT hres;
1110
1112
1113 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1114
1115 hres = IUnknown_QueryInterface(This->dataCache,
1117 (void**)&cacheDataObject);
1118
1119 if (FAILED(hres))
1120 return E_UNEXPECTED;
1121
1122 hres = IDataObject_GetData(cacheDataObject,
1123 pformatetcIn,
1124 pmedium);
1125
1126 IDataObject_Release(cacheDataObject);
1127
1128 if (hres == S_OK) return hres;
1129
1130 if (object_is_running( This ))
1131 {
1133 hres = IDataObject_GetData(This->pDataDelegate, pformatetcIn, pmedium);
1135 if (hres == S_OK) return hres;
1136 }
1137
1138 /* Query running state again, as the object may have closed during _GetData call */
1139 if (!object_is_running( This ))
1141
1142 return hres;
1143}
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ DefaultHandler_GetDataHere()

static HRESULT WINAPI DefaultHandler_GetDataHere ( IDataObject iface,
LPFORMATETC  pformatetc,
STGMEDIUM *  pmedium 
)
static

Definition at line 1145 of file defaulthandler.c.

1149{
1150 FIXME(": Stub\n");
1151 return E_NOTIMPL;
1152}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DefaultHandler_GetExtent()

static HRESULT WINAPI DefaultHandler_GetExtent ( IOleObject iface,
DWORD  dwDrawAspect,
SIZEL psizel 
)
static

Definition at line 860 of file defaulthandler.c.

864{
865 DVTARGETDEVICE* targetDevice;
866 IViewObject2* cacheView = NULL;
868
870
871 TRACE("(%p, %x, %p)\n", iface, dwDrawAspect, psizel);
872
874 {
876 hres = IOleObject_GetExtent(This->pOleDelegate, dwDrawAspect, psizel);
878 return hres;
879 }
880
881 hres = IUnknown_QueryInterface(This->dataCache, &IID_IViewObject2, (void**)&cacheView);
882 if (FAILED(hres))
883 return E_UNEXPECTED;
884
885 /*
886 * Prepare the call to the cache's GetExtent method.
887 *
888 * Here we would build a valid DVTARGETDEVICE structure
889 * but, since we are calling into the data cache, we
890 * know its implementation and we'll skip this
891 * extra work until later.
892 */
893 targetDevice = NULL;
894
895 hres = IViewObject2_GetExtent(cacheView,
896 dwDrawAspect,
897 -1,
898 targetDevice,
899 psizel);
900
901 IViewObject2_Release(cacheView);
902
903 return hres;
904}
const GUID IID_IViewObject2

◆ DefaultHandler_GetMiscStatus()

static HRESULT WINAPI DefaultHandler_GetMiscStatus ( IOleObject iface,
DWORD  dwAspect,
DWORD pdwStatus 
)
static

Definition at line 998 of file defaulthandler.c.

1002{
1003 HRESULT hres;
1005
1006 TRACE("(%p, %x, %p)\n", iface, dwAspect, pdwStatus);
1007
1009 {
1011 hres = IOleObject_GetMiscStatus(This->pOleDelegate, dwAspect, pdwStatus);
1013 return hres;
1014 }
1015
1016 hres = OleRegGetMiscStatus(&This->clsid, dwAspect, pdwStatus);
1017
1018 if (FAILED(hres))
1019 *pdwStatus = 0;
1020
1021 return hres;
1022}
HRESULT WINAPI OleRegGetMiscStatus(REFCLSID clsid, DWORD dwAspect, DWORD *pdwStatus)
Definition: ole2.c:864

◆ DefaultHandler_GetMoniker()

static HRESULT WINAPI DefaultHandler_GetMoniker ( IOleObject iface,
DWORD  dwAssign,
DWORD  dwWhichMoniker,
IMoniker **  ppmk 
)
static

Definition at line 570 of file defaulthandler.c.

575{
577 HRESULT hr;
578
579 TRACE("(%p, %d, %d, %p)\n",
580 iface, dwAssign, dwWhichMoniker, ppmk);
581
583 {
585 hr = IOleObject_GetMoniker(This->pOleDelegate, dwAssign, dwWhichMoniker,
586 ppmk);
588 return hr;
589 }
590
591 /* FIXME: dwWhichMoniker == OLEWHICHMK_CONTAINER only? */
592 if (This->clientSite)
593 {
594 return IOleClientSite_GetMoniker(This->clientSite,
595 dwAssign,
596 dwWhichMoniker,
597 ppmk);
598
599 }
600
601 return E_FAIL;
602}
#define E_FAIL
Definition: ddrawi.h:102

◆ DefaultHandler_GetRunningClass()

static HRESULT WINAPI DefaultHandler_GetRunningClass ( IRunnableObject iface,
LPCLSID  lpClsid 
)
static

Definition at line 1437 of file defaulthandler.c.

1440{
1441 FIXME("()\n");
1442 return S_OK;
1443}

◆ DefaultHandler_GetUserClassID()

static HRESULT WINAPI DefaultHandler_GetUserClassID ( IOleObject iface,
CLSID pClsid 
)
static

Definition at line 771 of file defaulthandler.c.

774{
776 HRESULT hr;
777
778 TRACE("(%p, %p)\n", iface, pClsid);
779
781 {
783 hr = IOleObject_GetUserClassID(This->pOleDelegate, pClsid);
785 return hr;
786 }
787
788 if (!pClsid)
789 return E_POINTER;
790
791 *pClsid = This->clsid;
792
793 return S_OK;
794}

◆ DefaultHandler_GetUserType()

static HRESULT WINAPI DefaultHandler_GetUserType ( IOleObject iface,
DWORD  dwFormOfType,
LPOLESTR pszUserType 
)
static

Definition at line 804 of file defaulthandler.c.

808{
810 HRESULT hr;
811
812 TRACE("(%p, %d, %p)\n", iface, dwFormOfType, pszUserType);
814 {
816 hr = IOleObject_GetUserType(This->pOleDelegate, dwFormOfType, pszUserType);
818 return hr;
819 }
820
821 return OleRegGetUserType(&This->clsid, dwFormOfType, pszUserType);
822}
HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype)
Definition: ole2.c:678

◆ DefaultHandler_IAdviseSink_AddRef()

static ULONG WINAPI DefaultHandler_IAdviseSink_AddRef ( IAdviseSink iface)
static

Definition at line 1583 of file defaulthandler.c.

1585{
1587
1588 return IUnknown_AddRef(&This->IUnknown_iface);
1589}
static DefaultHandler * impl_from_IAdviseSink(IAdviseSink *iface)

◆ DefaultHandler_IAdviseSink_OnClose()

static void WINAPI DefaultHandler_IAdviseSink_OnClose ( IAdviseSink iface)
static

Definition at line 1638 of file defaulthandler.c.

1640{
1642
1643 TRACE("()\n");
1644
1645 if (This->oleAdviseHolder)
1646 IOleAdviseHolder_SendOnClose(This->oleAdviseHolder);
1647
1648 if(!This->in_call)
1650 else
1651 {
1652 TRACE("OnClose during call. Deferring shutdown\n");
1653 This->object_state = object_state_deferred_close;
1654 }
1655}

◆ DefaultHandler_IAdviseSink_OnDataChange()

static void WINAPI DefaultHandler_IAdviseSink_OnDataChange ( IAdviseSink iface,
FORMATETC *  pFormatetc,
STGMEDIUM *  pStgmed 
)
static

Definition at line 1599 of file defaulthandler.c.

1603{
1604 FIXME(": stub\n");
1605}

◆ DefaultHandler_IAdviseSink_OnRename()

static void WINAPI DefaultHandler_IAdviseSink_OnRename ( IAdviseSink iface,
IMoniker pmk 
)
static

Definition at line 1615 of file defaulthandler.c.

1618{
1620
1621 TRACE("(%p)\n", pmk);
1622
1623 if (This->oleAdviseHolder)
1624 IOleAdviseHolder_SendOnRename(This->oleAdviseHolder, pmk);
1625}

◆ DefaultHandler_IAdviseSink_OnSave()

static void WINAPI DefaultHandler_IAdviseSink_OnSave ( IAdviseSink iface)
static

Definition at line 1627 of file defaulthandler.c.

1629{
1631
1632 TRACE("()\n");
1633
1634 if (This->oleAdviseHolder)
1635 IOleAdviseHolder_SendOnSave(This->oleAdviseHolder);
1636}

◆ DefaultHandler_IAdviseSink_OnViewChange()

static void WINAPI DefaultHandler_IAdviseSink_OnViewChange ( IAdviseSink iface,
DWORD  dwAspect,
LONG  lindex 
)
static

Definition at line 1607 of file defaulthandler.c.

1611{
1612 FIXME(": stub\n");
1613}

◆ DefaultHandler_IAdviseSink_QueryInterface()

static HRESULT WINAPI DefaultHandler_IAdviseSink_QueryInterface ( IAdviseSink iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1567 of file defaulthandler.c.

1571{
1572 if (IsEqualIID(riid, &IID_IUnknown) ||
1574 {
1575 *ppvObject = iface;
1576 IAdviseSink_AddRef(iface);
1577 return S_OK;
1578 }
1579
1580 return E_NOINTERFACE;
1581}
REFIID riid
Definition: atlbase.h:39
const GUID IID_IAdviseSink
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ DefaultHandler_IAdviseSink_Release()

static ULONG WINAPI DefaultHandler_IAdviseSink_Release ( IAdviseSink iface)
static

Definition at line 1591 of file defaulthandler.c.

1593{
1595
1596 return IUnknown_Release(&This->IUnknown_iface);
1597}

◆ DefaultHandler_IDataObject_AddRef()

static ULONG WINAPI DefaultHandler_IDataObject_AddRef ( IDataObject iface)
static

Definition at line 1075 of file defaulthandler.c.

1077{
1079
1080 return IUnknown_AddRef(This->outerUnknown);
1081}

◆ DefaultHandler_IDataObject_QueryInterface()

static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface ( IDataObject iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1060 of file defaulthandler.c.

1064{
1066
1067 return IUnknown_QueryInterface(This->outerUnknown, riid, ppvObject);
1068}

◆ DefaultHandler_IDataObject_Release()

static ULONG WINAPI DefaultHandler_IDataObject_Release ( IDataObject iface)
static

Definition at line 1088 of file defaulthandler.c.

1090{
1092
1093 return IUnknown_Release(This->outerUnknown);
1094}

◆ DefaultHandler_InitFromData()

static HRESULT WINAPI DefaultHandler_InitFromData ( IOleObject iface,
IDataObject pDataObject,
BOOL  fCreation,
DWORD  dwReserved 
)
static

Definition at line 611 of file defaulthandler.c.

616{
619
620 TRACE("(%p, %p, %d, %d)\n",
621 iface, pDataObject, fCreation, dwReserved);
622
624 {
626 hr = IOleObject_InitFromData(This->pOleDelegate, pDataObject, fCreation,
627 dwReserved);
629 }
630
631 return hr;
632}

◆ DefaultHandler_IPersistStorage_AddRef()

static ULONG WINAPI DefaultHandler_IPersistStorage_AddRef ( IPersistStorage iface)
static

Definition at line 1675 of file defaulthandler.c.

1677{
1679
1680 return IUnknown_AddRef(This->outerUnknown);
1681}
static DefaultHandler * impl_from_IPersistStorage(IPersistStorage *iface)

◆ DefaultHandler_IPersistStorage_GetClassID()

static HRESULT WINAPI DefaultHandler_IPersistStorage_GetClassID ( IPersistStorage iface,
CLSID clsid 
)
static

Definition at line 1699 of file defaulthandler.c.

1702{
1704 HRESULT hr;
1705
1706 TRACE("(%p)->(%p)\n", iface, clsid);
1707
1709 {
1711 hr = IPersistStorage_GetClassID(This->pPSDelegate, clsid);
1713 }
1714 else
1715 hr = IPersistStorage_GetClassID(This->dataCache_PersistStg, clsid);
1716
1717 return hr;
1718}

◆ DefaultHandler_IPersistStorage_HandsOffStorage()

static HRESULT WINAPI DefaultHandler_IPersistStorage_HandsOffStorage ( IPersistStorage iface)
static

Definition at line 1940 of file defaulthandler.c.

1942{
1944 HRESULT hr;
1945
1946 TRACE("(%p)\n", iface);
1947
1948 hr = IPersistStorage_HandsOffStorage(This->dataCache_PersistStg);
1949
1951 {
1953 hr = IPersistStorage_HandsOffStorage(This->pPSDelegate);
1955 }
1956
1957 if(This->storage) IStorage_Release(This->storage);
1958 This->storage = NULL;
1959 This->storage_state = storage_state_uninitialised;
1960
1961 return hr;
1962}

◆ DefaultHandler_IPersistStorage_InitNew()

static HRESULT WINAPI DefaultHandler_IPersistStorage_InitNew ( IPersistStorage iface,
IStorage pStg 
)
static

Definition at line 1810 of file defaulthandler.c.

1813{
1815 HRESULT hr;
1816
1817 TRACE("(%p)->(%p)\n", iface, pStg);
1818 hr = STORAGE_CreateOleStream(pStg, 0);
1819 if (hr != S_OK) return hr;
1820
1821 hr = IPersistStorage_InitNew(This->dataCache_PersistStg, pStg);
1822
1824 {
1826 hr = IPersistStorage_InitNew(This->pPSDelegate, pStg);
1828 }
1829
1830 if(SUCCEEDED(hr))
1831 {
1832 IStorage_AddRef(pStg);
1833 This->storage = pStg;
1834 This->storage_state = storage_state_initialised;
1835 }
1836
1837 return hr;
1838}
HRESULT STORAGE_CreateOleStream(IStorage *storage, DWORD flags)
Definition: storage32.c:9207

◆ DefaultHandler_IPersistStorage_IsDirty()

static HRESULT WINAPI DefaultHandler_IPersistStorage_IsDirty ( IPersistStorage iface)
static

Definition at line 1724 of file defaulthandler.c.

1726{
1728 HRESULT hr;
1729
1730 TRACE("(%p)\n", iface);
1731
1732 hr = IPersistStorage_IsDirty(This->dataCache_PersistStg);
1733 if(hr != S_FALSE) return hr;
1734
1736 {
1738 hr = IPersistStorage_IsDirty(This->pPSDelegate);
1740 }
1741
1742 return hr;
1743}
#define S_FALSE
Definition: winerror.h:2357

◆ DefaultHandler_IPersistStorage_Load()

static HRESULT WINAPI DefaultHandler_IPersistStorage_Load ( IPersistStorage iface,
IStorage pStg 
)
static

Definition at line 1845 of file defaulthandler.c.

1848{
1850 HRESULT hr;
1851
1852 TRACE("(%p)->(%p)\n", iface, pStg);
1853
1854 hr = load_ole_stream(This, pStg);
1855
1856 if(SUCCEEDED(hr))
1857 hr = IPersistStorage_Load(This->dataCache_PersistStg, pStg);
1858
1860 {
1862 hr = IPersistStorage_Load(This->pPSDelegate, pStg);
1864 }
1865
1866 if(SUCCEEDED(hr))
1867 {
1868 IStorage_AddRef(pStg);
1869 This->storage = pStg;
1870 This->storage_state = storage_state_loaded;
1871 }
1872 return hr;
1873}
static HRESULT load_ole_stream(DefaultHandler *This, IStorage *storage)

◆ DefaultHandler_IPersistStorage_QueryInterface()

static HRESULT WINAPI DefaultHandler_IPersistStorage_QueryInterface ( IPersistStorage iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1661 of file defaulthandler.c.

1665{
1667
1668 return IUnknown_QueryInterface(This->outerUnknown, riid, ppvObject);
1669}

◆ DefaultHandler_IPersistStorage_Release()

static ULONG WINAPI DefaultHandler_IPersistStorage_Release ( IPersistStorage iface)
static

Definition at line 1687 of file defaulthandler.c.

1689{
1691
1692 return IUnknown_Release(This->outerUnknown);
1693}

◆ DefaultHandler_IPersistStorage_Save()

static HRESULT WINAPI DefaultHandler_IPersistStorage_Save ( IPersistStorage iface,
IStorage pStgSave,
BOOL  fSameAsLoad 
)
static

Definition at line 1880 of file defaulthandler.c.

1884{
1886 HRESULT hr;
1887
1888 TRACE("(%p)->(%p, %d)\n", iface, pStgSave, fSameAsLoad);
1889
1890 hr = IPersistStorage_Save(This->dataCache_PersistStg, pStgSave, fSameAsLoad);
1892 {
1894 hr = IPersistStorage_Save(This->pPSDelegate, pStgSave, fSameAsLoad);
1896 }
1897
1898 return hr;
1899}

◆ DefaultHandler_IPersistStorage_SaveCompleted()

static HRESULT WINAPI DefaultHandler_IPersistStorage_SaveCompleted ( IPersistStorage iface,
IStorage pStgNew 
)
static

Definition at line 1906 of file defaulthandler.c.

1909{
1911 HRESULT hr;
1912
1913 TRACE("(%p)->(%p)\n", iface, pStgNew);
1914
1915 hr = IPersistStorage_SaveCompleted(This->dataCache_PersistStg, pStgNew);
1916
1918 {
1920 hr = IPersistStorage_SaveCompleted(This->pPSDelegate, pStgNew);
1922 }
1923
1924 if(pStgNew)
1925 {
1926 IStorage_AddRef(pStgNew);
1927 if(This->storage) IStorage_Release(This->storage);
1928 This->storage = pStgNew;
1929 This->storage_state = storage_state_loaded;
1930 }
1931
1932 return hr;
1933}

◆ DefaultHandler_IRunnableObject_AddRef()

static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef ( IRunnableObject iface)
static

Definition at line 1411 of file defaulthandler.c.

1413{
1415
1416 return IUnknown_AddRef(This->outerUnknown);
1417}
static DefaultHandler * impl_from_IRunnableObject(IRunnableObject *iface)

◆ DefaultHandler_IRunnableObject_QueryInterface()

static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface ( IRunnableObject iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1396 of file defaulthandler.c.

1400{
1402
1403 return IUnknown_QueryInterface(This->outerUnknown, riid, ppvObject);
1404}

◆ DefaultHandler_IRunnableObject_Release()

static ULONG WINAPI DefaultHandler_IRunnableObject_Release ( IRunnableObject iface)
static

Definition at line 1424 of file defaulthandler.c.

1426{
1428
1429 return IUnknown_Release(This->outerUnknown);
1430}

◆ DefaultHandler_IsRunning()

static BOOL WINAPI DefaultHandler_IsRunning ( IRunnableObject iface)
static

Definition at line 1527 of file defaulthandler.c.

1529{
1531
1532 TRACE("()\n");
1533
1534 if (This->object_state == object_state_running)
1535 return TRUE;
1536 else
1537 return FALSE;
1538}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

◆ DefaultHandler_IsUpToDate()

static HRESULT WINAPI DefaultHandler_IsUpToDate ( IOleObject iface)
static

Definition at line 747 of file defaulthandler.c.

749{
752 TRACE("(%p)\n", iface);
753
755 {
757 hr = IOleObject_IsUpToDate(This->pOleDelegate);
759 }
760
761 return hr;
762}

◆ DefaultHandler_LockRunning()

static HRESULT WINAPI DefaultHandler_LockRunning ( IRunnableObject iface,
BOOL  fLock,
BOOL  fLastUnlockCloses 
)
static

Definition at line 1545 of file defaulthandler.c.

1549{
1550 FIXME("()\n");
1551 return S_OK;
1552}

◆ DefaultHandler_NDIUnknown_AddRef()

static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef ( IUnknown iface)
static

Definition at line 276 of file defaulthandler.c.

278{
280 return InterlockedIncrement(&This->ref);
281}
#define InterlockedIncrement
Definition: armddk.h:53
static DefaultHandler * impl_from_IUnknown(IUnknown *iface)

◆ DefaultHandler_NDIUnknown_QueryInterface()

static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 215 of file defaulthandler.c.

219{
221
222 if (!ppvObject)
223 return E_INVALIDARG;
224
225 *ppvObject = NULL;
226
228 *ppvObject = iface;
229 else if (IsEqualIID(&IID_IOleObject, riid))
230 *ppvObject = &This->IOleObject_iface;
231 else if (IsEqualIID(&IID_IDataObject, riid))
232 *ppvObject = &This->IDataObject_iface;
234 *ppvObject = &This->IRunnableObject_iface;
235 else if (IsEqualIID(&IID_IPersist, riid) ||
237 *ppvObject = &This->IPersistStorage_iface;
238 else if (IsEqualIID(&IID_IViewObject, riid) ||
242 {
243 HRESULT hr = IUnknown_QueryInterface(This->dataCache, riid, ppvObject);
244 if (FAILED(hr)) FIXME("interface %s not implemented by data cache\n", debugstr_guid(riid));
245 return hr;
246 }
247 else if (This->inproc_server && This->pOleDelegate)
248 {
249 return IOleObject_QueryInterface(This->pOleDelegate, riid, ppvObject);
250 }
251
252 /* Check that we obtained an interface. */
253 if (*ppvObject == NULL)
254 {
255 WARN( "() : asking for unsupported interface %s\n", debugstr_guid(riid));
256 return E_NOINTERFACE;
257 }
258
259 /*
260 * Query Interface always increases the reference count by one when it is
261 * successful.
262 */
263 IUnknown_AddRef((IUnknown*)*ppvObject);
264
265 return S_OK;
266}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IViewObject
const GUID IID_IOleCache
const GUID IID_IRunnableObject
const GUID IID_IOleCache2
const GUID IID_IPersist
Definition: proxy.cpp:14

◆ DefaultHandler_NDIUnknown_Release()

static ULONG WINAPI DefaultHandler_NDIUnknown_Release ( IUnknown iface)
static

Definition at line 291 of file defaulthandler.c.

293{
295 ULONG ref;
296
298
300
301 return ref;
302}
#define InterlockedDecrement
Definition: armddk.h:52
static void DefaultHandler_Destroy(DefaultHandler *This)
unsigned int ULONG
Definition: retypes.h:1
Definition: send.c:48

◆ DefaultHandler_QueryGetData()

static HRESULT WINAPI DefaultHandler_QueryGetData ( IDataObject iface,
LPFORMATETC  pformatetc 
)
static

Definition at line 1162 of file defaulthandler.c.

1165{
1166 IDataObject* cacheDataObject = NULL;
1167 HRESULT hres;
1168
1170
1171 TRACE("(%p, %p)\n", iface, pformatetc);
1172
1173 hres = IUnknown_QueryInterface(This->dataCache,
1175 (void**)&cacheDataObject);
1176
1177 if (FAILED(hres))
1178 return E_UNEXPECTED;
1179
1180 hres = IDataObject_QueryGetData(cacheDataObject,
1181 pformatetc);
1182
1183 IDataObject_Release(cacheDataObject);
1184
1185 if (hres == S_OK) return hres;
1186
1187 if (object_is_running( This ))
1188 {
1190 hres = IDataObject_QueryGetData(This->pDataDelegate, pformatetc);
1192 if (hres == S_OK) return hres;
1193 }
1194
1195 /* Query running state again, as the object may have closed during _QueryGetData call */
1196 if (!object_is_running( This ))
1198
1199 return hres;
1200}

◆ DefaultHandler_QueryInterface()

static HRESULT WINAPI DefaultHandler_QueryInterface ( IOleObject iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 314 of file defaulthandler.c.

318{
320
321 return IUnknown_QueryInterface(This->outerUnknown, riid, ppvObject);
322}

◆ DefaultHandler_Release()

static ULONG WINAPI DefaultHandler_Release ( IOleObject iface)
static

Definition at line 342 of file defaulthandler.c.

344{
346
347 return IUnknown_Release(This->outerUnknown);
348}

◆ DefaultHandler_Run()

static HRESULT WINAPI DefaultHandler_Run ( IRunnableObject iface,
IBindCtx pbc 
)
static

Definition at line 1445 of file defaulthandler.c.

1448{
1450 HRESULT hr;
1451 IOleCacheControl *cache_ctrl;
1452
1453 FIXME("(%p): semi-stub\n", pbc);
1454
1455 /* already running? if so nothing to do */
1457 return S_OK;
1458
1460
1461 hr = CoCreateInstance(&This->clsid, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
1462 &IID_IOleObject, (void **)&This->pOleDelegate);
1463 if (FAILED(hr))
1464 return hr;
1465
1466 hr = IOleObject_Advise(This->pOleDelegate, &This->IAdviseSink_iface, &This->dwAdvConn);
1467 if (FAILED(hr)) goto fail;
1468
1469 if (This->clientSite)
1470 {
1471 hr = IOleObject_SetClientSite(This->pOleDelegate, This->clientSite);
1472 if (FAILED(hr)) goto fail;
1473 }
1474
1475 hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage,
1476 (void **)&This->pPSDelegate);
1477 if (FAILED(hr)) goto fail;
1478
1479 if (This->storage_state == storage_state_initialised)
1480 hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage);
1481 else if (This->storage_state == storage_state_loaded)
1482 hr = IPersistStorage_Load(This->pPSDelegate, This->storage);
1483 if (FAILED(hr)) goto fail;
1484
1485 if (This->containerApp)
1486 {
1487 hr = IOleObject_SetHostNames(This->pOleDelegate, This->containerApp,
1488 This->containerObj);
1489 if (FAILED(hr)) goto fail;
1490 }
1491
1492 /* FIXME: do more stuff here:
1493 * - IOleObject_GetMiscStatus
1494 * - IOleObject_GetMoniker
1495 */
1496
1497 hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject,
1498 (void **)&This->pDataDelegate);
1499 if (FAILED(hr)) goto fail;
1500
1501 This->object_state = object_state_running;
1502
1503 if (This->dataAdviseHolder)
1504 {
1505 hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate);
1506 if (FAILED(hr)) goto fail;
1507 }
1508
1509 hr = IUnknown_QueryInterface( This->dataCache, &IID_IOleCacheControl, (void **)&cache_ctrl );
1510 if (FAILED(hr)) goto fail;
1511 hr = IOleCacheControl_OnRun( cache_ctrl, This->pDataDelegate );
1512 IOleCacheControl_Release( cache_ctrl );
1513 if (FAILED(hr)) goto fail;
1514
1515 return hr;
1516
1517fail:
1519 return hr;
1520}
static void release_delegates(DefaultHandler *This)
const GUID IID_IOleCacheControl

◆ DefaultHandler_SetClientSite()

static HRESULT WINAPI DefaultHandler_SetClientSite ( IOleObject iface,
IOleClientSite pClientSite 
)
static

Definition at line 358 of file defaulthandler.c.

361{
363 HRESULT hr = S_OK;
364
365 TRACE("(%p, %p)\n", iface, pClientSite);
366
368 {
370 hr = IOleObject_SetClientSite(This->pOleDelegate, pClientSite);
372 }
373
374 /*
375 * Make sure we release the previous client site if there
376 * was one.
377 */
378 if (This->clientSite)
379 IOleClientSite_Release(This->clientSite);
380
381 This->clientSite = pClientSite;
382
383 if (This->clientSite)
384 IOleClientSite_AddRef(This->clientSite);
385
386 return hr;
387}

◆ DefaultHandler_SetColorScheme()

static HRESULT WINAPI DefaultHandler_SetColorScheme ( IOleObject iface,
struct tagLOGPALETTE pLogpal 
)
static

Definition at line 1031 of file defaulthandler.c.

1034{
1037
1038 TRACE("(%p, %p))\n", iface, pLogpal);
1039
1041 {
1043 hr = IOleObject_SetColorScheme(This->pOleDelegate, pLogpal);
1045 }
1046
1047 return hr;
1048}

◆ DefaultHandler_SetContainedObject()

static HRESULT WINAPI DefaultHandler_SetContainedObject ( IRunnableObject iface,
BOOL  fContained 
)
static

Definition at line 1559 of file defaulthandler.c.

1562{
1563 FIXME("()\n");
1564 return S_OK;
1565}

◆ DefaultHandler_SetData()

static HRESULT WINAPI DefaultHandler_SetData ( IDataObject iface,
LPFORMATETC  pformatetc,
STGMEDIUM *  pmedium,
BOOL  fRelease 
)
static

Definition at line 1237 of file defaulthandler.c.

1242{
1244 IDataObject* cacheDataObject = NULL;
1245 HRESULT hres;
1246
1247 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1248
1249 hres = IUnknown_QueryInterface(This->dataCache,
1251 (void**)&cacheDataObject);
1252
1253 if (FAILED(hres))
1254 return E_UNEXPECTED;
1255
1256 hres = IDataObject_SetData(cacheDataObject,
1257 pformatetc,
1258 pmedium,
1259 fRelease);
1260
1261 IDataObject_Release(cacheDataObject);
1262
1263 return hres;
1264}

◆ DefaultHandler_SetExtent()

static HRESULT WINAPI DefaultHandler_SetExtent ( IOleObject iface,
DWORD  dwDrawAspect,
SIZEL psizel 
)
static

Definition at line 831 of file defaulthandler.c.

835{
838
839 TRACE("(%p, %x, (%d x %d))\n", iface,
840 dwDrawAspect, psizel->cx, psizel->cy);
841
843 {
845 hr = IOleObject_SetExtent(This->pOleDelegate, dwDrawAspect, psizel);
847 }
848
849 return hr;
850}
LONG cx
Definition: windef.h:334
LONG cy
Definition: windef.h:335

◆ DefaultHandler_SetHostNames()

static HRESULT WINAPI DefaultHandler_SetHostNames ( IOleObject iface,
LPCOLESTR  szContainerApp,
LPCOLESTR  szContainerObj 
)
static

Definition at line 422 of file defaulthandler.c.

426{
428
429 TRACE("(%p, %s, %s)\n",
430 iface,
431 debugstr_w(szContainerApp),
432 debugstr_w(szContainerObj));
433
435 {
437 IOleObject_SetHostNames(This->pOleDelegate, szContainerApp, szContainerObj);
439 }
440
441 /* Be sure to cleanup before re-assigning the strings. */
442 HeapFree( GetProcessHeap(), 0, This->containerApp );
443 This->containerApp = NULL;
444 HeapFree( GetProcessHeap(), 0, This->containerObj );
445 This->containerObj = NULL;
446
447 if (szContainerApp)
448 {
449 if ((This->containerApp = HeapAlloc( GetProcessHeap(), 0,
450 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
451 lstrcpyW( This->containerApp, szContainerApp );
452 }
453
454 if (szContainerObj)
455 {
456 if ((This->containerObj = HeapAlloc( GetProcessHeap(), 0,
457 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
458 lstrcpyW( This->containerObj, szContainerObj );
459 }
460 return S_OK;
461}
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
#define debugstr_w
Definition: kernel32.h:32
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ DefaultHandler_SetMoniker()

static HRESULT WINAPI DefaultHandler_SetMoniker ( IOleObject iface,
DWORD  dwWhichMoniker,
IMoniker pmk 
)
static

Definition at line 543 of file defaulthandler.c.

547{
549 HRESULT hr = S_OK;
550
551 TRACE("(%p, %d, %p)\n", iface, dwWhichMoniker, pmk);
552
554 {
556 hr = IOleObject_SetMoniker(This->pOleDelegate, dwWhichMoniker, pmk);
558 }
559
560 return hr;
561}

◆ DefaultHandler_Stop()

static void DefaultHandler_Stop ( DefaultHandler This)
static

Definition at line 483 of file defaulthandler.c.

484{
485 IOleCacheControl *cache_ctrl;
486 HRESULT hr;
487
488 if (This->object_state == object_state_not_running)
489 return;
490
491 hr = IUnknown_QueryInterface( This->dataCache, &IID_IOleCacheControl, (void **)&cache_ctrl );
492 if (SUCCEEDED(hr))
493 {
494 hr = IOleCacheControl_OnStop( cache_ctrl );
495 IOleCacheControl_Release( cache_ctrl );
496 }
497
498 IOleObject_Unadvise(This->pOleDelegate, This->dwAdvConn);
499
500 if (This->dataAdviseHolder)
501 DataAdviseHolder_OnDisconnect(This->dataAdviseHolder);
502
503 This->object_state = object_state_not_running;
505}
void DataAdviseHolder_OnDisconnect(IDataAdviseHolder *iface) DECLSPEC_HIDDEN
Definition: oleobj.c:828

Referenced by DefaultHandler_Close(), DefaultHandler_Destroy(), DefaultHandler_IAdviseSink_OnClose(), DefaultHandler_Run(), and end_object_call().

◆ DefaultHandler_Unadvise()

static HRESULT WINAPI DefaultHandler_Unadvise ( IOleObject iface,
DWORD  dwConnection 
)
static

Definition at line 944 of file defaulthandler.c.

947{
949
950 TRACE("(%p, %d)\n", iface, dwConnection);
951
952 /*
953 * If we don't have an advise holder yet, it means we don't have
954 * a connection.
955 */
956 if (!This->oleAdviseHolder)
957 return OLE_E_NOCONNECTION;
958
959 return IOleAdviseHolder_Unadvise(This->oleAdviseHolder,
960 dwConnection);
961}

◆ DefaultHandler_Update()

static HRESULT WINAPI DefaultHandler_Update ( IOleObject iface)
static

Definition at line 719 of file defaulthandler.c.

721{
723 HRESULT hr;
724
725 TRACE("(%p)\n", iface);
726
728 {
729 FIXME("Should run object\n");
730 return E_NOTIMPL;
731 }
732
734 hr = IOleObject_Update(This->pOleDelegate);
736
737 return hr;
738}

◆ end_object_call()

◆ HandlerCF_AddRef()

static ULONG WINAPI HandlerCF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 2321 of file defaulthandler.c.

2322{
2324 return InterlockedIncrement(&This->refs);
2325}
static HandlerCF * impl_from_IClassFactory(IClassFactory *iface)

◆ HandlerCF_Create()

HRESULT HandlerCF_Create ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 2358 of file defaulthandler.c.

2359{
2360 HRESULT hr;
2361 HandlerCF *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
2362 if (!This) return E_OUTOFMEMORY;
2363 This->IClassFactory_iface.lpVtbl = &HandlerClassFactoryVtbl;
2364 This->refs = 0;
2365 This->clsid = *rclsid;
2366
2367 hr = IClassFactory_QueryInterface(&This->IClassFactory_iface, riid, ppv);
2368 if (FAILED(hr))
2370
2371 return hr;
2372}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IClassFactoryVtbl HandlerClassFactoryVtbl
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by Handler_DllGetClassObject().

◆ HandlerCF_CreateInstance()

static HRESULT WINAPI HandlerCF_CreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pUnk,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 2337 of file defaulthandler.c.

2339{
2341 return OleCreateDefaultHandler(&This->clsid, pUnk, riid, ppv);
2342}
HRESULT WINAPI OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30

◆ HandlerCF_LockServer()

static HRESULT WINAPI HandlerCF_LockServer ( LPCLASSFACTORY  iface,
BOOL  fLock 
)
static

Definition at line 2344 of file defaulthandler.c.

2345{
2346 FIXME("(%d), stub!\n",fLock);
2347 return S_OK;
2348}

◆ HandlerCF_QueryInterface()

static HRESULT WINAPI HandlerCF_QueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 2308 of file defaulthandler.c.

2309{
2310 *ppv = NULL;
2313 {
2314 *ppv = iface;
2315 IClassFactory_AddRef(iface);
2316 return S_OK;
2317 }
2318 return E_NOINTERFACE;
2319}
const GUID IID_IClassFactory

◆ HandlerCF_Release()

static ULONG WINAPI HandlerCF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 2327 of file defaulthandler.c.

2328{
2330 ULONG refs = InterlockedDecrement(&This->refs);
2331 if (!refs)
2333 return refs;
2334}

◆ impl_from_IAdviseSink()

static DefaultHandler * impl_from_IAdviseSink ( IAdviseSink iface)
inlinestatic

◆ impl_from_IClassFactory()

static HandlerCF * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 2302 of file defaulthandler.c.

2303{
2304 return CONTAINING_RECORD(iface, HandlerCF, IClassFactory_iface);
2305}

Referenced by HandlerCF_AddRef(), HandlerCF_CreateInstance(), and HandlerCF_Release().

◆ impl_from_IDataObject()

◆ impl_from_IOleObject()

◆ impl_from_IPersistStorage()

◆ impl_from_IRunnableObject()

static DefaultHandler * impl_from_IRunnableObject ( IRunnableObject iface)
inlinestatic

◆ impl_from_IUnknown()

static DefaultHandler * impl_from_IUnknown ( IUnknown iface)
inlinestatic

◆ load_ole_stream()

static HRESULT load_ole_stream ( DefaultHandler This,
IStorage storage 
)
static

Definition at line 1772 of file defaulthandler.c.

1773{
1774 IStream *stream;
1775 HRESULT hr;
1776
1777 hr = IStorage_OpenStream(storage, OleStream, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream);
1778
1779 if(SUCCEEDED(hr))
1780 {
1781 DWORD read;
1783
1784 hr = IStream_Read(stream, &header, sizeof(header), &read);
1785 if(hr == S_OK && read == sizeof(header) && header.version == ole_stream_version)
1786 {
1787 if(header.flags & 1)
1788 {
1789 /* FIXME: Read the moniker and deal with the link */
1790 FIXME("Linked objects are not supported yet\n");
1791 }
1792 }
1793 else
1794 {
1795 WARN("Incorrect OleStream header\n");
1797 }
1798 IStream_Release(stream);
1799 }
1800 else
1801 hr = STORAGE_CreateOleStream(storage, 0);
1802
1803 return hr;
1804}
#define read
Definition: acwin.h:96
static const WCHAR OleStream[]
static const DWORD ole_stream_version
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:923
#define STGM_READ
Definition: objbase.h:917
Definition: parse.h:23
#define DV_E_CLIPFORMAT
Definition: winerror.h:2639

Referenced by DefaultHandler_IPersistStorage_Load().

◆ object_is_running()

◆ OleCreateDefaultHandler()

HRESULT WINAPI OleCreateDefaultHandler ( REFCLSID  clsid,
LPUNKNOWN  pUnkOuter,
REFIID  riid,
LPVOID ppvObj 
)

Definition at line 2287 of file defaulthandler.c.

2289{
2290 TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter,debugstr_guid(riid), ppvObj);
2292 NULL, riid, ppvObj);
2293}
HRESULT WINAPI OleCreateEmbeddingHelper(REFCLSID clsid, LPUNKNOWN pUnkOuter, DWORD flags, IClassFactory *pCF, REFIID riid, LPVOID *ppvObj)
#define EMBDHLP_INPROC_HANDLER
Definition: ole2.h:47
#define EMBDHLP_CREATENOW
Definition: ole2.h:49

Referenced by add_icon_to_control(), HandlerCF_CreateInstance(), insert_static_object(), OleCreateStaticFromData(), OleLoad(), test_default_handler(), test_default_handler_run(), and test_olestream().

◆ OleCreateEmbeddingHelper()

HRESULT WINAPI OleCreateEmbeddingHelper ( REFCLSID  clsid,
LPUNKNOWN  pUnkOuter,
DWORD  flags,
IClassFactory pCF,
REFIID  riid,
LPVOID ppvObj 
)

Definition at line 2234 of file defaulthandler.c.

2241{
2242 DefaultHandler* newHandler = NULL;
2243 HRESULT hr = S_OK;
2244
2245 TRACE("(%s, %p, %08x, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, flags, pCF, debugstr_guid(riid), ppvObj);
2246
2247 if (!ppvObj)
2248 return E_POINTER;
2249
2250 *ppvObj = NULL;
2251
2252 /*
2253 * If This handler is constructed for aggregation, make sure
2254 * the caller is requesting the IUnknown interface.
2255 * This is necessary because it's the only time the non-delegating
2256 * IUnknown pointer can be returned to the outside.
2257 */
2258 if (pUnkOuter && !IsEqualIID(&IID_IUnknown, riid))
2259 return CLASS_E_NOAGGREGATION;
2260
2261 /*
2262 * Try to construct a new instance of the class.
2263 */
2264 newHandler = DefaultHandler_Construct(clsid, pUnkOuter, flags, pCF);
2265
2266 if (!newHandler)
2267 return E_OUTOFMEMORY;
2268
2269 /*
2270 * Make sure it supports the interface required by the caller.
2271 */
2272 hr = IUnknown_QueryInterface(&newHandler->IUnknown_iface, riid, ppvObj);
2273
2274 /*
2275 * Release the reference obtained in the constructor. If
2276 * the QueryInterface was unsuccessful, it will free the class.
2277 */
2278 IUnknown_Release(&newHandler->IUnknown_iface);
2279
2280 return hr;
2281}
static DefaultHandler * DefaultHandler_Construct(REFCLSID clsid, LPUNKNOWN pUnkOuter, DWORD flags, IClassFactory *pCF)
IUnknown IUnknown_iface
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

Referenced by OleCreateDefaultHandler(), and test_default_handler().

◆ release_delegates()

static void release_delegates ( DefaultHandler This)
static

Definition at line 463 of file defaulthandler.c.

464{
465 if (This->pDataDelegate)
466 {
467 IDataObject_Release(This->pDataDelegate);
468 This->pDataDelegate = NULL;
469 }
470 if (This->pPSDelegate)
471 {
472 IPersistStorage_Release(This->pPSDelegate);
473 This->pPSDelegate = NULL;
474 }
475 if (This->pOleDelegate)
476 {
477 IOleObject_Release(This->pOleDelegate);
478 This->pOleDelegate = NULL;
479 }
480}

Referenced by DefaultHandler_Run(), and DefaultHandler_Stop().

◆ start_object_call()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ DefaultHandler_IAdviseSink_VTable

const IAdviseSinkVtbl DefaultHandler_IAdviseSink_VTable
static
Initial value:
=
{
}
static void WINAPI DefaultHandler_IAdviseSink_OnViewChange(IAdviseSink *iface, DWORD dwAspect, LONG lindex)
static ULONG WINAPI DefaultHandler_IAdviseSink_AddRef(IAdviseSink *iface)
static ULONG WINAPI DefaultHandler_IAdviseSink_Release(IAdviseSink *iface)
static HRESULT WINAPI DefaultHandler_IAdviseSink_QueryInterface(IAdviseSink *iface, REFIID riid, void **ppvObject)
static void WINAPI DefaultHandler_IAdviseSink_OnSave(IAdviseSink *iface)
static void WINAPI DefaultHandler_IAdviseSink_OnRename(IAdviseSink *iface, IMoniker *pmk)
static void WINAPI DefaultHandler_IAdviseSink_OnClose(IAdviseSink *iface)
static void WINAPI DefaultHandler_IAdviseSink_OnDataChange(IAdviseSink *iface, FORMATETC *pFormatetc, STGMEDIUM *pStgmed)

Definition at line 2031 of file defaulthandler.c.

Referenced by DefaultHandler_Construct().

◆ DefaultHandler_IDataObject_VTable

const IDataObjectVtbl DefaultHandler_IDataObject_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI DefaultHandler_GetDataHere(IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
static HRESULT WINAPI DefaultHandler_SetData(IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(IDataObject *iface, REFIID riid, void **ppvObject)
static ULONG WINAPI DefaultHandler_IDataObject_Release(IDataObject *iface)
static HRESULT WINAPI DefaultHandler_EnumDAdvise(IDataObject *iface, IEnumSTATDATA **ppenumAdvise)
static HRESULT WINAPI DefaultHandler_QueryGetData(IDataObject *iface, LPFORMATETC pformatetc)
static HRESULT WINAPI DefaultHandler_GetData(IDataObject *iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(IDataObject *iface, LPFORMATETC pformatetcIn, LPFORMATETC pformatetcOut)
static HRESULT WINAPI DefaultHandler_DAdvise(IDataObject *iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
static HRESULT WINAPI DefaultHandler_DUnadvise(IDataObject *iface, DWORD dwConnection)
static HRESULT WINAPI DefaultHandler_EnumFormatEtc(IDataObject *iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
static ULONG WINAPI DefaultHandler_IDataObject_AddRef(IDataObject *iface)

Definition at line 2003 of file defaulthandler.c.

Referenced by DefaultHandler_Construct().

◆ DefaultHandler_IOleObject_VTable

const IOleObjectVtbl DefaultHandler_IOleObject_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI DefaultHandler_Unadvise(IOleObject *iface, DWORD dwConnection)
static HRESULT WINAPI DefaultHandler_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
static HRESULT WINAPI DefaultHandler_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite)
static ULONG WINAPI DefaultHandler_Release(IOleObject *iface)
static HRESULT WINAPI DefaultHandler_InitFromData(IOleObject *iface, IDataObject *pDataObject, BOOL fCreation, DWORD dwReserved)
static ULONG WINAPI DefaultHandler_AddRef(IOleObject *iface)
static HRESULT WINAPI DefaultHandler_Close(IOleObject *iface, DWORD dwSaveOption)
static HRESULT WINAPI DefaultHandler_SetColorScheme(IOleObject *iface, struct tagLOGPALETTE *pLogpal)
static HRESULT WINAPI DefaultHandler_Update(IOleObject *iface)
static HRESULT WINAPI DefaultHandler_GetClipboardData(IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject)
static HRESULT WINAPI DefaultHandler_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk)
static HRESULT WINAPI DefaultHandler_QueryInterface(IOleObject *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI DefaultHandler_IsUpToDate(IOleObject *iface)
static HRESULT WINAPI DefaultHandler_GetMoniker(IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
static HRESULT WINAPI DefaultHandler_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
static HRESULT WINAPI DefaultHandler_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType)
static HRESULT WINAPI DefaultHandler_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
static HRESULT WINAPI DefaultHandler_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite)
static HRESULT WINAPI DefaultHandler_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection)
static HRESULT WINAPI DefaultHandler_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
static HRESULT WINAPI DefaultHandler_DoVerb(IOleObject *iface, LONG iVerb, struct tagMSG *lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
static HRESULT WINAPI DefaultHandler_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
static HRESULT WINAPI DefaultHandler_GetUserClassID(IOleObject *iface, CLSID *pClsid)
static HRESULT WINAPI DefaultHandler_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)

Definition at line 1968 of file defaulthandler.c.

Referenced by DefaultHandler_Construct().

◆ DefaultHandler_IPersistStorage_VTable

const IPersistStorageVtbl DefaultHandler_IPersistStorage_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI DefaultHandler_IPersistStorage_InitNew(IPersistStorage *iface, IStorage *pStg)
static HRESULT WINAPI DefaultHandler_IPersistStorage_Load(IPersistStorage *iface, IStorage *pStg)
static HRESULT WINAPI DefaultHandler_IPersistStorage_Save(IPersistStorage *iface, IStorage *pStgSave, BOOL fSameAsLoad)
static HRESULT WINAPI DefaultHandler_IPersistStorage_IsDirty(IPersistStorage *iface)
static HRESULT WINAPI DefaultHandler_IPersistStorage_QueryInterface(IPersistStorage *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI DefaultHandler_IPersistStorage_GetClassID(IPersistStorage *iface, CLSID *clsid)
static HRESULT WINAPI DefaultHandler_IPersistStorage_HandsOffStorage(IPersistStorage *iface)
static ULONG WINAPI DefaultHandler_IPersistStorage_AddRef(IPersistStorage *iface)
static HRESULT WINAPI DefaultHandler_IPersistStorage_SaveCompleted(IPersistStorage *iface, IStorage *pStgNew)
static ULONG WINAPI DefaultHandler_IPersistStorage_Release(IPersistStorage *iface)

Definition at line 2043 of file defaulthandler.c.

Referenced by DefaultHandler_Construct().

◆ DefaultHandler_IRunnableObject_VTable

const IRunnableObjectVtbl DefaultHandler_IRunnableObject_VTable
static
Initial value:
=
{
}
static ULONG WINAPI DefaultHandler_IRunnableObject_Release(IRunnableObject *iface)
static BOOL WINAPI DefaultHandler_IsRunning(IRunnableObject *iface)
static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(IRunnableObject *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI DefaultHandler_GetRunningClass(IRunnableObject *iface, LPCLSID lpClsid)
static HRESULT WINAPI DefaultHandler_Run(IRunnableObject *iface, IBindCtx *pbc)
static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(IRunnableObject *iface)
static HRESULT WINAPI DefaultHandler_SetContainedObject(IRunnableObject *iface, BOOL fContained)
static HRESULT WINAPI DefaultHandler_LockRunning(IRunnableObject *iface, BOOL fLock, BOOL fLastUnlockCloses)

Definition at line 2019 of file defaulthandler.c.

Referenced by DefaultHandler_Construct().

◆ DefaultHandler_NDIUnknown_VTable

const IUnknownVtbl DefaultHandler_NDIUnknown_VTable
static
Initial value:
=
{
}
static ULONG WINAPI DefaultHandler_NDIUnknown_Release(IUnknown *iface)
static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppvObject)
static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(IUnknown *iface)

Definition at line 1996 of file defaulthandler.c.

Referenced by DefaultHandler_Construct().

◆ HandlerClassFactoryVtbl

const IClassFactoryVtbl HandlerClassFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HandlerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
static HRESULT WINAPI HandlerCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppv)
static HRESULT WINAPI HandlerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
static ULONG WINAPI HandlerCF_Release(LPCLASSFACTORY iface)
static ULONG WINAPI HandlerCF_AddRef(LPCLASSFACTORY iface)

Definition at line 2350 of file defaulthandler.c.

Referenced by HandlerCF_Create().

◆ ole_stream_version

const DWORD ole_stream_version = 0x02000001
static

Definition at line 1770 of file defaulthandler.c.

Referenced by load_ole_stream().

◆ OleStream

const WCHAR OleStream[] = {1,'O','l','e',0}
static

Definition at line 1761 of file defaulthandler.c.

Referenced by load_ole_stream().