Fixed format strings.
[wine/testsucceed.git] / dlls / ole32 / defaulthandler.c
blob9a298787d9f126db5e442551fd0a486ba4f49bd5
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 "wine/unicode.h"
39 #include "ole2.h"
40 #include "wine/obj_oleview.h"
41 #include "debugtools.h"
43 DEFAULT_DEBUG_CHANNEL(ole);
45 /****************************************************************************
46 * DefaultHandler
49 struct DefaultHandler
52 * List all interface VTables here
54 ICOM_VTABLE(IOleObject)* lpvtbl1;
55 ICOM_VTABLE(IUnknown)* lpvtbl2;
56 ICOM_VTABLE(IDataObject)* lpvtbl3;
57 ICOM_VTABLE(IRunnableObject)* lpvtbl4;
60 * Reference count of this object
62 ULONG ref;
65 * IUnknown implementation of the outer object.
67 IUnknown* outerUnknown;
70 * Class Id that this handler object represents.
72 CLSID clsid;
75 * IUnknown implementation of the datacache.
77 IUnknown* dataCache;
80 * Client site for the embedded object.
82 IOleClientSite* clientSite;
85 * The IOleAdviseHolder maintains the connections
86 * on behalf of the default handler.
88 IOleAdviseHolder* oleAdviseHolder;
91 * The IDataAdviseHolder maintains the data
92 * connections on behalf of the default handler.
94 IDataAdviseHolder* dataAdviseHolder;
97 * Name of the container and object contained
99 LPWSTR containerApp;
100 LPWSTR containerObj;
104 typedef struct DefaultHandler DefaultHandler;
107 * Here, I define utility macros to help with the casting of the
108 * "this" parameter.
109 * There is a version to accomodate all of the VTables implemented
110 * by this object.
112 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name;
113 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
114 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
115 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
118 * Prototypes for the methods of the DefaultHandler class.
120 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
121 LPUNKNOWN pUnkOuter);
122 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
125 * Prototypes for the methods of the DefaultHandler class
126 * that implement non delegating IUnknown methods.
128 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
129 IUnknown* iface,
130 REFIID riid,
131 void** ppvObject);
132 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
133 IUnknown* iface);
134 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
135 IUnknown* iface);
138 * Prototypes for the methods of the DefaultHandler class
139 * that implement IOleObject methods.
141 static HRESULT WINAPI DefaultHandler_QueryInterface(
142 IOleObject* iface,
143 REFIID riid,
144 void** ppvObject);
145 static ULONG WINAPI DefaultHandler_AddRef(
146 IOleObject* iface);
147 static ULONG WINAPI DefaultHandler_Release(
148 IOleObject* iface);
149 static HRESULT WINAPI DefaultHandler_SetClientSite(
150 IOleObject* iface,
151 IOleClientSite* pClientSite);
152 static HRESULT WINAPI DefaultHandler_GetClientSite(
153 IOleObject* iface,
154 IOleClientSite** ppClientSite);
155 static HRESULT WINAPI DefaultHandler_SetHostNames(
156 IOleObject* iface,
157 LPCOLESTR szContainerApp,
158 LPCOLESTR szContainerObj);
159 static HRESULT WINAPI DefaultHandler_Close(
160 IOleObject* iface,
161 DWORD dwSaveOption);
162 static HRESULT WINAPI DefaultHandler_SetMoniker(
163 IOleObject* iface,
164 DWORD dwWhichMoniker,
165 IMoniker* pmk);
166 static HRESULT WINAPI DefaultHandler_GetMoniker(
167 IOleObject* iface,
168 DWORD dwAssign,
169 DWORD dwWhichMoniker,
170 IMoniker** ppmk);
171 static HRESULT WINAPI DefaultHandler_InitFromData(
172 IOleObject* iface,
173 IDataObject* pDataObject,
174 BOOL fCreation,
175 DWORD dwReserved);
176 static HRESULT WINAPI DefaultHandler_GetClipboardData(
177 IOleObject* iface,
178 DWORD dwReserved,
179 IDataObject** ppDataObject);
180 static HRESULT WINAPI DefaultHandler_DoVerb(
181 IOleObject* iface,
182 LONG iVerb,
183 struct tagMSG* lpmsg,
184 IOleClientSite* pActiveSite,
185 LONG lindex,
186 HWND hwndParent,
187 LPCRECT lprcPosRect);
188 static HRESULT WINAPI DefaultHandler_EnumVerbs(
189 IOleObject* iface,
190 IEnumOLEVERB** ppEnumOleVerb);
191 static HRESULT WINAPI DefaultHandler_Update(
192 IOleObject* iface);
193 static HRESULT WINAPI DefaultHandler_IsUpToDate(
194 IOleObject* iface);
195 static HRESULT WINAPI DefaultHandler_GetUserClassID(
196 IOleObject* iface,
197 CLSID* pClsid);
198 static HRESULT WINAPI DefaultHandler_GetUserType(
199 IOleObject* iface,
200 DWORD dwFormOfType,
201 LPOLESTR* pszUserType);
202 static HRESULT WINAPI DefaultHandler_SetExtent(
203 IOleObject* iface,
204 DWORD dwDrawAspect,
205 SIZEL* psizel);
206 static HRESULT WINAPI DefaultHandler_GetExtent(
207 IOleObject* iface,
208 DWORD dwDrawAspect,
209 SIZEL* psizel);
210 static HRESULT WINAPI DefaultHandler_Advise(
211 IOleObject* iface,
212 IAdviseSink* pAdvSink,
213 DWORD* pdwConnection);
214 static HRESULT WINAPI DefaultHandler_Unadvise(
215 IOleObject* iface,
216 DWORD dwConnection);
217 static HRESULT WINAPI DefaultHandler_EnumAdvise(
218 IOleObject* iface,
219 IEnumSTATDATA** ppenumAdvise);
220 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
221 IOleObject* iface,
222 DWORD dwAspect,
223 DWORD* pdwStatus);
224 static HRESULT WINAPI DefaultHandler_SetColorScheme(
225 IOleObject* iface,
226 struct tagLOGPALETTE* pLogpal);
229 * Prototypes for the methods of the DefaultHandler class
230 * that implement IDataObject methods.
232 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
233 IDataObject* iface,
234 REFIID riid,
235 void** ppvObject);
236 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
237 IDataObject* iface);
238 static ULONG WINAPI DefaultHandler_IDataObject_Release(
239 IDataObject* iface);
240 static HRESULT WINAPI DefaultHandler_GetData(
241 IDataObject* iface,
242 LPFORMATETC pformatetcIn,
243 STGMEDIUM* pmedium);
244 static HRESULT WINAPI DefaultHandler_GetDataHere(
245 IDataObject* iface,
246 LPFORMATETC pformatetc,
247 STGMEDIUM* pmedium);
248 static HRESULT WINAPI DefaultHandler_QueryGetData(
249 IDataObject* iface,
250 LPFORMATETC pformatetc);
251 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
252 IDataObject* iface,
253 LPFORMATETC pformatectIn,
254 LPFORMATETC pformatetcOut);
255 static HRESULT WINAPI DefaultHandler_SetData(
256 IDataObject* iface,
257 LPFORMATETC pformatetc,
258 STGMEDIUM* pmedium,
259 BOOL fRelease);
260 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
261 IDataObject* iface,
262 DWORD dwDirection,
263 IEnumFORMATETC** ppenumFormatEtc);
264 static HRESULT WINAPI DefaultHandler_DAdvise(
265 IDataObject* iface,
266 FORMATETC* pformatetc,
267 DWORD advf,
268 IAdviseSink* pAdvSink,
269 DWORD* pdwConnection);
270 static HRESULT WINAPI DefaultHandler_DUnadvise(
271 IDataObject* iface,
272 DWORD dwConnection);
273 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
274 IDataObject* iface,
275 IEnumSTATDATA** ppenumAdvise);
278 * Prototypes for the methods of the DefaultHandler class
279 * that implement IRunnableObject methods.
281 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
282 IRunnableObject* iface,
283 REFIID riid,
284 void** ppvObject);
285 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
286 IRunnableObject* iface);
287 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
288 IRunnableObject* iface);
289 static HRESULT WINAPI DefaultHandler_GetRunningClass(
290 IRunnableObject* iface,
291 LPCLSID lpClsid);
292 static HRESULT WINAPI DefaultHandler_Run(
293 IRunnableObject* iface,
294 IBindCtx* pbc);
295 static BOOL WINAPI DefaultHandler_IsRunning(
296 IRunnableObject* iface);
297 static HRESULT WINAPI DefaultHandler_LockRunning(
298 IRunnableObject* iface,
299 BOOL fLock,
300 BOOL fLastUnlockCloses);
301 static HRESULT WINAPI DefaultHandler_SetContainedObject(
302 IRunnableObject* iface,
303 BOOL fContained);
307 * Virtual function tables for the DefaultHandler class.
309 static ICOM_VTABLE(IOleObject) DefaultHandler_IOleObject_VTable =
311 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
312 DefaultHandler_QueryInterface,
313 DefaultHandler_AddRef,
314 DefaultHandler_Release,
315 DefaultHandler_SetClientSite,
316 DefaultHandler_GetClientSite,
317 DefaultHandler_SetHostNames,
318 DefaultHandler_Close,
319 DefaultHandler_SetMoniker,
320 DefaultHandler_GetMoniker,
321 DefaultHandler_InitFromData,
322 DefaultHandler_GetClipboardData,
323 DefaultHandler_DoVerb,
324 DefaultHandler_EnumVerbs,
325 DefaultHandler_Update,
326 DefaultHandler_IsUpToDate,
327 DefaultHandler_GetUserClassID,
328 DefaultHandler_GetUserType,
329 DefaultHandler_SetExtent,
330 DefaultHandler_GetExtent,
331 DefaultHandler_Advise,
332 DefaultHandler_Unadvise,
333 DefaultHandler_EnumAdvise,
334 DefaultHandler_GetMiscStatus,
335 DefaultHandler_SetColorScheme
338 static ICOM_VTABLE(IUnknown) DefaultHandler_NDIUnknown_VTable =
340 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
341 DefaultHandler_NDIUnknown_QueryInterface,
342 DefaultHandler_NDIUnknown_AddRef,
343 DefaultHandler_NDIUnknown_Release,
346 static ICOM_VTABLE(IDataObject) DefaultHandler_IDataObject_VTable =
348 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
349 DefaultHandler_IDataObject_QueryInterface,
350 DefaultHandler_IDataObject_AddRef,
351 DefaultHandler_IDataObject_Release,
352 DefaultHandler_GetData,
353 DefaultHandler_GetDataHere,
354 DefaultHandler_QueryGetData,
355 DefaultHandler_GetCanonicalFormatEtc,
356 DefaultHandler_SetData,
357 DefaultHandler_EnumFormatEtc,
358 DefaultHandler_DAdvise,
359 DefaultHandler_DUnadvise,
360 DefaultHandler_EnumDAdvise
363 static ICOM_VTABLE(IRunnableObject) DefaultHandler_IRunnableObject_VTable =
365 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
366 DefaultHandler_IRunnableObject_QueryInterface,
367 DefaultHandler_IRunnableObject_AddRef,
368 DefaultHandler_IRunnableObject_Release,
369 DefaultHandler_GetRunningClass,
370 DefaultHandler_Run,
371 DefaultHandler_IsRunning,
372 DefaultHandler_LockRunning,
373 DefaultHandler_SetContainedObject
376 /******************************************************************************
377 * OleCreateDefaultHandler [OLE32.90]
379 HRESULT WINAPI OleCreateDefaultHandler(
380 REFCLSID clsid,
381 LPUNKNOWN pUnkOuter,
382 REFIID riid,
383 LPVOID* ppvObj)
385 DefaultHandler* newHandler = NULL;
386 HRESULT hr = S_OK;
388 TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, debugstr_guid(riid), ppvObj);
391 * Sanity check
393 if (ppvObj==0)
394 return E_POINTER;
396 *ppvObj = 0;
399 * If this handler is constructed for aggregation, make sure
400 * the caller is requesting the IUnknown interface.
401 * This is necessary because it's the only time the non-delegating
402 * IUnknown pointer can be returned to the outside.
404 if ( (pUnkOuter!=NULL) &&
405 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
406 return CLASS_E_NOAGGREGATION;
409 * Try to construct a new instance of the class.
411 newHandler = DefaultHandler_Construct(clsid,
412 pUnkOuter);
414 if (newHandler == 0)
415 return E_OUTOFMEMORY;
418 * Make sure it supports the interface required by the caller.
420 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
423 * Release the reference obtained in the constructor. If
424 * the QueryInterface was unsuccessful, it will free the class.
426 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
428 return hr;
431 /*********************************************************
432 * Methods implementation for the DefaultHandler class.
434 static DefaultHandler* DefaultHandler_Construct(
435 REFCLSID clsid,
436 LPUNKNOWN pUnkOuter)
438 DefaultHandler* newObject = 0;
441 * Allocate space for the object.
443 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
445 if (newObject==0)
446 return newObject;
449 * Initialize the virtual function table.
451 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
452 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
453 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
454 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
457 * Start with one reference count. The caller of this function
458 * must release the interface pointer when it is done.
460 newObject->ref = 1;
463 * Initialize the outer unknown
464 * We don't keep a reference on the outer unknown since, the way
465 * aggregation works, our lifetime is at least as large as it's
466 * lifetime.
468 if (pUnkOuter==NULL)
469 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
471 newObject->outerUnknown = pUnkOuter;
474 * Create a datacache object.
475 * We aggregate with the datacache. Make sure we pass our outer
476 * unknown as the datacache's outer unknown.
478 CreateDataCache(newObject->outerUnknown,
479 clsid,
480 &IID_IUnknown,
481 (void**)&newObject->dataCache);
484 * Initialize the other data members of the class.
486 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
487 newObject->clientSite = NULL;
488 newObject->oleAdviseHolder = NULL;
489 newObject->dataAdviseHolder = NULL;
490 newObject->containerApp = NULL;
491 newObject->containerObj = NULL;
493 return newObject;
496 static void DefaultHandler_Destroy(
497 DefaultHandler* ptrToDestroy)
500 * Free the strings idenfitying the object
502 if (ptrToDestroy->containerApp!=NULL)
504 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerApp );
505 ptrToDestroy->containerApp = NULL;
508 if (ptrToDestroy->containerObj!=NULL)
510 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj );
511 ptrToDestroy->containerObj = NULL;
515 * Release our reference to the data cache.
517 if (ptrToDestroy->dataCache!=NULL)
519 IUnknown_Release(ptrToDestroy->dataCache);
520 ptrToDestroy->dataCache = NULL;
524 * Same thing for the client site.
526 if (ptrToDestroy->clientSite!=NULL)
528 IOleClientSite_Release(ptrToDestroy->clientSite);
529 ptrToDestroy->clientSite = NULL;
533 * And the advise holder.
535 if (ptrToDestroy->oleAdviseHolder!=NULL)
537 IOleAdviseHolder_Release(ptrToDestroy->oleAdviseHolder);
538 ptrToDestroy->oleAdviseHolder = NULL;
542 * And the data advise holder.
544 if (ptrToDestroy->dataAdviseHolder!=NULL)
546 IDataAdviseHolder_Release(ptrToDestroy->dataAdviseHolder);
547 ptrToDestroy->dataAdviseHolder = NULL;
552 * Free the actual default handler structure.
554 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
557 /*********************************************************
558 * Method implementation for the non delegating IUnknown
559 * part of the DefaultHandler class.
562 /************************************************************************
563 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
565 * See Windows documentation for more details on IUnknown methods.
567 * This version of QueryInterface will not delegate it's implementation
568 * to the outer unknown.
570 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
571 IUnknown* iface,
572 REFIID riid,
573 void** ppvObject)
575 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
578 * Perform a sanity check on the parameters.
580 if ( (this==0) || (ppvObject==0) )
581 return E_INVALIDARG;
584 * Initialize the return parameter.
586 *ppvObject = 0;
589 * Compare the riid with the interface IDs implemented by this object.
591 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
593 *ppvObject = iface;
595 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
597 *ppvObject = (IOleObject*)&(this->lpvtbl1);
599 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
601 *ppvObject = (IDataObject*)&(this->lpvtbl3);
603 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
605 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
607 else
610 * Blind aggregate the data cache to "inherit" it's interfaces.
612 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK)
613 return S_OK;
617 * Check that we obtained an interface.
619 if ((*ppvObject)==0)
621 WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid));
622 return E_NOINTERFACE;
626 * Query Interface always increases the reference count by one when it is
627 * successful.
629 IUnknown_AddRef((IUnknown*)*ppvObject);
631 return S_OK;;
634 /************************************************************************
635 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
637 * See Windows documentation for more details on IUnknown methods.
639 * This version of QueryInterface will not delegate it's implementation
640 * to the outer unknown.
642 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
643 IUnknown* iface)
645 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
647 this->ref++;
649 return this->ref;
652 /************************************************************************
653 * DefaultHandler_NDIUnknown_Release (IUnknown)
655 * See Windows documentation for more details on IUnknown methods.
657 * This version of QueryInterface will not delegate it's implementation
658 * to the outer unknown.
660 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
661 IUnknown* iface)
663 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
666 * Decrease the reference count on this object.
668 this->ref--;
671 * If the reference count goes down to 0, perform suicide.
673 if (this->ref==0)
675 DefaultHandler_Destroy(this);
677 return 0;
680 return this->ref;
683 /*********************************************************
684 * Methods implementation for the IOleObject part of
685 * the DefaultHandler class.
688 /************************************************************************
689 * DefaultHandler_QueryInterface (IUnknown)
691 * See Windows documentation for more details on IUnknown methods.
693 static HRESULT WINAPI DefaultHandler_QueryInterface(
694 IOleObject* iface,
695 REFIID riid,
696 void** ppvObject)
698 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
700 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
703 /************************************************************************
704 * DefaultHandler_AddRef (IUnknown)
706 * See Windows documentation for more details on IUnknown methods.
708 static ULONG WINAPI DefaultHandler_AddRef(
709 IOleObject* iface)
711 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
713 return IUnknown_AddRef(this->outerUnknown);
716 /************************************************************************
717 * DefaultHandler_Release (IUnknown)
719 * See Windows documentation for more details on IUnknown methods.
721 static ULONG WINAPI DefaultHandler_Release(
722 IOleObject* iface)
724 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
726 return IUnknown_Release(this->outerUnknown);
729 /************************************************************************
730 * DefaultHandler_SetClientSite (IOleObject)
732 * The default handler's implementation of this method only keeps the
733 * client site pointer for future reference.
735 * See Windows documentation for more details on IOleObject methods.
737 static HRESULT WINAPI DefaultHandler_SetClientSite(
738 IOleObject* iface,
739 IOleClientSite* pClientSite)
741 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
743 TRACE("(%p, %p)\n", iface, pClientSite);
746 * Make sure we release the previous client site if there
747 * was one.
749 if (this->clientSite!=NULL)
751 IOleClientSite_Release(this->clientSite);
754 this->clientSite = pClientSite;
756 if (this->clientSite!=NULL)
758 IOleClientSite_AddRef(this->clientSite);
761 return S_OK;
764 /************************************************************************
765 * DefaultHandler_GetClientSite (IOleObject)
767 * The default handler's implementation of this method returns the
768 * last pointer set in IOleObject_SetClientSite.
770 * See Windows documentation for more details on IOleObject methods.
772 static HRESULT WINAPI DefaultHandler_GetClientSite(
773 IOleObject* iface,
774 IOleClientSite** ppClientSite)
776 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
779 * Sanity check.
781 if (ppClientSite == NULL)
782 return E_POINTER;
784 *ppClientSite = this->clientSite;
786 if (this->clientSite != NULL)
788 IOleClientSite_AddRef(this->clientSite);
791 return S_OK;
794 /************************************************************************
795 * DefaultHandler_SetHostNames (IOleObject)
797 * The default handler's implementation of this method just stores
798 * the strings and returns S_OK.
800 * See Windows documentation for more details on IOleObject methods.
802 static HRESULT WINAPI DefaultHandler_SetHostNames(
803 IOleObject* iface,
804 LPCOLESTR szContainerApp,
805 LPCOLESTR szContainerObj)
807 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
809 TRACE("(%p, %s, %s)\n",
810 iface,
811 debugstr_w(szContainerApp),
812 debugstr_w(szContainerObj));
815 * Be sure to cleanup before re-assinging the strings.
817 if (this->containerApp!=NULL)
819 HeapFree( GetProcessHeap(), 0, this->containerApp );
820 this->containerApp = NULL;
823 if (this->containerObj!=NULL)
825 HeapFree( GetProcessHeap(), 0, this->containerObj );
826 this->containerObj = NULL;
830 * Copy the string supplied.
832 if (szContainerApp != NULL)
834 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
835 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
836 strcpyW( this->containerApp, szContainerApp );
839 if (szContainerObj != NULL)
841 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
842 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
843 strcpyW( this->containerObj, szContainerObj );
845 return S_OK;
848 /************************************************************************
849 * DefaultHandler_Close (IOleObject)
851 * The default handler's implementation of this method is meaningless
852 * without a running server so it does nothing.
854 * See Windows documentation for more details on IOleObject methods.
856 static HRESULT WINAPI DefaultHandler_Close(
857 IOleObject* iface,
858 DWORD dwSaveOption)
860 TRACE("()\n");
861 return S_OK;
864 /************************************************************************
865 * DefaultHandler_SetMoniker (IOleObject)
867 * The default handler's implementation of this method does nothing.
869 * See Windows documentation for more details on IOleObject methods.
871 static HRESULT WINAPI DefaultHandler_SetMoniker(
872 IOleObject* iface,
873 DWORD dwWhichMoniker,
874 IMoniker* pmk)
876 TRACE("(%p, %ld, %p)\n",
877 iface,
878 dwWhichMoniker,
879 pmk);
881 return S_OK;
884 /************************************************************************
885 * DefaultHandler_GetMoniker (IOleObject)
887 * Delegate this request to the client site if we have one.
889 * See Windows documentation for more details on IOleObject methods.
891 static HRESULT WINAPI DefaultHandler_GetMoniker(
892 IOleObject* iface,
893 DWORD dwAssign,
894 DWORD dwWhichMoniker,
895 IMoniker** ppmk)
897 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
899 TRACE("(%p, %ld, %ld, %p)\n",
900 iface, dwAssign, dwWhichMoniker, ppmk);
902 if (this->clientSite)
904 return IOleClientSite_GetMoniker(this->clientSite,
905 dwAssign,
906 dwWhichMoniker,
907 ppmk);
911 return E_UNSPEC;
914 /************************************************************************
915 * DefaultHandler_InitFromData (IOleObject)
917 * This method is meaningless if the server is not running
919 * See Windows documentation for more details on IOleObject methods.
921 static HRESULT WINAPI DefaultHandler_InitFromData(
922 IOleObject* iface,
923 IDataObject* pDataObject,
924 BOOL fCreation,
925 DWORD dwReserved)
927 TRACE("(%p, %p, %d, %ld)\n",
928 iface, pDataObject, fCreation, dwReserved);
930 return OLE_E_NOTRUNNING;
933 /************************************************************************
934 * DefaultHandler_GetClipboardData (IOleObject)
936 * This method is meaningless if the server is not running
938 * See Windows documentation for more details on IOleObject methods.
940 static HRESULT WINAPI DefaultHandler_GetClipboardData(
941 IOleObject* iface,
942 DWORD dwReserved,
943 IDataObject** ppDataObject)
945 TRACE("(%p, %ld, %p)\n",
946 iface, dwReserved, ppDataObject);
948 return OLE_E_NOTRUNNING;
951 static HRESULT WINAPI DefaultHandler_DoVerb(
952 IOleObject* iface,
953 LONG iVerb,
954 struct tagMSG* lpmsg,
955 IOleClientSite* pActiveSite,
956 LONG lindex,
957 HWND hwndParent,
958 LPCRECT lprcPosRect)
960 FIXME(": Stub\n");
961 return E_NOTIMPL;
964 /************************************************************************
965 * DefaultHandler_EnumVerbs (IOleObject)
967 * The default handler implementation of this method simply delegates
968 * to OleRegEnumVerbs
970 * See Windows documentation for more details on IOleObject methods.
972 static HRESULT WINAPI DefaultHandler_EnumVerbs(
973 IOleObject* iface,
974 IEnumOLEVERB** ppEnumOleVerb)
976 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
978 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
980 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
983 static HRESULT WINAPI DefaultHandler_Update(
984 IOleObject* iface)
986 FIXME(": Stub\n");
987 return E_NOTIMPL;
990 /************************************************************************
991 * DefaultHandler_IsUpToDate (IOleObject)
993 * This method is meaningless if the server is not running
995 * See Windows documentation for more details on IOleObject methods.
997 static HRESULT WINAPI DefaultHandler_IsUpToDate(
998 IOleObject* iface)
1000 TRACE("(%p)\n", iface);
1002 return OLE_E_NOTRUNNING;
1005 /************************************************************************
1006 * DefaultHandler_GetUserClassID (IOleObject)
1008 * TODO: Map to a new class ID if emulation is active.
1010 * See Windows documentation for more details on IOleObject methods.
1012 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1013 IOleObject* iface,
1014 CLSID* pClsid)
1016 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1018 TRACE("(%p, %p)\n", iface, pClsid);
1021 * Sanity check.
1023 if (pClsid==NULL)
1024 return E_POINTER;
1026 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1028 return S_OK;
1031 /************************************************************************
1032 * DefaultHandler_GetUserType (IOleObject)
1034 * The default handler implementation of this method simply delegates
1035 * to OleRegGetUserType
1037 * See Windows documentation for more details on IOleObject methods.
1039 static HRESULT WINAPI DefaultHandler_GetUserType(
1040 IOleObject* iface,
1041 DWORD dwFormOfType,
1042 LPOLESTR* pszUserType)
1044 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1046 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1048 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1051 /************************************************************************
1052 * DefaultHandler_SetExtent (IOleObject)
1054 * This method is meaningless if the server is not running
1056 * See Windows documentation for more details on IOleObject methods.
1058 static HRESULT WINAPI DefaultHandler_SetExtent(
1059 IOleObject* iface,
1060 DWORD dwDrawAspect,
1061 SIZEL* psizel)
1063 TRACE("(%p, %lx, (%ld x %ld))\n", iface,
1064 dwDrawAspect, psizel->cx, psizel->cy);
1065 return OLE_E_NOTRUNNING;
1068 /************************************************************************
1069 * DefaultHandler_GetExtent (IOleObject)
1071 * The default handler's implementation of this method returns uses
1072 * the cache to locate the aspect and extract the extent from it.
1074 * See Windows documentation for more details on IOleObject methods.
1076 static HRESULT WINAPI DefaultHandler_GetExtent(
1077 IOleObject* iface,
1078 DWORD dwDrawAspect,
1079 SIZEL* psizel)
1081 DVTARGETDEVICE* targetDevice;
1082 IViewObject2* cacheView = NULL;
1083 HRESULT hres;
1085 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1087 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1089 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1091 if (FAILED(hres))
1092 return E_UNEXPECTED;
1095 * Prepare the call to the cache's GetExtent method.
1097 * Here we would build a valid DVTARGETDEVICE structure
1098 * but, since we are calling into the data cache, we
1099 * know it's implementation and we'll skip this
1100 * extra work until later.
1102 targetDevice = NULL;
1104 hres = IViewObject2_GetExtent(cacheView,
1105 dwDrawAspect,
1107 targetDevice,
1108 psizel);
1111 * Cleanup
1113 IViewObject2_Release(cacheView);
1115 return hres;
1118 /************************************************************************
1119 * DefaultHandler_Advise (IOleObject)
1121 * The default handler's implementation of this method simply
1122 * delegates to the OleAdviseHolder.
1124 * See Windows documentation for more details on IOleObject methods.
1126 static HRESULT WINAPI DefaultHandler_Advise(
1127 IOleObject* iface,
1128 IAdviseSink* pAdvSink,
1129 DWORD* pdwConnection)
1131 HRESULT hres = S_OK;
1132 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1134 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1137 * Make sure we have an advise holder before we start.
1139 if (this->oleAdviseHolder==NULL)
1141 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1144 if (SUCCEEDED(hres))
1146 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1147 pAdvSink,
1148 pdwConnection);
1151 return hres;
1154 /************************************************************************
1155 * DefaultHandler_Unadvise (IOleObject)
1157 * The default handler's implementation of this method simply
1158 * delegates to the OleAdviseHolder.
1160 * See Windows documentation for more details on IOleObject methods.
1162 static HRESULT WINAPI DefaultHandler_Unadvise(
1163 IOleObject* iface,
1164 DWORD dwConnection)
1166 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1168 TRACE("(%p, %ld)\n", iface, dwConnection);
1171 * If we don't have an advise holder yet, it means we don't have
1172 * a connection.
1174 if (this->oleAdviseHolder==NULL)
1175 return OLE_E_NOCONNECTION;
1177 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1178 dwConnection);
1181 /************************************************************************
1182 * DefaultHandler_EnumAdvise (IOleObject)
1184 * The default handler's implementation of this method simply
1185 * delegates to the OleAdviseHolder.
1187 * See Windows documentation for more details on IOleObject methods.
1189 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1190 IOleObject* iface,
1191 IEnumSTATDATA** ppenumAdvise)
1193 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1195 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1198 * Sanity check
1200 if (ppenumAdvise==NULL)
1201 return E_POINTER;
1204 * Initialize the out parameter.
1206 *ppenumAdvise = NULL;
1208 if (this->oleAdviseHolder==NULL)
1209 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1210 ppenumAdvise);
1212 return S_OK;
1215 /************************************************************************
1216 * DefaultHandler_GetMiscStatus (IOleObject)
1218 * The default handler's implementation of this method simply delegates
1219 * to OleRegGetMiscStatus.
1221 * See Windows documentation for more details on IOleObject methods.
1223 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1224 IOleObject* iface,
1225 DWORD dwAspect,
1226 DWORD* pdwStatus)
1228 HRESULT hres;
1229 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1231 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1233 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1235 if (FAILED(hres))
1236 *pdwStatus = 0;
1238 return S_OK;
1241 /************************************************************************
1242 * DefaultHandler_SetExtent (IOleObject)
1244 * This method is meaningless if the server is not running
1246 * See Windows documentation for more details on IOleObject methods.
1248 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1249 IOleObject* iface,
1250 struct tagLOGPALETTE* pLogpal)
1252 TRACE("(%p, %p))\n", iface, pLogpal);
1253 return OLE_E_NOTRUNNING;
1256 /*********************************************************
1257 * Methods implementation for the IDataObject part of
1258 * the DefaultHandler class.
1261 /************************************************************************
1262 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1264 * See Windows documentation for more details on IUnknown methods.
1266 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1267 IDataObject* iface,
1268 REFIID riid,
1269 void** ppvObject)
1271 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1273 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1276 /************************************************************************
1277 * DefaultHandler_IDataObject_AddRef (IUnknown)
1279 * See Windows documentation for more details on IUnknown methods.
1281 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1282 IDataObject* iface)
1284 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1286 return IUnknown_AddRef(this->outerUnknown);
1289 /************************************************************************
1290 * DefaultHandler_IDataObject_Release (IUnknown)
1292 * See Windows documentation for more details on IUnknown methods.
1294 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1295 IDataObject* iface)
1297 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1299 return IUnknown_Release(this->outerUnknown);
1302 /************************************************************************
1303 * DefaultHandler_GetData
1305 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1306 * See Windows documentation for more details on GetData.
1307 * Default handler's implementation of this method delegates to the cache.
1309 static HRESULT WINAPI DefaultHandler_GetData(
1310 IDataObject* iface,
1311 LPFORMATETC pformatetcIn,
1312 STGMEDIUM* pmedium)
1314 IDataObject* cacheDataObject = NULL;
1315 HRESULT hres;
1317 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1319 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1321 hres = IUnknown_QueryInterface(this->dataCache,
1322 &IID_IDataObject,
1323 (void**)&cacheDataObject);
1325 if (FAILED(hres))
1326 return E_UNEXPECTED;
1328 hres = IDataObject_GetData(cacheDataObject,
1329 pformatetcIn,
1330 pmedium);
1332 IDataObject_Release(cacheDataObject);
1334 return hres;
1337 static HRESULT WINAPI DefaultHandler_GetDataHere(
1338 IDataObject* iface,
1339 LPFORMATETC pformatetc,
1340 STGMEDIUM* pmedium)
1342 FIXME(": Stub\n");
1343 return E_NOTIMPL;
1346 /************************************************************************
1347 * DefaultHandler_QueryGetData (IDataObject)
1349 * The default handler's implementation of this method delegates to
1350 * the cache.
1352 * See Windows documentation for more details on IDataObject methods.
1354 static HRESULT WINAPI DefaultHandler_QueryGetData(
1355 IDataObject* iface,
1356 LPFORMATETC pformatetc)
1358 IDataObject* cacheDataObject = NULL;
1359 HRESULT hres;
1361 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1363 TRACE("(%p, %p)\n", iface, pformatetc);
1365 hres = IUnknown_QueryInterface(this->dataCache,
1366 &IID_IDataObject,
1367 (void**)&cacheDataObject);
1369 if (FAILED(hres))
1370 return E_UNEXPECTED;
1372 hres = IDataObject_QueryGetData(cacheDataObject,
1373 pformatetc);
1375 IDataObject_Release(cacheDataObject);
1377 return hres;
1380 /************************************************************************
1381 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1383 * This method is meaningless if the server is not running
1385 * See Windows documentation for more details on IDataObject methods.
1387 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1388 IDataObject* iface,
1389 LPFORMATETC pformatectIn,
1390 LPFORMATETC pformatetcOut)
1392 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1394 return OLE_E_NOTRUNNING;
1397 /************************************************************************
1398 * DefaultHandler_SetData (IDataObject)
1400 * The default handler's implementation of this method delegates to
1401 * the cache.
1403 * See Windows documentation for more details on IDataObject methods.
1405 static HRESULT WINAPI DefaultHandler_SetData(
1406 IDataObject* iface,
1407 LPFORMATETC pformatetc,
1408 STGMEDIUM* pmedium,
1409 BOOL fRelease)
1411 IDataObject* cacheDataObject = NULL;
1412 HRESULT hres;
1414 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1416 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1418 hres = IUnknown_QueryInterface(this->dataCache,
1419 &IID_IDataObject,
1420 (void**)&cacheDataObject);
1422 if (FAILED(hres))
1423 return E_UNEXPECTED;
1425 hres = IDataObject_SetData(cacheDataObject,
1426 pformatetc,
1427 pmedium,
1428 fRelease);
1430 IDataObject_Release(cacheDataObject);
1432 return hres;
1435 /************************************************************************
1436 * DefaultHandler_EnumFormatEtc (IDataObject)
1438 * The default handler's implementation of this method simply delegates
1439 * to OleRegEnumFormatEtc.
1441 * See Windows documentation for more details on IDataObject methods.
1443 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1444 IDataObject* iface,
1445 DWORD dwDirection,
1446 IEnumFORMATETC** ppenumFormatEtc)
1448 HRESULT hres;
1449 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1451 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1453 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1455 return hres;
1458 /************************************************************************
1459 * DefaultHandler_DAdvise (IDataObject)
1461 * The default handler's implementation of this method simply
1462 * delegates to the DataAdviseHolder.
1464 * See Windows documentation for more details on IDataObject methods.
1466 static HRESULT WINAPI DefaultHandler_DAdvise(
1467 IDataObject* iface,
1468 FORMATETC* pformatetc,
1469 DWORD advf,
1470 IAdviseSink* pAdvSink,
1471 DWORD* pdwConnection)
1473 HRESULT hres = S_OK;
1474 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1476 TRACE("(%p, %p, %ld, %p, %p)\n",
1477 iface, pformatetc, advf, pAdvSink, pdwConnection);
1480 * Make sure we have a data advise holder before we start.
1482 if (this->dataAdviseHolder==NULL)
1484 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1487 if (SUCCEEDED(hres))
1489 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1490 iface,
1491 pformatetc,
1492 advf,
1493 pAdvSink,
1494 pdwConnection);
1497 return hres;
1500 /************************************************************************
1501 * DefaultHandler_DUnadvise (IDataObject)
1503 * The default handler's implementation of this method simply
1504 * delegates to the DataAdviseHolder.
1506 * See Windows documentation for more details on IDataObject methods.
1508 static HRESULT WINAPI DefaultHandler_DUnadvise(
1509 IDataObject* iface,
1510 DWORD dwConnection)
1512 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1514 TRACE("(%p, %ld)\n", iface, dwConnection);
1517 * If we don't have a data advise holder yet, it means that
1518 * we don't have any connections..
1520 if (this->dataAdviseHolder==NULL)
1522 return OLE_E_NOCONNECTION;
1525 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1526 dwConnection);
1529 /************************************************************************
1530 * DefaultHandler_EnumDAdvise (IDataObject)
1532 * The default handler's implementation of this method simply
1533 * delegates to the DataAdviseHolder.
1535 * See Windows documentation for more details on IDataObject methods.
1537 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1538 IDataObject* iface,
1539 IEnumSTATDATA** ppenumAdvise)
1541 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1543 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1546 * Sanity check
1548 if (ppenumAdvise == NULL)
1549 return E_POINTER;
1552 * Initialize the out parameter.
1554 *ppenumAdvise = NULL;
1557 * If we have a data advise holder object, delegate.
1559 if (this->dataAdviseHolder!=NULL)
1561 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1562 ppenumAdvise);
1565 return S_OK;
1568 /*********************************************************
1569 * Methods implementation for the IRunnableObject part
1570 * of the DefaultHandler class.
1573 /************************************************************************
1574 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1576 * See Windows documentation for more details on IUnknown methods.
1578 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1579 IRunnableObject* iface,
1580 REFIID riid,
1581 void** ppvObject)
1583 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1585 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1588 /************************************************************************
1589 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1591 * See Windows documentation for more details on IUnknown methods.
1593 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1594 IRunnableObject* iface)
1596 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1598 return IUnknown_AddRef(this->outerUnknown);
1601 /************************************************************************
1602 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1604 * See Windows documentation for more details on IUnknown methods.
1606 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1607 IRunnableObject* iface)
1609 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1611 return IUnknown_Release(this->outerUnknown);
1614 /************************************************************************
1615 * DefaultHandler_GetRunningClass (IRunnableObject)
1617 * According to Brockscmidt, Chapter 19, the default handler's
1618 * implementation of IRunnableobject does nothing until the object
1619 * is actually running.
1621 * See Windows documentation for more details on IRunnableObject methods.
1623 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1624 IRunnableObject* iface,
1625 LPCLSID lpClsid)
1627 TRACE("()\n");
1628 return S_OK;
1631 static HRESULT WINAPI DefaultHandler_Run(
1632 IRunnableObject* iface,
1633 IBindCtx* pbc)
1635 FIXME(": Stub\n");
1636 return E_NOTIMPL;
1639 /************************************************************************
1640 * DefaultHandler_IsRunning (IRunnableObject)
1642 * According to Brockscmidt, Chapter 19, the default handler's
1643 * implementation of IRunnableobject does nothing until the object
1644 * is actually running.
1646 * See Windows documentation for more details on IRunnableObject methods.
1648 static BOOL WINAPI DefaultHandler_IsRunning(
1649 IRunnableObject* iface)
1651 TRACE("()\n");
1652 return S_FALSE;
1655 /************************************************************************
1656 * DefaultHandler_LockRunning (IRunnableObject)
1658 * According to Brockscmidt, Chapter 19, the default handler's
1659 * implementation of IRunnableobject does nothing until the object
1660 * is actually running.
1662 * See Windows documentation for more details on IRunnableObject methods.
1664 static HRESULT WINAPI DefaultHandler_LockRunning(
1665 IRunnableObject* iface,
1666 BOOL fLock,
1667 BOOL fLastUnlockCloses)
1669 TRACE("()\n");
1670 return S_OK;
1673 /************************************************************************
1674 * DefaultHandler_SetContainedObject (IRunnableObject)
1676 * According to Brockscmidt, Chapter 19, the default handler's
1677 * implementation of IRunnableobject does nothing until the object
1678 * is actually running.
1680 * See Windows documentation for more details on IRunnableObject methods.
1682 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1683 IRunnableObject* iface,
1684 BOOL fContained)
1686 TRACE("()\n");
1687 return S_OK;