Check for busy DCE moved to DCHook16().
[wine/hacks.git] / ole / defaulthandler.c
blob00f7da58df98d4a3930864de4362a037302bff49
1 /*
2 * OLE 2 default object handler
4 * Copyright 1999 Francis Beaudet
6 * NOTES:
7 * The OLE2 default object handler supports a whole whack of
8 * interfaces including:
9 * IOleObject, IDataObject, IPersistStorage, IViewObject2,
10 * IRunnableObject, IOleCache2, IOleCacheControl and much more.
12 * All the implementation details are taken from: Inside OLE
13 * second edition by Kraig Brockschmidt,
15 * TODO
16 * - This implementation of the default handler does not launch the
17 * server in the DoVerb, Update, GetData, GetDataHere and Run
18 * methods. When it is fixed to do so, all the methods will have
19 * to be revisited to allow delegating to the running object
21 * - All methods in the class that use the class ID should be
22 * aware that it is possible for a class to be treated as
23 * another one and go into emulation mode. Nothing has been
24 * done in this area.
26 * - Some functions still return E_NOTIMPL they have to be
27 * implemented most of those are related to the running of the
28 * actual server.
30 * - All the methods releated to notification and advise sinks are
31 * in place but no notifications are sent to the sinks yet.
33 #include <assert.h>
35 #include "winuser.h"
36 #include "winerror.h"
37 #include "ole2.h"
38 #include "debug.h"
40 DEFAULT_DEBUG_CHANNEL(ole)
42 /****************************************************************************
43 * DefaultHandler
46 struct DefaultHandler
49 * List all interface VTables here
51 ICOM_VTABLE(IOleObject)* lpvtbl1;
52 ICOM_VTABLE(IUnknown)* lpvtbl2;
53 ICOM_VTABLE(IDataObject)* lpvtbl3;
54 ICOM_VTABLE(IRunnableObject)* lpvtbl4;
57 * Reference count of this object
59 ULONG ref;
62 * IUnknown implementation of the outer object.
64 IUnknown* outerUnknown;
67 * Class Id that this handler object represents.
69 CLSID clsid;
72 * IUnknown implementation of the datacache.
74 IUnknown* dataCache;
77 * Client site for the embedded object.
79 IOleClientSite* clientSite;
82 * The IOleAdviseHolder maintains the connections
83 * on behalf of the default handler.
85 IOleAdviseHolder* oleAdviseHolder;
88 * The IDataAdviseHolder maintains the data
89 * connections on behalf of the default handler.
91 IDataAdviseHolder* dataAdviseHolder;
94 * Name of the container and object contained
96 BSTR containerApp;
97 BSTR containerObj;
101 typedef struct DefaultHandler DefaultHandler;
104 * Here, I define utility macros to help with the casting of the
105 * "this" parameter.
106 * There is a version to accomodate all of the VTables implemented
107 * by this object.
109 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name;
110 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((void*)name)-sizeof(void*));
111 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((void*)name)-2*sizeof(void*));
112 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((void*)name)-3*sizeof(void*));
115 * Prototypes for the methods of the DefaultHandler class.
117 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
118 LPUNKNOWN pUnkOuter);
119 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
122 * Prototypes for the methods of the DefaultHandler class
123 * that implement non delegating IUnknown methods.
125 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
126 IUnknown* iface,
127 REFIID riid,
128 void** ppvObject);
129 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
130 IUnknown* iface);
131 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
132 IUnknown* iface);
135 * Prototypes for the methods of the DefaultHandler class
136 * that implement IOleObject methods.
138 static HRESULT WINAPI DefaultHandler_QueryInterface(
139 IOleObject* iface,
140 REFIID riid,
141 void** ppvObject);
142 static ULONG WINAPI DefaultHandler_AddRef(
143 IOleObject* iface);
144 static ULONG WINAPI DefaultHandler_Release(
145 IOleObject* iface);
146 static HRESULT WINAPI DefaultHandler_SetClientSite(
147 IOleObject* iface,
148 IOleClientSite* pClientSite);
149 static HRESULT WINAPI DefaultHandler_GetClientSite(
150 IOleObject* iface,
151 IOleClientSite** ppClientSite);
152 static HRESULT WINAPI DefaultHandler_SetHostNames(
153 IOleObject* iface,
154 LPCOLESTR szContainerApp,
155 LPCOLESTR szContainerObj);
156 static HRESULT WINAPI DefaultHandler_Close(
157 IOleObject* iface,
158 DWORD dwSaveOption);
159 static HRESULT WINAPI DefaultHandler_SetMoniker(
160 IOleObject* iface,
161 DWORD dwWhichMoniker,
162 IMoniker* pmk);
163 static HRESULT WINAPI DefaultHandler_GetMoniker(
164 IOleObject* iface,
165 DWORD dwAssign,
166 DWORD dwWhichMoniker,
167 IMoniker** ppmk);
168 static HRESULT WINAPI DefaultHandler_InitFromData(
169 IOleObject* iface,
170 IDataObject* pDataObject,
171 BOOL fCreation,
172 DWORD dwReserved);
173 static HRESULT WINAPI DefaultHandler_GetClipboardData(
174 IOleObject* iface,
175 DWORD dwReserved,
176 IDataObject** ppDataObject);
177 static HRESULT WINAPI DefaultHandler_DoVerb(
178 IOleObject* iface,
179 LONG iVerb,
180 LPMSG lpmsg,
181 IOleClientSite* pActiveSite,
182 LONG lindex,
183 HWND hwndParent,
184 LPCRECT lprcPosRect);
185 static HRESULT WINAPI DefaultHandler_EnumVerbs(
186 IOleObject* iface,
187 IEnumOLEVERB** ppEnumOleVerb);
188 static HRESULT WINAPI DefaultHandler_Update(
189 IOleObject* iface);
190 static HRESULT WINAPI DefaultHandler_IsUpToDate(
191 IOleObject* iface);
192 static HRESULT WINAPI DefaultHandler_GetUserClassID(
193 IOleObject* iface,
194 CLSID* pClsid);
195 static HRESULT WINAPI DefaultHandler_GetUserType(
196 IOleObject* iface,
197 DWORD dwFormOfType,
198 LPOLESTR* pszUserType);
199 static HRESULT WINAPI DefaultHandler_SetExtent(
200 IOleObject* iface,
201 DWORD dwDrawAspect,
202 SIZEL* psizel);
203 static HRESULT WINAPI DefaultHandler_GetExtent(
204 IOleObject* iface,
205 DWORD dwDrawAspect,
206 SIZEL* psizel);
207 static HRESULT WINAPI DefaultHandler_Advise(
208 IOleObject* iface,
209 IAdviseSink* pAdvSink,
210 DWORD* pdwConnection);
211 static HRESULT WINAPI DefaultHandler_Unadvise(
212 IOleObject* iface,
213 DWORD dwConnection);
214 static HRESULT WINAPI DefaultHandler_EnumAdvise(
215 IOleObject* iface,
216 IEnumSTATDATA** ppenumAdvise);
217 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
218 IOleObject* iface,
219 DWORD dwAspect,
220 DWORD* pdwStatus);
221 static HRESULT WINAPI DefaultHandler_SetColorScheme(
222 IOleObject* iface,
223 LOGPALETTE* pLogpal);
226 * Prototypes for the methods of the DefaultHandler class
227 * that implement IDataObject methods.
229 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
230 IDataObject* iface,
231 REFIID riid,
232 void** ppvObject);
233 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
234 IDataObject* iface);
235 static ULONG WINAPI DefaultHandler_IDataObject_Release(
236 IDataObject* iface);
237 static HRESULT WINAPI DefaultHandler_GetData(
238 IDataObject* iface,
239 LPFORMATETC pformatetcIn,
240 STGMEDIUM* pmedium);
241 static HRESULT WINAPI DefaultHandler_GetDataHere(
242 IDataObject* iface,
243 LPFORMATETC pformatetc,
244 STGMEDIUM* pmedium);
245 static HRESULT WINAPI DefaultHandler_QueryGetData(
246 IDataObject* iface,
247 LPFORMATETC pformatetc);
248 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
249 IDataObject* iface,
250 LPFORMATETC pformatectIn,
251 LPFORMATETC pformatetcOut);
252 static HRESULT WINAPI DefaultHandler_SetData(
253 IDataObject* iface,
254 LPFORMATETC pformatetc,
255 STGMEDIUM* pmedium,
256 BOOL fRelease);
257 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
258 IDataObject* iface,
259 DWORD dwDirection,
260 IEnumFORMATETC** ppenumFormatEtc);
261 static HRESULT WINAPI DefaultHandler_DAdvise(
262 IDataObject* iface,
263 FORMATETC* pformatetc,
264 DWORD advf,
265 IAdviseSink* pAdvSink,
266 DWORD* pdwConnection);
267 static HRESULT WINAPI DefaultHandler_DUnadvise(
268 IDataObject* iface,
269 DWORD dwConnection);
270 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
271 IDataObject* iface,
272 IEnumSTATDATA** ppenumAdvise);
275 * Prototypes for the methods of the DefaultHandler class
276 * that implement IRunnableObject methods.
278 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
279 IRunnableObject* iface,
280 REFIID riid,
281 void** ppvObject);
282 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
283 IRunnableObject* iface);
284 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
285 IRunnableObject* iface);
286 static HRESULT WINAPI DefaultHandler_GetRunningClass(
287 IRunnableObject* iface,
288 LPCLSID lpClsid);
289 static HRESULT WINAPI DefaultHandler_Run(
290 IRunnableObject* iface,
291 IBindCtx* pbc);
292 static BOOL WINAPI DefaultHandler_IsRunning(
293 IRunnableObject* iface);
294 static HRESULT WINAPI DefaultHandler_LockRunning(
295 IRunnableObject* iface,
296 BOOL fLock,
297 BOOL fLastUnlockCloses);
298 static HRESULT WINAPI DefaultHandler_SetContainedObject(
299 IRunnableObject* iface,
300 BOOL fContained);
304 * Virtual function tables for the DefaultHandler class.
306 static ICOM_VTABLE(IOleObject) DefaultHandler_IOleObject_VTable =
308 DefaultHandler_QueryInterface,
309 DefaultHandler_AddRef,
310 DefaultHandler_Release,
311 DefaultHandler_SetClientSite,
312 DefaultHandler_GetClientSite,
313 DefaultHandler_SetHostNames,
314 DefaultHandler_Close,
315 DefaultHandler_SetMoniker,
316 DefaultHandler_GetMoniker,
317 DefaultHandler_InitFromData,
318 DefaultHandler_GetClipboardData,
319 DefaultHandler_DoVerb,
320 DefaultHandler_EnumVerbs,
321 DefaultHandler_Update,
322 DefaultHandler_IsUpToDate,
323 DefaultHandler_GetUserClassID,
324 DefaultHandler_GetUserType,
325 DefaultHandler_SetExtent,
326 DefaultHandler_GetExtent,
327 DefaultHandler_Advise,
328 DefaultHandler_Unadvise,
329 DefaultHandler_EnumAdvise,
330 DefaultHandler_GetMiscStatus,
331 DefaultHandler_SetColorScheme
334 static ICOM_VTABLE(IUnknown) DefaultHandler_NDIUnknown_VTable =
336 DefaultHandler_NDIUnknown_QueryInterface,
337 DefaultHandler_NDIUnknown_AddRef,
338 DefaultHandler_NDIUnknown_Release,
341 static ICOM_VTABLE(IDataObject) DefaultHandler_IDataObject_VTable =
343 DefaultHandler_IDataObject_QueryInterface,
344 DefaultHandler_IDataObject_AddRef,
345 DefaultHandler_IDataObject_Release,
346 DefaultHandler_GetData,
347 DefaultHandler_GetDataHere,
348 DefaultHandler_QueryGetData,
349 DefaultHandler_GetCanonicalFormatEtc,
350 DefaultHandler_SetData,
351 DefaultHandler_EnumFormatEtc,
352 DefaultHandler_DAdvise,
353 DefaultHandler_DUnadvise,
354 DefaultHandler_EnumDAdvise
357 static ICOM_VTABLE(IRunnableObject) DefaultHandler_IRunnableObject_VTable =
359 DefaultHandler_IRunnableObject_QueryInterface,
360 DefaultHandler_IRunnableObject_AddRef,
361 DefaultHandler_IRunnableObject_Release,
362 DefaultHandler_GetRunningClass,
363 DefaultHandler_Run,
364 DefaultHandler_IsRunning,
365 DefaultHandler_LockRunning,
366 DefaultHandler_SetContainedObject
369 /******************************************************************************
370 * OleCreateDefaultHandler [OLE32.90]
372 HRESULT WINAPI OleCreateDefaultHandler(
373 REFCLSID clsid,
374 LPUNKNOWN pUnkOuter,
375 REFIID riid,
376 LPVOID* ppvObj)
378 DefaultHandler* newHandler = NULL;
379 HRESULT hr = S_OK;
380 char xclsid[50];
381 char xriid[50];
383 WINE_StringFromCLSID((LPCLSID)clsid,xclsid);
384 WINE_StringFromCLSID((LPCLSID)riid,xriid);
386 TRACE(ole, "(%s, %p, %s, %p)\n", xclsid, pUnkOuter, xriid, ppvObj);
389 * Sanity check
391 if (ppvObj==0)
392 return E_POINTER;
394 *ppvObj = 0;
397 * If this handler is constructed for aggregation, make sure
398 * the caller is requesting the IUnknown interface.
399 * This is necessary because it's the only time the non-delegating
400 * IUnknown pointer can be returned to the outside.
402 if ( (pUnkOuter!=NULL) &&
403 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
404 return CLASS_E_NOAGGREGATION;
407 * Try to construct a new instance of the class.
409 newHandler = DefaultHandler_Construct(clsid,
410 pUnkOuter);
412 if (newHandler == 0)
413 return E_OUTOFMEMORY;
416 * Make sure it supports the interface required by the caller.
418 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
421 * Release the reference obtained in the constructor. If
422 * the QueryInterface was unsuccessful, it will free the class.
424 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
426 return hr;
429 /*********************************************************
430 * Methods implementation for the DefaultHandler class.
432 static DefaultHandler* DefaultHandler_Construct(
433 REFCLSID clsid,
434 LPUNKNOWN pUnkOuter)
436 DefaultHandler* newObject = 0;
439 * Allocate space for the object.
441 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
443 if (newObject==0)
444 return newObject;
447 * Initialize the virtual function table.
449 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
450 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
451 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
452 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
455 * Start with one reference count. The caller of this function
456 * must release the interface pointer when it is done.
458 newObject->ref = 1;
461 * Initialize the outer unknown
462 * We don't keep a reference on the outer unknown since, the way
463 * aggregation works, our lifetime is at least as large as it's
464 * lifetime.
466 if (pUnkOuter==NULL)
467 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
469 newObject->outerUnknown = pUnkOuter;
472 * Create a datacache object.
473 * We aggregate with the datacache. Make sure we pass our outer
474 * unknown as the datacache's outer unknown.
476 CreateDataCache(newObject->outerUnknown,
477 clsid,
478 &IID_IUnknown,
479 (void**)&newObject->dataCache);
482 * Initialize the other data members of the class.
484 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
485 newObject->clientSite = NULL;
486 newObject->oleAdviseHolder = NULL;
487 newObject->dataAdviseHolder = NULL;
488 newObject->containerApp = NULL;
489 newObject->containerObj = NULL;
491 return newObject;
494 static void DefaultHandler_Destroy(
495 DefaultHandler* ptrToDestroy)
498 * Free the strings idenfitying the object
500 if (ptrToDestroy->containerApp!=NULL)
502 SysFreeString(ptrToDestroy->containerApp);
503 ptrToDestroy->containerApp = NULL;
506 if (ptrToDestroy->containerObj!=NULL)
508 SysFreeString(ptrToDestroy->containerObj);
509 ptrToDestroy->containerObj = NULL;
513 * Release our reference to the data cache.
515 if (ptrToDestroy->dataCache!=NULL)
517 IUnknown_Release(ptrToDestroy->dataCache);
518 ptrToDestroy->dataCache = NULL;
522 * Same thing for the client site.
524 if (ptrToDestroy->clientSite!=NULL)
526 IOleClientSite_Release(ptrToDestroy->clientSite);
527 ptrToDestroy->clientSite = NULL;
531 * And the advise holder.
533 if (ptrToDestroy->oleAdviseHolder!=NULL)
535 IOleClientSite_Release(ptrToDestroy->oleAdviseHolder);
536 ptrToDestroy->oleAdviseHolder = NULL;
540 * And the data advise holder.
542 if (ptrToDestroy->dataAdviseHolder!=NULL)
544 IOleClientSite_Release(ptrToDestroy->dataAdviseHolder);
545 ptrToDestroy->dataAdviseHolder = NULL;
550 * Free the actual default handler structure.
552 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
555 /*********************************************************
556 * Method implementation for the non delegating IUnknown
557 * part of the DefaultHandler class.
560 /************************************************************************
561 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
563 * See Windows documentation for more details on IUnknown methods.
565 * This version of QueryInterface will not delegate it's implementation
566 * to the outer unknown.
568 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
569 IUnknown* iface,
570 REFIID riid,
571 void** ppvObject)
573 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
576 * Perform a sanity check on the parameters.
578 if ( (this==0) || (ppvObject==0) )
579 return E_INVALIDARG;
582 * Initialize the return parameter.
584 *ppvObject = 0;
587 * Compare the riid with the interface IDs implemented by this object.
589 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
591 *ppvObject = iface;
593 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
595 *ppvObject = (IOleObject*)&(this->lpvtbl1);
597 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
599 *ppvObject = (IDataObject*)&(this->lpvtbl3);
601 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
603 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
605 else
608 * Blind aggregate the data cache to "inherit" it's interfaces.
610 IUnknown_QueryInterface(this->dataCache, riid, ppvObject);
614 * Check that we obtained an interface.
616 if ((*ppvObject)==0)
618 char clsid[50];
620 WINE_StringFromCLSID((LPCLSID)riid,clsid);
622 WARN(ole,
623 "() : asking for un supported interface %s\n",
624 clsid);
626 return E_NOINTERFACE;
630 * Query Interface always increases the reference count by one when it is
631 * successful.
633 IUnknown_AddRef((IUnknown*)*ppvObject);
635 return S_OK;;
638 /************************************************************************
639 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
641 * See Windows documentation for more details on IUnknown methods.
643 * This version of QueryInterface will not delegate it's implementation
644 * to the outer unknown.
646 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
647 IUnknown* iface)
649 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
651 this->ref++;
653 return this->ref;
656 /************************************************************************
657 * DefaultHandler_NDIUnknown_Release (IUnknown)
659 * See Windows documentation for more details on IUnknown methods.
661 * This version of QueryInterface will not delegate it's implementation
662 * to the outer unknown.
664 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
665 IUnknown* iface)
667 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
670 * Decrease the reference count on this object.
672 this->ref--;
675 * If the reference count goes down to 0, perform suicide.
677 if (this->ref==0)
679 DefaultHandler_Destroy(this);
681 return 0;
684 return this->ref;
687 /*********************************************************
688 * Methods implementation for the IOleObject part of
689 * the DefaultHandler class.
692 /************************************************************************
693 * DefaultHandler_QueryInterface (IUnknown)
695 * See Windows documentation for more details on IUnknown methods.
697 static HRESULT WINAPI DefaultHandler_QueryInterface(
698 IOleObject* iface,
699 REFIID riid,
700 void** ppvObject)
702 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
704 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
707 /************************************************************************
708 * DefaultHandler_AddRef (IUnknown)
710 * See Windows documentation for more details on IUnknown methods.
712 static ULONG WINAPI DefaultHandler_AddRef(
713 IOleObject* iface)
715 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
717 return IUnknown_AddRef(this->outerUnknown);
720 /************************************************************************
721 * DefaultHandler_Release (IUnknown)
723 * See Windows documentation for more details on IUnknown methods.
725 static ULONG WINAPI DefaultHandler_Release(
726 IOleObject* iface)
728 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
730 return IUnknown_Release(this->outerUnknown);
733 /************************************************************************
734 * DefaultHandler_SetClientSite (IOleObject)
736 * The default handler's implementation of this method only keeps the
737 * client site pointer for future reference.
739 * See Windows documentation for more details on IOleObject methods.
741 static HRESULT WINAPI DefaultHandler_SetClientSite(
742 IOleObject* iface,
743 IOleClientSite* pClientSite)
745 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
747 TRACE(ole, "(%p, %p)\n", iface, pClientSite);
750 * Make sure we release the previous client site if there
751 * was one.
753 if (this->clientSite!=NULL)
755 IOleClientSite_Release(this->clientSite);
758 this->clientSite = pClientSite;
760 if (this->clientSite!=NULL)
762 IOleClientSite_AddRef(this->clientSite);
765 return S_OK;
768 /************************************************************************
769 * DefaultHandler_GetClientSite (IOleObject)
771 * The default handler's implementation of this method returns the
772 * last pointer set in IOleObject_SetClientSite.
774 * See Windows documentation for more details on IOleObject methods.
776 static HRESULT WINAPI DefaultHandler_GetClientSite(
777 IOleObject* iface,
778 IOleClientSite** ppClientSite)
780 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
783 * Sanity check.
785 if (ppClientSite == NULL)
786 return E_POINTER;
788 *ppClientSite = this->clientSite;
790 if (*ppClientSite!=NULL)
792 IOleClientSite_Release(*ppClientSite);
795 return S_OK;
798 /************************************************************************
799 * DefaultHandler_SetHostNames (IOleObject)
801 * The default handler's implementation of this method just stores
802 * the strings and returns S_OK.
804 * See Windows documentation for more details on IOleObject methods.
806 static HRESULT WINAPI DefaultHandler_SetHostNames(
807 IOleObject* iface,
808 LPCOLESTR szContainerApp,
809 LPCOLESTR szContainerObj)
811 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
813 TRACE(ole, "(%p, %s, %s)\n",
814 iface,
815 debugstr_w(szContainerApp),
816 debugstr_w(szContainerObj));
819 * Be sure to cleanup before re-assinging the strings.
821 if (this->containerApp!=NULL)
823 SysFreeString(this->containerApp);
824 this->containerApp = NULL;
827 if (this->containerObj!=NULL)
829 SysFreeString(this->containerObj);
830 this->containerObj = NULL;
834 * Copy the string supplied.
836 if (szContainerApp != NULL)
837 this->containerApp = SysAllocString(szContainerApp);
839 if (szContainerObj != NULL)
840 this->containerObj = SysAllocString(szContainerObj);
842 return S_OK;
845 /************************************************************************
846 * DefaultHandler_Close (IOleObject)
848 * The default handler's implementation of this method is meaningless
849 * without a running server so it does nothing.
851 * See Windows documentation for more details on IOleObject methods.
853 static HRESULT WINAPI DefaultHandler_Close(
854 IOleObject* iface,
855 DWORD dwSaveOption)
857 TRACE(ole, "()\n");
858 return S_OK;
861 /************************************************************************
862 * DefaultHandler_SetMoniker (IOleObject)
864 * The default handler's implementation of this method does nothing.
866 * See Windows documentation for more details on IOleObject methods.
868 static HRESULT WINAPI DefaultHandler_SetMoniker(
869 IOleObject* iface,
870 DWORD dwWhichMoniker,
871 IMoniker* pmk)
873 TRACE(ole, "(%p, %ld, %p)\n",
874 iface,
875 dwWhichMoniker,
876 pmk);
878 return S_OK;
881 /************************************************************************
882 * DefaultHandler_GetMoniker (IOleObject)
884 * Delegate this request to the client site if we have one.
886 * See Windows documentation for more details on IOleObject methods.
888 static HRESULT WINAPI DefaultHandler_GetMoniker(
889 IOleObject* iface,
890 DWORD dwAssign,
891 DWORD dwWhichMoniker,
892 IMoniker** ppmk)
894 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
896 TRACE(ole, "(%p, %ld, %ld, %p)\n",
897 iface, dwAssign, dwWhichMoniker, ppmk);
899 if (this->clientSite)
901 return IOleClientSite_GetMoniker(this->clientSite,
902 dwAssign,
903 dwWhichMoniker,
904 ppmk);
908 return E_UNSPEC;
911 /************************************************************************
912 * DefaultHandler_InitFromData (IOleObject)
914 * This method is meaningless if the server is not running
916 * See Windows documentation for more details on IOleObject methods.
918 static HRESULT WINAPI DefaultHandler_InitFromData(
919 IOleObject* iface,
920 IDataObject* pDataObject,
921 BOOL fCreation,
922 DWORD dwReserved)
924 TRACE(ole, "(%p, %p, %d, %ld)\n",
925 iface, pDataObject, fCreation, dwReserved);
927 return OLE_E_NOTRUNNING;
930 /************************************************************************
931 * DefaultHandler_GetClipboardData (IOleObject)
933 * This method is meaningless if the server is not running
935 * See Windows documentation for more details on IOleObject methods.
937 static HRESULT WINAPI DefaultHandler_GetClipboardData(
938 IOleObject* iface,
939 DWORD dwReserved,
940 IDataObject** ppDataObject)
942 TRACE(ole, "(%p, %ld, %p)\n",
943 iface, dwReserved, ppDataObject);
945 return OLE_E_NOTRUNNING;
948 static HRESULT WINAPI DefaultHandler_DoVerb(
949 IOleObject* iface,
950 LONG iVerb,
951 LPMSG lpmsg,
952 IOleClientSite* pActiveSite,
953 LONG lindex,
954 HWND hwndParent,
955 LPCRECT lprcPosRect)
957 FIXME(ole, ": Stub\n");
958 return E_NOTIMPL;
961 /************************************************************************
962 * DefaultHandler_EnumVerbs (IOleObject)
964 * The default handler implementation of this method simply delegates
965 * to OleRegEnumVerbs
967 * See Windows documentation for more details on IOleObject methods.
969 static HRESULT WINAPI DefaultHandler_EnumVerbs(
970 IOleObject* iface,
971 IEnumOLEVERB** ppEnumOleVerb)
973 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
975 TRACE(ole, "(%p, %p)\n", iface, ppEnumOleVerb);
977 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
980 static HRESULT WINAPI DefaultHandler_Update(
981 IOleObject* iface)
983 FIXME(ole, ": Stub\n");
984 return E_NOTIMPL;
987 /************************************************************************
988 * DefaultHandler_IsUpToDate (IOleObject)
990 * This method is meaningless if the server is not running
992 * See Windows documentation for more details on IOleObject methods.
994 static HRESULT WINAPI DefaultHandler_IsUpToDate(
995 IOleObject* iface)
997 TRACE(ole, "(%p)\n", iface);
999 return OLE_E_NOTRUNNING;
1002 /************************************************************************
1003 * DefaultHandler_GetUserClassID (IOleObject)
1005 * TODO: Map to a new class ID if emulation is active.
1007 * See Windows documentation for more details on IOleObject methods.
1009 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1010 IOleObject* iface,
1011 CLSID* pClsid)
1013 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1015 TRACE(ole, "(%p, %p)\n", iface, pClsid);
1018 * Sanity check.
1020 if (pClsid==NULL)
1021 return E_POINTER;
1023 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1025 return S_OK;
1028 /************************************************************************
1029 * DefaultHandler_GetUserType (IOleObject)
1031 * The default handler implementation of this method simply delegates
1032 * to OleRegGetUserType
1034 * See Windows documentation for more details on IOleObject methods.
1036 static HRESULT WINAPI DefaultHandler_GetUserType(
1037 IOleObject* iface,
1038 DWORD dwFormOfType,
1039 LPOLESTR* pszUserType)
1041 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1043 TRACE(ole, "(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1045 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1048 /************************************************************************
1049 * DefaultHandler_SetExtent (IOleObject)
1051 * This method is meaningless if the server is not running
1053 * See Windows documentation for more details on IOleObject methods.
1055 static HRESULT WINAPI DefaultHandler_SetExtent(
1056 IOleObject* iface,
1057 DWORD dwDrawAspect,
1058 SIZEL* psizel)
1060 TRACE(ole, "(%p, %lx, (%d,%d))\n", iface, dwDrawAspect, psizel->cx, psizel->cy);
1061 return OLE_E_NOTRUNNING;
1064 /************************************************************************
1065 * DefaultHandler_GetExtent (IOleObject)
1067 * The default handler's implementation of this method returns uses
1068 * the cache to locate the aspect and extract the extent from it.
1070 * See Windows documentation for more details on IOleObject methods.
1072 static HRESULT WINAPI DefaultHandler_GetExtent(
1073 IOleObject* iface,
1074 DWORD dwDrawAspect,
1075 SIZEL* psizel)
1077 DVTARGETDEVICE* targetDevice;
1078 IViewObject2* cacheView = NULL;
1079 HRESULT hres;
1081 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1083 TRACE(ole, "(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1085 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1087 if (FAILED(hres))
1088 return E_UNEXPECTED;
1091 * Prepare the call to the cache's GetExtent method.
1093 * Here we would build a valid DVTARGETDEVICE structure
1094 * but, since we are calling into the data cache, we
1095 * know it's implementation and we'll skip this
1096 * extra work until later.
1098 targetDevice = NULL;
1100 hres = IViewObject2_GetExtent(cacheView,
1101 dwDrawAspect,
1103 targetDevice,
1104 psizel);
1107 * Cleanup
1109 IViewObject2_Release(cacheView);
1111 return hres;
1114 /************************************************************************
1115 * DefaultHandler_Advise (IOleObject)
1117 * The default handler's implementation of this method simply
1118 * delegates to the OleAdviseHolder.
1120 * See Windows documentation for more details on IOleObject methods.
1122 static HRESULT WINAPI DefaultHandler_Advise(
1123 IOleObject* iface,
1124 IAdviseSink* pAdvSink,
1125 DWORD* pdwConnection)
1127 HRESULT hres = S_OK;
1128 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1130 TRACE(ole, "(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1133 * Make sure we have an advise holder before we start.
1135 if (this->oleAdviseHolder==NULL)
1137 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1140 if (SUCCEEDED(hres))
1142 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1143 pAdvSink,
1144 pdwConnection);
1147 return hres;
1150 /************************************************************************
1151 * DefaultHandler_Unadvise (IOleObject)
1153 * The default handler's implementation of this method simply
1154 * delegates to the OleAdviseHolder.
1156 * See Windows documentation for more details on IOleObject methods.
1158 static HRESULT WINAPI DefaultHandler_Unadvise(
1159 IOleObject* iface,
1160 DWORD dwConnection)
1162 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1164 TRACE(ole, "(%p, %ld)\n", iface, dwConnection);
1167 * If we don't have an advise holder yet, it means we don't have
1168 * a connection.
1170 if (this->oleAdviseHolder==NULL)
1171 return OLE_E_NOCONNECTION;
1173 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1174 dwConnection);
1177 /************************************************************************
1178 * DefaultHandler_EnumAdvise (IOleObject)
1180 * The default handler's implementation of this method simply
1181 * delegates to the OleAdviseHolder.
1183 * See Windows documentation for more details on IOleObject methods.
1185 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1186 IOleObject* iface,
1187 IEnumSTATDATA** ppenumAdvise)
1189 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1191 TRACE(ole, "(%p, %p)\n", iface, ppenumAdvise);
1194 * Sanity check
1196 if (ppenumAdvise==NULL)
1197 return E_POINTER;
1200 * Initialize the out parameter.
1202 *ppenumAdvise = NULL;
1204 if (this->oleAdviseHolder==NULL)
1205 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1206 ppenumAdvise);
1208 return S_OK;
1211 /************************************************************************
1212 * DefaultHandler_GetMiscStatus (IOleObject)
1214 * The default handler's implementation of this method simply delegates
1215 * to OleRegGetMiscStatus.
1217 * See Windows documentation for more details on IOleObject methods.
1219 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1220 IOleObject* iface,
1221 DWORD dwAspect,
1222 DWORD* pdwStatus)
1224 HRESULT hres;
1225 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1227 TRACE(ole, "(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1229 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1231 if (FAILED(hres))
1232 *pdwStatus = 0;
1234 return S_OK;
1237 /************************************************************************
1238 * DefaultHandler_SetExtent (IOleObject)
1240 * This method is meaningless if the server is not running
1242 * See Windows documentation for more details on IOleObject methods.
1244 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1245 IOleObject* iface,
1246 LOGPALETTE* pLogpal)
1248 TRACE(ole, "(%p, %p))\n", iface, pLogpal);
1249 return OLE_E_NOTRUNNING;
1252 /*********************************************************
1253 * Methods implementation for the IDataObject part of
1254 * the DefaultHandler class.
1257 /************************************************************************
1258 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1260 * See Windows documentation for more details on IUnknown methods.
1262 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1263 IDataObject* iface,
1264 REFIID riid,
1265 void** ppvObject)
1267 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1269 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1272 /************************************************************************
1273 * DefaultHandler_IDataObject_AddRef (IUnknown)
1275 * See Windows documentation for more details on IUnknown methods.
1277 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1278 IDataObject* iface)
1280 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1282 return IUnknown_AddRef(this->outerUnknown);
1285 /************************************************************************
1286 * DefaultHandler_IDataObject_Release (IUnknown)
1288 * See Windows documentation for more details on IUnknown methods.
1290 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1291 IDataObject* iface)
1293 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1295 return IUnknown_Release(this->outerUnknown);
1298 static HRESULT WINAPI DefaultHandler_GetData(
1299 IDataObject* iface,
1300 LPFORMATETC pformatetcIn,
1301 STGMEDIUM* pmedium)
1303 FIXME(ole, ": Stub\n");
1304 return E_NOTIMPL;
1307 static HRESULT WINAPI DefaultHandler_GetDataHere(
1308 IDataObject* iface,
1309 LPFORMATETC pformatetc,
1310 STGMEDIUM* pmedium)
1312 FIXME(ole, ": Stub\n");
1313 return E_NOTIMPL;
1316 /************************************************************************
1317 * DefaultHandler_QueryGetData (IDataObject)
1319 * The default handler's implementation of this method delegates to
1320 * the cache.
1322 * See Windows documentation for more details on IDataObject methods.
1324 static HRESULT WINAPI DefaultHandler_QueryGetData(
1325 IDataObject* iface,
1326 LPFORMATETC pformatetc)
1328 IDataObject* cacheDataObject = NULL;
1329 HRESULT hres;
1331 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1333 TRACE(ole, "(%p, %p)\n", iface, pformatetc);
1335 hres = IUnknown_QueryInterface(this->dataCache,
1336 &IID_IDataObject,
1337 (void**)&cacheDataObject);
1339 if (FAILED(hres))
1340 return E_UNEXPECTED;
1342 hres = IDataObject_QueryGetData(cacheDataObject,
1343 pformatetc);
1345 IDataObject_Release(cacheDataObject);
1347 return hres;
1350 /************************************************************************
1351 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1353 * This method is meaningless if the server is not running
1355 * See Windows documentation for more details on IDataObject methods.
1357 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1358 IDataObject* iface,
1359 LPFORMATETC pformatectIn,
1360 LPFORMATETC pformatetcOut)
1362 FIXME(ole, "(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1364 return OLE_E_NOTRUNNING;
1367 /************************************************************************
1368 * DefaultHandler_SetData (IDataObject)
1370 * The default handler's implementation of this method delegates to
1371 * the cache.
1373 * See Windows documentation for more details on IDataObject methods.
1375 static HRESULT WINAPI DefaultHandler_SetData(
1376 IDataObject* iface,
1377 LPFORMATETC pformatetc,
1378 STGMEDIUM* pmedium,
1379 BOOL fRelease)
1381 IDataObject* cacheDataObject = NULL;
1382 HRESULT hres;
1384 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1386 TRACE(ole, "(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1388 hres = IUnknown_QueryInterface(this->dataCache,
1389 &IID_IDataObject,
1390 (void**)&cacheDataObject);
1392 if (FAILED(hres))
1393 return E_UNEXPECTED;
1395 hres = IDataObject_SetData(cacheDataObject,
1396 pformatetc,
1397 pmedium,
1398 fRelease);
1400 IDataObject_Release(cacheDataObject);
1402 return hres;
1405 /************************************************************************
1406 * DefaultHandler_EnumFormatEtc (IDataObject)
1408 * The default handler's implementation of this method simply delegates
1409 * to OleRegEnumFormatEtc.
1411 * See Windows documentation for more details on IDataObject methods.
1413 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1414 IDataObject* iface,
1415 DWORD dwDirection,
1416 IEnumFORMATETC** ppenumFormatEtc)
1418 HRESULT hres;
1419 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1421 TRACE(ole, "(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1423 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1425 return hres;
1428 /************************************************************************
1429 * DefaultHandler_DAdvise (IDataObject)
1431 * The default handler's implementation of this method simply
1432 * delegates to the DataAdviseHolder.
1434 * See Windows documentation for more details on IDataObject methods.
1436 static HRESULT WINAPI DefaultHandler_DAdvise(
1437 IDataObject* iface,
1438 FORMATETC* pformatetc,
1439 DWORD advf,
1440 IAdviseSink* pAdvSink,
1441 DWORD* pdwConnection)
1443 HRESULT hres = S_OK;
1444 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1446 TRACE(ole, "(%p, %p, %ld, %p, %p)\n",
1447 iface, pformatetc, advf, pAdvSink, pdwConnection);
1450 * Make sure we have a data advise holder before we start.
1452 if (this->dataAdviseHolder==NULL)
1454 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1457 if (SUCCEEDED(hres))
1459 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1460 iface,
1461 pformatetc,
1462 advf,
1463 pAdvSink,
1464 pdwConnection);
1467 return hres;
1470 /************************************************************************
1471 * DefaultHandler_DUnadvise (IDataObject)
1473 * The default handler's implementation of this method simply
1474 * delegates to the DataAdviseHolder.
1476 * See Windows documentation for more details on IDataObject methods.
1478 static HRESULT WINAPI DefaultHandler_DUnadvise(
1479 IDataObject* iface,
1480 DWORD dwConnection)
1482 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1484 TRACE(ole, "(%p, %ld)\n", iface, dwConnection);
1487 * If we don't have a data advise holder yet, it means that
1488 * we don't have any connections..
1490 if (this->dataAdviseHolder==NULL)
1492 return OLE_E_NOCONNECTION;
1495 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1496 dwConnection);
1499 /************************************************************************
1500 * DefaultHandler_EnumDAdvise (IDataObject)
1502 * The default handler's implementation of this method simply
1503 * delegates to the DataAdviseHolder.
1505 * See Windows documentation for more details on IDataObject methods.
1507 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1508 IDataObject* iface,
1509 IEnumSTATDATA** ppenumAdvise)
1511 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1513 TRACE(ole, "(%p, %p)\n", iface, ppenumAdvise);
1516 * Sanity check
1518 if (ppenumAdvise == NULL)
1519 return E_POINTER;
1522 * Initialize the out parameter.
1524 *ppenumAdvise = NULL;
1527 * If we have a data advise holder object, delegate.
1529 if (this->dataAdviseHolder!=NULL)
1531 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1532 ppenumAdvise);
1535 return S_OK;
1538 /*********************************************************
1539 * Methods implementation for the IRunnableObject part
1540 * of the DefaultHandler class.
1543 /************************************************************************
1544 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1546 * See Windows documentation for more details on IUnknown methods.
1548 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1549 IRunnableObject* iface,
1550 REFIID riid,
1551 void** ppvObject)
1553 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1555 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1558 /************************************************************************
1559 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1561 * See Windows documentation for more details on IUnknown methods.
1563 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1564 IRunnableObject* iface)
1566 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1568 return IUnknown_AddRef(this->outerUnknown);
1571 /************************************************************************
1572 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1574 * See Windows documentation for more details on IUnknown methods.
1576 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1577 IRunnableObject* iface)
1579 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1581 return IUnknown_Release(this->outerUnknown);
1584 /************************************************************************
1585 * DefaultHandler_GetRunningClass (IRunnableObject)
1587 * According to Brockscmidt, Chapter 19, the default handler's
1588 * implementation of IRunnableobject does nothing until the object
1589 * is actually running.
1591 * See Windows documentation for more details on IRunnableObject methods.
1593 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1594 IRunnableObject* iface,
1595 LPCLSID lpClsid)
1597 TRACE(ole, "()\n");
1598 return S_OK;
1601 static HRESULT WINAPI DefaultHandler_Run(
1602 IRunnableObject* iface,
1603 IBindCtx* pbc)
1605 FIXME(ole, ": Stub\n");
1606 return E_NOTIMPL;
1609 /************************************************************************
1610 * DefaultHandler_IsRunning (IRunnableObject)
1612 * According to Brockscmidt, Chapter 19, the default handler's
1613 * implementation of IRunnableobject does nothing until the object
1614 * is actually running.
1616 * See Windows documentation for more details on IRunnableObject methods.
1618 static BOOL WINAPI DefaultHandler_IsRunning(
1619 IRunnableObject* iface)
1621 TRACE(ole, "()\n");
1622 return S_FALSE;
1625 /************************************************************************
1626 * DefaultHandler_LockRunning (IRunnableObject)
1628 * According to Brockscmidt, Chapter 19, the default handler's
1629 * implementation of IRunnableobject does nothing until the object
1630 * is actually running.
1632 * See Windows documentation for more details on IRunnableObject methods.
1634 static HRESULT WINAPI DefaultHandler_LockRunning(
1635 IRunnableObject* iface,
1636 BOOL fLock,
1637 BOOL fLastUnlockCloses)
1639 TRACE(ole, "()\n");
1640 return S_OK;
1643 /************************************************************************
1644 * DefaultHandler_SetContainedObject (IRunnableObject)
1646 * According to Brockscmidt, Chapter 19, the default handler's
1647 * implementation of IRunnableobject does nothing until the object
1648 * is actually running.
1650 * See Windows documentation for more details on IRunnableObject methods.
1652 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1653 IRunnableObject* iface,
1654 BOOL fContained)
1656 TRACE(ole, "()\n");
1657 return S_OK;