Replaced all lstr* calls from inside Wine code by their str* equivalent.
[wine/hacks.git] / dlls / ole32 / defaulthandler.c
blob73b94e5d98427ecd3b053f1cd92e85dbf8bce26c
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, (%d,%d))\n", iface, dwDrawAspect, psizel->cx, psizel->cy);
1064 return OLE_E_NOTRUNNING;
1067 /************************************************************************
1068 * DefaultHandler_GetExtent (IOleObject)
1070 * The default handler's implementation of this method returns uses
1071 * the cache to locate the aspect and extract the extent from it.
1073 * See Windows documentation for more details on IOleObject methods.
1075 static HRESULT WINAPI DefaultHandler_GetExtent(
1076 IOleObject* iface,
1077 DWORD dwDrawAspect,
1078 SIZEL* psizel)
1080 DVTARGETDEVICE* targetDevice;
1081 IViewObject2* cacheView = NULL;
1082 HRESULT hres;
1084 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1086 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1088 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1090 if (FAILED(hres))
1091 return E_UNEXPECTED;
1094 * Prepare the call to the cache's GetExtent method.
1096 * Here we would build a valid DVTARGETDEVICE structure
1097 * but, since we are calling into the data cache, we
1098 * know it's implementation and we'll skip this
1099 * extra work until later.
1101 targetDevice = NULL;
1103 hres = IViewObject2_GetExtent(cacheView,
1104 dwDrawAspect,
1106 targetDevice,
1107 psizel);
1110 * Cleanup
1112 IViewObject2_Release(cacheView);
1114 return hres;
1117 /************************************************************************
1118 * DefaultHandler_Advise (IOleObject)
1120 * The default handler's implementation of this method simply
1121 * delegates to the OleAdviseHolder.
1123 * See Windows documentation for more details on IOleObject methods.
1125 static HRESULT WINAPI DefaultHandler_Advise(
1126 IOleObject* iface,
1127 IAdviseSink* pAdvSink,
1128 DWORD* pdwConnection)
1130 HRESULT hres = S_OK;
1131 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1133 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1136 * Make sure we have an advise holder before we start.
1138 if (this->oleAdviseHolder==NULL)
1140 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1143 if (SUCCEEDED(hres))
1145 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1146 pAdvSink,
1147 pdwConnection);
1150 return hres;
1153 /************************************************************************
1154 * DefaultHandler_Unadvise (IOleObject)
1156 * The default handler's implementation of this method simply
1157 * delegates to the OleAdviseHolder.
1159 * See Windows documentation for more details on IOleObject methods.
1161 static HRESULT WINAPI DefaultHandler_Unadvise(
1162 IOleObject* iface,
1163 DWORD dwConnection)
1165 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1167 TRACE("(%p, %ld)\n", iface, dwConnection);
1170 * If we don't have an advise holder yet, it means we don't have
1171 * a connection.
1173 if (this->oleAdviseHolder==NULL)
1174 return OLE_E_NOCONNECTION;
1176 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1177 dwConnection);
1180 /************************************************************************
1181 * DefaultHandler_EnumAdvise (IOleObject)
1183 * The default handler's implementation of this method simply
1184 * delegates to the OleAdviseHolder.
1186 * See Windows documentation for more details on IOleObject methods.
1188 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1189 IOleObject* iface,
1190 IEnumSTATDATA** ppenumAdvise)
1192 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1194 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1197 * Sanity check
1199 if (ppenumAdvise==NULL)
1200 return E_POINTER;
1203 * Initialize the out parameter.
1205 *ppenumAdvise = NULL;
1207 if (this->oleAdviseHolder==NULL)
1208 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1209 ppenumAdvise);
1211 return S_OK;
1214 /************************************************************************
1215 * DefaultHandler_GetMiscStatus (IOleObject)
1217 * The default handler's implementation of this method simply delegates
1218 * to OleRegGetMiscStatus.
1220 * See Windows documentation for more details on IOleObject methods.
1222 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1223 IOleObject* iface,
1224 DWORD dwAspect,
1225 DWORD* pdwStatus)
1227 HRESULT hres;
1228 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1230 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1232 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1234 if (FAILED(hres))
1235 *pdwStatus = 0;
1237 return S_OK;
1240 /************************************************************************
1241 * DefaultHandler_SetExtent (IOleObject)
1243 * This method is meaningless if the server is not running
1245 * See Windows documentation for more details on IOleObject methods.
1247 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1248 IOleObject* iface,
1249 struct tagLOGPALETTE* pLogpal)
1251 TRACE("(%p, %p))\n", iface, pLogpal);
1252 return OLE_E_NOTRUNNING;
1255 /*********************************************************
1256 * Methods implementation for the IDataObject part of
1257 * the DefaultHandler class.
1260 /************************************************************************
1261 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1263 * See Windows documentation for more details on IUnknown methods.
1265 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1266 IDataObject* iface,
1267 REFIID riid,
1268 void** ppvObject)
1270 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1272 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1275 /************************************************************************
1276 * DefaultHandler_IDataObject_AddRef (IUnknown)
1278 * See Windows documentation for more details on IUnknown methods.
1280 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1281 IDataObject* iface)
1283 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1285 return IUnknown_AddRef(this->outerUnknown);
1288 /************************************************************************
1289 * DefaultHandler_IDataObject_Release (IUnknown)
1291 * See Windows documentation for more details on IUnknown methods.
1293 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1294 IDataObject* iface)
1296 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1298 return IUnknown_Release(this->outerUnknown);
1301 /************************************************************************
1302 * DefaultHandler_GetData
1304 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1305 * See Windows documentation for more details on GetData.
1306 * Default handler's implementation of this method delegates to the cache.
1308 static HRESULT WINAPI DefaultHandler_GetData(
1309 IDataObject* iface,
1310 LPFORMATETC pformatetcIn,
1311 STGMEDIUM* pmedium)
1313 IDataObject* cacheDataObject = NULL;
1314 HRESULT hres;
1316 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1318 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1320 hres = IUnknown_QueryInterface(this->dataCache,
1321 &IID_IDataObject,
1322 (void**)&cacheDataObject);
1324 if (FAILED(hres))
1325 return E_UNEXPECTED;
1327 hres = IDataObject_GetData(cacheDataObject,
1328 pformatetcIn,
1329 pmedium);
1331 IDataObject_Release(cacheDataObject);
1333 return hres;
1336 static HRESULT WINAPI DefaultHandler_GetDataHere(
1337 IDataObject* iface,
1338 LPFORMATETC pformatetc,
1339 STGMEDIUM* pmedium)
1341 FIXME(": Stub\n");
1342 return E_NOTIMPL;
1345 /************************************************************************
1346 * DefaultHandler_QueryGetData (IDataObject)
1348 * The default handler's implementation of this method delegates to
1349 * the cache.
1351 * See Windows documentation for more details on IDataObject methods.
1353 static HRESULT WINAPI DefaultHandler_QueryGetData(
1354 IDataObject* iface,
1355 LPFORMATETC pformatetc)
1357 IDataObject* cacheDataObject = NULL;
1358 HRESULT hres;
1360 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1362 TRACE("(%p, %p)\n", iface, pformatetc);
1364 hres = IUnknown_QueryInterface(this->dataCache,
1365 &IID_IDataObject,
1366 (void**)&cacheDataObject);
1368 if (FAILED(hres))
1369 return E_UNEXPECTED;
1371 hres = IDataObject_QueryGetData(cacheDataObject,
1372 pformatetc);
1374 IDataObject_Release(cacheDataObject);
1376 return hres;
1379 /************************************************************************
1380 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1382 * This method is meaningless if the server is not running
1384 * See Windows documentation for more details on IDataObject methods.
1386 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1387 IDataObject* iface,
1388 LPFORMATETC pformatectIn,
1389 LPFORMATETC pformatetcOut)
1391 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1393 return OLE_E_NOTRUNNING;
1396 /************************************************************************
1397 * DefaultHandler_SetData (IDataObject)
1399 * The default handler's implementation of this method delegates to
1400 * the cache.
1402 * See Windows documentation for more details on IDataObject methods.
1404 static HRESULT WINAPI DefaultHandler_SetData(
1405 IDataObject* iface,
1406 LPFORMATETC pformatetc,
1407 STGMEDIUM* pmedium,
1408 BOOL fRelease)
1410 IDataObject* cacheDataObject = NULL;
1411 HRESULT hres;
1413 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1415 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1417 hres = IUnknown_QueryInterface(this->dataCache,
1418 &IID_IDataObject,
1419 (void**)&cacheDataObject);
1421 if (FAILED(hres))
1422 return E_UNEXPECTED;
1424 hres = IDataObject_SetData(cacheDataObject,
1425 pformatetc,
1426 pmedium,
1427 fRelease);
1429 IDataObject_Release(cacheDataObject);
1431 return hres;
1434 /************************************************************************
1435 * DefaultHandler_EnumFormatEtc (IDataObject)
1437 * The default handler's implementation of this method simply delegates
1438 * to OleRegEnumFormatEtc.
1440 * See Windows documentation for more details on IDataObject methods.
1442 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1443 IDataObject* iface,
1444 DWORD dwDirection,
1445 IEnumFORMATETC** ppenumFormatEtc)
1447 HRESULT hres;
1448 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1450 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1452 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1454 return hres;
1457 /************************************************************************
1458 * DefaultHandler_DAdvise (IDataObject)
1460 * The default handler's implementation of this method simply
1461 * delegates to the DataAdviseHolder.
1463 * See Windows documentation for more details on IDataObject methods.
1465 static HRESULT WINAPI DefaultHandler_DAdvise(
1466 IDataObject* iface,
1467 FORMATETC* pformatetc,
1468 DWORD advf,
1469 IAdviseSink* pAdvSink,
1470 DWORD* pdwConnection)
1472 HRESULT hres = S_OK;
1473 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1475 TRACE("(%p, %p, %ld, %p, %p)\n",
1476 iface, pformatetc, advf, pAdvSink, pdwConnection);
1479 * Make sure we have a data advise holder before we start.
1481 if (this->dataAdviseHolder==NULL)
1483 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1486 if (SUCCEEDED(hres))
1488 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1489 iface,
1490 pformatetc,
1491 advf,
1492 pAdvSink,
1493 pdwConnection);
1496 return hres;
1499 /************************************************************************
1500 * DefaultHandler_DUnadvise (IDataObject)
1502 * The default handler's implementation of this method simply
1503 * delegates to the DataAdviseHolder.
1505 * See Windows documentation for more details on IDataObject methods.
1507 static HRESULT WINAPI DefaultHandler_DUnadvise(
1508 IDataObject* iface,
1509 DWORD dwConnection)
1511 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1513 TRACE("(%p, %ld)\n", iface, dwConnection);
1516 * If we don't have a data advise holder yet, it means that
1517 * we don't have any connections..
1519 if (this->dataAdviseHolder==NULL)
1521 return OLE_E_NOCONNECTION;
1524 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1525 dwConnection);
1528 /************************************************************************
1529 * DefaultHandler_EnumDAdvise (IDataObject)
1531 * The default handler's implementation of this method simply
1532 * delegates to the DataAdviseHolder.
1534 * See Windows documentation for more details on IDataObject methods.
1536 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1537 IDataObject* iface,
1538 IEnumSTATDATA** ppenumAdvise)
1540 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1542 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1545 * Sanity check
1547 if (ppenumAdvise == NULL)
1548 return E_POINTER;
1551 * Initialize the out parameter.
1553 *ppenumAdvise = NULL;
1556 * If we have a data advise holder object, delegate.
1558 if (this->dataAdviseHolder!=NULL)
1560 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1561 ppenumAdvise);
1564 return S_OK;
1567 /*********************************************************
1568 * Methods implementation for the IRunnableObject part
1569 * of the DefaultHandler class.
1572 /************************************************************************
1573 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1575 * See Windows documentation for more details on IUnknown methods.
1577 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1578 IRunnableObject* iface,
1579 REFIID riid,
1580 void** ppvObject)
1582 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1584 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1587 /************************************************************************
1588 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1590 * See Windows documentation for more details on IUnknown methods.
1592 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1593 IRunnableObject* iface)
1595 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1597 return IUnknown_AddRef(this->outerUnknown);
1600 /************************************************************************
1601 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1603 * See Windows documentation for more details on IUnknown methods.
1605 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1606 IRunnableObject* iface)
1608 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1610 return IUnknown_Release(this->outerUnknown);
1613 /************************************************************************
1614 * DefaultHandler_GetRunningClass (IRunnableObject)
1616 * According to Brockscmidt, Chapter 19, the default handler's
1617 * implementation of IRunnableobject does nothing until the object
1618 * is actually running.
1620 * See Windows documentation for more details on IRunnableObject methods.
1622 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1623 IRunnableObject* iface,
1624 LPCLSID lpClsid)
1626 TRACE("()\n");
1627 return S_OK;
1630 static HRESULT WINAPI DefaultHandler_Run(
1631 IRunnableObject* iface,
1632 IBindCtx* pbc)
1634 FIXME(": Stub\n");
1635 return E_NOTIMPL;
1638 /************************************************************************
1639 * DefaultHandler_IsRunning (IRunnableObject)
1641 * According to Brockscmidt, Chapter 19, the default handler's
1642 * implementation of IRunnableobject does nothing until the object
1643 * is actually running.
1645 * See Windows documentation for more details on IRunnableObject methods.
1647 static BOOL WINAPI DefaultHandler_IsRunning(
1648 IRunnableObject* iface)
1650 TRACE("()\n");
1651 return S_FALSE;
1654 /************************************************************************
1655 * DefaultHandler_LockRunning (IRunnableObject)
1657 * According to Brockscmidt, Chapter 19, the default handler's
1658 * implementation of IRunnableobject does nothing until the object
1659 * is actually running.
1661 * See Windows documentation for more details on IRunnableObject methods.
1663 static HRESULT WINAPI DefaultHandler_LockRunning(
1664 IRunnableObject* iface,
1665 BOOL fLock,
1666 BOOL fLastUnlockCloses)
1668 TRACE("()\n");
1669 return S_OK;
1672 /************************************************************************
1673 * DefaultHandler_SetContainedObject (IRunnableObject)
1675 * According to Brockscmidt, Chapter 19, the default handler's
1676 * implementation of IRunnableobject does nothing until the object
1677 * is actually running.
1679 * See Windows documentation for more details on IRunnableObject methods.
1681 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1682 IRunnableObject* iface,
1683 BOOL fContained)
1685 TRACE("()\n");
1686 return S_OK;