Abey George (of Macadamian/Corel)
[wine.git] / dlls / ole32 / defaulthandler.c
blob9f5bc574c314a8c50180565f0b67e4df5843e823
1 /*
2 * OLE 2 default object handler
4 * Copyright 1999 Francis Beaudet
5 * Copyright 2000 Abey George
7 * NOTES:
8 * The OLE2 default object handler supports a whole whack of
9 * interfaces including:
10 * IOleObject, IDataObject, IPersistStorage, IViewObject2,
11 * IRunnableObject, IOleCache2, IOleCacheControl and much more.
13 * All the implementation details are taken from: Inside OLE
14 * second edition by Kraig Brockschmidt,
16 * TODO
17 * - This implementation of the default handler does not launch the
18 * server in the DoVerb, Update, GetData, GetDataHere and Run
19 * methods. When it is fixed to do so, all the methods will have
20 * to be revisited to allow delegating to the running object
22 * - All methods in the class that use the class ID should be
23 * aware that it is possible for a class to be treated as
24 * another one and go into emulation mode. Nothing has been
25 * done in this area.
27 * - Some functions still return E_NOTIMPL they have to be
28 * implemented. Most of those are related to the running of the
29 * actual server.
31 * - All the methods related to notification and advise sinks are
32 * in place but no notifications are sent to the sinks yet.
34 #include <assert.h>
36 #include "winbase.h"
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 LPWSTR containerApp;
99 LPWSTR 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;
387 TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, debugstr_guid(riid), ppvObj);
390 * Sanity check
392 if (ppvObj==0)
393 return E_POINTER;
395 *ppvObj = 0;
398 * If this handler is constructed for aggregation, make sure
399 * the caller is requesting the IUnknown interface.
400 * This is necessary because it's the only time the non-delegating
401 * IUnknown pointer can be returned to the outside.
403 if ( (pUnkOuter!=NULL) &&
404 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
405 return CLASS_E_NOAGGREGATION;
408 * Try to construct a new instance of the class.
410 newHandler = DefaultHandler_Construct(clsid,
411 pUnkOuter);
413 if (newHandler == 0)
414 return E_OUTOFMEMORY;
417 * Make sure it supports the interface required by the caller.
419 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
422 * Release the reference obtained in the constructor. If
423 * the QueryInterface was unsuccessful, it will free the class.
425 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
427 return hr;
430 /*********************************************************
431 * Methods implementation for the DefaultHandler class.
433 static DefaultHandler* DefaultHandler_Construct(
434 REFCLSID clsid,
435 LPUNKNOWN pUnkOuter)
437 DefaultHandler* newObject = 0;
440 * Allocate space for the object.
442 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
444 if (newObject==0)
445 return newObject;
448 * Initialize the virtual function table.
450 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
451 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
452 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
453 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
456 * Start with one reference count. The caller of this function
457 * must release the interface pointer when it is done.
459 newObject->ref = 1;
462 * Initialize the outer unknown
463 * We don't keep a reference on the outer unknown since, the way
464 * aggregation works, our lifetime is at least as large as it's
465 * lifetime.
467 if (pUnkOuter==NULL)
468 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
470 newObject->outerUnknown = pUnkOuter;
473 * Create a datacache object.
474 * We aggregate with the datacache. Make sure we pass our outer
475 * unknown as the datacache's outer unknown.
477 CreateDataCache(newObject->outerUnknown,
478 clsid,
479 &IID_IUnknown,
480 (void**)&newObject->dataCache);
483 * Initialize the other data members of the class.
485 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
486 newObject->clientSite = NULL;
487 newObject->oleAdviseHolder = NULL;
488 newObject->dataAdviseHolder = NULL;
489 newObject->containerApp = NULL;
490 newObject->containerObj = NULL;
492 return newObject;
495 static void DefaultHandler_Destroy(
496 DefaultHandler* ptrToDestroy)
499 * Free the strings idenfitying the object
501 if (ptrToDestroy->containerApp!=NULL)
503 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerApp );
504 ptrToDestroy->containerApp = NULL;
507 if (ptrToDestroy->containerObj!=NULL)
509 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj );
510 ptrToDestroy->containerObj = NULL;
514 * Release our reference to the data cache.
516 if (ptrToDestroy->dataCache!=NULL)
518 IUnknown_Release(ptrToDestroy->dataCache);
519 ptrToDestroy->dataCache = NULL;
523 * Same thing for the client site.
525 if (ptrToDestroy->clientSite!=NULL)
527 IOleClientSite_Release(ptrToDestroy->clientSite);
528 ptrToDestroy->clientSite = NULL;
532 * And the advise holder.
534 if (ptrToDestroy->oleAdviseHolder!=NULL)
536 IOleAdviseHolder_Release(ptrToDestroy->oleAdviseHolder);
537 ptrToDestroy->oleAdviseHolder = NULL;
541 * And the data advise holder.
543 if (ptrToDestroy->dataAdviseHolder!=NULL)
545 IDataAdviseHolder_Release(ptrToDestroy->dataAdviseHolder);
546 ptrToDestroy->dataAdviseHolder = NULL;
551 * Free the actual default handler structure.
553 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
556 /*********************************************************
557 * Method implementation for the non delegating IUnknown
558 * part of the DefaultHandler class.
561 /************************************************************************
562 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
564 * See Windows documentation for more details on IUnknown methods.
566 * This version of QueryInterface will not delegate it's implementation
567 * to the outer unknown.
569 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
570 IUnknown* iface,
571 REFIID riid,
572 void** ppvObject)
574 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
577 * Perform a sanity check on the parameters.
579 if ( (this==0) || (ppvObject==0) )
580 return E_INVALIDARG;
583 * Initialize the return parameter.
585 *ppvObject = 0;
588 * Compare the riid with the interface IDs implemented by this object.
590 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
592 *ppvObject = iface;
594 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
596 *ppvObject = (IOleObject*)&(this->lpvtbl1);
598 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
600 *ppvObject = (IDataObject*)&(this->lpvtbl3);
602 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
604 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
606 else
609 * Blind aggregate the data cache to "inherit" it's interfaces.
611 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK)
612 return S_OK;
616 * Check that we obtained an interface.
618 if ((*ppvObject)==0)
620 WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid));
621 return E_NOINTERFACE;
625 * Query Interface always increases the reference count by one when it is
626 * successful.
628 IUnknown_AddRef((IUnknown*)*ppvObject);
630 return S_OK;;
633 /************************************************************************
634 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
636 * See Windows documentation for more details on IUnknown methods.
638 * This version of QueryInterface will not delegate it's implementation
639 * to the outer unknown.
641 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
642 IUnknown* iface)
644 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
646 this->ref++;
648 return this->ref;
651 /************************************************************************
652 * DefaultHandler_NDIUnknown_Release (IUnknown)
654 * See Windows documentation for more details on IUnknown methods.
656 * This version of QueryInterface will not delegate it's implementation
657 * to the outer unknown.
659 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
660 IUnknown* iface)
662 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
665 * Decrease the reference count on this object.
667 this->ref--;
670 * If the reference count goes down to 0, perform suicide.
672 if (this->ref==0)
674 DefaultHandler_Destroy(this);
676 return 0;
679 return this->ref;
682 /*********************************************************
683 * Methods implementation for the IOleObject part of
684 * the DefaultHandler class.
687 /************************************************************************
688 * DefaultHandler_QueryInterface (IUnknown)
690 * See Windows documentation for more details on IUnknown methods.
692 static HRESULT WINAPI DefaultHandler_QueryInterface(
693 IOleObject* iface,
694 REFIID riid,
695 void** ppvObject)
697 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
699 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
702 /************************************************************************
703 * DefaultHandler_AddRef (IUnknown)
705 * See Windows documentation for more details on IUnknown methods.
707 static ULONG WINAPI DefaultHandler_AddRef(
708 IOleObject* iface)
710 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
712 return IUnknown_AddRef(this->outerUnknown);
715 /************************************************************************
716 * DefaultHandler_Release (IUnknown)
718 * See Windows documentation for more details on IUnknown methods.
720 static ULONG WINAPI DefaultHandler_Release(
721 IOleObject* iface)
723 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
725 return IUnknown_Release(this->outerUnknown);
728 /************************************************************************
729 * DefaultHandler_SetClientSite (IOleObject)
731 * The default handler's implementation of this method only keeps the
732 * client site pointer for future reference.
734 * See Windows documentation for more details on IOleObject methods.
736 static HRESULT WINAPI DefaultHandler_SetClientSite(
737 IOleObject* iface,
738 IOleClientSite* pClientSite)
740 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
742 TRACE("(%p, %p)\n", iface, pClientSite);
745 * Make sure we release the previous client site if there
746 * was one.
748 if (this->clientSite!=NULL)
750 IOleClientSite_Release(this->clientSite);
753 this->clientSite = pClientSite;
755 if (this->clientSite!=NULL)
757 IOleClientSite_AddRef(this->clientSite);
760 return S_OK;
763 /************************************************************************
764 * DefaultHandler_GetClientSite (IOleObject)
766 * The default handler's implementation of this method returns the
767 * last pointer set in IOleObject_SetClientSite.
769 * See Windows documentation for more details on IOleObject methods.
771 static HRESULT WINAPI DefaultHandler_GetClientSite(
772 IOleObject* iface,
773 IOleClientSite** ppClientSite)
775 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
778 * Sanity check.
780 if (ppClientSite == NULL)
781 return E_POINTER;
783 *ppClientSite = this->clientSite;
785 if (this->clientSite != NULL)
787 IOleClientSite_AddRef(this->clientSite);
790 return S_OK;
793 /************************************************************************
794 * DefaultHandler_SetHostNames (IOleObject)
796 * The default handler's implementation of this method just stores
797 * the strings and returns S_OK.
799 * See Windows documentation for more details on IOleObject methods.
801 static HRESULT WINAPI DefaultHandler_SetHostNames(
802 IOleObject* iface,
803 LPCOLESTR szContainerApp,
804 LPCOLESTR szContainerObj)
806 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
808 TRACE("(%p, %s, %s)\n",
809 iface,
810 debugstr_w(szContainerApp),
811 debugstr_w(szContainerObj));
814 * Be sure to cleanup before re-assinging the strings.
816 if (this->containerApp!=NULL)
818 HeapFree( GetProcessHeap(), 0, this->containerApp );
819 this->containerApp = NULL;
822 if (this->containerObj!=NULL)
824 HeapFree( GetProcessHeap(), 0, this->containerObj );
825 this->containerObj = NULL;
829 * Copy the string supplied.
831 if (szContainerApp != NULL)
833 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
834 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
835 lstrcpyW( this->containerApp, szContainerApp );
838 if (szContainerObj != NULL)
840 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
841 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
842 lstrcpyW( this->containerObj, szContainerObj );
844 return S_OK;
847 /************************************************************************
848 * DefaultHandler_Close (IOleObject)
850 * The default handler's implementation of this method is meaningless
851 * without a running server so it does nothing.
853 * See Windows documentation for more details on IOleObject methods.
855 static HRESULT WINAPI DefaultHandler_Close(
856 IOleObject* iface,
857 DWORD dwSaveOption)
859 TRACE("()\n");
860 return S_OK;
863 /************************************************************************
864 * DefaultHandler_SetMoniker (IOleObject)
866 * The default handler's implementation of this method does nothing.
868 * See Windows documentation for more details on IOleObject methods.
870 static HRESULT WINAPI DefaultHandler_SetMoniker(
871 IOleObject* iface,
872 DWORD dwWhichMoniker,
873 IMoniker* pmk)
875 TRACE("(%p, %ld, %p)\n",
876 iface,
877 dwWhichMoniker,
878 pmk);
880 return S_OK;
883 /************************************************************************
884 * DefaultHandler_GetMoniker (IOleObject)
886 * Delegate this request to the client site if we have one.
888 * See Windows documentation for more details on IOleObject methods.
890 static HRESULT WINAPI DefaultHandler_GetMoniker(
891 IOleObject* iface,
892 DWORD dwAssign,
893 DWORD dwWhichMoniker,
894 IMoniker** ppmk)
896 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
898 TRACE("(%p, %ld, %ld, %p)\n",
899 iface, dwAssign, dwWhichMoniker, ppmk);
901 if (this->clientSite)
903 return IOleClientSite_GetMoniker(this->clientSite,
904 dwAssign,
905 dwWhichMoniker,
906 ppmk);
910 return E_UNSPEC;
913 /************************************************************************
914 * DefaultHandler_InitFromData (IOleObject)
916 * This method is meaningless if the server is not running
918 * See Windows documentation for more details on IOleObject methods.
920 static HRESULT WINAPI DefaultHandler_InitFromData(
921 IOleObject* iface,
922 IDataObject* pDataObject,
923 BOOL fCreation,
924 DWORD dwReserved)
926 TRACE("(%p, %p, %d, %ld)\n",
927 iface, pDataObject, fCreation, dwReserved);
929 return OLE_E_NOTRUNNING;
932 /************************************************************************
933 * DefaultHandler_GetClipboardData (IOleObject)
935 * This method is meaningless if the server is not running
937 * See Windows documentation for more details on IOleObject methods.
939 static HRESULT WINAPI DefaultHandler_GetClipboardData(
940 IOleObject* iface,
941 DWORD dwReserved,
942 IDataObject** ppDataObject)
944 TRACE("(%p, %ld, %p)\n",
945 iface, dwReserved, ppDataObject);
947 return OLE_E_NOTRUNNING;
950 static HRESULT WINAPI DefaultHandler_DoVerb(
951 IOleObject* iface,
952 LONG iVerb,
953 struct tagMSG* lpmsg,
954 IOleClientSite* pActiveSite,
955 LONG lindex,
956 HWND hwndParent,
957 LPCRECT lprcPosRect)
959 FIXME(": Stub\n");
960 return E_NOTIMPL;
963 /************************************************************************
964 * DefaultHandler_EnumVerbs (IOleObject)
966 * The default handler implementation of this method simply delegates
967 * to OleRegEnumVerbs
969 * See Windows documentation for more details on IOleObject methods.
971 static HRESULT WINAPI DefaultHandler_EnumVerbs(
972 IOleObject* iface,
973 IEnumOLEVERB** ppEnumOleVerb)
975 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
977 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
979 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
982 static HRESULT WINAPI DefaultHandler_Update(
983 IOleObject* iface)
985 FIXME(": Stub\n");
986 return E_NOTIMPL;
989 /************************************************************************
990 * DefaultHandler_IsUpToDate (IOleObject)
992 * This method is meaningless if the server is not running
994 * See Windows documentation for more details on IOleObject methods.
996 static HRESULT WINAPI DefaultHandler_IsUpToDate(
997 IOleObject* iface)
999 TRACE("(%p)\n", iface);
1001 return OLE_E_NOTRUNNING;
1004 /************************************************************************
1005 * DefaultHandler_GetUserClassID (IOleObject)
1007 * TODO: Map to a new class ID if emulation is active.
1009 * See Windows documentation for more details on IOleObject methods.
1011 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1012 IOleObject* iface,
1013 CLSID* pClsid)
1015 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1017 TRACE("(%p, %p)\n", iface, pClsid);
1020 * Sanity check.
1022 if (pClsid==NULL)
1023 return E_POINTER;
1025 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1027 return S_OK;
1030 /************************************************************************
1031 * DefaultHandler_GetUserType (IOleObject)
1033 * The default handler implementation of this method simply delegates
1034 * to OleRegGetUserType
1036 * See Windows documentation for more details on IOleObject methods.
1038 static HRESULT WINAPI DefaultHandler_GetUserType(
1039 IOleObject* iface,
1040 DWORD dwFormOfType,
1041 LPOLESTR* pszUserType)
1043 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1045 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1047 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1050 /************************************************************************
1051 * DefaultHandler_SetExtent (IOleObject)
1053 * This method is meaningless if the server is not running
1055 * See Windows documentation for more details on IOleObject methods.
1057 static HRESULT WINAPI DefaultHandler_SetExtent(
1058 IOleObject* iface,
1059 DWORD dwDrawAspect,
1060 SIZEL* psizel)
1062 TRACE("(%p, %lx, (%d,%d))\n", iface, dwDrawAspect, psizel->cx, psizel->cy);
1063 return OLE_E_NOTRUNNING;
1066 /************************************************************************
1067 * DefaultHandler_GetExtent (IOleObject)
1069 * The default handler's implementation of this method returns uses
1070 * the cache to locate the aspect and extract the extent from it.
1072 * See Windows documentation for more details on IOleObject methods.
1074 static HRESULT WINAPI DefaultHandler_GetExtent(
1075 IOleObject* iface,
1076 DWORD dwDrawAspect,
1077 SIZEL* psizel)
1079 DVTARGETDEVICE* targetDevice;
1080 IViewObject2* cacheView = NULL;
1081 HRESULT hres;
1083 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1085 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1087 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1089 if (FAILED(hres))
1090 return E_UNEXPECTED;
1093 * Prepare the call to the cache's GetExtent method.
1095 * Here we would build a valid DVTARGETDEVICE structure
1096 * but, since we are calling into the data cache, we
1097 * know it's implementation and we'll skip this
1098 * extra work until later.
1100 targetDevice = NULL;
1102 hres = IViewObject2_GetExtent(cacheView,
1103 dwDrawAspect,
1105 targetDevice,
1106 psizel);
1109 * Cleanup
1111 IViewObject2_Release(cacheView);
1113 return hres;
1116 /************************************************************************
1117 * DefaultHandler_Advise (IOleObject)
1119 * The default handler's implementation of this method simply
1120 * delegates to the OleAdviseHolder.
1122 * See Windows documentation for more details on IOleObject methods.
1124 static HRESULT WINAPI DefaultHandler_Advise(
1125 IOleObject* iface,
1126 IAdviseSink* pAdvSink,
1127 DWORD* pdwConnection)
1129 HRESULT hres = S_OK;
1130 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1132 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1135 * Make sure we have an advise holder before we start.
1137 if (this->oleAdviseHolder==NULL)
1139 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1142 if (SUCCEEDED(hres))
1144 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1145 pAdvSink,
1146 pdwConnection);
1149 return hres;
1152 /************************************************************************
1153 * DefaultHandler_Unadvise (IOleObject)
1155 * The default handler's implementation of this method simply
1156 * delegates to the OleAdviseHolder.
1158 * See Windows documentation for more details on IOleObject methods.
1160 static HRESULT WINAPI DefaultHandler_Unadvise(
1161 IOleObject* iface,
1162 DWORD dwConnection)
1164 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1166 TRACE("(%p, %ld)\n", iface, dwConnection);
1169 * If we don't have an advise holder yet, it means we don't have
1170 * a connection.
1172 if (this->oleAdviseHolder==NULL)
1173 return OLE_E_NOCONNECTION;
1175 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1176 dwConnection);
1179 /************************************************************************
1180 * DefaultHandler_EnumAdvise (IOleObject)
1182 * The default handler's implementation of this method simply
1183 * delegates to the OleAdviseHolder.
1185 * See Windows documentation for more details on IOleObject methods.
1187 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1188 IOleObject* iface,
1189 IEnumSTATDATA** ppenumAdvise)
1191 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1193 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1196 * Sanity check
1198 if (ppenumAdvise==NULL)
1199 return E_POINTER;
1202 * Initialize the out parameter.
1204 *ppenumAdvise = NULL;
1206 if (this->oleAdviseHolder==NULL)
1207 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1208 ppenumAdvise);
1210 return S_OK;
1213 /************************************************************************
1214 * DefaultHandler_GetMiscStatus (IOleObject)
1216 * The default handler's implementation of this method simply delegates
1217 * to OleRegGetMiscStatus.
1219 * See Windows documentation for more details on IOleObject methods.
1221 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1222 IOleObject* iface,
1223 DWORD dwAspect,
1224 DWORD* pdwStatus)
1226 HRESULT hres;
1227 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1229 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1231 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1233 if (FAILED(hres))
1234 *pdwStatus = 0;
1236 return S_OK;
1239 /************************************************************************
1240 * DefaultHandler_SetExtent (IOleObject)
1242 * This method is meaningless if the server is not running
1244 * See Windows documentation for more details on IOleObject methods.
1246 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1247 IOleObject* iface,
1248 struct tagLOGPALETTE* pLogpal)
1250 TRACE("(%p, %p))\n", iface, pLogpal);
1251 return OLE_E_NOTRUNNING;
1254 /*********************************************************
1255 * Methods implementation for the IDataObject part of
1256 * the DefaultHandler class.
1259 /************************************************************************
1260 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1262 * See Windows documentation for more details on IUnknown methods.
1264 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1265 IDataObject* iface,
1266 REFIID riid,
1267 void** ppvObject)
1269 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1271 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1274 /************************************************************************
1275 * DefaultHandler_IDataObject_AddRef (IUnknown)
1277 * See Windows documentation for more details on IUnknown methods.
1279 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1280 IDataObject* iface)
1282 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1284 return IUnknown_AddRef(this->outerUnknown);
1287 /************************************************************************
1288 * DefaultHandler_IDataObject_Release (IUnknown)
1290 * See Windows documentation for more details on IUnknown methods.
1292 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1293 IDataObject* iface)
1295 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1297 return IUnknown_Release(this->outerUnknown);
1300 /************************************************************************
1301 * DefaultHandler_GetData
1303 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1304 * See Windows documentation for more details on GetData.
1305 * Default handler's implementation of this method delegates to the cache.
1307 static HRESULT WINAPI DefaultHandler_GetData(
1308 IDataObject* iface,
1309 LPFORMATETC pformatetcIn,
1310 STGMEDIUM* pmedium)
1312 IDataObject* cacheDataObject = NULL;
1313 HRESULT hres;
1315 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1317 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1319 hres = IUnknown_QueryInterface(this->dataCache,
1320 &IID_IDataObject,
1321 (void**)&cacheDataObject);
1323 if (FAILED(hres))
1324 return E_UNEXPECTED;
1326 hres = IDataObject_GetData(cacheDataObject,
1327 pformatetcIn,
1328 pmedium);
1330 IDataObject_Release(cacheDataObject);
1332 return hres;
1335 static HRESULT WINAPI DefaultHandler_GetDataHere(
1336 IDataObject* iface,
1337 LPFORMATETC pformatetc,
1338 STGMEDIUM* pmedium)
1340 FIXME(": Stub\n");
1341 return E_NOTIMPL;
1344 /************************************************************************
1345 * DefaultHandler_QueryGetData (IDataObject)
1347 * The default handler's implementation of this method delegates to
1348 * the cache.
1350 * See Windows documentation for more details on IDataObject methods.
1352 static HRESULT WINAPI DefaultHandler_QueryGetData(
1353 IDataObject* iface,
1354 LPFORMATETC pformatetc)
1356 IDataObject* cacheDataObject = NULL;
1357 HRESULT hres;
1359 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1361 TRACE("(%p, %p)\n", iface, pformatetc);
1363 hres = IUnknown_QueryInterface(this->dataCache,
1364 &IID_IDataObject,
1365 (void**)&cacheDataObject);
1367 if (FAILED(hres))
1368 return E_UNEXPECTED;
1370 hres = IDataObject_QueryGetData(cacheDataObject,
1371 pformatetc);
1373 IDataObject_Release(cacheDataObject);
1375 return hres;
1378 /************************************************************************
1379 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1381 * This method is meaningless if the server is not running
1383 * See Windows documentation for more details on IDataObject methods.
1385 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1386 IDataObject* iface,
1387 LPFORMATETC pformatectIn,
1388 LPFORMATETC pformatetcOut)
1390 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1392 return OLE_E_NOTRUNNING;
1395 /************************************************************************
1396 * DefaultHandler_SetData (IDataObject)
1398 * The default handler's implementation of this method delegates to
1399 * the cache.
1401 * See Windows documentation for more details on IDataObject methods.
1403 static HRESULT WINAPI DefaultHandler_SetData(
1404 IDataObject* iface,
1405 LPFORMATETC pformatetc,
1406 STGMEDIUM* pmedium,
1407 BOOL fRelease)
1409 IDataObject* cacheDataObject = NULL;
1410 HRESULT hres;
1412 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1414 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1416 hres = IUnknown_QueryInterface(this->dataCache,
1417 &IID_IDataObject,
1418 (void**)&cacheDataObject);
1420 if (FAILED(hres))
1421 return E_UNEXPECTED;
1423 hres = IDataObject_SetData(cacheDataObject,
1424 pformatetc,
1425 pmedium,
1426 fRelease);
1428 IDataObject_Release(cacheDataObject);
1430 return hres;
1433 /************************************************************************
1434 * DefaultHandler_EnumFormatEtc (IDataObject)
1436 * The default handler's implementation of this method simply delegates
1437 * to OleRegEnumFormatEtc.
1439 * See Windows documentation for more details on IDataObject methods.
1441 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1442 IDataObject* iface,
1443 DWORD dwDirection,
1444 IEnumFORMATETC** ppenumFormatEtc)
1446 HRESULT hres;
1447 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1449 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1451 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1453 return hres;
1456 /************************************************************************
1457 * DefaultHandler_DAdvise (IDataObject)
1459 * The default handler's implementation of this method simply
1460 * delegates to the DataAdviseHolder.
1462 * See Windows documentation for more details on IDataObject methods.
1464 static HRESULT WINAPI DefaultHandler_DAdvise(
1465 IDataObject* iface,
1466 FORMATETC* pformatetc,
1467 DWORD advf,
1468 IAdviseSink* pAdvSink,
1469 DWORD* pdwConnection)
1471 HRESULT hres = S_OK;
1472 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1474 TRACE("(%p, %p, %ld, %p, %p)\n",
1475 iface, pformatetc, advf, pAdvSink, pdwConnection);
1478 * Make sure we have a data advise holder before we start.
1480 if (this->dataAdviseHolder==NULL)
1482 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1485 if (SUCCEEDED(hres))
1487 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1488 iface,
1489 pformatetc,
1490 advf,
1491 pAdvSink,
1492 pdwConnection);
1495 return hres;
1498 /************************************************************************
1499 * DefaultHandler_DUnadvise (IDataObject)
1501 * The default handler's implementation of this method simply
1502 * delegates to the DataAdviseHolder.
1504 * See Windows documentation for more details on IDataObject methods.
1506 static HRESULT WINAPI DefaultHandler_DUnadvise(
1507 IDataObject* iface,
1508 DWORD dwConnection)
1510 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1512 TRACE("(%p, %ld)\n", iface, dwConnection);
1515 * If we don't have a data advise holder yet, it means that
1516 * we don't have any connections..
1518 if (this->dataAdviseHolder==NULL)
1520 return OLE_E_NOCONNECTION;
1523 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1524 dwConnection);
1527 /************************************************************************
1528 * DefaultHandler_EnumDAdvise (IDataObject)
1530 * The default handler's implementation of this method simply
1531 * delegates to the DataAdviseHolder.
1533 * See Windows documentation for more details on IDataObject methods.
1535 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1536 IDataObject* iface,
1537 IEnumSTATDATA** ppenumAdvise)
1539 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1541 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1544 * Sanity check
1546 if (ppenumAdvise == NULL)
1547 return E_POINTER;
1550 * Initialize the out parameter.
1552 *ppenumAdvise = NULL;
1555 * If we have a data advise holder object, delegate.
1557 if (this->dataAdviseHolder!=NULL)
1559 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1560 ppenumAdvise);
1563 return S_OK;
1566 /*********************************************************
1567 * Methods implementation for the IRunnableObject part
1568 * of the DefaultHandler class.
1571 /************************************************************************
1572 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1574 * See Windows documentation for more details on IUnknown methods.
1576 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1577 IRunnableObject* iface,
1578 REFIID riid,
1579 void** ppvObject)
1581 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1583 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1586 /************************************************************************
1587 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1589 * See Windows documentation for more details on IUnknown methods.
1591 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1592 IRunnableObject* iface)
1594 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1596 return IUnknown_AddRef(this->outerUnknown);
1599 /************************************************************************
1600 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1602 * See Windows documentation for more details on IUnknown methods.
1604 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1605 IRunnableObject* iface)
1607 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1609 return IUnknown_Release(this->outerUnknown);
1612 /************************************************************************
1613 * DefaultHandler_GetRunningClass (IRunnableObject)
1615 * According to Brockscmidt, Chapter 19, the default handler's
1616 * implementation of IRunnableobject does nothing until the object
1617 * is actually running.
1619 * See Windows documentation for more details on IRunnableObject methods.
1621 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1622 IRunnableObject* iface,
1623 LPCLSID lpClsid)
1625 TRACE("()\n");
1626 return S_OK;
1629 static HRESULT WINAPI DefaultHandler_Run(
1630 IRunnableObject* iface,
1631 IBindCtx* pbc)
1633 FIXME(": Stub\n");
1634 return E_NOTIMPL;
1637 /************************************************************************
1638 * DefaultHandler_IsRunning (IRunnableObject)
1640 * According to Brockscmidt, Chapter 19, the default handler's
1641 * implementation of IRunnableobject does nothing until the object
1642 * is actually running.
1644 * See Windows documentation for more details on IRunnableObject methods.
1646 static BOOL WINAPI DefaultHandler_IsRunning(
1647 IRunnableObject* iface)
1649 TRACE("()\n");
1650 return S_FALSE;
1653 /************************************************************************
1654 * DefaultHandler_LockRunning (IRunnableObject)
1656 * According to Brockscmidt, Chapter 19, the default handler's
1657 * implementation of IRunnableobject does nothing until the object
1658 * is actually running.
1660 * See Windows documentation for more details on IRunnableObject methods.
1662 static HRESULT WINAPI DefaultHandler_LockRunning(
1663 IRunnableObject* iface,
1664 BOOL fLock,
1665 BOOL fLastUnlockCloses)
1667 TRACE("()\n");
1668 return S_OK;
1671 /************************************************************************
1672 * DefaultHandler_SetContainedObject (IRunnableObject)
1674 * According to Brockscmidt, Chapter 19, the default handler's
1675 * implementation of IRunnableobject does nothing until the object
1676 * is actually running.
1678 * See Windows documentation for more details on IRunnableObject methods.
1680 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1681 IRunnableObject* iface,
1682 BOOL fContained)
1684 TRACE("()\n");
1685 return S_OK;