Added missing WINAPI for SHValidateUNC.
[wine/dcerpc.git] / ole / defaulthandler.c
blob9f83959f24490dc2fe97f7c40828940085136d3b
1 /*
2 * OLE 2 default object handler
4 * Copyright 1999 Francis Beaudet
6 * NOTES:
7 * The OLE2 default object handler supports a whole whack of
8 * interfaces including:
9 * IOleObject, IDataObject, IPersistStorage, IViewObject2,
10 * IRunnableObject, IOleCache2, IOleCacheControl and much more.
12 * All the implementation details are taken from: Inside OLE
13 * second edition by Kraig Brockschmidt,
15 * TODO
16 * - This implementation of the default handler does not launch the
17 * server in the DoVerb, Update, GetData, GetDataHere and Run
18 * methods. When it is fixed to do so, all the methods will have
19 * to be revisited to allow delegating to the running object
21 * - All methods in the class that use the class ID should be
22 * aware that it is possible for a class to be treated as
23 * another one and go into emulation mode. Nothing has been
24 * done in this area.
26 * - Some functions still return E_NOTIMPL they have to be
27 * implemented. Most of those are related to the running of the
28 * actual server.
30 * - All the methods related to notification and advise sinks are
31 * in place but no notifications are sent to the sinks yet.
33 #include <assert.h>
35 #include "winuser.h"
36 #include "winerror.h"
37 #include "ole2.h"
38 #include "debug.h"
40 DEFAULT_DEBUG_CHANNEL(ole)
42 /****************************************************************************
43 * DefaultHandler
46 struct DefaultHandler
49 * List all interface VTables here
51 ICOM_VTABLE(IOleObject)* lpvtbl1;
52 ICOM_VTABLE(IUnknown)* lpvtbl2;
53 ICOM_VTABLE(IDataObject)* lpvtbl3;
54 ICOM_VTABLE(IRunnableObject)* lpvtbl4;
57 * Reference count of this object
59 ULONG ref;
62 * IUnknown implementation of the outer object.
64 IUnknown* outerUnknown;
67 * Class Id that this handler object represents.
69 CLSID clsid;
72 * IUnknown implementation of the datacache.
74 IUnknown* dataCache;
77 * Client site for the embedded object.
79 IOleClientSite* clientSite;
82 * The IOleAdviseHolder maintains the connections
83 * on behalf of the default handler.
85 IOleAdviseHolder* oleAdviseHolder;
88 * The IDataAdviseHolder maintains the data
89 * connections on behalf of the default handler.
91 IDataAdviseHolder* dataAdviseHolder;
94 * Name of the container and object contained
96 BSTR containerApp;
97 BSTR containerObj;
101 typedef struct DefaultHandler DefaultHandler;
104 * Here, I define utility macros to help with the casting of the
105 * "this" parameter.
106 * There is a version to accomodate all of the VTables implemented
107 * by this object.
109 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name;
110 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
111 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
112 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
115 * Prototypes for the methods of the DefaultHandler class.
117 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
118 LPUNKNOWN pUnkOuter);
119 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
122 * Prototypes for the methods of the DefaultHandler class
123 * that implement non delegating IUnknown methods.
125 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
126 IUnknown* iface,
127 REFIID riid,
128 void** ppvObject);
129 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
130 IUnknown* iface);
131 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
132 IUnknown* iface);
135 * Prototypes for the methods of the DefaultHandler class
136 * that implement IOleObject methods.
138 static HRESULT WINAPI DefaultHandler_QueryInterface(
139 IOleObject* iface,
140 REFIID riid,
141 void** ppvObject);
142 static ULONG WINAPI DefaultHandler_AddRef(
143 IOleObject* iface);
144 static ULONG WINAPI DefaultHandler_Release(
145 IOleObject* iface);
146 static HRESULT WINAPI DefaultHandler_SetClientSite(
147 IOleObject* iface,
148 IOleClientSite* pClientSite);
149 static HRESULT WINAPI DefaultHandler_GetClientSite(
150 IOleObject* iface,
151 IOleClientSite** ppClientSite);
152 static HRESULT WINAPI DefaultHandler_SetHostNames(
153 IOleObject* iface,
154 LPCOLESTR szContainerApp,
155 LPCOLESTR szContainerObj);
156 static HRESULT WINAPI DefaultHandler_Close(
157 IOleObject* iface,
158 DWORD dwSaveOption);
159 static HRESULT WINAPI DefaultHandler_SetMoniker(
160 IOleObject* iface,
161 DWORD dwWhichMoniker,
162 IMoniker* pmk);
163 static HRESULT WINAPI DefaultHandler_GetMoniker(
164 IOleObject* iface,
165 DWORD dwAssign,
166 DWORD dwWhichMoniker,
167 IMoniker** ppmk);
168 static HRESULT WINAPI DefaultHandler_InitFromData(
169 IOleObject* iface,
170 IDataObject* pDataObject,
171 BOOL fCreation,
172 DWORD dwReserved);
173 static HRESULT WINAPI DefaultHandler_GetClipboardData(
174 IOleObject* iface,
175 DWORD dwReserved,
176 IDataObject** ppDataObject);
177 static HRESULT WINAPI DefaultHandler_DoVerb(
178 IOleObject* iface,
179 LONG iVerb,
180 LPMSG lpmsg,
181 IOleClientSite* pActiveSite,
182 LONG lindex,
183 HWND hwndParent,
184 LPCRECT lprcPosRect);
185 static HRESULT WINAPI DefaultHandler_EnumVerbs(
186 IOleObject* iface,
187 IEnumOLEVERB** ppEnumOleVerb);
188 static HRESULT WINAPI DefaultHandler_Update(
189 IOleObject* iface);
190 static HRESULT WINAPI DefaultHandler_IsUpToDate(
191 IOleObject* iface);
192 static HRESULT WINAPI DefaultHandler_GetUserClassID(
193 IOleObject* iface,
194 CLSID* pClsid);
195 static HRESULT WINAPI DefaultHandler_GetUserType(
196 IOleObject* iface,
197 DWORD dwFormOfType,
198 LPOLESTR* pszUserType);
199 static HRESULT WINAPI DefaultHandler_SetExtent(
200 IOleObject* iface,
201 DWORD dwDrawAspect,
202 SIZEL* psizel);
203 static HRESULT WINAPI DefaultHandler_GetExtent(
204 IOleObject* iface,
205 DWORD dwDrawAspect,
206 SIZEL* psizel);
207 static HRESULT WINAPI DefaultHandler_Advise(
208 IOleObject* iface,
209 IAdviseSink* pAdvSink,
210 DWORD* pdwConnection);
211 static HRESULT WINAPI DefaultHandler_Unadvise(
212 IOleObject* iface,
213 DWORD dwConnection);
214 static HRESULT WINAPI DefaultHandler_EnumAdvise(
215 IOleObject* iface,
216 IEnumSTATDATA** ppenumAdvise);
217 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
218 IOleObject* iface,
219 DWORD dwAspect,
220 DWORD* pdwStatus);
221 static HRESULT WINAPI DefaultHandler_SetColorScheme(
222 IOleObject* iface,
223 LOGPALETTE* pLogpal);
226 * Prototypes for the methods of the DefaultHandler class
227 * that implement IDataObject methods.
229 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
230 IDataObject* iface,
231 REFIID riid,
232 void** ppvObject);
233 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
234 IDataObject* iface);
235 static ULONG WINAPI DefaultHandler_IDataObject_Release(
236 IDataObject* iface);
237 static HRESULT WINAPI DefaultHandler_GetData(
238 IDataObject* iface,
239 LPFORMATETC pformatetcIn,
240 STGMEDIUM* pmedium);
241 static HRESULT WINAPI DefaultHandler_GetDataHere(
242 IDataObject* iface,
243 LPFORMATETC pformatetc,
244 STGMEDIUM* pmedium);
245 static HRESULT WINAPI DefaultHandler_QueryGetData(
246 IDataObject* iface,
247 LPFORMATETC pformatetc);
248 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
249 IDataObject* iface,
250 LPFORMATETC pformatectIn,
251 LPFORMATETC pformatetcOut);
252 static HRESULT WINAPI DefaultHandler_SetData(
253 IDataObject* iface,
254 LPFORMATETC pformatetc,
255 STGMEDIUM* pmedium,
256 BOOL fRelease);
257 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
258 IDataObject* iface,
259 DWORD dwDirection,
260 IEnumFORMATETC** ppenumFormatEtc);
261 static HRESULT WINAPI DefaultHandler_DAdvise(
262 IDataObject* iface,
263 FORMATETC* pformatetc,
264 DWORD advf,
265 IAdviseSink* pAdvSink,
266 DWORD* pdwConnection);
267 static HRESULT WINAPI DefaultHandler_DUnadvise(
268 IDataObject* iface,
269 DWORD dwConnection);
270 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
271 IDataObject* iface,
272 IEnumSTATDATA** ppenumAdvise);
275 * Prototypes for the methods of the DefaultHandler class
276 * that implement IRunnableObject methods.
278 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
279 IRunnableObject* iface,
280 REFIID riid,
281 void** ppvObject);
282 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
283 IRunnableObject* iface);
284 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
285 IRunnableObject* iface);
286 static HRESULT WINAPI DefaultHandler_GetRunningClass(
287 IRunnableObject* iface,
288 LPCLSID lpClsid);
289 static HRESULT WINAPI DefaultHandler_Run(
290 IRunnableObject* iface,
291 IBindCtx* pbc);
292 static BOOL WINAPI DefaultHandler_IsRunning(
293 IRunnableObject* iface);
294 static HRESULT WINAPI DefaultHandler_LockRunning(
295 IRunnableObject* iface,
296 BOOL fLock,
297 BOOL fLastUnlockCloses);
298 static HRESULT WINAPI DefaultHandler_SetContainedObject(
299 IRunnableObject* iface,
300 BOOL fContained);
304 * Virtual function tables for the DefaultHandler class.
306 static ICOM_VTABLE(IOleObject) DefaultHandler_IOleObject_VTable =
308 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
309 DefaultHandler_QueryInterface,
310 DefaultHandler_AddRef,
311 DefaultHandler_Release,
312 DefaultHandler_SetClientSite,
313 DefaultHandler_GetClientSite,
314 DefaultHandler_SetHostNames,
315 DefaultHandler_Close,
316 DefaultHandler_SetMoniker,
317 DefaultHandler_GetMoniker,
318 DefaultHandler_InitFromData,
319 DefaultHandler_GetClipboardData,
320 DefaultHandler_DoVerb,
321 DefaultHandler_EnumVerbs,
322 DefaultHandler_Update,
323 DefaultHandler_IsUpToDate,
324 DefaultHandler_GetUserClassID,
325 DefaultHandler_GetUserType,
326 DefaultHandler_SetExtent,
327 DefaultHandler_GetExtent,
328 DefaultHandler_Advise,
329 DefaultHandler_Unadvise,
330 DefaultHandler_EnumAdvise,
331 DefaultHandler_GetMiscStatus,
332 DefaultHandler_SetColorScheme
335 static ICOM_VTABLE(IUnknown) DefaultHandler_NDIUnknown_VTable =
337 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
338 DefaultHandler_NDIUnknown_QueryInterface,
339 DefaultHandler_NDIUnknown_AddRef,
340 DefaultHandler_NDIUnknown_Release,
343 static ICOM_VTABLE(IDataObject) DefaultHandler_IDataObject_VTable =
345 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
346 DefaultHandler_IDataObject_QueryInterface,
347 DefaultHandler_IDataObject_AddRef,
348 DefaultHandler_IDataObject_Release,
349 DefaultHandler_GetData,
350 DefaultHandler_GetDataHere,
351 DefaultHandler_QueryGetData,
352 DefaultHandler_GetCanonicalFormatEtc,
353 DefaultHandler_SetData,
354 DefaultHandler_EnumFormatEtc,
355 DefaultHandler_DAdvise,
356 DefaultHandler_DUnadvise,
357 DefaultHandler_EnumDAdvise
360 static ICOM_VTABLE(IRunnableObject) DefaultHandler_IRunnableObject_VTable =
362 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
363 DefaultHandler_IRunnableObject_QueryInterface,
364 DefaultHandler_IRunnableObject_AddRef,
365 DefaultHandler_IRunnableObject_Release,
366 DefaultHandler_GetRunningClass,
367 DefaultHandler_Run,
368 DefaultHandler_IsRunning,
369 DefaultHandler_LockRunning,
370 DefaultHandler_SetContainedObject
373 /******************************************************************************
374 * OleCreateDefaultHandler [OLE32.90]
376 HRESULT WINAPI OleCreateDefaultHandler(
377 REFCLSID clsid,
378 LPUNKNOWN pUnkOuter,
379 REFIID riid,
380 LPVOID* ppvObj)
382 DefaultHandler* newHandler = NULL;
383 HRESULT hr = S_OK;
384 char xclsid[50];
385 char xriid[50];
387 WINE_StringFromCLSID((LPCLSID)clsid,xclsid);
388 WINE_StringFromCLSID((LPCLSID)riid,xriid);
390 TRACE(ole, "(%s, %p, %s, %p)\n", xclsid, pUnkOuter, xriid, ppvObj);
393 * Sanity check
395 if (ppvObj==0)
396 return E_POINTER;
398 *ppvObj = 0;
401 * If this handler is constructed for aggregation, make sure
402 * the caller is requesting the IUnknown interface.
403 * This is necessary because it's the only time the non-delegating
404 * IUnknown pointer can be returned to the outside.
406 if ( (pUnkOuter!=NULL) &&
407 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
408 return CLASS_E_NOAGGREGATION;
411 * Try to construct a new instance of the class.
413 newHandler = DefaultHandler_Construct(clsid,
414 pUnkOuter);
416 if (newHandler == 0)
417 return E_OUTOFMEMORY;
420 * Make sure it supports the interface required by the caller.
422 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
425 * Release the reference obtained in the constructor. If
426 * the QueryInterface was unsuccessful, it will free the class.
428 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
430 return hr;
433 /*********************************************************
434 * Methods implementation for the DefaultHandler class.
436 static DefaultHandler* DefaultHandler_Construct(
437 REFCLSID clsid,
438 LPUNKNOWN pUnkOuter)
440 DefaultHandler* newObject = 0;
443 * Allocate space for the object.
445 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
447 if (newObject==0)
448 return newObject;
451 * Initialize the virtual function table.
453 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
454 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
455 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
456 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
459 * Start with one reference count. The caller of this function
460 * must release the interface pointer when it is done.
462 newObject->ref = 1;
465 * Initialize the outer unknown
466 * We don't keep a reference on the outer unknown since, the way
467 * aggregation works, our lifetime is at least as large as it's
468 * lifetime.
470 if (pUnkOuter==NULL)
471 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
473 newObject->outerUnknown = pUnkOuter;
476 * Create a datacache object.
477 * We aggregate with the datacache. Make sure we pass our outer
478 * unknown as the datacache's outer unknown.
480 CreateDataCache(newObject->outerUnknown,
481 clsid,
482 &IID_IUnknown,
483 (void**)&newObject->dataCache);
486 * Initialize the other data members of the class.
488 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
489 newObject->clientSite = NULL;
490 newObject->oleAdviseHolder = NULL;
491 newObject->dataAdviseHolder = NULL;
492 newObject->containerApp = NULL;
493 newObject->containerObj = NULL;
495 return newObject;
498 static void DefaultHandler_Destroy(
499 DefaultHandler* ptrToDestroy)
502 * Free the strings idenfitying the object
504 if (ptrToDestroy->containerApp!=NULL)
506 SysFreeString(ptrToDestroy->containerApp);
507 ptrToDestroy->containerApp = NULL;
510 if (ptrToDestroy->containerObj!=NULL)
512 SysFreeString(ptrToDestroy->containerObj);
513 ptrToDestroy->containerObj = NULL;
517 * Release our reference to the data cache.
519 if (ptrToDestroy->dataCache!=NULL)
521 IUnknown_Release(ptrToDestroy->dataCache);
522 ptrToDestroy->dataCache = NULL;
526 * Same thing for the client site.
528 if (ptrToDestroy->clientSite!=NULL)
530 IOleClientSite_Release(ptrToDestroy->clientSite);
531 ptrToDestroy->clientSite = NULL;
535 * And the advise holder.
537 if (ptrToDestroy->oleAdviseHolder!=NULL)
539 IOleClientSite_Release(ptrToDestroy->oleAdviseHolder);
540 ptrToDestroy->oleAdviseHolder = NULL;
544 * And the data advise holder.
546 if (ptrToDestroy->dataAdviseHolder!=NULL)
548 IOleClientSite_Release(ptrToDestroy->dataAdviseHolder);
549 ptrToDestroy->dataAdviseHolder = NULL;
554 * Free the actual default handler structure.
556 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
559 /*********************************************************
560 * Method implementation for the non delegating IUnknown
561 * part of the DefaultHandler class.
564 /************************************************************************
565 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
567 * See Windows documentation for more details on IUnknown methods.
569 * This version of QueryInterface will not delegate it's implementation
570 * to the outer unknown.
572 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
573 IUnknown* iface,
574 REFIID riid,
575 void** ppvObject)
577 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
580 * Perform a sanity check on the parameters.
582 if ( (this==0) || (ppvObject==0) )
583 return E_INVALIDARG;
586 * Initialize the return parameter.
588 *ppvObject = 0;
591 * Compare the riid with the interface IDs implemented by this object.
593 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
595 *ppvObject = iface;
597 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
599 *ppvObject = (IOleObject*)&(this->lpvtbl1);
601 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
603 *ppvObject = (IDataObject*)&(this->lpvtbl3);
605 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
607 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
609 else
612 * Blind aggregate the data cache to "inherit" it's interfaces.
614 IUnknown_QueryInterface(this->dataCache, riid, ppvObject);
618 * Check that we obtained an interface.
620 if ((*ppvObject)==0)
622 char clsid[50];
624 WINE_StringFromCLSID((LPCLSID)riid,clsid);
626 WARN(ole,
627 "() : asking for un supported interface %s\n",
628 clsid);
630 return E_NOINTERFACE;
634 * Query Interface always increases the reference count by one when it is
635 * successful.
637 IUnknown_AddRef((IUnknown*)*ppvObject);
639 return S_OK;;
642 /************************************************************************
643 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
645 * See Windows documentation for more details on IUnknown methods.
647 * This version of QueryInterface will not delegate it's implementation
648 * to the outer unknown.
650 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
651 IUnknown* iface)
653 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
655 this->ref++;
657 return this->ref;
660 /************************************************************************
661 * DefaultHandler_NDIUnknown_Release (IUnknown)
663 * See Windows documentation for more details on IUnknown methods.
665 * This version of QueryInterface will not delegate it's implementation
666 * to the outer unknown.
668 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
669 IUnknown* iface)
671 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
674 * Decrease the reference count on this object.
676 this->ref--;
679 * If the reference count goes down to 0, perform suicide.
681 if (this->ref==0)
683 DefaultHandler_Destroy(this);
685 return 0;
688 return this->ref;
691 /*********************************************************
692 * Methods implementation for the IOleObject part of
693 * the DefaultHandler class.
696 /************************************************************************
697 * DefaultHandler_QueryInterface (IUnknown)
699 * See Windows documentation for more details on IUnknown methods.
701 static HRESULT WINAPI DefaultHandler_QueryInterface(
702 IOleObject* iface,
703 REFIID riid,
704 void** ppvObject)
706 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
708 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
711 /************************************************************************
712 * DefaultHandler_AddRef (IUnknown)
714 * See Windows documentation for more details on IUnknown methods.
716 static ULONG WINAPI DefaultHandler_AddRef(
717 IOleObject* iface)
719 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
721 return IUnknown_AddRef(this->outerUnknown);
724 /************************************************************************
725 * DefaultHandler_Release (IUnknown)
727 * See Windows documentation for more details on IUnknown methods.
729 static ULONG WINAPI DefaultHandler_Release(
730 IOleObject* iface)
732 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
734 return IUnknown_Release(this->outerUnknown);
737 /************************************************************************
738 * DefaultHandler_SetClientSite (IOleObject)
740 * The default handler's implementation of this method only keeps the
741 * client site pointer for future reference.
743 * See Windows documentation for more details on IOleObject methods.
745 static HRESULT WINAPI DefaultHandler_SetClientSite(
746 IOleObject* iface,
747 IOleClientSite* pClientSite)
749 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
751 TRACE(ole, "(%p, %p)\n", iface, pClientSite);
754 * Make sure we release the previous client site if there
755 * was one.
757 if (this->clientSite!=NULL)
759 IOleClientSite_Release(this->clientSite);
762 this->clientSite = pClientSite;
764 if (this->clientSite!=NULL)
766 IOleClientSite_AddRef(this->clientSite);
769 return S_OK;
772 /************************************************************************
773 * DefaultHandler_GetClientSite (IOleObject)
775 * The default handler's implementation of this method returns the
776 * last pointer set in IOleObject_SetClientSite.
778 * See Windows documentation for more details on IOleObject methods.
780 static HRESULT WINAPI DefaultHandler_GetClientSite(
781 IOleObject* iface,
782 IOleClientSite** ppClientSite)
784 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
787 * Sanity check.
789 if (ppClientSite == NULL)
790 return E_POINTER;
792 *ppClientSite = this->clientSite;
794 if (*ppClientSite!=NULL)
796 IOleClientSite_Release(*ppClientSite);
799 return S_OK;
802 /************************************************************************
803 * DefaultHandler_SetHostNames (IOleObject)
805 * The default handler's implementation of this method just stores
806 * the strings and returns S_OK.
808 * See Windows documentation for more details on IOleObject methods.
810 static HRESULT WINAPI DefaultHandler_SetHostNames(
811 IOleObject* iface,
812 LPCOLESTR szContainerApp,
813 LPCOLESTR szContainerObj)
815 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
817 TRACE(ole, "(%p, %s, %s)\n",
818 iface,
819 debugstr_w(szContainerApp),
820 debugstr_w(szContainerObj));
823 * Be sure to cleanup before re-assinging the strings.
825 if (this->containerApp!=NULL)
827 SysFreeString(this->containerApp);
828 this->containerApp = NULL;
831 if (this->containerObj!=NULL)
833 SysFreeString(this->containerObj);
834 this->containerObj = NULL;
838 * Copy the string supplied.
840 if (szContainerApp != NULL)
841 this->containerApp = SysAllocString(szContainerApp);
843 if (szContainerObj != NULL)
844 this->containerObj = SysAllocString(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(ole, "()\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(ole, "(%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(ole, "(%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(ole, "(%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(ole, "(%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 LPMSG lpmsg,
956 IOleClientSite* pActiveSite,
957 LONG lindex,
958 HWND hwndParent,
959 LPCRECT lprcPosRect)
961 FIXME(ole, ": 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(ole, "(%p, %p)\n", iface, ppEnumOleVerb);
981 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
984 static HRESULT WINAPI DefaultHandler_Update(
985 IOleObject* iface)
987 FIXME(ole, ": 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(ole, "(%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(ole, "(%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(ole, "(%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(ole, "(%p, %lx, (%d,%d))\n", iface, 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(ole, "(%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(ole, "(%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(ole, "(%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(ole, "(%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(ole, "(%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 LOGPALETTE* pLogpal)
1252 TRACE(ole, "(%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 static HRESULT WINAPI DefaultHandler_GetData(
1303 IDataObject* iface,
1304 LPFORMATETC pformatetcIn,
1305 STGMEDIUM* pmedium)
1307 FIXME(ole, ": Stub\n");
1308 return E_NOTIMPL;
1311 static HRESULT WINAPI DefaultHandler_GetDataHere(
1312 IDataObject* iface,
1313 LPFORMATETC pformatetc,
1314 STGMEDIUM* pmedium)
1316 FIXME(ole, ": Stub\n");
1317 return E_NOTIMPL;
1320 /************************************************************************
1321 * DefaultHandler_QueryGetData (IDataObject)
1323 * The default handler's implementation of this method delegates to
1324 * the cache.
1326 * See Windows documentation for more details on IDataObject methods.
1328 static HRESULT WINAPI DefaultHandler_QueryGetData(
1329 IDataObject* iface,
1330 LPFORMATETC pformatetc)
1332 IDataObject* cacheDataObject = NULL;
1333 HRESULT hres;
1335 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1337 TRACE(ole, "(%p, %p)\n", iface, pformatetc);
1339 hres = IUnknown_QueryInterface(this->dataCache,
1340 &IID_IDataObject,
1341 (void**)&cacheDataObject);
1343 if (FAILED(hres))
1344 return E_UNEXPECTED;
1346 hres = IDataObject_QueryGetData(cacheDataObject,
1347 pformatetc);
1349 IDataObject_Release(cacheDataObject);
1351 return hres;
1354 /************************************************************************
1355 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1357 * This method is meaningless if the server is not running
1359 * See Windows documentation for more details on IDataObject methods.
1361 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1362 IDataObject* iface,
1363 LPFORMATETC pformatectIn,
1364 LPFORMATETC pformatetcOut)
1366 FIXME(ole, "(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1368 return OLE_E_NOTRUNNING;
1371 /************************************************************************
1372 * DefaultHandler_SetData (IDataObject)
1374 * The default handler's implementation of this method delegates to
1375 * the cache.
1377 * See Windows documentation for more details on IDataObject methods.
1379 static HRESULT WINAPI DefaultHandler_SetData(
1380 IDataObject* iface,
1381 LPFORMATETC pformatetc,
1382 STGMEDIUM* pmedium,
1383 BOOL fRelease)
1385 IDataObject* cacheDataObject = NULL;
1386 HRESULT hres;
1388 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1390 TRACE(ole, "(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1392 hres = IUnknown_QueryInterface(this->dataCache,
1393 &IID_IDataObject,
1394 (void**)&cacheDataObject);
1396 if (FAILED(hres))
1397 return E_UNEXPECTED;
1399 hres = IDataObject_SetData(cacheDataObject,
1400 pformatetc,
1401 pmedium,
1402 fRelease);
1404 IDataObject_Release(cacheDataObject);
1406 return hres;
1409 /************************************************************************
1410 * DefaultHandler_EnumFormatEtc (IDataObject)
1412 * The default handler's implementation of this method simply delegates
1413 * to OleRegEnumFormatEtc.
1415 * See Windows documentation for more details on IDataObject methods.
1417 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1418 IDataObject* iface,
1419 DWORD dwDirection,
1420 IEnumFORMATETC** ppenumFormatEtc)
1422 HRESULT hres;
1423 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1425 TRACE(ole, "(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1427 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1429 return hres;
1432 /************************************************************************
1433 * DefaultHandler_DAdvise (IDataObject)
1435 * The default handler's implementation of this method simply
1436 * delegates to the DataAdviseHolder.
1438 * See Windows documentation for more details on IDataObject methods.
1440 static HRESULT WINAPI DefaultHandler_DAdvise(
1441 IDataObject* iface,
1442 FORMATETC* pformatetc,
1443 DWORD advf,
1444 IAdviseSink* pAdvSink,
1445 DWORD* pdwConnection)
1447 HRESULT hres = S_OK;
1448 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1450 TRACE(ole, "(%p, %p, %ld, %p, %p)\n",
1451 iface, pformatetc, advf, pAdvSink, pdwConnection);
1454 * Make sure we have a data advise holder before we start.
1456 if (this->dataAdviseHolder==NULL)
1458 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1461 if (SUCCEEDED(hres))
1463 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1464 iface,
1465 pformatetc,
1466 advf,
1467 pAdvSink,
1468 pdwConnection);
1471 return hres;
1474 /************************************************************************
1475 * DefaultHandler_DUnadvise (IDataObject)
1477 * The default handler's implementation of this method simply
1478 * delegates to the DataAdviseHolder.
1480 * See Windows documentation for more details on IDataObject methods.
1482 static HRESULT WINAPI DefaultHandler_DUnadvise(
1483 IDataObject* iface,
1484 DWORD dwConnection)
1486 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1488 TRACE(ole, "(%p, %ld)\n", iface, dwConnection);
1491 * If we don't have a data advise holder yet, it means that
1492 * we don't have any connections..
1494 if (this->dataAdviseHolder==NULL)
1496 return OLE_E_NOCONNECTION;
1499 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1500 dwConnection);
1503 /************************************************************************
1504 * DefaultHandler_EnumDAdvise (IDataObject)
1506 * The default handler's implementation of this method simply
1507 * delegates to the DataAdviseHolder.
1509 * See Windows documentation for more details on IDataObject methods.
1511 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1512 IDataObject* iface,
1513 IEnumSTATDATA** ppenumAdvise)
1515 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1517 TRACE(ole, "(%p, %p)\n", iface, ppenumAdvise);
1520 * Sanity check
1522 if (ppenumAdvise == NULL)
1523 return E_POINTER;
1526 * Initialize the out parameter.
1528 *ppenumAdvise = NULL;
1531 * If we have a data advise holder object, delegate.
1533 if (this->dataAdviseHolder!=NULL)
1535 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1536 ppenumAdvise);
1539 return S_OK;
1542 /*********************************************************
1543 * Methods implementation for the IRunnableObject part
1544 * of the DefaultHandler class.
1547 /************************************************************************
1548 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1550 * See Windows documentation for more details on IUnknown methods.
1552 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1553 IRunnableObject* iface,
1554 REFIID riid,
1555 void** ppvObject)
1557 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1559 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1562 /************************************************************************
1563 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1565 * See Windows documentation for more details on IUnknown methods.
1567 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1568 IRunnableObject* iface)
1570 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1572 return IUnknown_AddRef(this->outerUnknown);
1575 /************************************************************************
1576 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1578 * See Windows documentation for more details on IUnknown methods.
1580 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1581 IRunnableObject* iface)
1583 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1585 return IUnknown_Release(this->outerUnknown);
1588 /************************************************************************
1589 * DefaultHandler_GetRunningClass (IRunnableObject)
1591 * According to Brockscmidt, Chapter 19, the default handler's
1592 * implementation of IRunnableobject does nothing until the object
1593 * is actually running.
1595 * See Windows documentation for more details on IRunnableObject methods.
1597 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1598 IRunnableObject* iface,
1599 LPCLSID lpClsid)
1601 TRACE(ole, "()\n");
1602 return S_OK;
1605 static HRESULT WINAPI DefaultHandler_Run(
1606 IRunnableObject* iface,
1607 IBindCtx* pbc)
1609 FIXME(ole, ": Stub\n");
1610 return E_NOTIMPL;
1613 /************************************************************************
1614 * DefaultHandler_IsRunning (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 BOOL WINAPI DefaultHandler_IsRunning(
1623 IRunnableObject* iface)
1625 TRACE(ole, "()\n");
1626 return S_FALSE;
1629 /************************************************************************
1630 * DefaultHandler_LockRunning (IRunnableObject)
1632 * According to Brockscmidt, Chapter 19, the default handler's
1633 * implementation of IRunnableobject does nothing until the object
1634 * is actually running.
1636 * See Windows documentation for more details on IRunnableObject methods.
1638 static HRESULT WINAPI DefaultHandler_LockRunning(
1639 IRunnableObject* iface,
1640 BOOL fLock,
1641 BOOL fLastUnlockCloses)
1643 TRACE(ole, "()\n");
1644 return S_OK;
1647 /************************************************************************
1648 * DefaultHandler_SetContainedObject (IRunnableObject)
1650 * According to Brockscmidt, Chapter 19, the default handler's
1651 * implementation of IRunnableobject does nothing until the object
1652 * is actually running.
1654 * See Windows documentation for more details on IRunnableObject methods.
1656 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1657 IRunnableObject* iface,
1658 BOOL fContained)
1660 TRACE(ole, "()\n");
1661 return S_OK;