Ref count increment/decrement cleanup.
[wine/multimedia.git] / dlls / ole32 / defaulthandler.c
blobdaa40c62e77a777ac45b57ebe218767a842545c8
1 /*
2 * OLE 2 default object handler
4 * Copyright 1999 Francis Beaudet
5 * Copyright 2000 Abey George
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * NOTES:
22 * The OLE2 default object handler supports a whole whack of
23 * interfaces including:
24 * IOleObject, IDataObject, IPersistStorage, IViewObject2,
25 * IRunnableObject, IOleCache2, IOleCacheControl and much more.
27 * All the implementation details are taken from: Inside OLE
28 * second edition by Kraig Brockschmidt,
30 * TODO
31 * - This implementation of the default handler does not launch the
32 * server in the DoVerb, Update, GetData, GetDataHere and Run
33 * methods. When it is fixed to do so, all the methods will have
34 * to be revisited to allow delegating to the running object
36 * - All methods in the class that use the class ID should be
37 * aware that it is possible for a class to be treated as
38 * another one and go into emulation mode. Nothing has been
39 * done in this area.
41 * - Some functions still return E_NOTIMPL they have to be
42 * implemented. Most of those are related to the running of the
43 * actual server.
45 * - All the methods related to notification and advise sinks are
46 * in place but no notifications are sent to the sinks yet.
48 #include <assert.h>
49 #include <stdarg.h>
50 #include <string.h>
52 #include "windef.h"
53 #include "winbase.h"
54 #include "winuser.h"
55 #include "winerror.h"
56 #include "wine/unicode.h"
57 #include "ole2.h"
58 #include "wine/debug.h"
60 WINE_DEFAULT_DEBUG_CHANNEL(ole);
62 /****************************************************************************
63 * DefaultHandler
66 struct DefaultHandler
69 * List all interface VTables here
71 IOleObjectVtbl* lpvtbl1;
72 IUnknownVtbl* lpvtbl2;
73 IDataObjectVtbl* lpvtbl3;
74 IRunnableObjectVtbl* lpvtbl4;
77 * Reference count of this object
79 ULONG ref;
82 * IUnknown implementation of the outer object.
84 IUnknown* outerUnknown;
87 * Class Id that this handler object represents.
89 CLSID clsid;
92 * IUnknown implementation of the datacache.
94 IUnknown* dataCache;
97 * Client site for the embedded object.
99 IOleClientSite* clientSite;
102 * The IOleAdviseHolder maintains the connections
103 * on behalf of the default handler.
105 IOleAdviseHolder* oleAdviseHolder;
108 * The IDataAdviseHolder maintains the data
109 * connections on behalf of the default handler.
111 IDataAdviseHolder* dataAdviseHolder;
114 * Name of the container and object contained
116 LPWSTR containerApp;
117 LPWSTR containerObj;
121 typedef struct DefaultHandler DefaultHandler;
124 * Here, I define utility macros to help with the casting of the
125 * "this" parameter.
126 * There is a version to accomodate all of the VTables implemented
127 * by this object.
129 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name
130 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
131 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*))
132 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*))
135 * Prototypes for the methods of the DefaultHandler class.
137 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
138 LPUNKNOWN pUnkOuter);
139 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
142 * Prototypes for the methods of the DefaultHandler class
143 * that implement non delegating IUnknown methods.
145 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
146 IUnknown* iface,
147 REFIID riid,
148 void** ppvObject);
149 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
150 IUnknown* iface);
151 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
152 IUnknown* iface);
155 * Prototypes for the methods of the DefaultHandler class
156 * that implement IOleObject methods.
158 static HRESULT WINAPI DefaultHandler_QueryInterface(
159 IOleObject* iface,
160 REFIID riid,
161 void** ppvObject);
162 static ULONG WINAPI DefaultHandler_AddRef(
163 IOleObject* iface);
164 static ULONG WINAPI DefaultHandler_Release(
165 IOleObject* iface);
166 static HRESULT WINAPI DefaultHandler_SetClientSite(
167 IOleObject* iface,
168 IOleClientSite* pClientSite);
169 static HRESULT WINAPI DefaultHandler_GetClientSite(
170 IOleObject* iface,
171 IOleClientSite** ppClientSite);
172 static HRESULT WINAPI DefaultHandler_SetHostNames(
173 IOleObject* iface,
174 LPCOLESTR szContainerApp,
175 LPCOLESTR szContainerObj);
176 static HRESULT WINAPI DefaultHandler_Close(
177 IOleObject* iface,
178 DWORD dwSaveOption);
179 static HRESULT WINAPI DefaultHandler_SetMoniker(
180 IOleObject* iface,
181 DWORD dwWhichMoniker,
182 IMoniker* pmk);
183 static HRESULT WINAPI DefaultHandler_GetMoniker(
184 IOleObject* iface,
185 DWORD dwAssign,
186 DWORD dwWhichMoniker,
187 IMoniker** ppmk);
188 static HRESULT WINAPI DefaultHandler_InitFromData(
189 IOleObject* iface,
190 IDataObject* pDataObject,
191 BOOL fCreation,
192 DWORD dwReserved);
193 static HRESULT WINAPI DefaultHandler_GetClipboardData(
194 IOleObject* iface,
195 DWORD dwReserved,
196 IDataObject** ppDataObject);
197 static HRESULT WINAPI DefaultHandler_DoVerb(
198 IOleObject* iface,
199 LONG iVerb,
200 struct tagMSG* lpmsg,
201 IOleClientSite* pActiveSite,
202 LONG lindex,
203 HWND hwndParent,
204 LPCRECT lprcPosRect);
205 static HRESULT WINAPI DefaultHandler_EnumVerbs(
206 IOleObject* iface,
207 IEnumOLEVERB** ppEnumOleVerb);
208 static HRESULT WINAPI DefaultHandler_Update(
209 IOleObject* iface);
210 static HRESULT WINAPI DefaultHandler_IsUpToDate(
211 IOleObject* iface);
212 static HRESULT WINAPI DefaultHandler_GetUserClassID(
213 IOleObject* iface,
214 CLSID* pClsid);
215 static HRESULT WINAPI DefaultHandler_GetUserType(
216 IOleObject* iface,
217 DWORD dwFormOfType,
218 LPOLESTR* pszUserType);
219 static HRESULT WINAPI DefaultHandler_SetExtent(
220 IOleObject* iface,
221 DWORD dwDrawAspect,
222 SIZEL* psizel);
223 static HRESULT WINAPI DefaultHandler_GetExtent(
224 IOleObject* iface,
225 DWORD dwDrawAspect,
226 SIZEL* psizel);
227 static HRESULT WINAPI DefaultHandler_Advise(
228 IOleObject* iface,
229 IAdviseSink* pAdvSink,
230 DWORD* pdwConnection);
231 static HRESULT WINAPI DefaultHandler_Unadvise(
232 IOleObject* iface,
233 DWORD dwConnection);
234 static HRESULT WINAPI DefaultHandler_EnumAdvise(
235 IOleObject* iface,
236 IEnumSTATDATA** ppenumAdvise);
237 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
238 IOleObject* iface,
239 DWORD dwAspect,
240 DWORD* pdwStatus);
241 static HRESULT WINAPI DefaultHandler_SetColorScheme(
242 IOleObject* iface,
243 struct tagLOGPALETTE* pLogpal);
246 * Prototypes for the methods of the DefaultHandler class
247 * that implement IDataObject methods.
249 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
250 IDataObject* iface,
251 REFIID riid,
252 void** ppvObject);
253 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
254 IDataObject* iface);
255 static ULONG WINAPI DefaultHandler_IDataObject_Release(
256 IDataObject* iface);
257 static HRESULT WINAPI DefaultHandler_GetData(
258 IDataObject* iface,
259 LPFORMATETC pformatetcIn,
260 STGMEDIUM* pmedium);
261 static HRESULT WINAPI DefaultHandler_GetDataHere(
262 IDataObject* iface,
263 LPFORMATETC pformatetc,
264 STGMEDIUM* pmedium);
265 static HRESULT WINAPI DefaultHandler_QueryGetData(
266 IDataObject* iface,
267 LPFORMATETC pformatetc);
268 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
269 IDataObject* iface,
270 LPFORMATETC pformatectIn,
271 LPFORMATETC pformatetcOut);
272 static HRESULT WINAPI DefaultHandler_SetData(
273 IDataObject* iface,
274 LPFORMATETC pformatetc,
275 STGMEDIUM* pmedium,
276 BOOL fRelease);
277 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
278 IDataObject* iface,
279 DWORD dwDirection,
280 IEnumFORMATETC** ppenumFormatEtc);
281 static HRESULT WINAPI DefaultHandler_DAdvise(
282 IDataObject* iface,
283 FORMATETC* pformatetc,
284 DWORD advf,
285 IAdviseSink* pAdvSink,
286 DWORD* pdwConnection);
287 static HRESULT WINAPI DefaultHandler_DUnadvise(
288 IDataObject* iface,
289 DWORD dwConnection);
290 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
291 IDataObject* iface,
292 IEnumSTATDATA** ppenumAdvise);
295 * Prototypes for the methods of the DefaultHandler class
296 * that implement IRunnableObject methods.
298 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
299 IRunnableObject* iface,
300 REFIID riid,
301 void** ppvObject);
302 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
303 IRunnableObject* iface);
304 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
305 IRunnableObject* iface);
306 static HRESULT WINAPI DefaultHandler_GetRunningClass(
307 IRunnableObject* iface,
308 LPCLSID lpClsid);
309 static HRESULT WINAPI DefaultHandler_Run(
310 IRunnableObject* iface,
311 IBindCtx* pbc);
312 static BOOL WINAPI DefaultHandler_IsRunning(
313 IRunnableObject* iface);
314 static HRESULT WINAPI DefaultHandler_LockRunning(
315 IRunnableObject* iface,
316 BOOL fLock,
317 BOOL fLastUnlockCloses);
318 static HRESULT WINAPI DefaultHandler_SetContainedObject(
319 IRunnableObject* iface,
320 BOOL fContained);
324 * Virtual function tables for the DefaultHandler class.
326 static IOleObjectVtbl DefaultHandler_IOleObject_VTable =
328 DefaultHandler_QueryInterface,
329 DefaultHandler_AddRef,
330 DefaultHandler_Release,
331 DefaultHandler_SetClientSite,
332 DefaultHandler_GetClientSite,
333 DefaultHandler_SetHostNames,
334 DefaultHandler_Close,
335 DefaultHandler_SetMoniker,
336 DefaultHandler_GetMoniker,
337 DefaultHandler_InitFromData,
338 DefaultHandler_GetClipboardData,
339 DefaultHandler_DoVerb,
340 DefaultHandler_EnumVerbs,
341 DefaultHandler_Update,
342 DefaultHandler_IsUpToDate,
343 DefaultHandler_GetUserClassID,
344 DefaultHandler_GetUserType,
345 DefaultHandler_SetExtent,
346 DefaultHandler_GetExtent,
347 DefaultHandler_Advise,
348 DefaultHandler_Unadvise,
349 DefaultHandler_EnumAdvise,
350 DefaultHandler_GetMiscStatus,
351 DefaultHandler_SetColorScheme
354 static IUnknownVtbl DefaultHandler_NDIUnknown_VTable =
356 DefaultHandler_NDIUnknown_QueryInterface,
357 DefaultHandler_NDIUnknown_AddRef,
358 DefaultHandler_NDIUnknown_Release,
361 static IDataObjectVtbl DefaultHandler_IDataObject_VTable =
363 DefaultHandler_IDataObject_QueryInterface,
364 DefaultHandler_IDataObject_AddRef,
365 DefaultHandler_IDataObject_Release,
366 DefaultHandler_GetData,
367 DefaultHandler_GetDataHere,
368 DefaultHandler_QueryGetData,
369 DefaultHandler_GetCanonicalFormatEtc,
370 DefaultHandler_SetData,
371 DefaultHandler_EnumFormatEtc,
372 DefaultHandler_DAdvise,
373 DefaultHandler_DUnadvise,
374 DefaultHandler_EnumDAdvise
377 static IRunnableObjectVtbl DefaultHandler_IRunnableObject_VTable =
379 DefaultHandler_IRunnableObject_QueryInterface,
380 DefaultHandler_IRunnableObject_AddRef,
381 DefaultHandler_IRunnableObject_Release,
382 DefaultHandler_GetRunningClass,
383 DefaultHandler_Run,
384 DefaultHandler_IsRunning,
385 DefaultHandler_LockRunning,
386 DefaultHandler_SetContainedObject
389 /******************************************************************************
390 * OleCreateDefaultHandler [OLE32.@]
392 HRESULT WINAPI OleCreateDefaultHandler(
393 REFCLSID clsid,
394 LPUNKNOWN pUnkOuter,
395 REFIID riid,
396 LPVOID* ppvObj)
398 DefaultHandler* newHandler = NULL;
399 HRESULT hr = S_OK;
401 TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, debugstr_guid(riid), ppvObj);
404 * Sanity check
406 if (ppvObj==0)
407 return E_POINTER;
409 *ppvObj = 0;
412 * If this handler is constructed for aggregation, make sure
413 * the caller is requesting the IUnknown interface.
414 * This is necessary because it's the only time the non-delegating
415 * IUnknown pointer can be returned to the outside.
417 if ( (pUnkOuter!=NULL) &&
418 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
419 return CLASS_E_NOAGGREGATION;
422 * Try to construct a new instance of the class.
424 newHandler = DefaultHandler_Construct(clsid,
425 pUnkOuter);
427 if (newHandler == 0)
428 return E_OUTOFMEMORY;
431 * Make sure it supports the interface required by the caller.
433 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
436 * Release the reference obtained in the constructor. If
437 * the QueryInterface was unsuccessful, it will free the class.
439 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
441 return hr;
444 /*********************************************************
445 * Methods implementation for the DefaultHandler class.
447 static DefaultHandler* DefaultHandler_Construct(
448 REFCLSID clsid,
449 LPUNKNOWN pUnkOuter)
451 DefaultHandler* newObject = 0;
454 * Allocate space for the object.
456 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
458 if (newObject==0)
459 return newObject;
462 * Initialize the virtual function table.
464 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
465 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
466 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
467 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
470 * Start with one reference count. The caller of this function
471 * must release the interface pointer when it is done.
473 newObject->ref = 1;
476 * Initialize the outer unknown
477 * We don't keep a reference on the outer unknown since, the way
478 * aggregation works, our lifetime is at least as large as it's
479 * lifetime.
481 if (pUnkOuter==NULL)
482 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
484 newObject->outerUnknown = pUnkOuter;
487 * Create a datacache object.
488 * We aggregate with the datacache. Make sure we pass our outer
489 * unknown as the datacache's outer unknown.
491 CreateDataCache(newObject->outerUnknown,
492 clsid,
493 &IID_IUnknown,
494 (void**)&newObject->dataCache);
497 * Initialize the other data members of the class.
499 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
500 newObject->clientSite = NULL;
501 newObject->oleAdviseHolder = NULL;
502 newObject->dataAdviseHolder = NULL;
503 newObject->containerApp = NULL;
504 newObject->containerObj = NULL;
506 return newObject;
509 static void DefaultHandler_Destroy(
510 DefaultHandler* ptrToDestroy)
513 * Free the strings idenfitying the object
515 if (ptrToDestroy->containerApp!=NULL)
517 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerApp );
518 ptrToDestroy->containerApp = NULL;
521 if (ptrToDestroy->containerObj!=NULL)
523 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj );
524 ptrToDestroy->containerObj = NULL;
528 * Release our reference to the data cache.
530 if (ptrToDestroy->dataCache!=NULL)
532 IUnknown_Release(ptrToDestroy->dataCache);
533 ptrToDestroy->dataCache = NULL;
537 * Same thing for the client site.
539 if (ptrToDestroy->clientSite!=NULL)
541 IOleClientSite_Release(ptrToDestroy->clientSite);
542 ptrToDestroy->clientSite = NULL;
546 * And the advise holder.
548 if (ptrToDestroy->oleAdviseHolder!=NULL)
550 IOleAdviseHolder_Release(ptrToDestroy->oleAdviseHolder);
551 ptrToDestroy->oleAdviseHolder = NULL;
555 * And the data advise holder.
557 if (ptrToDestroy->dataAdviseHolder!=NULL)
559 IDataAdviseHolder_Release(ptrToDestroy->dataAdviseHolder);
560 ptrToDestroy->dataAdviseHolder = NULL;
565 * Free the actual default handler structure.
567 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
570 /*********************************************************
571 * Method implementation for the non delegating IUnknown
572 * part of the DefaultHandler class.
575 /************************************************************************
576 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
578 * See Windows documentation for more details on IUnknown methods.
580 * This version of QueryInterface will not delegate it's implementation
581 * to the outer unknown.
583 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
584 IUnknown* iface,
585 REFIID riid,
586 void** ppvObject)
588 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
591 * Perform a sanity check on the parameters.
593 if ( (this==0) || (ppvObject==0) )
594 return E_INVALIDARG;
597 * Initialize the return parameter.
599 *ppvObject = 0;
602 * Compare the riid with the interface IDs implemented by this object.
604 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
606 *ppvObject = iface;
608 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
610 *ppvObject = (IOleObject*)&(this->lpvtbl1);
612 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
614 *ppvObject = (IDataObject*)&(this->lpvtbl3);
616 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
618 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
620 else
623 * Blind aggregate the data cache to "inherit" it's interfaces.
625 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK)
626 return S_OK;
630 * Check that we obtained an interface.
632 if ((*ppvObject)==0)
634 WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid));
635 return E_NOINTERFACE;
639 * Query Interface always increases the reference count by one when it is
640 * successful.
642 IUnknown_AddRef((IUnknown*)*ppvObject);
644 return S_OK;
647 /************************************************************************
648 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
650 * See Windows documentation for more details on IUnknown methods.
652 * This version of QueryInterface will not delegate it's implementation
653 * to the outer unknown.
655 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
656 IUnknown* iface)
658 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
659 return InterlockedIncrement(&this->ref);
662 /************************************************************************
663 * DefaultHandler_NDIUnknown_Release (IUnknown)
665 * See Windows documentation for more details on IUnknown methods.
667 * This version of QueryInterface will not delegate it's implementation
668 * to the outer unknown.
670 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
671 IUnknown* iface)
673 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
674 ULONG ref;
677 * Decrease the reference count on this object.
679 ref = InterlockedDecrement(&this->ref);
682 * If the reference count goes down to 0, perform suicide.
684 if (ref == 0) DefaultHandler_Destroy(this);
686 return ref;
689 /*********************************************************
690 * Methods implementation for the IOleObject part of
691 * the DefaultHandler class.
694 /************************************************************************
695 * DefaultHandler_QueryInterface (IUnknown)
697 * See Windows documentation for more details on IUnknown methods.
699 static HRESULT WINAPI DefaultHandler_QueryInterface(
700 IOleObject* iface,
701 REFIID riid,
702 void** ppvObject)
704 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
706 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
709 /************************************************************************
710 * DefaultHandler_AddRef (IUnknown)
712 * See Windows documentation for more details on IUnknown methods.
714 static ULONG WINAPI DefaultHandler_AddRef(
715 IOleObject* iface)
717 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
719 return IUnknown_AddRef(this->outerUnknown);
722 /************************************************************************
723 * DefaultHandler_Release (IUnknown)
725 * See Windows documentation for more details on IUnknown methods.
727 static ULONG WINAPI DefaultHandler_Release(
728 IOleObject* iface)
730 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
732 return IUnknown_Release(this->outerUnknown);
735 /************************************************************************
736 * DefaultHandler_SetClientSite (IOleObject)
738 * The default handler's implementation of this method only keeps the
739 * client site pointer for future reference.
741 * See Windows documentation for more details on IOleObject methods.
743 static HRESULT WINAPI DefaultHandler_SetClientSite(
744 IOleObject* iface,
745 IOleClientSite* pClientSite)
747 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
749 TRACE("(%p, %p)\n", iface, pClientSite);
752 * Make sure we release the previous client site if there
753 * was one.
755 if (this->clientSite!=NULL)
757 IOleClientSite_Release(this->clientSite);
760 this->clientSite = pClientSite;
762 if (this->clientSite!=NULL)
764 IOleClientSite_AddRef(this->clientSite);
767 return S_OK;
770 /************************************************************************
771 * DefaultHandler_GetClientSite (IOleObject)
773 * The default handler's implementation of this method returns the
774 * last pointer set in IOleObject_SetClientSite.
776 * See Windows documentation for more details on IOleObject methods.
778 static HRESULT WINAPI DefaultHandler_GetClientSite(
779 IOleObject* iface,
780 IOleClientSite** ppClientSite)
782 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
785 * Sanity check.
787 if (ppClientSite == NULL)
788 return E_POINTER;
790 *ppClientSite = this->clientSite;
792 if (this->clientSite != NULL)
794 IOleClientSite_AddRef(this->clientSite);
797 return S_OK;
800 /************************************************************************
801 * DefaultHandler_SetHostNames (IOleObject)
803 * The default handler's implementation of this method just stores
804 * the strings and returns S_OK.
806 * See Windows documentation for more details on IOleObject methods.
808 static HRESULT WINAPI DefaultHandler_SetHostNames(
809 IOleObject* iface,
810 LPCOLESTR szContainerApp,
811 LPCOLESTR szContainerObj)
813 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
815 TRACE("(%p, %s, %s)\n",
816 iface,
817 debugstr_w(szContainerApp),
818 debugstr_w(szContainerObj));
821 * Be sure to cleanup before re-assinging the strings.
823 if (this->containerApp!=NULL)
825 HeapFree( GetProcessHeap(), 0, this->containerApp );
826 this->containerApp = NULL;
829 if (this->containerObj!=NULL)
831 HeapFree( GetProcessHeap(), 0, this->containerObj );
832 this->containerObj = NULL;
836 * Copy the string supplied.
838 if (szContainerApp != NULL)
840 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
841 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
842 strcpyW( this->containerApp, szContainerApp );
845 if (szContainerObj != NULL)
847 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
848 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
849 strcpyW( this->containerObj, szContainerObj );
851 return S_OK;
854 /************************************************************************
855 * DefaultHandler_Close (IOleObject)
857 * The default handler's implementation of this method is meaningless
858 * without a running server so it does nothing.
860 * See Windows documentation for more details on IOleObject methods.
862 static HRESULT WINAPI DefaultHandler_Close(
863 IOleObject* iface,
864 DWORD dwSaveOption)
866 TRACE("()\n");
867 return S_OK;
870 /************************************************************************
871 * DefaultHandler_SetMoniker (IOleObject)
873 * The default handler's implementation of this method does nothing.
875 * See Windows documentation for more details on IOleObject methods.
877 static HRESULT WINAPI DefaultHandler_SetMoniker(
878 IOleObject* iface,
879 DWORD dwWhichMoniker,
880 IMoniker* pmk)
882 TRACE("(%p, %ld, %p)\n",
883 iface,
884 dwWhichMoniker,
885 pmk);
887 return S_OK;
890 /************************************************************************
891 * DefaultHandler_GetMoniker (IOleObject)
893 * Delegate this request to the client site if we have one.
895 * See Windows documentation for more details on IOleObject methods.
897 static HRESULT WINAPI DefaultHandler_GetMoniker(
898 IOleObject* iface,
899 DWORD dwAssign,
900 DWORD dwWhichMoniker,
901 IMoniker** ppmk)
903 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
905 TRACE("(%p, %ld, %ld, %p)\n",
906 iface, dwAssign, dwWhichMoniker, ppmk);
908 if (this->clientSite)
910 return IOleClientSite_GetMoniker(this->clientSite,
911 dwAssign,
912 dwWhichMoniker,
913 ppmk);
917 return E_FAIL;
920 /************************************************************************
921 * DefaultHandler_InitFromData (IOleObject)
923 * This method is meaningless if the server is not running
925 * See Windows documentation for more details on IOleObject methods.
927 static HRESULT WINAPI DefaultHandler_InitFromData(
928 IOleObject* iface,
929 IDataObject* pDataObject,
930 BOOL fCreation,
931 DWORD dwReserved)
933 TRACE("(%p, %p, %d, %ld)\n",
934 iface, pDataObject, fCreation, dwReserved);
936 return OLE_E_NOTRUNNING;
939 /************************************************************************
940 * DefaultHandler_GetClipboardData (IOleObject)
942 * This method is meaningless if the server is not running
944 * See Windows documentation for more details on IOleObject methods.
946 static HRESULT WINAPI DefaultHandler_GetClipboardData(
947 IOleObject* iface,
948 DWORD dwReserved,
949 IDataObject** ppDataObject)
951 TRACE("(%p, %ld, %p)\n",
952 iface, dwReserved, ppDataObject);
954 return OLE_E_NOTRUNNING;
957 static HRESULT WINAPI DefaultHandler_DoVerb(
958 IOleObject* iface,
959 LONG iVerb,
960 struct tagMSG* lpmsg,
961 IOleClientSite* pActiveSite,
962 LONG lindex,
963 HWND hwndParent,
964 LPCRECT lprcPosRect)
966 FIXME(": Stub\n");
967 return E_NOTIMPL;
970 /************************************************************************
971 * DefaultHandler_EnumVerbs (IOleObject)
973 * The default handler implementation of this method simply delegates
974 * to OleRegEnumVerbs
976 * See Windows documentation for more details on IOleObject methods.
978 static HRESULT WINAPI DefaultHandler_EnumVerbs(
979 IOleObject* iface,
980 IEnumOLEVERB** ppEnumOleVerb)
982 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
984 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
986 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
989 static HRESULT WINAPI DefaultHandler_Update(
990 IOleObject* iface)
992 FIXME(": Stub\n");
993 return E_NOTIMPL;
996 /************************************************************************
997 * DefaultHandler_IsUpToDate (IOleObject)
999 * This method is meaningless if the server is not running
1001 * See Windows documentation for more details on IOleObject methods.
1003 static HRESULT WINAPI DefaultHandler_IsUpToDate(
1004 IOleObject* iface)
1006 TRACE("(%p)\n", iface);
1008 return OLE_E_NOTRUNNING;
1011 /************************************************************************
1012 * DefaultHandler_GetUserClassID (IOleObject)
1014 * TODO: Map to a new class ID if emulation is active.
1016 * See Windows documentation for more details on IOleObject methods.
1018 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1019 IOleObject* iface,
1020 CLSID* pClsid)
1022 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1024 TRACE("(%p, %p)\n", iface, pClsid);
1027 * Sanity check.
1029 if (pClsid==NULL)
1030 return E_POINTER;
1032 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1034 return S_OK;
1037 /************************************************************************
1038 * DefaultHandler_GetUserType (IOleObject)
1040 * The default handler implementation of this method simply delegates
1041 * to OleRegGetUserType
1043 * See Windows documentation for more details on IOleObject methods.
1045 static HRESULT WINAPI DefaultHandler_GetUserType(
1046 IOleObject* iface,
1047 DWORD dwFormOfType,
1048 LPOLESTR* pszUserType)
1050 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1052 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1054 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1057 /************************************************************************
1058 * DefaultHandler_SetExtent (IOleObject)
1060 * This method is meaningless if the server is not running
1062 * See Windows documentation for more details on IOleObject methods.
1064 static HRESULT WINAPI DefaultHandler_SetExtent(
1065 IOleObject* iface,
1066 DWORD dwDrawAspect,
1067 SIZEL* psizel)
1069 TRACE("(%p, %lx, (%ld x %ld))\n", iface,
1070 dwDrawAspect, psizel->cx, psizel->cy);
1071 return OLE_E_NOTRUNNING;
1074 /************************************************************************
1075 * DefaultHandler_GetExtent (IOleObject)
1077 * The default handler's implementation of this method returns uses
1078 * the cache to locate the aspect and extract the extent from it.
1080 * See Windows documentation for more details on IOleObject methods.
1082 static HRESULT WINAPI DefaultHandler_GetExtent(
1083 IOleObject* iface,
1084 DWORD dwDrawAspect,
1085 SIZEL* psizel)
1087 DVTARGETDEVICE* targetDevice;
1088 IViewObject2* cacheView = NULL;
1089 HRESULT hres;
1091 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1093 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1095 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1097 if (FAILED(hres))
1098 return E_UNEXPECTED;
1101 * Prepare the call to the cache's GetExtent method.
1103 * Here we would build a valid DVTARGETDEVICE structure
1104 * but, since we are calling into the data cache, we
1105 * know it's implementation and we'll skip this
1106 * extra work until later.
1108 targetDevice = NULL;
1110 hres = IViewObject2_GetExtent(cacheView,
1111 dwDrawAspect,
1113 targetDevice,
1114 psizel);
1117 * Cleanup
1119 IViewObject2_Release(cacheView);
1121 return hres;
1124 /************************************************************************
1125 * DefaultHandler_Advise (IOleObject)
1127 * The default handler's implementation of this method simply
1128 * delegates to the OleAdviseHolder.
1130 * See Windows documentation for more details on IOleObject methods.
1132 static HRESULT WINAPI DefaultHandler_Advise(
1133 IOleObject* iface,
1134 IAdviseSink* pAdvSink,
1135 DWORD* pdwConnection)
1137 HRESULT hres = S_OK;
1138 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1140 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1143 * Make sure we have an advise holder before we start.
1145 if (this->oleAdviseHolder==NULL)
1147 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1150 if (SUCCEEDED(hres))
1152 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1153 pAdvSink,
1154 pdwConnection);
1157 return hres;
1160 /************************************************************************
1161 * DefaultHandler_Unadvise (IOleObject)
1163 * The default handler's implementation of this method simply
1164 * delegates to the OleAdviseHolder.
1166 * See Windows documentation for more details on IOleObject methods.
1168 static HRESULT WINAPI DefaultHandler_Unadvise(
1169 IOleObject* iface,
1170 DWORD dwConnection)
1172 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1174 TRACE("(%p, %ld)\n", iface, dwConnection);
1177 * If we don't have an advise holder yet, it means we don't have
1178 * a connection.
1180 if (this->oleAdviseHolder==NULL)
1181 return OLE_E_NOCONNECTION;
1183 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1184 dwConnection);
1187 /************************************************************************
1188 * DefaultHandler_EnumAdvise (IOleObject)
1190 * The default handler's implementation of this method simply
1191 * delegates to the OleAdviseHolder.
1193 * See Windows documentation for more details on IOleObject methods.
1195 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1196 IOleObject* iface,
1197 IEnumSTATDATA** ppenumAdvise)
1199 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1201 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1204 * Sanity check
1206 if (ppenumAdvise==NULL)
1207 return E_POINTER;
1210 * Initialize the out parameter.
1212 *ppenumAdvise = NULL;
1214 if (this->oleAdviseHolder==NULL)
1215 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1216 ppenumAdvise);
1218 return S_OK;
1221 /************************************************************************
1222 * DefaultHandler_GetMiscStatus (IOleObject)
1224 * The default handler's implementation of this method simply delegates
1225 * to OleRegGetMiscStatus.
1227 * See Windows documentation for more details on IOleObject methods.
1229 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1230 IOleObject* iface,
1231 DWORD dwAspect,
1232 DWORD* pdwStatus)
1234 HRESULT hres;
1235 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1237 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1239 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1241 if (FAILED(hres))
1242 *pdwStatus = 0;
1244 return S_OK;
1247 /************************************************************************
1248 * DefaultHandler_SetExtent (IOleObject)
1250 * This method is meaningless if the server is not running
1252 * See Windows documentation for more details on IOleObject methods.
1254 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1255 IOleObject* iface,
1256 struct tagLOGPALETTE* pLogpal)
1258 TRACE("(%p, %p))\n", iface, pLogpal);
1259 return OLE_E_NOTRUNNING;
1262 /*********************************************************
1263 * Methods implementation for the IDataObject part of
1264 * the DefaultHandler class.
1267 /************************************************************************
1268 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1270 * See Windows documentation for more details on IUnknown methods.
1272 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1273 IDataObject* iface,
1274 REFIID riid,
1275 void** ppvObject)
1277 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1279 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1282 /************************************************************************
1283 * DefaultHandler_IDataObject_AddRef (IUnknown)
1285 * See Windows documentation for more details on IUnknown methods.
1287 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1288 IDataObject* iface)
1290 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1292 return IUnknown_AddRef(this->outerUnknown);
1295 /************************************************************************
1296 * DefaultHandler_IDataObject_Release (IUnknown)
1298 * See Windows documentation for more details on IUnknown methods.
1300 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1301 IDataObject* iface)
1303 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1305 return IUnknown_Release(this->outerUnknown);
1308 /************************************************************************
1309 * DefaultHandler_GetData
1311 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1312 * See Windows documentation for more details on GetData.
1313 * Default handler's implementation of this method delegates to the cache.
1315 static HRESULT WINAPI DefaultHandler_GetData(
1316 IDataObject* iface,
1317 LPFORMATETC pformatetcIn,
1318 STGMEDIUM* pmedium)
1320 IDataObject* cacheDataObject = NULL;
1321 HRESULT hres;
1323 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1325 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1327 hres = IUnknown_QueryInterface(this->dataCache,
1328 &IID_IDataObject,
1329 (void**)&cacheDataObject);
1331 if (FAILED(hres))
1332 return E_UNEXPECTED;
1334 hres = IDataObject_GetData(cacheDataObject,
1335 pformatetcIn,
1336 pmedium);
1338 IDataObject_Release(cacheDataObject);
1340 return hres;
1343 static HRESULT WINAPI DefaultHandler_GetDataHere(
1344 IDataObject* iface,
1345 LPFORMATETC pformatetc,
1346 STGMEDIUM* pmedium)
1348 FIXME(": Stub\n");
1349 return E_NOTIMPL;
1352 /************************************************************************
1353 * DefaultHandler_QueryGetData (IDataObject)
1355 * The default handler's implementation of this method delegates to
1356 * the cache.
1358 * See Windows documentation for more details on IDataObject methods.
1360 static HRESULT WINAPI DefaultHandler_QueryGetData(
1361 IDataObject* iface,
1362 LPFORMATETC pformatetc)
1364 IDataObject* cacheDataObject = NULL;
1365 HRESULT hres;
1367 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1369 TRACE("(%p, %p)\n", iface, pformatetc);
1371 hres = IUnknown_QueryInterface(this->dataCache,
1372 &IID_IDataObject,
1373 (void**)&cacheDataObject);
1375 if (FAILED(hres))
1376 return E_UNEXPECTED;
1378 hres = IDataObject_QueryGetData(cacheDataObject,
1379 pformatetc);
1381 IDataObject_Release(cacheDataObject);
1383 return hres;
1386 /************************************************************************
1387 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1389 * This method is meaningless if the server is not running
1391 * See Windows documentation for more details on IDataObject methods.
1393 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1394 IDataObject* iface,
1395 LPFORMATETC pformatectIn,
1396 LPFORMATETC pformatetcOut)
1398 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1400 return OLE_E_NOTRUNNING;
1403 /************************************************************************
1404 * DefaultHandler_SetData (IDataObject)
1406 * The default handler's implementation of this method delegates to
1407 * the cache.
1409 * See Windows documentation for more details on IDataObject methods.
1411 static HRESULT WINAPI DefaultHandler_SetData(
1412 IDataObject* iface,
1413 LPFORMATETC pformatetc,
1414 STGMEDIUM* pmedium,
1415 BOOL fRelease)
1417 IDataObject* cacheDataObject = NULL;
1418 HRESULT hres;
1420 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1422 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1424 hres = IUnknown_QueryInterface(this->dataCache,
1425 &IID_IDataObject,
1426 (void**)&cacheDataObject);
1428 if (FAILED(hres))
1429 return E_UNEXPECTED;
1431 hres = IDataObject_SetData(cacheDataObject,
1432 pformatetc,
1433 pmedium,
1434 fRelease);
1436 IDataObject_Release(cacheDataObject);
1438 return hres;
1441 /************************************************************************
1442 * DefaultHandler_EnumFormatEtc (IDataObject)
1444 * The default handler's implementation of this method simply delegates
1445 * to OleRegEnumFormatEtc.
1447 * See Windows documentation for more details on IDataObject methods.
1449 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1450 IDataObject* iface,
1451 DWORD dwDirection,
1452 IEnumFORMATETC** ppenumFormatEtc)
1454 HRESULT hres;
1455 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1457 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1459 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1461 return hres;
1464 /************************************************************************
1465 * DefaultHandler_DAdvise (IDataObject)
1467 * The default handler's implementation of this method simply
1468 * delegates to the DataAdviseHolder.
1470 * See Windows documentation for more details on IDataObject methods.
1472 static HRESULT WINAPI DefaultHandler_DAdvise(
1473 IDataObject* iface,
1474 FORMATETC* pformatetc,
1475 DWORD advf,
1476 IAdviseSink* pAdvSink,
1477 DWORD* pdwConnection)
1479 HRESULT hres = S_OK;
1480 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1482 TRACE("(%p, %p, %ld, %p, %p)\n",
1483 iface, pformatetc, advf, pAdvSink, pdwConnection);
1486 * Make sure we have a data advise holder before we start.
1488 if (this->dataAdviseHolder==NULL)
1490 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1493 if (SUCCEEDED(hres))
1495 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1496 iface,
1497 pformatetc,
1498 advf,
1499 pAdvSink,
1500 pdwConnection);
1503 return hres;
1506 /************************************************************************
1507 * DefaultHandler_DUnadvise (IDataObject)
1509 * The default handler's implementation of this method simply
1510 * delegates to the DataAdviseHolder.
1512 * See Windows documentation for more details on IDataObject methods.
1514 static HRESULT WINAPI DefaultHandler_DUnadvise(
1515 IDataObject* iface,
1516 DWORD dwConnection)
1518 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1520 TRACE("(%p, %ld)\n", iface, dwConnection);
1523 * If we don't have a data advise holder yet, it means that
1524 * we don't have any connections..
1526 if (this->dataAdviseHolder==NULL)
1528 return OLE_E_NOCONNECTION;
1531 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1532 dwConnection);
1535 /************************************************************************
1536 * DefaultHandler_EnumDAdvise (IDataObject)
1538 * The default handler's implementation of this method simply
1539 * delegates to the DataAdviseHolder.
1541 * See Windows documentation for more details on IDataObject methods.
1543 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1544 IDataObject* iface,
1545 IEnumSTATDATA** ppenumAdvise)
1547 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1549 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1552 * Sanity check
1554 if (ppenumAdvise == NULL)
1555 return E_POINTER;
1558 * Initialize the out parameter.
1560 *ppenumAdvise = NULL;
1563 * If we have a data advise holder object, delegate.
1565 if (this->dataAdviseHolder!=NULL)
1567 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1568 ppenumAdvise);
1571 return S_OK;
1574 /*********************************************************
1575 * Methods implementation for the IRunnableObject part
1576 * of the DefaultHandler class.
1579 /************************************************************************
1580 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1582 * See Windows documentation for more details on IUnknown methods.
1584 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1585 IRunnableObject* iface,
1586 REFIID riid,
1587 void** ppvObject)
1589 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1591 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1594 /************************************************************************
1595 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1597 * See Windows documentation for more details on IUnknown methods.
1599 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1600 IRunnableObject* iface)
1602 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1604 return IUnknown_AddRef(this->outerUnknown);
1607 /************************************************************************
1608 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1610 * See Windows documentation for more details on IUnknown methods.
1612 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1613 IRunnableObject* iface)
1615 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1617 return IUnknown_Release(this->outerUnknown);
1620 /************************************************************************
1621 * DefaultHandler_GetRunningClass (IRunnableObject)
1623 * According to Brockscmidt, Chapter 19, the default handler's
1624 * implementation of IRunnableobject does nothing until the object
1625 * is actually running.
1627 * See Windows documentation for more details on IRunnableObject methods.
1629 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1630 IRunnableObject* iface,
1631 LPCLSID lpClsid)
1633 TRACE("()\n");
1634 return S_OK;
1637 static HRESULT WINAPI DefaultHandler_Run(
1638 IRunnableObject* iface,
1639 IBindCtx* pbc)
1641 FIXME(": Stub\n");
1642 return E_NOTIMPL;
1645 /************************************************************************
1646 * DefaultHandler_IsRunning (IRunnableObject)
1648 * According to Brockscmidt, Chapter 19, the default handler's
1649 * implementation of IRunnableobject does nothing until the object
1650 * is actually running.
1652 * See Windows documentation for more details on IRunnableObject methods.
1654 static BOOL WINAPI DefaultHandler_IsRunning(
1655 IRunnableObject* iface)
1657 TRACE("()\n");
1658 return S_FALSE;
1661 /************************************************************************
1662 * DefaultHandler_LockRunning (IRunnableObject)
1664 * According to Brockscmidt, Chapter 19, the default handler's
1665 * implementation of IRunnableobject does nothing until the object
1666 * is actually running.
1668 * See Windows documentation for more details on IRunnableObject methods.
1670 static HRESULT WINAPI DefaultHandler_LockRunning(
1671 IRunnableObject* iface,
1672 BOOL fLock,
1673 BOOL fLastUnlockCloses)
1675 TRACE("()\n");
1676 return S_OK;
1679 /************************************************************************
1680 * DefaultHandler_SetContainedObject (IRunnableObject)
1682 * According to Brockscmidt, Chapter 19, the default handler's
1683 * implementation of IRunnableobject does nothing until the object
1684 * is actually running.
1686 * See Windows documentation for more details on IRunnableObject methods.
1688 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1689 IRunnableObject* iface,
1690 BOOL fContained)
1692 TRACE("()\n");
1693 return S_OK;