Handle the %f case in wsprintf.
[wine.git] / dlls / ole32 / defaulthandler.c
blob39b852b1f6a40e29fb9b2566201af7eea68005a8
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>
35 #include <string.h>
37 #include "winbase.h"
38 #include "winerror.h"
39 #include "wine/unicode.h"
40 #include "ole2.h"
41 #include "wine/obj_oleview.h"
42 #include "debugtools.h"
44 DEFAULT_DEBUG_CHANNEL(ole);
46 /****************************************************************************
47 * DefaultHandler
50 struct DefaultHandler
53 * List all interface VTables here
55 ICOM_VTABLE(IOleObject)* lpvtbl1;
56 ICOM_VTABLE(IUnknown)* lpvtbl2;
57 ICOM_VTABLE(IDataObject)* lpvtbl3;
58 ICOM_VTABLE(IRunnableObject)* lpvtbl4;
61 * Reference count of this object
63 ULONG ref;
66 * IUnknown implementation of the outer object.
68 IUnknown* outerUnknown;
71 * Class Id that this handler object represents.
73 CLSID clsid;
76 * IUnknown implementation of the datacache.
78 IUnknown* dataCache;
81 * Client site for the embedded object.
83 IOleClientSite* clientSite;
86 * The IOleAdviseHolder maintains the connections
87 * on behalf of the default handler.
89 IOleAdviseHolder* oleAdviseHolder;
92 * The IDataAdviseHolder maintains the data
93 * connections on behalf of the default handler.
95 IDataAdviseHolder* dataAdviseHolder;
98 * Name of the container and object contained
100 LPWSTR containerApp;
101 LPWSTR containerObj;
105 typedef struct DefaultHandler DefaultHandler;
108 * Here, I define utility macros to help with the casting of the
109 * "this" parameter.
110 * There is a version to accomodate all of the VTables implemented
111 * by this object.
113 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name;
114 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
115 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
116 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
119 * Prototypes for the methods of the DefaultHandler class.
121 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
122 LPUNKNOWN pUnkOuter);
123 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
126 * Prototypes for the methods of the DefaultHandler class
127 * that implement non delegating IUnknown methods.
129 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
130 IUnknown* iface,
131 REFIID riid,
132 void** ppvObject);
133 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
134 IUnknown* iface);
135 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
136 IUnknown* iface);
139 * Prototypes for the methods of the DefaultHandler class
140 * that implement IOleObject methods.
142 static HRESULT WINAPI DefaultHandler_QueryInterface(
143 IOleObject* iface,
144 REFIID riid,
145 void** ppvObject);
146 static ULONG WINAPI DefaultHandler_AddRef(
147 IOleObject* iface);
148 static ULONG WINAPI DefaultHandler_Release(
149 IOleObject* iface);
150 static HRESULT WINAPI DefaultHandler_SetClientSite(
151 IOleObject* iface,
152 IOleClientSite* pClientSite);
153 static HRESULT WINAPI DefaultHandler_GetClientSite(
154 IOleObject* iface,
155 IOleClientSite** ppClientSite);
156 static HRESULT WINAPI DefaultHandler_SetHostNames(
157 IOleObject* iface,
158 LPCOLESTR szContainerApp,
159 LPCOLESTR szContainerObj);
160 static HRESULT WINAPI DefaultHandler_Close(
161 IOleObject* iface,
162 DWORD dwSaveOption);
163 static HRESULT WINAPI DefaultHandler_SetMoniker(
164 IOleObject* iface,
165 DWORD dwWhichMoniker,
166 IMoniker* pmk);
167 static HRESULT WINAPI DefaultHandler_GetMoniker(
168 IOleObject* iface,
169 DWORD dwAssign,
170 DWORD dwWhichMoniker,
171 IMoniker** ppmk);
172 static HRESULT WINAPI DefaultHandler_InitFromData(
173 IOleObject* iface,
174 IDataObject* pDataObject,
175 BOOL fCreation,
176 DWORD dwReserved);
177 static HRESULT WINAPI DefaultHandler_GetClipboardData(
178 IOleObject* iface,
179 DWORD dwReserved,
180 IDataObject** ppDataObject);
181 static HRESULT WINAPI DefaultHandler_DoVerb(
182 IOleObject* iface,
183 LONG iVerb,
184 struct tagMSG* lpmsg,
185 IOleClientSite* pActiveSite,
186 LONG lindex,
187 HWND hwndParent,
188 LPCRECT lprcPosRect);
189 static HRESULT WINAPI DefaultHandler_EnumVerbs(
190 IOleObject* iface,
191 IEnumOLEVERB** ppEnumOleVerb);
192 static HRESULT WINAPI DefaultHandler_Update(
193 IOleObject* iface);
194 static HRESULT WINAPI DefaultHandler_IsUpToDate(
195 IOleObject* iface);
196 static HRESULT WINAPI DefaultHandler_GetUserClassID(
197 IOleObject* iface,
198 CLSID* pClsid);
199 static HRESULT WINAPI DefaultHandler_GetUserType(
200 IOleObject* iface,
201 DWORD dwFormOfType,
202 LPOLESTR* pszUserType);
203 static HRESULT WINAPI DefaultHandler_SetExtent(
204 IOleObject* iface,
205 DWORD dwDrawAspect,
206 SIZEL* psizel);
207 static HRESULT WINAPI DefaultHandler_GetExtent(
208 IOleObject* iface,
209 DWORD dwDrawAspect,
210 SIZEL* psizel);
211 static HRESULT WINAPI DefaultHandler_Advise(
212 IOleObject* iface,
213 IAdviseSink* pAdvSink,
214 DWORD* pdwConnection);
215 static HRESULT WINAPI DefaultHandler_Unadvise(
216 IOleObject* iface,
217 DWORD dwConnection);
218 static HRESULT WINAPI DefaultHandler_EnumAdvise(
219 IOleObject* iface,
220 IEnumSTATDATA** ppenumAdvise);
221 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
222 IOleObject* iface,
223 DWORD dwAspect,
224 DWORD* pdwStatus);
225 static HRESULT WINAPI DefaultHandler_SetColorScheme(
226 IOleObject* iface,
227 struct tagLOGPALETTE* pLogpal);
230 * Prototypes for the methods of the DefaultHandler class
231 * that implement IDataObject methods.
233 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
234 IDataObject* iface,
235 REFIID riid,
236 void** ppvObject);
237 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
238 IDataObject* iface);
239 static ULONG WINAPI DefaultHandler_IDataObject_Release(
240 IDataObject* iface);
241 static HRESULT WINAPI DefaultHandler_GetData(
242 IDataObject* iface,
243 LPFORMATETC pformatetcIn,
244 STGMEDIUM* pmedium);
245 static HRESULT WINAPI DefaultHandler_GetDataHere(
246 IDataObject* iface,
247 LPFORMATETC pformatetc,
248 STGMEDIUM* pmedium);
249 static HRESULT WINAPI DefaultHandler_QueryGetData(
250 IDataObject* iface,
251 LPFORMATETC pformatetc);
252 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
253 IDataObject* iface,
254 LPFORMATETC pformatectIn,
255 LPFORMATETC pformatetcOut);
256 static HRESULT WINAPI DefaultHandler_SetData(
257 IDataObject* iface,
258 LPFORMATETC pformatetc,
259 STGMEDIUM* pmedium,
260 BOOL fRelease);
261 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
262 IDataObject* iface,
263 DWORD dwDirection,
264 IEnumFORMATETC** ppenumFormatEtc);
265 static HRESULT WINAPI DefaultHandler_DAdvise(
266 IDataObject* iface,
267 FORMATETC* pformatetc,
268 DWORD advf,
269 IAdviseSink* pAdvSink,
270 DWORD* pdwConnection);
271 static HRESULT WINAPI DefaultHandler_DUnadvise(
272 IDataObject* iface,
273 DWORD dwConnection);
274 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
275 IDataObject* iface,
276 IEnumSTATDATA** ppenumAdvise);
279 * Prototypes for the methods of the DefaultHandler class
280 * that implement IRunnableObject methods.
282 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
283 IRunnableObject* iface,
284 REFIID riid,
285 void** ppvObject);
286 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
287 IRunnableObject* iface);
288 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
289 IRunnableObject* iface);
290 static HRESULT WINAPI DefaultHandler_GetRunningClass(
291 IRunnableObject* iface,
292 LPCLSID lpClsid);
293 static HRESULT WINAPI DefaultHandler_Run(
294 IRunnableObject* iface,
295 IBindCtx* pbc);
296 static BOOL WINAPI DefaultHandler_IsRunning(
297 IRunnableObject* iface);
298 static HRESULT WINAPI DefaultHandler_LockRunning(
299 IRunnableObject* iface,
300 BOOL fLock,
301 BOOL fLastUnlockCloses);
302 static HRESULT WINAPI DefaultHandler_SetContainedObject(
303 IRunnableObject* iface,
304 BOOL fContained);
308 * Virtual function tables for the DefaultHandler class.
310 static ICOM_VTABLE(IOleObject) DefaultHandler_IOleObject_VTable =
312 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
313 DefaultHandler_QueryInterface,
314 DefaultHandler_AddRef,
315 DefaultHandler_Release,
316 DefaultHandler_SetClientSite,
317 DefaultHandler_GetClientSite,
318 DefaultHandler_SetHostNames,
319 DefaultHandler_Close,
320 DefaultHandler_SetMoniker,
321 DefaultHandler_GetMoniker,
322 DefaultHandler_InitFromData,
323 DefaultHandler_GetClipboardData,
324 DefaultHandler_DoVerb,
325 DefaultHandler_EnumVerbs,
326 DefaultHandler_Update,
327 DefaultHandler_IsUpToDate,
328 DefaultHandler_GetUserClassID,
329 DefaultHandler_GetUserType,
330 DefaultHandler_SetExtent,
331 DefaultHandler_GetExtent,
332 DefaultHandler_Advise,
333 DefaultHandler_Unadvise,
334 DefaultHandler_EnumAdvise,
335 DefaultHandler_GetMiscStatus,
336 DefaultHandler_SetColorScheme
339 static ICOM_VTABLE(IUnknown) DefaultHandler_NDIUnknown_VTable =
341 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
342 DefaultHandler_NDIUnknown_QueryInterface,
343 DefaultHandler_NDIUnknown_AddRef,
344 DefaultHandler_NDIUnknown_Release,
347 static ICOM_VTABLE(IDataObject) DefaultHandler_IDataObject_VTable =
349 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
350 DefaultHandler_IDataObject_QueryInterface,
351 DefaultHandler_IDataObject_AddRef,
352 DefaultHandler_IDataObject_Release,
353 DefaultHandler_GetData,
354 DefaultHandler_GetDataHere,
355 DefaultHandler_QueryGetData,
356 DefaultHandler_GetCanonicalFormatEtc,
357 DefaultHandler_SetData,
358 DefaultHandler_EnumFormatEtc,
359 DefaultHandler_DAdvise,
360 DefaultHandler_DUnadvise,
361 DefaultHandler_EnumDAdvise
364 static ICOM_VTABLE(IRunnableObject) DefaultHandler_IRunnableObject_VTable =
366 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
367 DefaultHandler_IRunnableObject_QueryInterface,
368 DefaultHandler_IRunnableObject_AddRef,
369 DefaultHandler_IRunnableObject_Release,
370 DefaultHandler_GetRunningClass,
371 DefaultHandler_Run,
372 DefaultHandler_IsRunning,
373 DefaultHandler_LockRunning,
374 DefaultHandler_SetContainedObject
377 /******************************************************************************
378 * OleCreateDefaultHandler [OLE32.90]
380 HRESULT WINAPI OleCreateDefaultHandler(
381 REFCLSID clsid,
382 LPUNKNOWN pUnkOuter,
383 REFIID riid,
384 LPVOID* ppvObj)
386 DefaultHandler* newHandler = NULL;
387 HRESULT hr = S_OK;
389 TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, debugstr_guid(riid), ppvObj);
392 * Sanity check
394 if (ppvObj==0)
395 return E_POINTER;
397 *ppvObj = 0;
400 * If this handler is constructed for aggregation, make sure
401 * the caller is requesting the IUnknown interface.
402 * This is necessary because it's the only time the non-delegating
403 * IUnknown pointer can be returned to the outside.
405 if ( (pUnkOuter!=NULL) &&
406 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
407 return CLASS_E_NOAGGREGATION;
410 * Try to construct a new instance of the class.
412 newHandler = DefaultHandler_Construct(clsid,
413 pUnkOuter);
415 if (newHandler == 0)
416 return E_OUTOFMEMORY;
419 * Make sure it supports the interface required by the caller.
421 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
424 * Release the reference obtained in the constructor. If
425 * the QueryInterface was unsuccessful, it will free the class.
427 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
429 return hr;
432 /*********************************************************
433 * Methods implementation for the DefaultHandler class.
435 static DefaultHandler* DefaultHandler_Construct(
436 REFCLSID clsid,
437 LPUNKNOWN pUnkOuter)
439 DefaultHandler* newObject = 0;
442 * Allocate space for the object.
444 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
446 if (newObject==0)
447 return newObject;
450 * Initialize the virtual function table.
452 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
453 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
454 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
455 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
458 * Start with one reference count. The caller of this function
459 * must release the interface pointer when it is done.
461 newObject->ref = 1;
464 * Initialize the outer unknown
465 * We don't keep a reference on the outer unknown since, the way
466 * aggregation works, our lifetime is at least as large as it's
467 * lifetime.
469 if (pUnkOuter==NULL)
470 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
472 newObject->outerUnknown = pUnkOuter;
475 * Create a datacache object.
476 * We aggregate with the datacache. Make sure we pass our outer
477 * unknown as the datacache's outer unknown.
479 CreateDataCache(newObject->outerUnknown,
480 clsid,
481 &IID_IUnknown,
482 (void**)&newObject->dataCache);
485 * Initialize the other data members of the class.
487 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
488 newObject->clientSite = NULL;
489 newObject->oleAdviseHolder = NULL;
490 newObject->dataAdviseHolder = NULL;
491 newObject->containerApp = NULL;
492 newObject->containerObj = NULL;
494 return newObject;
497 static void DefaultHandler_Destroy(
498 DefaultHandler* ptrToDestroy)
501 * Free the strings idenfitying the object
503 if (ptrToDestroy->containerApp!=NULL)
505 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerApp );
506 ptrToDestroy->containerApp = NULL;
509 if (ptrToDestroy->containerObj!=NULL)
511 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj );
512 ptrToDestroy->containerObj = NULL;
516 * Release our reference to the data cache.
518 if (ptrToDestroy->dataCache!=NULL)
520 IUnknown_Release(ptrToDestroy->dataCache);
521 ptrToDestroy->dataCache = NULL;
525 * Same thing for the client site.
527 if (ptrToDestroy->clientSite!=NULL)
529 IOleClientSite_Release(ptrToDestroy->clientSite);
530 ptrToDestroy->clientSite = NULL;
534 * And the advise holder.
536 if (ptrToDestroy->oleAdviseHolder!=NULL)
538 IOleAdviseHolder_Release(ptrToDestroy->oleAdviseHolder);
539 ptrToDestroy->oleAdviseHolder = NULL;
543 * And the data advise holder.
545 if (ptrToDestroy->dataAdviseHolder!=NULL)
547 IDataAdviseHolder_Release(ptrToDestroy->dataAdviseHolder);
548 ptrToDestroy->dataAdviseHolder = NULL;
553 * Free the actual default handler structure.
555 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
558 /*********************************************************
559 * Method implementation for the non delegating IUnknown
560 * part of the DefaultHandler class.
563 /************************************************************************
564 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
566 * See Windows documentation for more details on IUnknown methods.
568 * This version of QueryInterface will not delegate it's implementation
569 * to the outer unknown.
571 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
572 IUnknown* iface,
573 REFIID riid,
574 void** ppvObject)
576 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
579 * Perform a sanity check on the parameters.
581 if ( (this==0) || (ppvObject==0) )
582 return E_INVALIDARG;
585 * Initialize the return parameter.
587 *ppvObject = 0;
590 * Compare the riid with the interface IDs implemented by this object.
592 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
594 *ppvObject = iface;
596 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
598 *ppvObject = (IOleObject*)&(this->lpvtbl1);
600 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
602 *ppvObject = (IDataObject*)&(this->lpvtbl3);
604 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
606 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
608 else
611 * Blind aggregate the data cache to "inherit" it's interfaces.
613 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK)
614 return S_OK;
618 * Check that we obtained an interface.
620 if ((*ppvObject)==0)
622 WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid));
623 return E_NOINTERFACE;
627 * Query Interface always increases the reference count by one when it is
628 * successful.
630 IUnknown_AddRef((IUnknown*)*ppvObject);
632 return S_OK;;
635 /************************************************************************
636 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
638 * See Windows documentation for more details on IUnknown methods.
640 * This version of QueryInterface will not delegate it's implementation
641 * to the outer unknown.
643 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
644 IUnknown* iface)
646 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
648 this->ref++;
650 return this->ref;
653 /************************************************************************
654 * DefaultHandler_NDIUnknown_Release (IUnknown)
656 * See Windows documentation for more details on IUnknown methods.
658 * This version of QueryInterface will not delegate it's implementation
659 * to the outer unknown.
661 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
662 IUnknown* iface)
664 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
667 * Decrease the reference count on this object.
669 this->ref--;
672 * If the reference count goes down to 0, perform suicide.
674 if (this->ref==0)
676 DefaultHandler_Destroy(this);
678 return 0;
681 return this->ref;
684 /*********************************************************
685 * Methods implementation for the IOleObject part of
686 * the DefaultHandler class.
689 /************************************************************************
690 * DefaultHandler_QueryInterface (IUnknown)
692 * See Windows documentation for more details on IUnknown methods.
694 static HRESULT WINAPI DefaultHandler_QueryInterface(
695 IOleObject* iface,
696 REFIID riid,
697 void** ppvObject)
699 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
701 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
704 /************************************************************************
705 * DefaultHandler_AddRef (IUnknown)
707 * See Windows documentation for more details on IUnknown methods.
709 static ULONG WINAPI DefaultHandler_AddRef(
710 IOleObject* iface)
712 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
714 return IUnknown_AddRef(this->outerUnknown);
717 /************************************************************************
718 * DefaultHandler_Release (IUnknown)
720 * See Windows documentation for more details on IUnknown methods.
722 static ULONG WINAPI DefaultHandler_Release(
723 IOleObject* iface)
725 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
727 return IUnknown_Release(this->outerUnknown);
730 /************************************************************************
731 * DefaultHandler_SetClientSite (IOleObject)
733 * The default handler's implementation of this method only keeps the
734 * client site pointer for future reference.
736 * See Windows documentation for more details on IOleObject methods.
738 static HRESULT WINAPI DefaultHandler_SetClientSite(
739 IOleObject* iface,
740 IOleClientSite* pClientSite)
742 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
744 TRACE("(%p, %p)\n", iface, pClientSite);
747 * Make sure we release the previous client site if there
748 * was one.
750 if (this->clientSite!=NULL)
752 IOleClientSite_Release(this->clientSite);
755 this->clientSite = pClientSite;
757 if (this->clientSite!=NULL)
759 IOleClientSite_AddRef(this->clientSite);
762 return S_OK;
765 /************************************************************************
766 * DefaultHandler_GetClientSite (IOleObject)
768 * The default handler's implementation of this method returns the
769 * last pointer set in IOleObject_SetClientSite.
771 * See Windows documentation for more details on IOleObject methods.
773 static HRESULT WINAPI DefaultHandler_GetClientSite(
774 IOleObject* iface,
775 IOleClientSite** ppClientSite)
777 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
780 * Sanity check.
782 if (ppClientSite == NULL)
783 return E_POINTER;
785 *ppClientSite = this->clientSite;
787 if (this->clientSite != NULL)
789 IOleClientSite_AddRef(this->clientSite);
792 return S_OK;
795 /************************************************************************
796 * DefaultHandler_SetHostNames (IOleObject)
798 * The default handler's implementation of this method just stores
799 * the strings and returns S_OK.
801 * See Windows documentation for more details on IOleObject methods.
803 static HRESULT WINAPI DefaultHandler_SetHostNames(
804 IOleObject* iface,
805 LPCOLESTR szContainerApp,
806 LPCOLESTR szContainerObj)
808 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
810 TRACE("(%p, %s, %s)\n",
811 iface,
812 debugstr_w(szContainerApp),
813 debugstr_w(szContainerObj));
816 * Be sure to cleanup before re-assinging the strings.
818 if (this->containerApp!=NULL)
820 HeapFree( GetProcessHeap(), 0, this->containerApp );
821 this->containerApp = NULL;
824 if (this->containerObj!=NULL)
826 HeapFree( GetProcessHeap(), 0, this->containerObj );
827 this->containerObj = NULL;
831 * Copy the string supplied.
833 if (szContainerApp != NULL)
835 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
836 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
837 strcpyW( this->containerApp, szContainerApp );
840 if (szContainerObj != NULL)
842 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
843 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
844 strcpyW( this->containerObj, szContainerObj );
846 return S_OK;
849 /************************************************************************
850 * DefaultHandler_Close (IOleObject)
852 * The default handler's implementation of this method is meaningless
853 * without a running server so it does nothing.
855 * See Windows documentation for more details on IOleObject methods.
857 static HRESULT WINAPI DefaultHandler_Close(
858 IOleObject* iface,
859 DWORD dwSaveOption)
861 TRACE("()\n");
862 return S_OK;
865 /************************************************************************
866 * DefaultHandler_SetMoniker (IOleObject)
868 * The default handler's implementation of this method does nothing.
870 * See Windows documentation for more details on IOleObject methods.
872 static HRESULT WINAPI DefaultHandler_SetMoniker(
873 IOleObject* iface,
874 DWORD dwWhichMoniker,
875 IMoniker* pmk)
877 TRACE("(%p, %ld, %p)\n",
878 iface,
879 dwWhichMoniker,
880 pmk);
882 return S_OK;
885 /************************************************************************
886 * DefaultHandler_GetMoniker (IOleObject)
888 * Delegate this request to the client site if we have one.
890 * See Windows documentation for more details on IOleObject methods.
892 static HRESULT WINAPI DefaultHandler_GetMoniker(
893 IOleObject* iface,
894 DWORD dwAssign,
895 DWORD dwWhichMoniker,
896 IMoniker** ppmk)
898 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
900 TRACE("(%p, %ld, %ld, %p)\n",
901 iface, dwAssign, dwWhichMoniker, ppmk);
903 if (this->clientSite)
905 return IOleClientSite_GetMoniker(this->clientSite,
906 dwAssign,
907 dwWhichMoniker,
908 ppmk);
912 return E_UNSPEC;
915 /************************************************************************
916 * DefaultHandler_InitFromData (IOleObject)
918 * This method is meaningless if the server is not running
920 * See Windows documentation for more details on IOleObject methods.
922 static HRESULT WINAPI DefaultHandler_InitFromData(
923 IOleObject* iface,
924 IDataObject* pDataObject,
925 BOOL fCreation,
926 DWORD dwReserved)
928 TRACE("(%p, %p, %d, %ld)\n",
929 iface, pDataObject, fCreation, dwReserved);
931 return OLE_E_NOTRUNNING;
934 /************************************************************************
935 * DefaultHandler_GetClipboardData (IOleObject)
937 * This method is meaningless if the server is not running
939 * See Windows documentation for more details on IOleObject methods.
941 static HRESULT WINAPI DefaultHandler_GetClipboardData(
942 IOleObject* iface,
943 DWORD dwReserved,
944 IDataObject** ppDataObject)
946 TRACE("(%p, %ld, %p)\n",
947 iface, dwReserved, ppDataObject);
949 return OLE_E_NOTRUNNING;
952 static HRESULT WINAPI DefaultHandler_DoVerb(
953 IOleObject* iface,
954 LONG iVerb,
955 struct tagMSG* lpmsg,
956 IOleClientSite* pActiveSite,
957 LONG lindex,
958 HWND hwndParent,
959 LPCRECT lprcPosRect)
961 FIXME(": Stub\n");
962 return E_NOTIMPL;
965 /************************************************************************
966 * DefaultHandler_EnumVerbs (IOleObject)
968 * The default handler implementation of this method simply delegates
969 * to OleRegEnumVerbs
971 * See Windows documentation for more details on IOleObject methods.
973 static HRESULT WINAPI DefaultHandler_EnumVerbs(
974 IOleObject* iface,
975 IEnumOLEVERB** ppEnumOleVerb)
977 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
979 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
981 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
984 static HRESULT WINAPI DefaultHandler_Update(
985 IOleObject* iface)
987 FIXME(": Stub\n");
988 return E_NOTIMPL;
991 /************************************************************************
992 * DefaultHandler_IsUpToDate (IOleObject)
994 * This method is meaningless if the server is not running
996 * See Windows documentation for more details on IOleObject methods.
998 static HRESULT WINAPI DefaultHandler_IsUpToDate(
999 IOleObject* iface)
1001 TRACE("(%p)\n", iface);
1003 return OLE_E_NOTRUNNING;
1006 /************************************************************************
1007 * DefaultHandler_GetUserClassID (IOleObject)
1009 * TODO: Map to a new class ID if emulation is active.
1011 * See Windows documentation for more details on IOleObject methods.
1013 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1014 IOleObject* iface,
1015 CLSID* pClsid)
1017 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1019 TRACE("(%p, %p)\n", iface, pClsid);
1022 * Sanity check.
1024 if (pClsid==NULL)
1025 return E_POINTER;
1027 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1029 return S_OK;
1032 /************************************************************************
1033 * DefaultHandler_GetUserType (IOleObject)
1035 * The default handler implementation of this method simply delegates
1036 * to OleRegGetUserType
1038 * See Windows documentation for more details on IOleObject methods.
1040 static HRESULT WINAPI DefaultHandler_GetUserType(
1041 IOleObject* iface,
1042 DWORD dwFormOfType,
1043 LPOLESTR* pszUserType)
1045 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1047 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1049 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1052 /************************************************************************
1053 * DefaultHandler_SetExtent (IOleObject)
1055 * This method is meaningless if the server is not running
1057 * See Windows documentation for more details on IOleObject methods.
1059 static HRESULT WINAPI DefaultHandler_SetExtent(
1060 IOleObject* iface,
1061 DWORD dwDrawAspect,
1062 SIZEL* psizel)
1064 TRACE("(%p, %lx, (%ld x %ld))\n", iface,
1065 dwDrawAspect, psizel->cx, psizel->cy);
1066 return OLE_E_NOTRUNNING;
1069 /************************************************************************
1070 * DefaultHandler_GetExtent (IOleObject)
1072 * The default handler's implementation of this method returns uses
1073 * the cache to locate the aspect and extract the extent from it.
1075 * See Windows documentation for more details on IOleObject methods.
1077 static HRESULT WINAPI DefaultHandler_GetExtent(
1078 IOleObject* iface,
1079 DWORD dwDrawAspect,
1080 SIZEL* psizel)
1082 DVTARGETDEVICE* targetDevice;
1083 IViewObject2* cacheView = NULL;
1084 HRESULT hres;
1086 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1088 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1090 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1092 if (FAILED(hres))
1093 return E_UNEXPECTED;
1096 * Prepare the call to the cache's GetExtent method.
1098 * Here we would build a valid DVTARGETDEVICE structure
1099 * but, since we are calling into the data cache, we
1100 * know it's implementation and we'll skip this
1101 * extra work until later.
1103 targetDevice = NULL;
1105 hres = IViewObject2_GetExtent(cacheView,
1106 dwDrawAspect,
1108 targetDevice,
1109 psizel);
1112 * Cleanup
1114 IViewObject2_Release(cacheView);
1116 return hres;
1119 /************************************************************************
1120 * DefaultHandler_Advise (IOleObject)
1122 * The default handler's implementation of this method simply
1123 * delegates to the OleAdviseHolder.
1125 * See Windows documentation for more details on IOleObject methods.
1127 static HRESULT WINAPI DefaultHandler_Advise(
1128 IOleObject* iface,
1129 IAdviseSink* pAdvSink,
1130 DWORD* pdwConnection)
1132 HRESULT hres = S_OK;
1133 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1135 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1138 * Make sure we have an advise holder before we start.
1140 if (this->oleAdviseHolder==NULL)
1142 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1145 if (SUCCEEDED(hres))
1147 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1148 pAdvSink,
1149 pdwConnection);
1152 return hres;
1155 /************************************************************************
1156 * DefaultHandler_Unadvise (IOleObject)
1158 * The default handler's implementation of this method simply
1159 * delegates to the OleAdviseHolder.
1161 * See Windows documentation for more details on IOleObject methods.
1163 static HRESULT WINAPI DefaultHandler_Unadvise(
1164 IOleObject* iface,
1165 DWORD dwConnection)
1167 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1169 TRACE("(%p, %ld)\n", iface, dwConnection);
1172 * If we don't have an advise holder yet, it means we don't have
1173 * a connection.
1175 if (this->oleAdviseHolder==NULL)
1176 return OLE_E_NOCONNECTION;
1178 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1179 dwConnection);
1182 /************************************************************************
1183 * DefaultHandler_EnumAdvise (IOleObject)
1185 * The default handler's implementation of this method simply
1186 * delegates to the OleAdviseHolder.
1188 * See Windows documentation for more details on IOleObject methods.
1190 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1191 IOleObject* iface,
1192 IEnumSTATDATA** ppenumAdvise)
1194 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1196 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1199 * Sanity check
1201 if (ppenumAdvise==NULL)
1202 return E_POINTER;
1205 * Initialize the out parameter.
1207 *ppenumAdvise = NULL;
1209 if (this->oleAdviseHolder==NULL)
1210 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1211 ppenumAdvise);
1213 return S_OK;
1216 /************************************************************************
1217 * DefaultHandler_GetMiscStatus (IOleObject)
1219 * The default handler's implementation of this method simply delegates
1220 * to OleRegGetMiscStatus.
1222 * See Windows documentation for more details on IOleObject methods.
1224 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1225 IOleObject* iface,
1226 DWORD dwAspect,
1227 DWORD* pdwStatus)
1229 HRESULT hres;
1230 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1232 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1234 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1236 if (FAILED(hres))
1237 *pdwStatus = 0;
1239 return S_OK;
1242 /************************************************************************
1243 * DefaultHandler_SetExtent (IOleObject)
1245 * This method is meaningless if the server is not running
1247 * See Windows documentation for more details on IOleObject methods.
1249 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1250 IOleObject* iface,
1251 struct tagLOGPALETTE* pLogpal)
1253 TRACE("(%p, %p))\n", iface, pLogpal);
1254 return OLE_E_NOTRUNNING;
1257 /*********************************************************
1258 * Methods implementation for the IDataObject part of
1259 * the DefaultHandler class.
1262 /************************************************************************
1263 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1265 * See Windows documentation for more details on IUnknown methods.
1267 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1268 IDataObject* iface,
1269 REFIID riid,
1270 void** ppvObject)
1272 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1274 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1277 /************************************************************************
1278 * DefaultHandler_IDataObject_AddRef (IUnknown)
1280 * See Windows documentation for more details on IUnknown methods.
1282 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1283 IDataObject* iface)
1285 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1287 return IUnknown_AddRef(this->outerUnknown);
1290 /************************************************************************
1291 * DefaultHandler_IDataObject_Release (IUnknown)
1293 * See Windows documentation for more details on IUnknown methods.
1295 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1296 IDataObject* iface)
1298 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1300 return IUnknown_Release(this->outerUnknown);
1303 /************************************************************************
1304 * DefaultHandler_GetData
1306 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1307 * See Windows documentation for more details on GetData.
1308 * Default handler's implementation of this method delegates to the cache.
1310 static HRESULT WINAPI DefaultHandler_GetData(
1311 IDataObject* iface,
1312 LPFORMATETC pformatetcIn,
1313 STGMEDIUM* pmedium)
1315 IDataObject* cacheDataObject = NULL;
1316 HRESULT hres;
1318 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1320 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1322 hres = IUnknown_QueryInterface(this->dataCache,
1323 &IID_IDataObject,
1324 (void**)&cacheDataObject);
1326 if (FAILED(hres))
1327 return E_UNEXPECTED;
1329 hres = IDataObject_GetData(cacheDataObject,
1330 pformatetcIn,
1331 pmedium);
1333 IDataObject_Release(cacheDataObject);
1335 return hres;
1338 static HRESULT WINAPI DefaultHandler_GetDataHere(
1339 IDataObject* iface,
1340 LPFORMATETC pformatetc,
1341 STGMEDIUM* pmedium)
1343 FIXME(": Stub\n");
1344 return E_NOTIMPL;
1347 /************************************************************************
1348 * DefaultHandler_QueryGetData (IDataObject)
1350 * The default handler's implementation of this method delegates to
1351 * the cache.
1353 * See Windows documentation for more details on IDataObject methods.
1355 static HRESULT WINAPI DefaultHandler_QueryGetData(
1356 IDataObject* iface,
1357 LPFORMATETC pformatetc)
1359 IDataObject* cacheDataObject = NULL;
1360 HRESULT hres;
1362 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1364 TRACE("(%p, %p)\n", iface, pformatetc);
1366 hres = IUnknown_QueryInterface(this->dataCache,
1367 &IID_IDataObject,
1368 (void**)&cacheDataObject);
1370 if (FAILED(hres))
1371 return E_UNEXPECTED;
1373 hres = IDataObject_QueryGetData(cacheDataObject,
1374 pformatetc);
1376 IDataObject_Release(cacheDataObject);
1378 return hres;
1381 /************************************************************************
1382 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1384 * This method is meaningless if the server is not running
1386 * See Windows documentation for more details on IDataObject methods.
1388 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1389 IDataObject* iface,
1390 LPFORMATETC pformatectIn,
1391 LPFORMATETC pformatetcOut)
1393 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1395 return OLE_E_NOTRUNNING;
1398 /************************************************************************
1399 * DefaultHandler_SetData (IDataObject)
1401 * The default handler's implementation of this method delegates to
1402 * the cache.
1404 * See Windows documentation for more details on IDataObject methods.
1406 static HRESULT WINAPI DefaultHandler_SetData(
1407 IDataObject* iface,
1408 LPFORMATETC pformatetc,
1409 STGMEDIUM* pmedium,
1410 BOOL fRelease)
1412 IDataObject* cacheDataObject = NULL;
1413 HRESULT hres;
1415 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1417 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1419 hres = IUnknown_QueryInterface(this->dataCache,
1420 &IID_IDataObject,
1421 (void**)&cacheDataObject);
1423 if (FAILED(hres))
1424 return E_UNEXPECTED;
1426 hres = IDataObject_SetData(cacheDataObject,
1427 pformatetc,
1428 pmedium,
1429 fRelease);
1431 IDataObject_Release(cacheDataObject);
1433 return hres;
1436 /************************************************************************
1437 * DefaultHandler_EnumFormatEtc (IDataObject)
1439 * The default handler's implementation of this method simply delegates
1440 * to OleRegEnumFormatEtc.
1442 * See Windows documentation for more details on IDataObject methods.
1444 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1445 IDataObject* iface,
1446 DWORD dwDirection,
1447 IEnumFORMATETC** ppenumFormatEtc)
1449 HRESULT hres;
1450 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1452 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1454 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1456 return hres;
1459 /************************************************************************
1460 * DefaultHandler_DAdvise (IDataObject)
1462 * The default handler's implementation of this method simply
1463 * delegates to the DataAdviseHolder.
1465 * See Windows documentation for more details on IDataObject methods.
1467 static HRESULT WINAPI DefaultHandler_DAdvise(
1468 IDataObject* iface,
1469 FORMATETC* pformatetc,
1470 DWORD advf,
1471 IAdviseSink* pAdvSink,
1472 DWORD* pdwConnection)
1474 HRESULT hres = S_OK;
1475 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1477 TRACE("(%p, %p, %ld, %p, %p)\n",
1478 iface, pformatetc, advf, pAdvSink, pdwConnection);
1481 * Make sure we have a data advise holder before we start.
1483 if (this->dataAdviseHolder==NULL)
1485 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1488 if (SUCCEEDED(hres))
1490 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1491 iface,
1492 pformatetc,
1493 advf,
1494 pAdvSink,
1495 pdwConnection);
1498 return hres;
1501 /************************************************************************
1502 * DefaultHandler_DUnadvise (IDataObject)
1504 * The default handler's implementation of this method simply
1505 * delegates to the DataAdviseHolder.
1507 * See Windows documentation for more details on IDataObject methods.
1509 static HRESULT WINAPI DefaultHandler_DUnadvise(
1510 IDataObject* iface,
1511 DWORD dwConnection)
1513 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1515 TRACE("(%p, %ld)\n", iface, dwConnection);
1518 * If we don't have a data advise holder yet, it means that
1519 * we don't have any connections..
1521 if (this->dataAdviseHolder==NULL)
1523 return OLE_E_NOCONNECTION;
1526 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1527 dwConnection);
1530 /************************************************************************
1531 * DefaultHandler_EnumDAdvise (IDataObject)
1533 * The default handler's implementation of this method simply
1534 * delegates to the DataAdviseHolder.
1536 * See Windows documentation for more details on IDataObject methods.
1538 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1539 IDataObject* iface,
1540 IEnumSTATDATA** ppenumAdvise)
1542 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1544 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1547 * Sanity check
1549 if (ppenumAdvise == NULL)
1550 return E_POINTER;
1553 * Initialize the out parameter.
1555 *ppenumAdvise = NULL;
1558 * If we have a data advise holder object, delegate.
1560 if (this->dataAdviseHolder!=NULL)
1562 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1563 ppenumAdvise);
1566 return S_OK;
1569 /*********************************************************
1570 * Methods implementation for the IRunnableObject part
1571 * of the DefaultHandler class.
1574 /************************************************************************
1575 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1577 * See Windows documentation for more details on IUnknown methods.
1579 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1580 IRunnableObject* iface,
1581 REFIID riid,
1582 void** ppvObject)
1584 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1586 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1589 /************************************************************************
1590 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1592 * See Windows documentation for more details on IUnknown methods.
1594 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1595 IRunnableObject* iface)
1597 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1599 return IUnknown_AddRef(this->outerUnknown);
1602 /************************************************************************
1603 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1605 * See Windows documentation for more details on IUnknown methods.
1607 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1608 IRunnableObject* iface)
1610 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1612 return IUnknown_Release(this->outerUnknown);
1615 /************************************************************************
1616 * DefaultHandler_GetRunningClass (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 HRESULT WINAPI DefaultHandler_GetRunningClass(
1625 IRunnableObject* iface,
1626 LPCLSID lpClsid)
1628 TRACE("()\n");
1629 return S_OK;
1632 static HRESULT WINAPI DefaultHandler_Run(
1633 IRunnableObject* iface,
1634 IBindCtx* pbc)
1636 FIXME(": Stub\n");
1637 return E_NOTIMPL;
1640 /************************************************************************
1641 * DefaultHandler_IsRunning (IRunnableObject)
1643 * According to Brockscmidt, Chapter 19, the default handler's
1644 * implementation of IRunnableobject does nothing until the object
1645 * is actually running.
1647 * See Windows documentation for more details on IRunnableObject methods.
1649 static BOOL WINAPI DefaultHandler_IsRunning(
1650 IRunnableObject* iface)
1652 TRACE("()\n");
1653 return S_FALSE;
1656 /************************************************************************
1657 * DefaultHandler_LockRunning (IRunnableObject)
1659 * According to Brockscmidt, Chapter 19, the default handler's
1660 * implementation of IRunnableobject does nothing until the object
1661 * is actually running.
1663 * See Windows documentation for more details on IRunnableObject methods.
1665 static HRESULT WINAPI DefaultHandler_LockRunning(
1666 IRunnableObject* iface,
1667 BOOL fLock,
1668 BOOL fLastUnlockCloses)
1670 TRACE("()\n");
1671 return S_OK;
1674 /************************************************************************
1675 * DefaultHandler_SetContainedObject (IRunnableObject)
1677 * According to Brockscmidt, Chapter 19, the default handler's
1678 * implementation of IRunnableobject does nothing until the object
1679 * is actually running.
1681 * See Windows documentation for more details on IRunnableObject methods.
1683 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1684 IRunnableObject* iface,
1685 BOOL fContained)
1687 TRACE("()\n");
1688 return S_OK;