Improved a bit link handling (a few more link types loaded from file
[wine/hacks.git] / dlls / ole32 / defaulthandler.c
blob7a46610b761694ffc42c8e64e975c5a4ba7a9499
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 <string.h>
51 #include "winbase.h"
52 #include "winerror.h"
53 #include "wine/unicode.h"
54 #include "ole2.h"
55 #include "wine/obj_oleview.h"
56 #include "wine/debug.h"
58 WINE_DEFAULT_DEBUG_CHANNEL(ole);
60 /****************************************************************************
61 * DefaultHandler
64 struct DefaultHandler
67 * List all interface VTables here
69 ICOM_VTABLE(IOleObject)* lpvtbl1;
70 ICOM_VTABLE(IUnknown)* lpvtbl2;
71 ICOM_VTABLE(IDataObject)* lpvtbl3;
72 ICOM_VTABLE(IRunnableObject)* lpvtbl4;
75 * Reference count of this object
77 ULONG ref;
80 * IUnknown implementation of the outer object.
82 IUnknown* outerUnknown;
85 * Class Id that this handler object represents.
87 CLSID clsid;
90 * IUnknown implementation of the datacache.
92 IUnknown* dataCache;
95 * Client site for the embedded object.
97 IOleClientSite* clientSite;
100 * The IOleAdviseHolder maintains the connections
101 * on behalf of the default handler.
103 IOleAdviseHolder* oleAdviseHolder;
106 * The IDataAdviseHolder maintains the data
107 * connections on behalf of the default handler.
109 IDataAdviseHolder* dataAdviseHolder;
112 * Name of the container and object contained
114 LPWSTR containerApp;
115 LPWSTR containerObj;
119 typedef struct DefaultHandler DefaultHandler;
122 * Here, I define utility macros to help with the casting of the
123 * "this" parameter.
124 * There is a version to accomodate all of the VTables implemented
125 * by this object.
127 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name;
128 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
129 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
130 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
133 * Prototypes for the methods of the DefaultHandler class.
135 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
136 LPUNKNOWN pUnkOuter);
137 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
140 * Prototypes for the methods of the DefaultHandler class
141 * that implement non delegating IUnknown methods.
143 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
144 IUnknown* iface,
145 REFIID riid,
146 void** ppvObject);
147 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
148 IUnknown* iface);
149 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
150 IUnknown* iface);
153 * Prototypes for the methods of the DefaultHandler class
154 * that implement IOleObject methods.
156 static HRESULT WINAPI DefaultHandler_QueryInterface(
157 IOleObject* iface,
158 REFIID riid,
159 void** ppvObject);
160 static ULONG WINAPI DefaultHandler_AddRef(
161 IOleObject* iface);
162 static ULONG WINAPI DefaultHandler_Release(
163 IOleObject* iface);
164 static HRESULT WINAPI DefaultHandler_SetClientSite(
165 IOleObject* iface,
166 IOleClientSite* pClientSite);
167 static HRESULT WINAPI DefaultHandler_GetClientSite(
168 IOleObject* iface,
169 IOleClientSite** ppClientSite);
170 static HRESULT WINAPI DefaultHandler_SetHostNames(
171 IOleObject* iface,
172 LPCOLESTR szContainerApp,
173 LPCOLESTR szContainerObj);
174 static HRESULT WINAPI DefaultHandler_Close(
175 IOleObject* iface,
176 DWORD dwSaveOption);
177 static HRESULT WINAPI DefaultHandler_SetMoniker(
178 IOleObject* iface,
179 DWORD dwWhichMoniker,
180 IMoniker* pmk);
181 static HRESULT WINAPI DefaultHandler_GetMoniker(
182 IOleObject* iface,
183 DWORD dwAssign,
184 DWORD dwWhichMoniker,
185 IMoniker** ppmk);
186 static HRESULT WINAPI DefaultHandler_InitFromData(
187 IOleObject* iface,
188 IDataObject* pDataObject,
189 BOOL fCreation,
190 DWORD dwReserved);
191 static HRESULT WINAPI DefaultHandler_GetClipboardData(
192 IOleObject* iface,
193 DWORD dwReserved,
194 IDataObject** ppDataObject);
195 static HRESULT WINAPI DefaultHandler_DoVerb(
196 IOleObject* iface,
197 LONG iVerb,
198 struct tagMSG* lpmsg,
199 IOleClientSite* pActiveSite,
200 LONG lindex,
201 HWND hwndParent,
202 LPCRECT lprcPosRect);
203 static HRESULT WINAPI DefaultHandler_EnumVerbs(
204 IOleObject* iface,
205 IEnumOLEVERB** ppEnumOleVerb);
206 static HRESULT WINAPI DefaultHandler_Update(
207 IOleObject* iface);
208 static HRESULT WINAPI DefaultHandler_IsUpToDate(
209 IOleObject* iface);
210 static HRESULT WINAPI DefaultHandler_GetUserClassID(
211 IOleObject* iface,
212 CLSID* pClsid);
213 static HRESULT WINAPI DefaultHandler_GetUserType(
214 IOleObject* iface,
215 DWORD dwFormOfType,
216 LPOLESTR* pszUserType);
217 static HRESULT WINAPI DefaultHandler_SetExtent(
218 IOleObject* iface,
219 DWORD dwDrawAspect,
220 SIZEL* psizel);
221 static HRESULT WINAPI DefaultHandler_GetExtent(
222 IOleObject* iface,
223 DWORD dwDrawAspect,
224 SIZEL* psizel);
225 static HRESULT WINAPI DefaultHandler_Advise(
226 IOleObject* iface,
227 IAdviseSink* pAdvSink,
228 DWORD* pdwConnection);
229 static HRESULT WINAPI DefaultHandler_Unadvise(
230 IOleObject* iface,
231 DWORD dwConnection);
232 static HRESULT WINAPI DefaultHandler_EnumAdvise(
233 IOleObject* iface,
234 IEnumSTATDATA** ppenumAdvise);
235 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
236 IOleObject* iface,
237 DWORD dwAspect,
238 DWORD* pdwStatus);
239 static HRESULT WINAPI DefaultHandler_SetColorScheme(
240 IOleObject* iface,
241 struct tagLOGPALETTE* pLogpal);
244 * Prototypes for the methods of the DefaultHandler class
245 * that implement IDataObject methods.
247 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
248 IDataObject* iface,
249 REFIID riid,
250 void** ppvObject);
251 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
252 IDataObject* iface);
253 static ULONG WINAPI DefaultHandler_IDataObject_Release(
254 IDataObject* iface);
255 static HRESULT WINAPI DefaultHandler_GetData(
256 IDataObject* iface,
257 LPFORMATETC pformatetcIn,
258 STGMEDIUM* pmedium);
259 static HRESULT WINAPI DefaultHandler_GetDataHere(
260 IDataObject* iface,
261 LPFORMATETC pformatetc,
262 STGMEDIUM* pmedium);
263 static HRESULT WINAPI DefaultHandler_QueryGetData(
264 IDataObject* iface,
265 LPFORMATETC pformatetc);
266 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
267 IDataObject* iface,
268 LPFORMATETC pformatectIn,
269 LPFORMATETC pformatetcOut);
270 static HRESULT WINAPI DefaultHandler_SetData(
271 IDataObject* iface,
272 LPFORMATETC pformatetc,
273 STGMEDIUM* pmedium,
274 BOOL fRelease);
275 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
276 IDataObject* iface,
277 DWORD dwDirection,
278 IEnumFORMATETC** ppenumFormatEtc);
279 static HRESULT WINAPI DefaultHandler_DAdvise(
280 IDataObject* iface,
281 FORMATETC* pformatetc,
282 DWORD advf,
283 IAdviseSink* pAdvSink,
284 DWORD* pdwConnection);
285 static HRESULT WINAPI DefaultHandler_DUnadvise(
286 IDataObject* iface,
287 DWORD dwConnection);
288 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
289 IDataObject* iface,
290 IEnumSTATDATA** ppenumAdvise);
293 * Prototypes for the methods of the DefaultHandler class
294 * that implement IRunnableObject methods.
296 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
297 IRunnableObject* iface,
298 REFIID riid,
299 void** ppvObject);
300 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
301 IRunnableObject* iface);
302 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
303 IRunnableObject* iface);
304 static HRESULT WINAPI DefaultHandler_GetRunningClass(
305 IRunnableObject* iface,
306 LPCLSID lpClsid);
307 static HRESULT WINAPI DefaultHandler_Run(
308 IRunnableObject* iface,
309 IBindCtx* pbc);
310 static BOOL WINAPI DefaultHandler_IsRunning(
311 IRunnableObject* iface);
312 static HRESULT WINAPI DefaultHandler_LockRunning(
313 IRunnableObject* iface,
314 BOOL fLock,
315 BOOL fLastUnlockCloses);
316 static HRESULT WINAPI DefaultHandler_SetContainedObject(
317 IRunnableObject* iface,
318 BOOL fContained);
322 * Virtual function tables for the DefaultHandler class.
324 static ICOM_VTABLE(IOleObject) DefaultHandler_IOleObject_VTable =
326 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
327 DefaultHandler_QueryInterface,
328 DefaultHandler_AddRef,
329 DefaultHandler_Release,
330 DefaultHandler_SetClientSite,
331 DefaultHandler_GetClientSite,
332 DefaultHandler_SetHostNames,
333 DefaultHandler_Close,
334 DefaultHandler_SetMoniker,
335 DefaultHandler_GetMoniker,
336 DefaultHandler_InitFromData,
337 DefaultHandler_GetClipboardData,
338 DefaultHandler_DoVerb,
339 DefaultHandler_EnumVerbs,
340 DefaultHandler_Update,
341 DefaultHandler_IsUpToDate,
342 DefaultHandler_GetUserClassID,
343 DefaultHandler_GetUserType,
344 DefaultHandler_SetExtent,
345 DefaultHandler_GetExtent,
346 DefaultHandler_Advise,
347 DefaultHandler_Unadvise,
348 DefaultHandler_EnumAdvise,
349 DefaultHandler_GetMiscStatus,
350 DefaultHandler_SetColorScheme
353 static ICOM_VTABLE(IUnknown) DefaultHandler_NDIUnknown_VTable =
355 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
356 DefaultHandler_NDIUnknown_QueryInterface,
357 DefaultHandler_NDIUnknown_AddRef,
358 DefaultHandler_NDIUnknown_Release,
361 static ICOM_VTABLE(IDataObject) DefaultHandler_IDataObject_VTable =
363 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
364 DefaultHandler_IDataObject_QueryInterface,
365 DefaultHandler_IDataObject_AddRef,
366 DefaultHandler_IDataObject_Release,
367 DefaultHandler_GetData,
368 DefaultHandler_GetDataHere,
369 DefaultHandler_QueryGetData,
370 DefaultHandler_GetCanonicalFormatEtc,
371 DefaultHandler_SetData,
372 DefaultHandler_EnumFormatEtc,
373 DefaultHandler_DAdvise,
374 DefaultHandler_DUnadvise,
375 DefaultHandler_EnumDAdvise
378 static ICOM_VTABLE(IRunnableObject) DefaultHandler_IRunnableObject_VTable =
380 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
381 DefaultHandler_IRunnableObject_QueryInterface,
382 DefaultHandler_IRunnableObject_AddRef,
383 DefaultHandler_IRunnableObject_Release,
384 DefaultHandler_GetRunningClass,
385 DefaultHandler_Run,
386 DefaultHandler_IsRunning,
387 DefaultHandler_LockRunning,
388 DefaultHandler_SetContainedObject
391 /******************************************************************************
392 * OleCreateDefaultHandler [OLE32.90]
394 HRESULT WINAPI OleCreateDefaultHandler(
395 REFCLSID clsid,
396 LPUNKNOWN pUnkOuter,
397 REFIID riid,
398 LPVOID* ppvObj)
400 DefaultHandler* newHandler = NULL;
401 HRESULT hr = S_OK;
403 TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, debugstr_guid(riid), ppvObj);
406 * Sanity check
408 if (ppvObj==0)
409 return E_POINTER;
411 *ppvObj = 0;
414 * If this handler is constructed for aggregation, make sure
415 * the caller is requesting the IUnknown interface.
416 * This is necessary because it's the only time the non-delegating
417 * IUnknown pointer can be returned to the outside.
419 if ( (pUnkOuter!=NULL) &&
420 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
421 return CLASS_E_NOAGGREGATION;
424 * Try to construct a new instance of the class.
426 newHandler = DefaultHandler_Construct(clsid,
427 pUnkOuter);
429 if (newHandler == 0)
430 return E_OUTOFMEMORY;
433 * Make sure it supports the interface required by the caller.
435 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
438 * Release the reference obtained in the constructor. If
439 * the QueryInterface was unsuccessful, it will free the class.
441 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
443 return hr;
446 /*********************************************************
447 * Methods implementation for the DefaultHandler class.
449 static DefaultHandler* DefaultHandler_Construct(
450 REFCLSID clsid,
451 LPUNKNOWN pUnkOuter)
453 DefaultHandler* newObject = 0;
456 * Allocate space for the object.
458 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
460 if (newObject==0)
461 return newObject;
464 * Initialize the virtual function table.
466 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
467 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
468 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
469 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
472 * Start with one reference count. The caller of this function
473 * must release the interface pointer when it is done.
475 newObject->ref = 1;
478 * Initialize the outer unknown
479 * We don't keep a reference on the outer unknown since, the way
480 * aggregation works, our lifetime is at least as large as it's
481 * lifetime.
483 if (pUnkOuter==NULL)
484 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
486 newObject->outerUnknown = pUnkOuter;
489 * Create a datacache object.
490 * We aggregate with the datacache. Make sure we pass our outer
491 * unknown as the datacache's outer unknown.
493 CreateDataCache(newObject->outerUnknown,
494 clsid,
495 &IID_IUnknown,
496 (void**)&newObject->dataCache);
499 * Initialize the other data members of the class.
501 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
502 newObject->clientSite = NULL;
503 newObject->oleAdviseHolder = NULL;
504 newObject->dataAdviseHolder = NULL;
505 newObject->containerApp = NULL;
506 newObject->containerObj = NULL;
508 return newObject;
511 static void DefaultHandler_Destroy(
512 DefaultHandler* ptrToDestroy)
515 * Free the strings idenfitying the object
517 if (ptrToDestroy->containerApp!=NULL)
519 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerApp );
520 ptrToDestroy->containerApp = NULL;
523 if (ptrToDestroy->containerObj!=NULL)
525 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj );
526 ptrToDestroy->containerObj = NULL;
530 * Release our reference to the data cache.
532 if (ptrToDestroy->dataCache!=NULL)
534 IUnknown_Release(ptrToDestroy->dataCache);
535 ptrToDestroy->dataCache = NULL;
539 * Same thing for the client site.
541 if (ptrToDestroy->clientSite!=NULL)
543 IOleClientSite_Release(ptrToDestroy->clientSite);
544 ptrToDestroy->clientSite = NULL;
548 * And the advise holder.
550 if (ptrToDestroy->oleAdviseHolder!=NULL)
552 IOleAdviseHolder_Release(ptrToDestroy->oleAdviseHolder);
553 ptrToDestroy->oleAdviseHolder = NULL;
557 * And the data advise holder.
559 if (ptrToDestroy->dataAdviseHolder!=NULL)
561 IDataAdviseHolder_Release(ptrToDestroy->dataAdviseHolder);
562 ptrToDestroy->dataAdviseHolder = NULL;
567 * Free the actual default handler structure.
569 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
572 /*********************************************************
573 * Method implementation for the non delegating IUnknown
574 * part of the DefaultHandler class.
577 /************************************************************************
578 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
580 * See Windows documentation for more details on IUnknown methods.
582 * This version of QueryInterface will not delegate it's implementation
583 * to the outer unknown.
585 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
586 IUnknown* iface,
587 REFIID riid,
588 void** ppvObject)
590 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
593 * Perform a sanity check on the parameters.
595 if ( (this==0) || (ppvObject==0) )
596 return E_INVALIDARG;
599 * Initialize the return parameter.
601 *ppvObject = 0;
604 * Compare the riid with the interface IDs implemented by this object.
606 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
608 *ppvObject = iface;
610 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
612 *ppvObject = (IOleObject*)&(this->lpvtbl1);
614 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
616 *ppvObject = (IDataObject*)&(this->lpvtbl3);
618 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
620 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
622 else
625 * Blind aggregate the data cache to "inherit" it's interfaces.
627 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK)
628 return S_OK;
632 * Check that we obtained an interface.
634 if ((*ppvObject)==0)
636 WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid));
637 return E_NOINTERFACE;
641 * Query Interface always increases the reference count by one when it is
642 * successful.
644 IUnknown_AddRef((IUnknown*)*ppvObject);
646 return S_OK;
649 /************************************************************************
650 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
652 * See Windows documentation for more details on IUnknown methods.
654 * This version of QueryInterface will not delegate it's implementation
655 * to the outer unknown.
657 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
658 IUnknown* iface)
660 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
662 this->ref++;
664 return this->ref;
667 /************************************************************************
668 * DefaultHandler_NDIUnknown_Release (IUnknown)
670 * See Windows documentation for more details on IUnknown methods.
672 * This version of QueryInterface will not delegate it's implementation
673 * to the outer unknown.
675 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
676 IUnknown* iface)
678 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
681 * Decrease the reference count on this object.
683 this->ref--;
686 * If the reference count goes down to 0, perform suicide.
688 if (this->ref==0)
690 DefaultHandler_Destroy(this);
692 return 0;
695 return this->ref;
698 /*********************************************************
699 * Methods implementation for the IOleObject part of
700 * the DefaultHandler class.
703 /************************************************************************
704 * DefaultHandler_QueryInterface (IUnknown)
706 * See Windows documentation for more details on IUnknown methods.
708 static HRESULT WINAPI DefaultHandler_QueryInterface(
709 IOleObject* iface,
710 REFIID riid,
711 void** ppvObject)
713 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
715 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
718 /************************************************************************
719 * DefaultHandler_AddRef (IUnknown)
721 * See Windows documentation for more details on IUnknown methods.
723 static ULONG WINAPI DefaultHandler_AddRef(
724 IOleObject* iface)
726 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
728 return IUnknown_AddRef(this->outerUnknown);
731 /************************************************************************
732 * DefaultHandler_Release (IUnknown)
734 * See Windows documentation for more details on IUnknown methods.
736 static ULONG WINAPI DefaultHandler_Release(
737 IOleObject* iface)
739 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
741 return IUnknown_Release(this->outerUnknown);
744 /************************************************************************
745 * DefaultHandler_SetClientSite (IOleObject)
747 * The default handler's implementation of this method only keeps the
748 * client site pointer for future reference.
750 * See Windows documentation for more details on IOleObject methods.
752 static HRESULT WINAPI DefaultHandler_SetClientSite(
753 IOleObject* iface,
754 IOleClientSite* pClientSite)
756 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
758 TRACE("(%p, %p)\n", iface, pClientSite);
761 * Make sure we release the previous client site if there
762 * was one.
764 if (this->clientSite!=NULL)
766 IOleClientSite_Release(this->clientSite);
769 this->clientSite = pClientSite;
771 if (this->clientSite!=NULL)
773 IOleClientSite_AddRef(this->clientSite);
776 return S_OK;
779 /************************************************************************
780 * DefaultHandler_GetClientSite (IOleObject)
782 * The default handler's implementation of this method returns the
783 * last pointer set in IOleObject_SetClientSite.
785 * See Windows documentation for more details on IOleObject methods.
787 static HRESULT WINAPI DefaultHandler_GetClientSite(
788 IOleObject* iface,
789 IOleClientSite** ppClientSite)
791 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
794 * Sanity check.
796 if (ppClientSite == NULL)
797 return E_POINTER;
799 *ppClientSite = this->clientSite;
801 if (this->clientSite != NULL)
803 IOleClientSite_AddRef(this->clientSite);
806 return S_OK;
809 /************************************************************************
810 * DefaultHandler_SetHostNames (IOleObject)
812 * The default handler's implementation of this method just stores
813 * the strings and returns S_OK.
815 * See Windows documentation for more details on IOleObject methods.
817 static HRESULT WINAPI DefaultHandler_SetHostNames(
818 IOleObject* iface,
819 LPCOLESTR szContainerApp,
820 LPCOLESTR szContainerObj)
822 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
824 TRACE("(%p, %s, %s)\n",
825 iface,
826 debugstr_w(szContainerApp),
827 debugstr_w(szContainerObj));
830 * Be sure to cleanup before re-assinging the strings.
832 if (this->containerApp!=NULL)
834 HeapFree( GetProcessHeap(), 0, this->containerApp );
835 this->containerApp = NULL;
838 if (this->containerObj!=NULL)
840 HeapFree( GetProcessHeap(), 0, this->containerObj );
841 this->containerObj = NULL;
845 * Copy the string supplied.
847 if (szContainerApp != NULL)
849 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
850 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
851 strcpyW( this->containerApp, szContainerApp );
854 if (szContainerObj != NULL)
856 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
857 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
858 strcpyW( this->containerObj, szContainerObj );
860 return S_OK;
863 /************************************************************************
864 * DefaultHandler_Close (IOleObject)
866 * The default handler's implementation of this method is meaningless
867 * without a running server so it does nothing.
869 * See Windows documentation for more details on IOleObject methods.
871 static HRESULT WINAPI DefaultHandler_Close(
872 IOleObject* iface,
873 DWORD dwSaveOption)
875 TRACE("()\n");
876 return S_OK;
879 /************************************************************************
880 * DefaultHandler_SetMoniker (IOleObject)
882 * The default handler's implementation of this method does nothing.
884 * See Windows documentation for more details on IOleObject methods.
886 static HRESULT WINAPI DefaultHandler_SetMoniker(
887 IOleObject* iface,
888 DWORD dwWhichMoniker,
889 IMoniker* pmk)
891 TRACE("(%p, %ld, %p)\n",
892 iface,
893 dwWhichMoniker,
894 pmk);
896 return S_OK;
899 /************************************************************************
900 * DefaultHandler_GetMoniker (IOleObject)
902 * Delegate this request to the client site if we have one.
904 * See Windows documentation for more details on IOleObject methods.
906 static HRESULT WINAPI DefaultHandler_GetMoniker(
907 IOleObject* iface,
908 DWORD dwAssign,
909 DWORD dwWhichMoniker,
910 IMoniker** ppmk)
912 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
914 TRACE("(%p, %ld, %ld, %p)\n",
915 iface, dwAssign, dwWhichMoniker, ppmk);
917 if (this->clientSite)
919 return IOleClientSite_GetMoniker(this->clientSite,
920 dwAssign,
921 dwWhichMoniker,
922 ppmk);
926 return E_UNSPEC;
929 /************************************************************************
930 * DefaultHandler_InitFromData (IOleObject)
932 * This method is meaningless if the server is not running
934 * See Windows documentation for more details on IOleObject methods.
936 static HRESULT WINAPI DefaultHandler_InitFromData(
937 IOleObject* iface,
938 IDataObject* pDataObject,
939 BOOL fCreation,
940 DWORD dwReserved)
942 TRACE("(%p, %p, %d, %ld)\n",
943 iface, pDataObject, fCreation, dwReserved);
945 return OLE_E_NOTRUNNING;
948 /************************************************************************
949 * DefaultHandler_GetClipboardData (IOleObject)
951 * This method is meaningless if the server is not running
953 * See Windows documentation for more details on IOleObject methods.
955 static HRESULT WINAPI DefaultHandler_GetClipboardData(
956 IOleObject* iface,
957 DWORD dwReserved,
958 IDataObject** ppDataObject)
960 TRACE("(%p, %ld, %p)\n",
961 iface, dwReserved, ppDataObject);
963 return OLE_E_NOTRUNNING;
966 static HRESULT WINAPI DefaultHandler_DoVerb(
967 IOleObject* iface,
968 LONG iVerb,
969 struct tagMSG* lpmsg,
970 IOleClientSite* pActiveSite,
971 LONG lindex,
972 HWND hwndParent,
973 LPCRECT lprcPosRect)
975 FIXME(": Stub\n");
976 return E_NOTIMPL;
979 /************************************************************************
980 * DefaultHandler_EnumVerbs (IOleObject)
982 * The default handler implementation of this method simply delegates
983 * to OleRegEnumVerbs
985 * See Windows documentation for more details on IOleObject methods.
987 static HRESULT WINAPI DefaultHandler_EnumVerbs(
988 IOleObject* iface,
989 IEnumOLEVERB** ppEnumOleVerb)
991 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
993 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
995 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
998 static HRESULT WINAPI DefaultHandler_Update(
999 IOleObject* iface)
1001 FIXME(": Stub\n");
1002 return E_NOTIMPL;
1005 /************************************************************************
1006 * DefaultHandler_IsUpToDate (IOleObject)
1008 * This method is meaningless if the server is not running
1010 * See Windows documentation for more details on IOleObject methods.
1012 static HRESULT WINAPI DefaultHandler_IsUpToDate(
1013 IOleObject* iface)
1015 TRACE("(%p)\n", iface);
1017 return OLE_E_NOTRUNNING;
1020 /************************************************************************
1021 * DefaultHandler_GetUserClassID (IOleObject)
1023 * TODO: Map to a new class ID if emulation is active.
1025 * See Windows documentation for more details on IOleObject methods.
1027 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1028 IOleObject* iface,
1029 CLSID* pClsid)
1031 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1033 TRACE("(%p, %p)\n", iface, pClsid);
1036 * Sanity check.
1038 if (pClsid==NULL)
1039 return E_POINTER;
1041 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1043 return S_OK;
1046 /************************************************************************
1047 * DefaultHandler_GetUserType (IOleObject)
1049 * The default handler implementation of this method simply delegates
1050 * to OleRegGetUserType
1052 * See Windows documentation for more details on IOleObject methods.
1054 static HRESULT WINAPI DefaultHandler_GetUserType(
1055 IOleObject* iface,
1056 DWORD dwFormOfType,
1057 LPOLESTR* pszUserType)
1059 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1061 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1063 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1066 /************************************************************************
1067 * DefaultHandler_SetExtent (IOleObject)
1069 * This method is meaningless if the server is not running
1071 * See Windows documentation for more details on IOleObject methods.
1073 static HRESULT WINAPI DefaultHandler_SetExtent(
1074 IOleObject* iface,
1075 DWORD dwDrawAspect,
1076 SIZEL* psizel)
1078 TRACE("(%p, %lx, (%ld x %ld))\n", iface,
1079 dwDrawAspect, psizel->cx, psizel->cy);
1080 return OLE_E_NOTRUNNING;
1083 /************************************************************************
1084 * DefaultHandler_GetExtent (IOleObject)
1086 * The default handler's implementation of this method returns uses
1087 * the cache to locate the aspect and extract the extent from it.
1089 * See Windows documentation for more details on IOleObject methods.
1091 static HRESULT WINAPI DefaultHandler_GetExtent(
1092 IOleObject* iface,
1093 DWORD dwDrawAspect,
1094 SIZEL* psizel)
1096 DVTARGETDEVICE* targetDevice;
1097 IViewObject2* cacheView = NULL;
1098 HRESULT hres;
1100 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1102 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1104 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1106 if (FAILED(hres))
1107 return E_UNEXPECTED;
1110 * Prepare the call to the cache's GetExtent method.
1112 * Here we would build a valid DVTARGETDEVICE structure
1113 * but, since we are calling into the data cache, we
1114 * know it's implementation and we'll skip this
1115 * extra work until later.
1117 targetDevice = NULL;
1119 hres = IViewObject2_GetExtent(cacheView,
1120 dwDrawAspect,
1122 targetDevice,
1123 psizel);
1126 * Cleanup
1128 IViewObject2_Release(cacheView);
1130 return hres;
1133 /************************************************************************
1134 * DefaultHandler_Advise (IOleObject)
1136 * The default handler's implementation of this method simply
1137 * delegates to the OleAdviseHolder.
1139 * See Windows documentation for more details on IOleObject methods.
1141 static HRESULT WINAPI DefaultHandler_Advise(
1142 IOleObject* iface,
1143 IAdviseSink* pAdvSink,
1144 DWORD* pdwConnection)
1146 HRESULT hres = S_OK;
1147 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1149 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1152 * Make sure we have an advise holder before we start.
1154 if (this->oleAdviseHolder==NULL)
1156 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1159 if (SUCCEEDED(hres))
1161 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1162 pAdvSink,
1163 pdwConnection);
1166 return hres;
1169 /************************************************************************
1170 * DefaultHandler_Unadvise (IOleObject)
1172 * The default handler's implementation of this method simply
1173 * delegates to the OleAdviseHolder.
1175 * See Windows documentation for more details on IOleObject methods.
1177 static HRESULT WINAPI DefaultHandler_Unadvise(
1178 IOleObject* iface,
1179 DWORD dwConnection)
1181 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1183 TRACE("(%p, %ld)\n", iface, dwConnection);
1186 * If we don't have an advise holder yet, it means we don't have
1187 * a connection.
1189 if (this->oleAdviseHolder==NULL)
1190 return OLE_E_NOCONNECTION;
1192 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1193 dwConnection);
1196 /************************************************************************
1197 * DefaultHandler_EnumAdvise (IOleObject)
1199 * The default handler's implementation of this method simply
1200 * delegates to the OleAdviseHolder.
1202 * See Windows documentation for more details on IOleObject methods.
1204 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1205 IOleObject* iface,
1206 IEnumSTATDATA** ppenumAdvise)
1208 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1210 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1213 * Sanity check
1215 if (ppenumAdvise==NULL)
1216 return E_POINTER;
1219 * Initialize the out parameter.
1221 *ppenumAdvise = NULL;
1223 if (this->oleAdviseHolder==NULL)
1224 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1225 ppenumAdvise);
1227 return S_OK;
1230 /************************************************************************
1231 * DefaultHandler_GetMiscStatus (IOleObject)
1233 * The default handler's implementation of this method simply delegates
1234 * to OleRegGetMiscStatus.
1236 * See Windows documentation for more details on IOleObject methods.
1238 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1239 IOleObject* iface,
1240 DWORD dwAspect,
1241 DWORD* pdwStatus)
1243 HRESULT hres;
1244 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1246 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1248 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1250 if (FAILED(hres))
1251 *pdwStatus = 0;
1253 return S_OK;
1256 /************************************************************************
1257 * DefaultHandler_SetExtent (IOleObject)
1259 * This method is meaningless if the server is not running
1261 * See Windows documentation for more details on IOleObject methods.
1263 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1264 IOleObject* iface,
1265 struct tagLOGPALETTE* pLogpal)
1267 TRACE("(%p, %p))\n", iface, pLogpal);
1268 return OLE_E_NOTRUNNING;
1271 /*********************************************************
1272 * Methods implementation for the IDataObject part of
1273 * the DefaultHandler class.
1276 /************************************************************************
1277 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1279 * See Windows documentation for more details on IUnknown methods.
1281 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1282 IDataObject* iface,
1283 REFIID riid,
1284 void** ppvObject)
1286 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1288 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1291 /************************************************************************
1292 * DefaultHandler_IDataObject_AddRef (IUnknown)
1294 * See Windows documentation for more details on IUnknown methods.
1296 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1297 IDataObject* iface)
1299 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1301 return IUnknown_AddRef(this->outerUnknown);
1304 /************************************************************************
1305 * DefaultHandler_IDataObject_Release (IUnknown)
1307 * See Windows documentation for more details on IUnknown methods.
1309 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1310 IDataObject* iface)
1312 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1314 return IUnknown_Release(this->outerUnknown);
1317 /************************************************************************
1318 * DefaultHandler_GetData
1320 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1321 * See Windows documentation for more details on GetData.
1322 * Default handler's implementation of this method delegates to the cache.
1324 static HRESULT WINAPI DefaultHandler_GetData(
1325 IDataObject* iface,
1326 LPFORMATETC pformatetcIn,
1327 STGMEDIUM* pmedium)
1329 IDataObject* cacheDataObject = NULL;
1330 HRESULT hres;
1332 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1334 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1336 hres = IUnknown_QueryInterface(this->dataCache,
1337 &IID_IDataObject,
1338 (void**)&cacheDataObject);
1340 if (FAILED(hres))
1341 return E_UNEXPECTED;
1343 hres = IDataObject_GetData(cacheDataObject,
1344 pformatetcIn,
1345 pmedium);
1347 IDataObject_Release(cacheDataObject);
1349 return hres;
1352 static HRESULT WINAPI DefaultHandler_GetDataHere(
1353 IDataObject* iface,
1354 LPFORMATETC pformatetc,
1355 STGMEDIUM* pmedium)
1357 FIXME(": Stub\n");
1358 return E_NOTIMPL;
1361 /************************************************************************
1362 * DefaultHandler_QueryGetData (IDataObject)
1364 * The default handler's implementation of this method delegates to
1365 * the cache.
1367 * See Windows documentation for more details on IDataObject methods.
1369 static HRESULT WINAPI DefaultHandler_QueryGetData(
1370 IDataObject* iface,
1371 LPFORMATETC pformatetc)
1373 IDataObject* cacheDataObject = NULL;
1374 HRESULT hres;
1376 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1378 TRACE("(%p, %p)\n", iface, pformatetc);
1380 hres = IUnknown_QueryInterface(this->dataCache,
1381 &IID_IDataObject,
1382 (void**)&cacheDataObject);
1384 if (FAILED(hres))
1385 return E_UNEXPECTED;
1387 hres = IDataObject_QueryGetData(cacheDataObject,
1388 pformatetc);
1390 IDataObject_Release(cacheDataObject);
1392 return hres;
1395 /************************************************************************
1396 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1398 * This method is meaningless if the server is not running
1400 * See Windows documentation for more details on IDataObject methods.
1402 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1403 IDataObject* iface,
1404 LPFORMATETC pformatectIn,
1405 LPFORMATETC pformatetcOut)
1407 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1409 return OLE_E_NOTRUNNING;
1412 /************************************************************************
1413 * DefaultHandler_SetData (IDataObject)
1415 * The default handler's implementation of this method delegates to
1416 * the cache.
1418 * See Windows documentation for more details on IDataObject methods.
1420 static HRESULT WINAPI DefaultHandler_SetData(
1421 IDataObject* iface,
1422 LPFORMATETC pformatetc,
1423 STGMEDIUM* pmedium,
1424 BOOL fRelease)
1426 IDataObject* cacheDataObject = NULL;
1427 HRESULT hres;
1429 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1431 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1433 hres = IUnknown_QueryInterface(this->dataCache,
1434 &IID_IDataObject,
1435 (void**)&cacheDataObject);
1437 if (FAILED(hres))
1438 return E_UNEXPECTED;
1440 hres = IDataObject_SetData(cacheDataObject,
1441 pformatetc,
1442 pmedium,
1443 fRelease);
1445 IDataObject_Release(cacheDataObject);
1447 return hres;
1450 /************************************************************************
1451 * DefaultHandler_EnumFormatEtc (IDataObject)
1453 * The default handler's implementation of this method simply delegates
1454 * to OleRegEnumFormatEtc.
1456 * See Windows documentation for more details on IDataObject methods.
1458 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1459 IDataObject* iface,
1460 DWORD dwDirection,
1461 IEnumFORMATETC** ppenumFormatEtc)
1463 HRESULT hres;
1464 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1466 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1468 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1470 return hres;
1473 /************************************************************************
1474 * DefaultHandler_DAdvise (IDataObject)
1476 * The default handler's implementation of this method simply
1477 * delegates to the DataAdviseHolder.
1479 * See Windows documentation for more details on IDataObject methods.
1481 static HRESULT WINAPI DefaultHandler_DAdvise(
1482 IDataObject* iface,
1483 FORMATETC* pformatetc,
1484 DWORD advf,
1485 IAdviseSink* pAdvSink,
1486 DWORD* pdwConnection)
1488 HRESULT hres = S_OK;
1489 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1491 TRACE("(%p, %p, %ld, %p, %p)\n",
1492 iface, pformatetc, advf, pAdvSink, pdwConnection);
1495 * Make sure we have a data advise holder before we start.
1497 if (this->dataAdviseHolder==NULL)
1499 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1502 if (SUCCEEDED(hres))
1504 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1505 iface,
1506 pformatetc,
1507 advf,
1508 pAdvSink,
1509 pdwConnection);
1512 return hres;
1515 /************************************************************************
1516 * DefaultHandler_DUnadvise (IDataObject)
1518 * The default handler's implementation of this method simply
1519 * delegates to the DataAdviseHolder.
1521 * See Windows documentation for more details on IDataObject methods.
1523 static HRESULT WINAPI DefaultHandler_DUnadvise(
1524 IDataObject* iface,
1525 DWORD dwConnection)
1527 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1529 TRACE("(%p, %ld)\n", iface, dwConnection);
1532 * If we don't have a data advise holder yet, it means that
1533 * we don't have any connections..
1535 if (this->dataAdviseHolder==NULL)
1537 return OLE_E_NOCONNECTION;
1540 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1541 dwConnection);
1544 /************************************************************************
1545 * DefaultHandler_EnumDAdvise (IDataObject)
1547 * The default handler's implementation of this method simply
1548 * delegates to the DataAdviseHolder.
1550 * See Windows documentation for more details on IDataObject methods.
1552 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1553 IDataObject* iface,
1554 IEnumSTATDATA** ppenumAdvise)
1556 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1558 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1561 * Sanity check
1563 if (ppenumAdvise == NULL)
1564 return E_POINTER;
1567 * Initialize the out parameter.
1569 *ppenumAdvise = NULL;
1572 * If we have a data advise holder object, delegate.
1574 if (this->dataAdviseHolder!=NULL)
1576 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1577 ppenumAdvise);
1580 return S_OK;
1583 /*********************************************************
1584 * Methods implementation for the IRunnableObject part
1585 * of the DefaultHandler class.
1588 /************************************************************************
1589 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1591 * See Windows documentation for more details on IUnknown methods.
1593 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1594 IRunnableObject* iface,
1595 REFIID riid,
1596 void** ppvObject)
1598 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1600 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1603 /************************************************************************
1604 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1606 * See Windows documentation for more details on IUnknown methods.
1608 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1609 IRunnableObject* iface)
1611 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1613 return IUnknown_AddRef(this->outerUnknown);
1616 /************************************************************************
1617 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1619 * See Windows documentation for more details on IUnknown methods.
1621 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1622 IRunnableObject* iface)
1624 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1626 return IUnknown_Release(this->outerUnknown);
1629 /************************************************************************
1630 * DefaultHandler_GetRunningClass (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_GetRunningClass(
1639 IRunnableObject* iface,
1640 LPCLSID lpClsid)
1642 TRACE("()\n");
1643 return S_OK;
1646 static HRESULT WINAPI DefaultHandler_Run(
1647 IRunnableObject* iface,
1648 IBindCtx* pbc)
1650 FIXME(": Stub\n");
1651 return E_NOTIMPL;
1654 /************************************************************************
1655 * DefaultHandler_IsRunning (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 BOOL WINAPI DefaultHandler_IsRunning(
1664 IRunnableObject* iface)
1666 TRACE("()\n");
1667 return S_FALSE;
1670 /************************************************************************
1671 * DefaultHandler_LockRunning (IRunnableObject)
1673 * According to Brockscmidt, Chapter 19, the default handler's
1674 * implementation of IRunnableobject does nothing until the object
1675 * is actually running.
1677 * See Windows documentation for more details on IRunnableObject methods.
1679 static HRESULT WINAPI DefaultHandler_LockRunning(
1680 IRunnableObject* iface,
1681 BOOL fLock,
1682 BOOL fLastUnlockCloses)
1684 TRACE("()\n");
1685 return S_OK;
1688 /************************************************************************
1689 * DefaultHandler_SetContainedObject (IRunnableObject)
1691 * According to Brockscmidt, Chapter 19, the default handler's
1692 * implementation of IRunnableobject does nothing until the object
1693 * is actually running.
1695 * See Windows documentation for more details on IRunnableObject methods.
1697 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1698 IRunnableObject* iface,
1699 BOOL fContained)
1701 TRACE("()\n");
1702 return S_OK;