- Implement interprocess clipboard communication.
[wine.git] / ole / defaulthandler.c
blob89e9b5b09d68c07a33f224caf8c69436c5ee3728
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 related to notification and advise sinks are
31 * in place but no notifications are sent to the sinks yet.
33 #include <assert.h>
35 #include "winbase.h"
36 #include "oleauto.h" /* for SysFreeString(BSTR) */
37 #include "winerror.h"
38 #include "ole2.h"
39 #include "wine/obj_oleview.h"
40 #include "debugtools.h"
42 DEFAULT_DEBUG_CHANNEL(ole)
44 /****************************************************************************
45 * DefaultHandler
48 struct DefaultHandler
51 * List all interface VTables here
53 ICOM_VTABLE(IOleObject)* lpvtbl1;
54 ICOM_VTABLE(IUnknown)* lpvtbl2;
55 ICOM_VTABLE(IDataObject)* lpvtbl3;
56 ICOM_VTABLE(IRunnableObject)* lpvtbl4;
59 * Reference count of this object
61 ULONG ref;
64 * IUnknown implementation of the outer object.
66 IUnknown* outerUnknown;
69 * Class Id that this handler object represents.
71 CLSID clsid;
74 * IUnknown implementation of the datacache.
76 IUnknown* dataCache;
79 * Client site for the embedded object.
81 IOleClientSite* clientSite;
84 * The IOleAdviseHolder maintains the connections
85 * on behalf of the default handler.
87 IOleAdviseHolder* oleAdviseHolder;
90 * The IDataAdviseHolder maintains the data
91 * connections on behalf of the default handler.
93 IDataAdviseHolder* dataAdviseHolder;
96 * Name of the container and object contained
98 BSTR containerApp;
99 BSTR containerObj;
103 typedef struct DefaultHandler DefaultHandler;
106 * Here, I define utility macros to help with the casting of the
107 * "this" parameter.
108 * There is a version to accomodate all of the VTables implemented
109 * by this object.
111 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name;
112 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
113 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
114 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
117 * Prototypes for the methods of the DefaultHandler class.
119 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
120 LPUNKNOWN pUnkOuter);
121 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
124 * Prototypes for the methods of the DefaultHandler class
125 * that implement non delegating IUnknown methods.
127 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
128 IUnknown* iface,
129 REFIID riid,
130 void** ppvObject);
131 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
132 IUnknown* iface);
133 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
134 IUnknown* iface);
137 * Prototypes for the methods of the DefaultHandler class
138 * that implement IOleObject methods.
140 static HRESULT WINAPI DefaultHandler_QueryInterface(
141 IOleObject* iface,
142 REFIID riid,
143 void** ppvObject);
144 static ULONG WINAPI DefaultHandler_AddRef(
145 IOleObject* iface);
146 static ULONG WINAPI DefaultHandler_Release(
147 IOleObject* iface);
148 static HRESULT WINAPI DefaultHandler_SetClientSite(
149 IOleObject* iface,
150 IOleClientSite* pClientSite);
151 static HRESULT WINAPI DefaultHandler_GetClientSite(
152 IOleObject* iface,
153 IOleClientSite** ppClientSite);
154 static HRESULT WINAPI DefaultHandler_SetHostNames(
155 IOleObject* iface,
156 LPCOLESTR szContainerApp,
157 LPCOLESTR szContainerObj);
158 static HRESULT WINAPI DefaultHandler_Close(
159 IOleObject* iface,
160 DWORD dwSaveOption);
161 static HRESULT WINAPI DefaultHandler_SetMoniker(
162 IOleObject* iface,
163 DWORD dwWhichMoniker,
164 IMoniker* pmk);
165 static HRESULT WINAPI DefaultHandler_GetMoniker(
166 IOleObject* iface,
167 DWORD dwAssign,
168 DWORD dwWhichMoniker,
169 IMoniker** ppmk);
170 static HRESULT WINAPI DefaultHandler_InitFromData(
171 IOleObject* iface,
172 IDataObject* pDataObject,
173 BOOL fCreation,
174 DWORD dwReserved);
175 static HRESULT WINAPI DefaultHandler_GetClipboardData(
176 IOleObject* iface,
177 DWORD dwReserved,
178 IDataObject** ppDataObject);
179 static HRESULT WINAPI DefaultHandler_DoVerb(
180 IOleObject* iface,
181 LONG iVerb,
182 struct tagMSG* lpmsg,
183 IOleClientSite* pActiveSite,
184 LONG lindex,
185 HWND hwndParent,
186 LPCRECT lprcPosRect);
187 static HRESULT WINAPI DefaultHandler_EnumVerbs(
188 IOleObject* iface,
189 IEnumOLEVERB** ppEnumOleVerb);
190 static HRESULT WINAPI DefaultHandler_Update(
191 IOleObject* iface);
192 static HRESULT WINAPI DefaultHandler_IsUpToDate(
193 IOleObject* iface);
194 static HRESULT WINAPI DefaultHandler_GetUserClassID(
195 IOleObject* iface,
196 CLSID* pClsid);
197 static HRESULT WINAPI DefaultHandler_GetUserType(
198 IOleObject* iface,
199 DWORD dwFormOfType,
200 LPOLESTR* pszUserType);
201 static HRESULT WINAPI DefaultHandler_SetExtent(
202 IOleObject* iface,
203 DWORD dwDrawAspect,
204 SIZEL* psizel);
205 static HRESULT WINAPI DefaultHandler_GetExtent(
206 IOleObject* iface,
207 DWORD dwDrawAspect,
208 SIZEL* psizel);
209 static HRESULT WINAPI DefaultHandler_Advise(
210 IOleObject* iface,
211 IAdviseSink* pAdvSink,
212 DWORD* pdwConnection);
213 static HRESULT WINAPI DefaultHandler_Unadvise(
214 IOleObject* iface,
215 DWORD dwConnection);
216 static HRESULT WINAPI DefaultHandler_EnumAdvise(
217 IOleObject* iface,
218 IEnumSTATDATA** ppenumAdvise);
219 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
220 IOleObject* iface,
221 DWORD dwAspect,
222 DWORD* pdwStatus);
223 static HRESULT WINAPI DefaultHandler_SetColorScheme(
224 IOleObject* iface,
225 struct tagLOGPALETTE* pLogpal);
228 * Prototypes for the methods of the DefaultHandler class
229 * that implement IDataObject methods.
231 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
232 IDataObject* iface,
233 REFIID riid,
234 void** ppvObject);
235 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
236 IDataObject* iface);
237 static ULONG WINAPI DefaultHandler_IDataObject_Release(
238 IDataObject* iface);
239 static HRESULT WINAPI DefaultHandler_GetData(
240 IDataObject* iface,
241 LPFORMATETC pformatetcIn,
242 STGMEDIUM* pmedium);
243 static HRESULT WINAPI DefaultHandler_GetDataHere(
244 IDataObject* iface,
245 LPFORMATETC pformatetc,
246 STGMEDIUM* pmedium);
247 static HRESULT WINAPI DefaultHandler_QueryGetData(
248 IDataObject* iface,
249 LPFORMATETC pformatetc);
250 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
251 IDataObject* iface,
252 LPFORMATETC pformatectIn,
253 LPFORMATETC pformatetcOut);
254 static HRESULT WINAPI DefaultHandler_SetData(
255 IDataObject* iface,
256 LPFORMATETC pformatetc,
257 STGMEDIUM* pmedium,
258 BOOL fRelease);
259 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
260 IDataObject* iface,
261 DWORD dwDirection,
262 IEnumFORMATETC** ppenumFormatEtc);
263 static HRESULT WINAPI DefaultHandler_DAdvise(
264 IDataObject* iface,
265 FORMATETC* pformatetc,
266 DWORD advf,
267 IAdviseSink* pAdvSink,
268 DWORD* pdwConnection);
269 static HRESULT WINAPI DefaultHandler_DUnadvise(
270 IDataObject* iface,
271 DWORD dwConnection);
272 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
273 IDataObject* iface,
274 IEnumSTATDATA** ppenumAdvise);
277 * Prototypes for the methods of the DefaultHandler class
278 * that implement IRunnableObject methods.
280 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
281 IRunnableObject* iface,
282 REFIID riid,
283 void** ppvObject);
284 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
285 IRunnableObject* iface);
286 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
287 IRunnableObject* iface);
288 static HRESULT WINAPI DefaultHandler_GetRunningClass(
289 IRunnableObject* iface,
290 LPCLSID lpClsid);
291 static HRESULT WINAPI DefaultHandler_Run(
292 IRunnableObject* iface,
293 IBindCtx* pbc);
294 static BOOL WINAPI DefaultHandler_IsRunning(
295 IRunnableObject* iface);
296 static HRESULT WINAPI DefaultHandler_LockRunning(
297 IRunnableObject* iface,
298 BOOL fLock,
299 BOOL fLastUnlockCloses);
300 static HRESULT WINAPI DefaultHandler_SetContainedObject(
301 IRunnableObject* iface,
302 BOOL fContained);
306 * Virtual function tables for the DefaultHandler class.
308 static ICOM_VTABLE(IOleObject) DefaultHandler_IOleObject_VTable =
310 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
311 DefaultHandler_QueryInterface,
312 DefaultHandler_AddRef,
313 DefaultHandler_Release,
314 DefaultHandler_SetClientSite,
315 DefaultHandler_GetClientSite,
316 DefaultHandler_SetHostNames,
317 DefaultHandler_Close,
318 DefaultHandler_SetMoniker,
319 DefaultHandler_GetMoniker,
320 DefaultHandler_InitFromData,
321 DefaultHandler_GetClipboardData,
322 DefaultHandler_DoVerb,
323 DefaultHandler_EnumVerbs,
324 DefaultHandler_Update,
325 DefaultHandler_IsUpToDate,
326 DefaultHandler_GetUserClassID,
327 DefaultHandler_GetUserType,
328 DefaultHandler_SetExtent,
329 DefaultHandler_GetExtent,
330 DefaultHandler_Advise,
331 DefaultHandler_Unadvise,
332 DefaultHandler_EnumAdvise,
333 DefaultHandler_GetMiscStatus,
334 DefaultHandler_SetColorScheme
337 static ICOM_VTABLE(IUnknown) DefaultHandler_NDIUnknown_VTable =
339 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
340 DefaultHandler_NDIUnknown_QueryInterface,
341 DefaultHandler_NDIUnknown_AddRef,
342 DefaultHandler_NDIUnknown_Release,
345 static ICOM_VTABLE(IDataObject) DefaultHandler_IDataObject_VTable =
347 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
348 DefaultHandler_IDataObject_QueryInterface,
349 DefaultHandler_IDataObject_AddRef,
350 DefaultHandler_IDataObject_Release,
351 DefaultHandler_GetData,
352 DefaultHandler_GetDataHere,
353 DefaultHandler_QueryGetData,
354 DefaultHandler_GetCanonicalFormatEtc,
355 DefaultHandler_SetData,
356 DefaultHandler_EnumFormatEtc,
357 DefaultHandler_DAdvise,
358 DefaultHandler_DUnadvise,
359 DefaultHandler_EnumDAdvise
362 static ICOM_VTABLE(IRunnableObject) DefaultHandler_IRunnableObject_VTable =
364 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
365 DefaultHandler_IRunnableObject_QueryInterface,
366 DefaultHandler_IRunnableObject_AddRef,
367 DefaultHandler_IRunnableObject_Release,
368 DefaultHandler_GetRunningClass,
369 DefaultHandler_Run,
370 DefaultHandler_IsRunning,
371 DefaultHandler_LockRunning,
372 DefaultHandler_SetContainedObject
375 /******************************************************************************
376 * OleCreateDefaultHandler [OLE32.90]
378 HRESULT WINAPI OleCreateDefaultHandler(
379 REFCLSID clsid,
380 LPUNKNOWN pUnkOuter,
381 REFIID riid,
382 LPVOID* ppvObj)
384 DefaultHandler* newHandler = NULL;
385 HRESULT hr = S_OK;
386 char xclsid[50];
387 char xriid[50];
389 WINE_StringFromCLSID((LPCLSID)clsid,xclsid);
390 WINE_StringFromCLSID((LPCLSID)riid,xriid);
392 TRACE("(%s, %p, %s, %p)\n", xclsid, pUnkOuter, xriid, ppvObj);
395 * Sanity check
397 if (ppvObj==0)
398 return E_POINTER;
400 *ppvObj = 0;
403 * If this handler is constructed for aggregation, make sure
404 * the caller is requesting the IUnknown interface.
405 * This is necessary because it's the only time the non-delegating
406 * IUnknown pointer can be returned to the outside.
408 if ( (pUnkOuter!=NULL) &&
409 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
410 return CLASS_E_NOAGGREGATION;
413 * Try to construct a new instance of the class.
415 newHandler = DefaultHandler_Construct(clsid,
416 pUnkOuter);
418 if (newHandler == 0)
419 return E_OUTOFMEMORY;
422 * Make sure it supports the interface required by the caller.
424 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
427 * Release the reference obtained in the constructor. If
428 * the QueryInterface was unsuccessful, it will free the class.
430 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
432 return hr;
435 /*********************************************************
436 * Methods implementation for the DefaultHandler class.
438 static DefaultHandler* DefaultHandler_Construct(
439 REFCLSID clsid,
440 LPUNKNOWN pUnkOuter)
442 DefaultHandler* newObject = 0;
445 * Allocate space for the object.
447 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
449 if (newObject==0)
450 return newObject;
453 * Initialize the virtual function table.
455 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
456 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
457 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
458 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
461 * Start with one reference count. The caller of this function
462 * must release the interface pointer when it is done.
464 newObject->ref = 1;
467 * Initialize the outer unknown
468 * We don't keep a reference on the outer unknown since, the way
469 * aggregation works, our lifetime is at least as large as it's
470 * lifetime.
472 if (pUnkOuter==NULL)
473 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
475 newObject->outerUnknown = pUnkOuter;
478 * Create a datacache object.
479 * We aggregate with the datacache. Make sure we pass our outer
480 * unknown as the datacache's outer unknown.
482 CreateDataCache(newObject->outerUnknown,
483 clsid,
484 &IID_IUnknown,
485 (void**)&newObject->dataCache);
488 * Initialize the other data members of the class.
490 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
491 newObject->clientSite = NULL;
492 newObject->oleAdviseHolder = NULL;
493 newObject->dataAdviseHolder = NULL;
494 newObject->containerApp = NULL;
495 newObject->containerObj = NULL;
497 return newObject;
500 static void DefaultHandler_Destroy(
501 DefaultHandler* ptrToDestroy)
504 * Free the strings idenfitying the object
506 if (ptrToDestroy->containerApp!=NULL)
508 SysFreeString(ptrToDestroy->containerApp);
509 ptrToDestroy->containerApp = NULL;
512 if (ptrToDestroy->containerObj!=NULL)
514 SysFreeString(ptrToDestroy->containerObj);
515 ptrToDestroy->containerObj = NULL;
519 * Release our reference to the data cache.
521 if (ptrToDestroy->dataCache!=NULL)
523 IUnknown_Release(ptrToDestroy->dataCache);
524 ptrToDestroy->dataCache = NULL;
528 * Same thing for the client site.
530 if (ptrToDestroy->clientSite!=NULL)
532 IOleClientSite_Release(ptrToDestroy->clientSite);
533 ptrToDestroy->clientSite = NULL;
537 * And the advise holder.
539 if (ptrToDestroy->oleAdviseHolder!=NULL)
541 IOleClientSite_Release(ptrToDestroy->oleAdviseHolder);
542 ptrToDestroy->oleAdviseHolder = NULL;
546 * And the data advise holder.
548 if (ptrToDestroy->dataAdviseHolder!=NULL)
550 IOleClientSite_Release(ptrToDestroy->dataAdviseHolder);
551 ptrToDestroy->dataAdviseHolder = NULL;
556 * Free the actual default handler structure.
558 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
561 /*********************************************************
562 * Method implementation for the non delegating IUnknown
563 * part of the DefaultHandler class.
566 /************************************************************************
567 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
569 * See Windows documentation for more details on IUnknown methods.
571 * This version of QueryInterface will not delegate it's implementation
572 * to the outer unknown.
574 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
575 IUnknown* iface,
576 REFIID riid,
577 void** ppvObject)
579 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
582 * Perform a sanity check on the parameters.
584 if ( (this==0) || (ppvObject==0) )
585 return E_INVALIDARG;
588 * Initialize the return parameter.
590 *ppvObject = 0;
593 * Compare the riid with the interface IDs implemented by this object.
595 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
597 *ppvObject = iface;
599 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
601 *ppvObject = (IOleObject*)&(this->lpvtbl1);
603 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
605 *ppvObject = (IDataObject*)&(this->lpvtbl3);
607 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
609 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
611 else
614 * Blind aggregate the data cache to "inherit" it's interfaces.
616 IUnknown_QueryInterface(this->dataCache, riid, ppvObject);
620 * Check that we obtained an interface.
622 if ((*ppvObject)==0)
624 char clsid[50];
626 WINE_StringFromCLSID((LPCLSID)riid,clsid);
628 WARN(
629 "() : asking for un supported interface %s\n",
630 clsid);
632 return E_NOINTERFACE;
636 * Query Interface always increases the reference count by one when it is
637 * successful.
639 IUnknown_AddRef((IUnknown*)*ppvObject);
641 return S_OK;;
644 /************************************************************************
645 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
647 * See Windows documentation for more details on IUnknown methods.
649 * This version of QueryInterface will not delegate it's implementation
650 * to the outer unknown.
652 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
653 IUnknown* iface)
655 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
657 this->ref++;
659 return this->ref;
662 /************************************************************************
663 * DefaultHandler_NDIUnknown_Release (IUnknown)
665 * See Windows documentation for more details on IUnknown methods.
667 * This version of QueryInterface will not delegate it's implementation
668 * to the outer unknown.
670 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
671 IUnknown* iface)
673 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
676 * Decrease the reference count on this object.
678 this->ref--;
681 * If the reference count goes down to 0, perform suicide.
683 if (this->ref==0)
685 DefaultHandler_Destroy(this);
687 return 0;
690 return this->ref;
693 /*********************************************************
694 * Methods implementation for the IOleObject part of
695 * the DefaultHandler class.
698 /************************************************************************
699 * DefaultHandler_QueryInterface (IUnknown)
701 * See Windows documentation for more details on IUnknown methods.
703 static HRESULT WINAPI DefaultHandler_QueryInterface(
704 IOleObject* iface,
705 REFIID riid,
706 void** ppvObject)
708 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
710 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
713 /************************************************************************
714 * DefaultHandler_AddRef (IUnknown)
716 * See Windows documentation for more details on IUnknown methods.
718 static ULONG WINAPI DefaultHandler_AddRef(
719 IOleObject* iface)
721 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
723 return IUnknown_AddRef(this->outerUnknown);
726 /************************************************************************
727 * DefaultHandler_Release (IUnknown)
729 * See Windows documentation for more details on IUnknown methods.
731 static ULONG WINAPI DefaultHandler_Release(
732 IOleObject* iface)
734 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
736 return IUnknown_Release(this->outerUnknown);
739 /************************************************************************
740 * DefaultHandler_SetClientSite (IOleObject)
742 * The default handler's implementation of this method only keeps the
743 * client site pointer for future reference.
745 * See Windows documentation for more details on IOleObject methods.
747 static HRESULT WINAPI DefaultHandler_SetClientSite(
748 IOleObject* iface,
749 IOleClientSite* pClientSite)
751 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
753 TRACE("(%p, %p)\n", iface, pClientSite);
756 * Make sure we release the previous client site if there
757 * was one.
759 if (this->clientSite!=NULL)
761 IOleClientSite_Release(this->clientSite);
764 this->clientSite = pClientSite;
766 if (this->clientSite!=NULL)
768 IOleClientSite_AddRef(this->clientSite);
771 return S_OK;
774 /************************************************************************
775 * DefaultHandler_GetClientSite (IOleObject)
777 * The default handler's implementation of this method returns the
778 * last pointer set in IOleObject_SetClientSite.
780 * See Windows documentation for more details on IOleObject methods.
782 static HRESULT WINAPI DefaultHandler_GetClientSite(
783 IOleObject* iface,
784 IOleClientSite** ppClientSite)
786 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
789 * Sanity check.
791 if (ppClientSite == NULL)
792 return E_POINTER;
794 *ppClientSite = this->clientSite;
796 if (*ppClientSite!=NULL)
798 IOleClientSite_Release(*ppClientSite);
801 return S_OK;
804 /************************************************************************
805 * DefaultHandler_SetHostNames (IOleObject)
807 * The default handler's implementation of this method just stores
808 * the strings and returns S_OK.
810 * See Windows documentation for more details on IOleObject methods.
812 static HRESULT WINAPI DefaultHandler_SetHostNames(
813 IOleObject* iface,
814 LPCOLESTR szContainerApp,
815 LPCOLESTR szContainerObj)
817 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
819 TRACE("(%p, %s, %s)\n",
820 iface,
821 debugstr_w(szContainerApp),
822 debugstr_w(szContainerObj));
825 * Be sure to cleanup before re-assinging the strings.
827 if (this->containerApp!=NULL)
829 SysFreeString(this->containerApp);
830 this->containerApp = NULL;
833 if (this->containerObj!=NULL)
835 SysFreeString(this->containerObj);
836 this->containerObj = NULL;
840 * Copy the string supplied.
842 if (szContainerApp != NULL)
843 this->containerApp = SysAllocString(szContainerApp);
845 if (szContainerObj != NULL)
846 this->containerObj = SysAllocString(szContainerObj);
848 return S_OK;
851 /************************************************************************
852 * DefaultHandler_Close (IOleObject)
854 * The default handler's implementation of this method is meaningless
855 * without a running server so it does nothing.
857 * See Windows documentation for more details on IOleObject methods.
859 static HRESULT WINAPI DefaultHandler_Close(
860 IOleObject* iface,
861 DWORD dwSaveOption)
863 TRACE("()\n");
864 return S_OK;
867 /************************************************************************
868 * DefaultHandler_SetMoniker (IOleObject)
870 * The default handler's implementation of this method does nothing.
872 * See Windows documentation for more details on IOleObject methods.
874 static HRESULT WINAPI DefaultHandler_SetMoniker(
875 IOleObject* iface,
876 DWORD dwWhichMoniker,
877 IMoniker* pmk)
879 TRACE("(%p, %ld, %p)\n",
880 iface,
881 dwWhichMoniker,
882 pmk);
884 return S_OK;
887 /************************************************************************
888 * DefaultHandler_GetMoniker (IOleObject)
890 * Delegate this request to the client site if we have one.
892 * See Windows documentation for more details on IOleObject methods.
894 static HRESULT WINAPI DefaultHandler_GetMoniker(
895 IOleObject* iface,
896 DWORD dwAssign,
897 DWORD dwWhichMoniker,
898 IMoniker** ppmk)
900 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
902 TRACE("(%p, %ld, %ld, %p)\n",
903 iface, dwAssign, dwWhichMoniker, ppmk);
905 if (this->clientSite)
907 return IOleClientSite_GetMoniker(this->clientSite,
908 dwAssign,
909 dwWhichMoniker,
910 ppmk);
914 return E_UNSPEC;
917 /************************************************************************
918 * DefaultHandler_InitFromData (IOleObject)
920 * This method is meaningless if the server is not running
922 * See Windows documentation for more details on IOleObject methods.
924 static HRESULT WINAPI DefaultHandler_InitFromData(
925 IOleObject* iface,
926 IDataObject* pDataObject,
927 BOOL fCreation,
928 DWORD dwReserved)
930 TRACE("(%p, %p, %d, %ld)\n",
931 iface, pDataObject, fCreation, dwReserved);
933 return OLE_E_NOTRUNNING;
936 /************************************************************************
937 * DefaultHandler_GetClipboardData (IOleObject)
939 * This method is meaningless if the server is not running
941 * See Windows documentation for more details on IOleObject methods.
943 static HRESULT WINAPI DefaultHandler_GetClipboardData(
944 IOleObject* iface,
945 DWORD dwReserved,
946 IDataObject** ppDataObject)
948 TRACE("(%p, %ld, %p)\n",
949 iface, dwReserved, ppDataObject);
951 return OLE_E_NOTRUNNING;
954 static HRESULT WINAPI DefaultHandler_DoVerb(
955 IOleObject* iface,
956 LONG iVerb,
957 struct tagMSG* lpmsg,
958 IOleClientSite* pActiveSite,
959 LONG lindex,
960 HWND hwndParent,
961 LPCRECT lprcPosRect)
963 FIXME(": Stub\n");
964 return E_NOTIMPL;
967 /************************************************************************
968 * DefaultHandler_EnumVerbs (IOleObject)
970 * The default handler implementation of this method simply delegates
971 * to OleRegEnumVerbs
973 * See Windows documentation for more details on IOleObject methods.
975 static HRESULT WINAPI DefaultHandler_EnumVerbs(
976 IOleObject* iface,
977 IEnumOLEVERB** ppEnumOleVerb)
979 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
981 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
983 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
986 static HRESULT WINAPI DefaultHandler_Update(
987 IOleObject* iface)
989 FIXME(": Stub\n");
990 return E_NOTIMPL;
993 /************************************************************************
994 * DefaultHandler_IsUpToDate (IOleObject)
996 * This method is meaningless if the server is not running
998 * See Windows documentation for more details on IOleObject methods.
1000 static HRESULT WINAPI DefaultHandler_IsUpToDate(
1001 IOleObject* iface)
1003 TRACE("(%p)\n", iface);
1005 return OLE_E_NOTRUNNING;
1008 /************************************************************************
1009 * DefaultHandler_GetUserClassID (IOleObject)
1011 * TODO: Map to a new class ID if emulation is active.
1013 * See Windows documentation for more details on IOleObject methods.
1015 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1016 IOleObject* iface,
1017 CLSID* pClsid)
1019 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1021 TRACE("(%p, %p)\n", iface, pClsid);
1024 * Sanity check.
1026 if (pClsid==NULL)
1027 return E_POINTER;
1029 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1031 return S_OK;
1034 /************************************************************************
1035 * DefaultHandler_GetUserType (IOleObject)
1037 * The default handler implementation of this method simply delegates
1038 * to OleRegGetUserType
1040 * See Windows documentation for more details on IOleObject methods.
1042 static HRESULT WINAPI DefaultHandler_GetUserType(
1043 IOleObject* iface,
1044 DWORD dwFormOfType,
1045 LPOLESTR* pszUserType)
1047 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1049 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1051 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1054 /************************************************************************
1055 * DefaultHandler_SetExtent (IOleObject)
1057 * This method is meaningless if the server is not running
1059 * See Windows documentation for more details on IOleObject methods.
1061 static HRESULT WINAPI DefaultHandler_SetExtent(
1062 IOleObject* iface,
1063 DWORD dwDrawAspect,
1064 SIZEL* psizel)
1066 TRACE("(%p, %lx, (%d,%d))\n", iface, dwDrawAspect, psizel->cx, psizel->cy);
1067 return OLE_E_NOTRUNNING;
1070 /************************************************************************
1071 * DefaultHandler_GetExtent (IOleObject)
1073 * The default handler's implementation of this method returns uses
1074 * the cache to locate the aspect and extract the extent from it.
1076 * See Windows documentation for more details on IOleObject methods.
1078 static HRESULT WINAPI DefaultHandler_GetExtent(
1079 IOleObject* iface,
1080 DWORD dwDrawAspect,
1081 SIZEL* psizel)
1083 DVTARGETDEVICE* targetDevice;
1084 IViewObject2* cacheView = NULL;
1085 HRESULT hres;
1087 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1089 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1091 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1093 if (FAILED(hres))
1094 return E_UNEXPECTED;
1097 * Prepare the call to the cache's GetExtent method.
1099 * Here we would build a valid DVTARGETDEVICE structure
1100 * but, since we are calling into the data cache, we
1101 * know it's implementation and we'll skip this
1102 * extra work until later.
1104 targetDevice = NULL;
1106 hres = IViewObject2_GetExtent(cacheView,
1107 dwDrawAspect,
1109 targetDevice,
1110 psizel);
1113 * Cleanup
1115 IViewObject2_Release(cacheView);
1117 return hres;
1120 /************************************************************************
1121 * DefaultHandler_Advise (IOleObject)
1123 * The default handler's implementation of this method simply
1124 * delegates to the OleAdviseHolder.
1126 * See Windows documentation for more details on IOleObject methods.
1128 static HRESULT WINAPI DefaultHandler_Advise(
1129 IOleObject* iface,
1130 IAdviseSink* pAdvSink,
1131 DWORD* pdwConnection)
1133 HRESULT hres = S_OK;
1134 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1136 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1139 * Make sure we have an advise holder before we start.
1141 if (this->oleAdviseHolder==NULL)
1143 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1146 if (SUCCEEDED(hres))
1148 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1149 pAdvSink,
1150 pdwConnection);
1153 return hres;
1156 /************************************************************************
1157 * DefaultHandler_Unadvise (IOleObject)
1159 * The default handler's implementation of this method simply
1160 * delegates to the OleAdviseHolder.
1162 * See Windows documentation for more details on IOleObject methods.
1164 static HRESULT WINAPI DefaultHandler_Unadvise(
1165 IOleObject* iface,
1166 DWORD dwConnection)
1168 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1170 TRACE("(%p, %ld)\n", iface, dwConnection);
1173 * If we don't have an advise holder yet, it means we don't have
1174 * a connection.
1176 if (this->oleAdviseHolder==NULL)
1177 return OLE_E_NOCONNECTION;
1179 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1180 dwConnection);
1183 /************************************************************************
1184 * DefaultHandler_EnumAdvise (IOleObject)
1186 * The default handler's implementation of this method simply
1187 * delegates to the OleAdviseHolder.
1189 * See Windows documentation for more details on IOleObject methods.
1191 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1192 IOleObject* iface,
1193 IEnumSTATDATA** ppenumAdvise)
1195 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1197 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1200 * Sanity check
1202 if (ppenumAdvise==NULL)
1203 return E_POINTER;
1206 * Initialize the out parameter.
1208 *ppenumAdvise = NULL;
1210 if (this->oleAdviseHolder==NULL)
1211 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1212 ppenumAdvise);
1214 return S_OK;
1217 /************************************************************************
1218 * DefaultHandler_GetMiscStatus (IOleObject)
1220 * The default handler's implementation of this method simply delegates
1221 * to OleRegGetMiscStatus.
1223 * See Windows documentation for more details on IOleObject methods.
1225 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1226 IOleObject* iface,
1227 DWORD dwAspect,
1228 DWORD* pdwStatus)
1230 HRESULT hres;
1231 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1233 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1235 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1237 if (FAILED(hres))
1238 *pdwStatus = 0;
1240 return S_OK;
1243 /************************************************************************
1244 * DefaultHandler_SetExtent (IOleObject)
1246 * This method is meaningless if the server is not running
1248 * See Windows documentation for more details on IOleObject methods.
1250 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1251 IOleObject* iface,
1252 struct tagLOGPALETTE* pLogpal)
1254 TRACE("(%p, %p))\n", iface, pLogpal);
1255 return OLE_E_NOTRUNNING;
1258 /*********************************************************
1259 * Methods implementation for the IDataObject part of
1260 * the DefaultHandler class.
1263 /************************************************************************
1264 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1266 * See Windows documentation for more details on IUnknown methods.
1268 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1269 IDataObject* iface,
1270 REFIID riid,
1271 void** ppvObject)
1273 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1275 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1278 /************************************************************************
1279 * DefaultHandler_IDataObject_AddRef (IUnknown)
1281 * See Windows documentation for more details on IUnknown methods.
1283 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1284 IDataObject* iface)
1286 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1288 return IUnknown_AddRef(this->outerUnknown);
1291 /************************************************************************
1292 * DefaultHandler_IDataObject_Release (IUnknown)
1294 * See Windows documentation for more details on IUnknown methods.
1296 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1297 IDataObject* iface)
1299 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1301 return IUnknown_Release(this->outerUnknown);
1304 static HRESULT WINAPI DefaultHandler_GetData(
1305 IDataObject* iface,
1306 LPFORMATETC pformatetcIn,
1307 STGMEDIUM* pmedium)
1309 FIXME(": Stub\n");
1310 return E_NOTIMPL;
1313 static HRESULT WINAPI DefaultHandler_GetDataHere(
1314 IDataObject* iface,
1315 LPFORMATETC pformatetc,
1316 STGMEDIUM* pmedium)
1318 FIXME(": Stub\n");
1319 return E_NOTIMPL;
1322 /************************************************************************
1323 * DefaultHandler_QueryGetData (IDataObject)
1325 * The default handler's implementation of this method delegates to
1326 * the cache.
1328 * See Windows documentation for more details on IDataObject methods.
1330 static HRESULT WINAPI DefaultHandler_QueryGetData(
1331 IDataObject* iface,
1332 LPFORMATETC pformatetc)
1334 IDataObject* cacheDataObject = NULL;
1335 HRESULT hres;
1337 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1339 TRACE("(%p, %p)\n", iface, pformatetc);
1341 hres = IUnknown_QueryInterface(this->dataCache,
1342 &IID_IDataObject,
1343 (void**)&cacheDataObject);
1345 if (FAILED(hres))
1346 return E_UNEXPECTED;
1348 hres = IDataObject_QueryGetData(cacheDataObject,
1349 pformatetc);
1351 IDataObject_Release(cacheDataObject);
1353 return hres;
1356 /************************************************************************
1357 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1359 * This method is meaningless if the server is not running
1361 * See Windows documentation for more details on IDataObject methods.
1363 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1364 IDataObject* iface,
1365 LPFORMATETC pformatectIn,
1366 LPFORMATETC pformatetcOut)
1368 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1370 return OLE_E_NOTRUNNING;
1373 /************************************************************************
1374 * DefaultHandler_SetData (IDataObject)
1376 * The default handler's implementation of this method delegates to
1377 * the cache.
1379 * See Windows documentation for more details on IDataObject methods.
1381 static HRESULT WINAPI DefaultHandler_SetData(
1382 IDataObject* iface,
1383 LPFORMATETC pformatetc,
1384 STGMEDIUM* pmedium,
1385 BOOL fRelease)
1387 IDataObject* cacheDataObject = NULL;
1388 HRESULT hres;
1390 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1392 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1394 hres = IUnknown_QueryInterface(this->dataCache,
1395 &IID_IDataObject,
1396 (void**)&cacheDataObject);
1398 if (FAILED(hres))
1399 return E_UNEXPECTED;
1401 hres = IDataObject_SetData(cacheDataObject,
1402 pformatetc,
1403 pmedium,
1404 fRelease);
1406 IDataObject_Release(cacheDataObject);
1408 return hres;
1411 /************************************************************************
1412 * DefaultHandler_EnumFormatEtc (IDataObject)
1414 * The default handler's implementation of this method simply delegates
1415 * to OleRegEnumFormatEtc.
1417 * See Windows documentation for more details on IDataObject methods.
1419 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1420 IDataObject* iface,
1421 DWORD dwDirection,
1422 IEnumFORMATETC** ppenumFormatEtc)
1424 HRESULT hres;
1425 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1427 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1429 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1431 return hres;
1434 /************************************************************************
1435 * DefaultHandler_DAdvise (IDataObject)
1437 * The default handler's implementation of this method simply
1438 * delegates to the DataAdviseHolder.
1440 * See Windows documentation for more details on IDataObject methods.
1442 static HRESULT WINAPI DefaultHandler_DAdvise(
1443 IDataObject* iface,
1444 FORMATETC* pformatetc,
1445 DWORD advf,
1446 IAdviseSink* pAdvSink,
1447 DWORD* pdwConnection)
1449 HRESULT hres = S_OK;
1450 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1452 TRACE("(%p, %p, %ld, %p, %p)\n",
1453 iface, pformatetc, advf, pAdvSink, pdwConnection);
1456 * Make sure we have a data advise holder before we start.
1458 if (this->dataAdviseHolder==NULL)
1460 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1463 if (SUCCEEDED(hres))
1465 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1466 iface,
1467 pformatetc,
1468 advf,
1469 pAdvSink,
1470 pdwConnection);
1473 return hres;
1476 /************************************************************************
1477 * DefaultHandler_DUnadvise (IDataObject)
1479 * The default handler's implementation of this method simply
1480 * delegates to the DataAdviseHolder.
1482 * See Windows documentation for more details on IDataObject methods.
1484 static HRESULT WINAPI DefaultHandler_DUnadvise(
1485 IDataObject* iface,
1486 DWORD dwConnection)
1488 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1490 TRACE("(%p, %ld)\n", iface, dwConnection);
1493 * If we don't have a data advise holder yet, it means that
1494 * we don't have any connections..
1496 if (this->dataAdviseHolder==NULL)
1498 return OLE_E_NOCONNECTION;
1501 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1502 dwConnection);
1505 /************************************************************************
1506 * DefaultHandler_EnumDAdvise (IDataObject)
1508 * The default handler's implementation of this method simply
1509 * delegates to the DataAdviseHolder.
1511 * See Windows documentation for more details on IDataObject methods.
1513 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1514 IDataObject* iface,
1515 IEnumSTATDATA** ppenumAdvise)
1517 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1519 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1522 * Sanity check
1524 if (ppenumAdvise == NULL)
1525 return E_POINTER;
1528 * Initialize the out parameter.
1530 *ppenumAdvise = NULL;
1533 * If we have a data advise holder object, delegate.
1535 if (this->dataAdviseHolder!=NULL)
1537 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1538 ppenumAdvise);
1541 return S_OK;
1544 /*********************************************************
1545 * Methods implementation for the IRunnableObject part
1546 * of the DefaultHandler class.
1549 /************************************************************************
1550 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1552 * See Windows documentation for more details on IUnknown methods.
1554 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1555 IRunnableObject* iface,
1556 REFIID riid,
1557 void** ppvObject)
1559 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1561 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1564 /************************************************************************
1565 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1567 * See Windows documentation for more details on IUnknown methods.
1569 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1570 IRunnableObject* iface)
1572 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1574 return IUnknown_AddRef(this->outerUnknown);
1577 /************************************************************************
1578 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1580 * See Windows documentation for more details on IUnknown methods.
1582 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1583 IRunnableObject* iface)
1585 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1587 return IUnknown_Release(this->outerUnknown);
1590 /************************************************************************
1591 * DefaultHandler_GetRunningClass (IRunnableObject)
1593 * According to Brockscmidt, Chapter 19, the default handler's
1594 * implementation of IRunnableobject does nothing until the object
1595 * is actually running.
1597 * See Windows documentation for more details on IRunnableObject methods.
1599 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1600 IRunnableObject* iface,
1601 LPCLSID lpClsid)
1603 TRACE("()\n");
1604 return S_OK;
1607 static HRESULT WINAPI DefaultHandler_Run(
1608 IRunnableObject* iface,
1609 IBindCtx* pbc)
1611 FIXME(": Stub\n");
1612 return E_NOTIMPL;
1615 /************************************************************************
1616 * DefaultHandler_IsRunning (IRunnableObject)
1618 * According to Brockscmidt, Chapter 19, the default handler's
1619 * implementation of IRunnableobject does nothing until the object
1620 * is actually running.
1622 * See Windows documentation for more details on IRunnableObject methods.
1624 static BOOL WINAPI DefaultHandler_IsRunning(
1625 IRunnableObject* iface)
1627 TRACE("()\n");
1628 return S_FALSE;
1631 /************************************************************************
1632 * DefaultHandler_LockRunning (IRunnableObject)
1634 * According to Brockscmidt, Chapter 19, the default handler's
1635 * implementation of IRunnableobject does nothing until the object
1636 * is actually running.
1638 * See Windows documentation for more details on IRunnableObject methods.
1640 static HRESULT WINAPI DefaultHandler_LockRunning(
1641 IRunnableObject* iface,
1642 BOOL fLock,
1643 BOOL fLastUnlockCloses)
1645 TRACE("()\n");
1646 return S_OK;
1649 /************************************************************************
1650 * DefaultHandler_SetContainedObject (IRunnableObject)
1652 * According to Brockscmidt, Chapter 19, the default handler's
1653 * implementation of IRunnableobject does nothing until the object
1654 * is actually running.
1656 * See Windows documentation for more details on IRunnableObject methods.
1658 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1659 IRunnableObject* iface,
1660 BOOL fContained)
1662 TRACE("()\n");
1663 return S_OK;