Don't define COBJMACROS in objbase.h.
[wine/wine-gecko.git] / dlls / ole32 / defaulthandler.c
blob956709cda1b31da8ece88373f23aa3a0704af1e7
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 #define COBJMACROS
54 #include "windef.h"
55 #include "winbase.h"
56 #include "winuser.h"
57 #include "winerror.h"
58 #include "wine/unicode.h"
59 #include "ole2.h"
60 #include "wine/debug.h"
62 WINE_DEFAULT_DEBUG_CHANNEL(ole);
64 /****************************************************************************
65 * DefaultHandler
68 struct DefaultHandler
71 * List all interface VTables here
73 IOleObjectVtbl* lpvtbl1;
74 IUnknownVtbl* lpvtbl2;
75 IDataObjectVtbl* lpvtbl3;
76 IRunnableObjectVtbl* lpvtbl4;
79 * Reference count of this object
81 ULONG ref;
84 * IUnknown implementation of the outer object.
86 IUnknown* outerUnknown;
89 * Class Id that this handler object represents.
91 CLSID clsid;
94 * IUnknown implementation of the datacache.
96 IUnknown* dataCache;
99 * Client site for the embedded object.
101 IOleClientSite* clientSite;
104 * The IOleAdviseHolder maintains the connections
105 * on behalf of the default handler.
107 IOleAdviseHolder* oleAdviseHolder;
110 * The IDataAdviseHolder maintains the data
111 * connections on behalf of the default handler.
113 IDataAdviseHolder* dataAdviseHolder;
116 * Name of the container and object contained
118 LPWSTR containerApp;
119 LPWSTR containerObj;
123 typedef struct DefaultHandler DefaultHandler;
126 * Here, I define utility macros to help with the casting of the
127 * "this" parameter.
128 * There is a version to accommodate all of the VTables implemented
129 * by this object.
131 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name
132 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
133 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*))
134 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*))
137 * Prototypes for the methods of the DefaultHandler class.
139 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
140 LPUNKNOWN pUnkOuter);
141 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
144 * Prototypes for the methods of the DefaultHandler class
145 * that implement non delegating IUnknown methods.
147 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
148 IUnknown* iface,
149 REFIID riid,
150 void** ppvObject);
151 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
152 IUnknown* iface);
153 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
154 IUnknown* iface);
157 * Prototypes for the methods of the DefaultHandler class
158 * that implement IOleObject methods.
160 static HRESULT WINAPI DefaultHandler_QueryInterface(
161 IOleObject* iface,
162 REFIID riid,
163 void** ppvObject);
164 static ULONG WINAPI DefaultHandler_AddRef(
165 IOleObject* iface);
166 static ULONG WINAPI DefaultHandler_Release(
167 IOleObject* iface);
168 static HRESULT WINAPI DefaultHandler_SetClientSite(
169 IOleObject* iface,
170 IOleClientSite* pClientSite);
171 static HRESULT WINAPI DefaultHandler_GetClientSite(
172 IOleObject* iface,
173 IOleClientSite** ppClientSite);
174 static HRESULT WINAPI DefaultHandler_SetHostNames(
175 IOleObject* iface,
176 LPCOLESTR szContainerApp,
177 LPCOLESTR szContainerObj);
178 static HRESULT WINAPI DefaultHandler_Close(
179 IOleObject* iface,
180 DWORD dwSaveOption);
181 static HRESULT WINAPI DefaultHandler_SetMoniker(
182 IOleObject* iface,
183 DWORD dwWhichMoniker,
184 IMoniker* pmk);
185 static HRESULT WINAPI DefaultHandler_GetMoniker(
186 IOleObject* iface,
187 DWORD dwAssign,
188 DWORD dwWhichMoniker,
189 IMoniker** ppmk);
190 static HRESULT WINAPI DefaultHandler_InitFromData(
191 IOleObject* iface,
192 IDataObject* pDataObject,
193 BOOL fCreation,
194 DWORD dwReserved);
195 static HRESULT WINAPI DefaultHandler_GetClipboardData(
196 IOleObject* iface,
197 DWORD dwReserved,
198 IDataObject** ppDataObject);
199 static HRESULT WINAPI DefaultHandler_DoVerb(
200 IOleObject* iface,
201 LONG iVerb,
202 struct tagMSG* lpmsg,
203 IOleClientSite* pActiveSite,
204 LONG lindex,
205 HWND hwndParent,
206 LPCRECT lprcPosRect);
207 static HRESULT WINAPI DefaultHandler_EnumVerbs(
208 IOleObject* iface,
209 IEnumOLEVERB** ppEnumOleVerb);
210 static HRESULT WINAPI DefaultHandler_Update(
211 IOleObject* iface);
212 static HRESULT WINAPI DefaultHandler_IsUpToDate(
213 IOleObject* iface);
214 static HRESULT WINAPI DefaultHandler_GetUserClassID(
215 IOleObject* iface,
216 CLSID* pClsid);
217 static HRESULT WINAPI DefaultHandler_GetUserType(
218 IOleObject* iface,
219 DWORD dwFormOfType,
220 LPOLESTR* pszUserType);
221 static HRESULT WINAPI DefaultHandler_SetExtent(
222 IOleObject* iface,
223 DWORD dwDrawAspect,
224 SIZEL* psizel);
225 static HRESULT WINAPI DefaultHandler_GetExtent(
226 IOleObject* iface,
227 DWORD dwDrawAspect,
228 SIZEL* psizel);
229 static HRESULT WINAPI DefaultHandler_Advise(
230 IOleObject* iface,
231 IAdviseSink* pAdvSink,
232 DWORD* pdwConnection);
233 static HRESULT WINAPI DefaultHandler_Unadvise(
234 IOleObject* iface,
235 DWORD dwConnection);
236 static HRESULT WINAPI DefaultHandler_EnumAdvise(
237 IOleObject* iface,
238 IEnumSTATDATA** ppenumAdvise);
239 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
240 IOleObject* iface,
241 DWORD dwAspect,
242 DWORD* pdwStatus);
243 static HRESULT WINAPI DefaultHandler_SetColorScheme(
244 IOleObject* iface,
245 struct tagLOGPALETTE* pLogpal);
248 * Prototypes for the methods of the DefaultHandler class
249 * that implement IDataObject methods.
251 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
252 IDataObject* iface,
253 REFIID riid,
254 void** ppvObject);
255 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
256 IDataObject* iface);
257 static ULONG WINAPI DefaultHandler_IDataObject_Release(
258 IDataObject* iface);
259 static HRESULT WINAPI DefaultHandler_GetData(
260 IDataObject* iface,
261 LPFORMATETC pformatetcIn,
262 STGMEDIUM* pmedium);
263 static HRESULT WINAPI DefaultHandler_GetDataHere(
264 IDataObject* iface,
265 LPFORMATETC pformatetc,
266 STGMEDIUM* pmedium);
267 static HRESULT WINAPI DefaultHandler_QueryGetData(
268 IDataObject* iface,
269 LPFORMATETC pformatetc);
270 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
271 IDataObject* iface,
272 LPFORMATETC pformatectIn,
273 LPFORMATETC pformatetcOut);
274 static HRESULT WINAPI DefaultHandler_SetData(
275 IDataObject* iface,
276 LPFORMATETC pformatetc,
277 STGMEDIUM* pmedium,
278 BOOL fRelease);
279 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
280 IDataObject* iface,
281 DWORD dwDirection,
282 IEnumFORMATETC** ppenumFormatEtc);
283 static HRESULT WINAPI DefaultHandler_DAdvise(
284 IDataObject* iface,
285 FORMATETC* pformatetc,
286 DWORD advf,
287 IAdviseSink* pAdvSink,
288 DWORD* pdwConnection);
289 static HRESULT WINAPI DefaultHandler_DUnadvise(
290 IDataObject* iface,
291 DWORD dwConnection);
292 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
293 IDataObject* iface,
294 IEnumSTATDATA** ppenumAdvise);
297 * Prototypes for the methods of the DefaultHandler class
298 * that implement IRunnableObject methods.
300 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
301 IRunnableObject* iface,
302 REFIID riid,
303 void** ppvObject);
304 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
305 IRunnableObject* iface);
306 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
307 IRunnableObject* iface);
308 static HRESULT WINAPI DefaultHandler_GetRunningClass(
309 IRunnableObject* iface,
310 LPCLSID lpClsid);
311 static HRESULT WINAPI DefaultHandler_Run(
312 IRunnableObject* iface,
313 IBindCtx* pbc);
314 static BOOL WINAPI DefaultHandler_IsRunning(
315 IRunnableObject* iface);
316 static HRESULT WINAPI DefaultHandler_LockRunning(
317 IRunnableObject* iface,
318 BOOL fLock,
319 BOOL fLastUnlockCloses);
320 static HRESULT WINAPI DefaultHandler_SetContainedObject(
321 IRunnableObject* iface,
322 BOOL fContained);
326 * Virtual function tables for the DefaultHandler class.
328 static IOleObjectVtbl DefaultHandler_IOleObject_VTable =
330 DefaultHandler_QueryInterface,
331 DefaultHandler_AddRef,
332 DefaultHandler_Release,
333 DefaultHandler_SetClientSite,
334 DefaultHandler_GetClientSite,
335 DefaultHandler_SetHostNames,
336 DefaultHandler_Close,
337 DefaultHandler_SetMoniker,
338 DefaultHandler_GetMoniker,
339 DefaultHandler_InitFromData,
340 DefaultHandler_GetClipboardData,
341 DefaultHandler_DoVerb,
342 DefaultHandler_EnumVerbs,
343 DefaultHandler_Update,
344 DefaultHandler_IsUpToDate,
345 DefaultHandler_GetUserClassID,
346 DefaultHandler_GetUserType,
347 DefaultHandler_SetExtent,
348 DefaultHandler_GetExtent,
349 DefaultHandler_Advise,
350 DefaultHandler_Unadvise,
351 DefaultHandler_EnumAdvise,
352 DefaultHandler_GetMiscStatus,
353 DefaultHandler_SetColorScheme
356 static IUnknownVtbl DefaultHandler_NDIUnknown_VTable =
358 DefaultHandler_NDIUnknown_QueryInterface,
359 DefaultHandler_NDIUnknown_AddRef,
360 DefaultHandler_NDIUnknown_Release,
363 static IDataObjectVtbl DefaultHandler_IDataObject_VTable =
365 DefaultHandler_IDataObject_QueryInterface,
366 DefaultHandler_IDataObject_AddRef,
367 DefaultHandler_IDataObject_Release,
368 DefaultHandler_GetData,
369 DefaultHandler_GetDataHere,
370 DefaultHandler_QueryGetData,
371 DefaultHandler_GetCanonicalFormatEtc,
372 DefaultHandler_SetData,
373 DefaultHandler_EnumFormatEtc,
374 DefaultHandler_DAdvise,
375 DefaultHandler_DUnadvise,
376 DefaultHandler_EnumDAdvise
379 static IRunnableObjectVtbl DefaultHandler_IRunnableObject_VTable =
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.@]
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);
661 return InterlockedIncrement(&this->ref);
664 /************************************************************************
665 * DefaultHandler_NDIUnknown_Release (IUnknown)
667 * See Windows documentation for more details on IUnknown methods.
669 * This version of QueryInterface will not delegate it's implementation
670 * to the outer unknown.
672 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
673 IUnknown* iface)
675 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
676 ULONG ref;
679 * Decrease the reference count on this object.
681 ref = InterlockedDecrement(&this->ref);
684 * If the reference count goes down to 0, perform suicide.
686 if (ref == 0) DefaultHandler_Destroy(this);
688 return 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("(%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 (this->clientSite != NULL)
796 IOleClientSite_AddRef(this->clientSite);
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("(%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 HeapFree( GetProcessHeap(), 0, this->containerApp );
828 this->containerApp = NULL;
831 if (this->containerObj!=NULL)
833 HeapFree( GetProcessHeap(), 0, this->containerObj );
834 this->containerObj = NULL;
838 * Copy the string supplied.
840 if (szContainerApp != NULL)
842 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
843 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
844 strcpyW( this->containerApp, szContainerApp );
847 if (szContainerObj != NULL)
849 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
850 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
851 strcpyW( this->containerObj, szContainerObj );
853 return S_OK;
856 /************************************************************************
857 * DefaultHandler_Close (IOleObject)
859 * The default handler's implementation of this method is meaningless
860 * without a running server so it does nothing.
862 * See Windows documentation for more details on IOleObject methods.
864 static HRESULT WINAPI DefaultHandler_Close(
865 IOleObject* iface,
866 DWORD dwSaveOption)
868 TRACE("()\n");
869 return S_OK;
872 /************************************************************************
873 * DefaultHandler_SetMoniker (IOleObject)
875 * The default handler's implementation of this method does nothing.
877 * See Windows documentation for more details on IOleObject methods.
879 static HRESULT WINAPI DefaultHandler_SetMoniker(
880 IOleObject* iface,
881 DWORD dwWhichMoniker,
882 IMoniker* pmk)
884 TRACE("(%p, %ld, %p)\n",
885 iface,
886 dwWhichMoniker,
887 pmk);
889 return S_OK;
892 /************************************************************************
893 * DefaultHandler_GetMoniker (IOleObject)
895 * Delegate this request to the client site if we have one.
897 * See Windows documentation for more details on IOleObject methods.
899 static HRESULT WINAPI DefaultHandler_GetMoniker(
900 IOleObject* iface,
901 DWORD dwAssign,
902 DWORD dwWhichMoniker,
903 IMoniker** ppmk)
905 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
907 TRACE("(%p, %ld, %ld, %p)\n",
908 iface, dwAssign, dwWhichMoniker, ppmk);
910 if (this->clientSite)
912 return IOleClientSite_GetMoniker(this->clientSite,
913 dwAssign,
914 dwWhichMoniker,
915 ppmk);
919 return E_FAIL;
922 /************************************************************************
923 * DefaultHandler_InitFromData (IOleObject)
925 * This method is meaningless if the server is not running
927 * See Windows documentation for more details on IOleObject methods.
929 static HRESULT WINAPI DefaultHandler_InitFromData(
930 IOleObject* iface,
931 IDataObject* pDataObject,
932 BOOL fCreation,
933 DWORD dwReserved)
935 TRACE("(%p, %p, %d, %ld)\n",
936 iface, pDataObject, fCreation, dwReserved);
938 return OLE_E_NOTRUNNING;
941 /************************************************************************
942 * DefaultHandler_GetClipboardData (IOleObject)
944 * This method is meaningless if the server is not running
946 * See Windows documentation for more details on IOleObject methods.
948 static HRESULT WINAPI DefaultHandler_GetClipboardData(
949 IOleObject* iface,
950 DWORD dwReserved,
951 IDataObject** ppDataObject)
953 TRACE("(%p, %ld, %p)\n",
954 iface, dwReserved, ppDataObject);
956 return OLE_E_NOTRUNNING;
959 static HRESULT WINAPI DefaultHandler_DoVerb(
960 IOleObject* iface,
961 LONG iVerb,
962 struct tagMSG* lpmsg,
963 IOleClientSite* pActiveSite,
964 LONG lindex,
965 HWND hwndParent,
966 LPCRECT lprcPosRect)
968 FIXME(": Stub\n");
969 return E_NOTIMPL;
972 /************************************************************************
973 * DefaultHandler_EnumVerbs (IOleObject)
975 * The default handler implementation of this method simply delegates
976 * to OleRegEnumVerbs
978 * See Windows documentation for more details on IOleObject methods.
980 static HRESULT WINAPI DefaultHandler_EnumVerbs(
981 IOleObject* iface,
982 IEnumOLEVERB** ppEnumOleVerb)
984 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
986 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
988 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
991 static HRESULT WINAPI DefaultHandler_Update(
992 IOleObject* iface)
994 FIXME(": Stub\n");
995 return E_NOTIMPL;
998 /************************************************************************
999 * DefaultHandler_IsUpToDate (IOleObject)
1001 * This method is meaningless if the server is not running
1003 * See Windows documentation for more details on IOleObject methods.
1005 static HRESULT WINAPI DefaultHandler_IsUpToDate(
1006 IOleObject* iface)
1008 TRACE("(%p)\n", iface);
1010 return OLE_E_NOTRUNNING;
1013 /************************************************************************
1014 * DefaultHandler_GetUserClassID (IOleObject)
1016 * TODO: Map to a new class ID if emulation is active.
1018 * See Windows documentation for more details on IOleObject methods.
1020 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1021 IOleObject* iface,
1022 CLSID* pClsid)
1024 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1026 TRACE("(%p, %p)\n", iface, pClsid);
1029 * Sanity check.
1031 if (pClsid==NULL)
1032 return E_POINTER;
1034 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1036 return S_OK;
1039 /************************************************************************
1040 * DefaultHandler_GetUserType (IOleObject)
1042 * The default handler implementation of this method simply delegates
1043 * to OleRegGetUserType
1045 * See Windows documentation for more details on IOleObject methods.
1047 static HRESULT WINAPI DefaultHandler_GetUserType(
1048 IOleObject* iface,
1049 DWORD dwFormOfType,
1050 LPOLESTR* pszUserType)
1052 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1054 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1056 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1059 /************************************************************************
1060 * DefaultHandler_SetExtent (IOleObject)
1062 * This method is meaningless if the server is not running
1064 * See Windows documentation for more details on IOleObject methods.
1066 static HRESULT WINAPI DefaultHandler_SetExtent(
1067 IOleObject* iface,
1068 DWORD dwDrawAspect,
1069 SIZEL* psizel)
1071 TRACE("(%p, %lx, (%ld x %ld))\n", iface,
1072 dwDrawAspect, psizel->cx, psizel->cy);
1073 return OLE_E_NOTRUNNING;
1076 /************************************************************************
1077 * DefaultHandler_GetExtent (IOleObject)
1079 * The default handler's implementation of this method returns uses
1080 * the cache to locate the aspect and extract the extent from it.
1082 * See Windows documentation for more details on IOleObject methods.
1084 static HRESULT WINAPI DefaultHandler_GetExtent(
1085 IOleObject* iface,
1086 DWORD dwDrawAspect,
1087 SIZEL* psizel)
1089 DVTARGETDEVICE* targetDevice;
1090 IViewObject2* cacheView = NULL;
1091 HRESULT hres;
1093 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1095 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1097 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1099 if (FAILED(hres))
1100 return E_UNEXPECTED;
1103 * Prepare the call to the cache's GetExtent method.
1105 * Here we would build a valid DVTARGETDEVICE structure
1106 * but, since we are calling into the data cache, we
1107 * know it's implementation and we'll skip this
1108 * extra work until later.
1110 targetDevice = NULL;
1112 hres = IViewObject2_GetExtent(cacheView,
1113 dwDrawAspect,
1115 targetDevice,
1116 psizel);
1119 * Cleanup
1121 IViewObject2_Release(cacheView);
1123 return hres;
1126 /************************************************************************
1127 * DefaultHandler_Advise (IOleObject)
1129 * The default handler's implementation of this method simply
1130 * delegates to the OleAdviseHolder.
1132 * See Windows documentation for more details on IOleObject methods.
1134 static HRESULT WINAPI DefaultHandler_Advise(
1135 IOleObject* iface,
1136 IAdviseSink* pAdvSink,
1137 DWORD* pdwConnection)
1139 HRESULT hres = S_OK;
1140 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1142 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1145 * Make sure we have an advise holder before we start.
1147 if (this->oleAdviseHolder==NULL)
1149 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1152 if (SUCCEEDED(hres))
1154 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1155 pAdvSink,
1156 pdwConnection);
1159 return hres;
1162 /************************************************************************
1163 * DefaultHandler_Unadvise (IOleObject)
1165 * The default handler's implementation of this method simply
1166 * delegates to the OleAdviseHolder.
1168 * See Windows documentation for more details on IOleObject methods.
1170 static HRESULT WINAPI DefaultHandler_Unadvise(
1171 IOleObject* iface,
1172 DWORD dwConnection)
1174 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1176 TRACE("(%p, %ld)\n", iface, dwConnection);
1179 * If we don't have an advise holder yet, it means we don't have
1180 * a connection.
1182 if (this->oleAdviseHolder==NULL)
1183 return OLE_E_NOCONNECTION;
1185 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1186 dwConnection);
1189 /************************************************************************
1190 * DefaultHandler_EnumAdvise (IOleObject)
1192 * The default handler's implementation of this method simply
1193 * delegates to the OleAdviseHolder.
1195 * See Windows documentation for more details on IOleObject methods.
1197 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1198 IOleObject* iface,
1199 IEnumSTATDATA** ppenumAdvise)
1201 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1203 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1206 * Sanity check
1208 if (ppenumAdvise==NULL)
1209 return E_POINTER;
1212 * Initialize the out parameter.
1214 *ppenumAdvise = NULL;
1216 if (this->oleAdviseHolder==NULL)
1217 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1218 ppenumAdvise);
1220 return S_OK;
1223 /************************************************************************
1224 * DefaultHandler_GetMiscStatus (IOleObject)
1226 * The default handler's implementation of this method simply delegates
1227 * to OleRegGetMiscStatus.
1229 * See Windows documentation for more details on IOleObject methods.
1231 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1232 IOleObject* iface,
1233 DWORD dwAspect,
1234 DWORD* pdwStatus)
1236 HRESULT hres;
1237 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1239 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1241 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1243 if (FAILED(hres))
1244 *pdwStatus = 0;
1246 return S_OK;
1249 /************************************************************************
1250 * DefaultHandler_SetExtent (IOleObject)
1252 * This method is meaningless if the server is not running
1254 * See Windows documentation for more details on IOleObject methods.
1256 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1257 IOleObject* iface,
1258 struct tagLOGPALETTE* pLogpal)
1260 TRACE("(%p, %p))\n", iface, pLogpal);
1261 return OLE_E_NOTRUNNING;
1264 /*********************************************************
1265 * Methods implementation for the IDataObject part of
1266 * the DefaultHandler class.
1269 /************************************************************************
1270 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1272 * See Windows documentation for more details on IUnknown methods.
1274 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1275 IDataObject* iface,
1276 REFIID riid,
1277 void** ppvObject)
1279 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1281 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1284 /************************************************************************
1285 * DefaultHandler_IDataObject_AddRef (IUnknown)
1287 * See Windows documentation for more details on IUnknown methods.
1289 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1290 IDataObject* iface)
1292 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1294 return IUnknown_AddRef(this->outerUnknown);
1297 /************************************************************************
1298 * DefaultHandler_IDataObject_Release (IUnknown)
1300 * See Windows documentation for more details on IUnknown methods.
1302 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1303 IDataObject* iface)
1305 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1307 return IUnknown_Release(this->outerUnknown);
1310 /************************************************************************
1311 * DefaultHandler_GetData
1313 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1314 * See Windows documentation for more details on GetData.
1315 * Default handler's implementation of this method delegates to the cache.
1317 static HRESULT WINAPI DefaultHandler_GetData(
1318 IDataObject* iface,
1319 LPFORMATETC pformatetcIn,
1320 STGMEDIUM* pmedium)
1322 IDataObject* cacheDataObject = NULL;
1323 HRESULT hres;
1325 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1327 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1329 hres = IUnknown_QueryInterface(this->dataCache,
1330 &IID_IDataObject,
1331 (void**)&cacheDataObject);
1333 if (FAILED(hres))
1334 return E_UNEXPECTED;
1336 hres = IDataObject_GetData(cacheDataObject,
1337 pformatetcIn,
1338 pmedium);
1340 IDataObject_Release(cacheDataObject);
1342 return hres;
1345 static HRESULT WINAPI DefaultHandler_GetDataHere(
1346 IDataObject* iface,
1347 LPFORMATETC pformatetc,
1348 STGMEDIUM* pmedium)
1350 FIXME(": Stub\n");
1351 return E_NOTIMPL;
1354 /************************************************************************
1355 * DefaultHandler_QueryGetData (IDataObject)
1357 * The default handler's implementation of this method delegates to
1358 * the cache.
1360 * See Windows documentation for more details on IDataObject methods.
1362 static HRESULT WINAPI DefaultHandler_QueryGetData(
1363 IDataObject* iface,
1364 LPFORMATETC pformatetc)
1366 IDataObject* cacheDataObject = NULL;
1367 HRESULT hres;
1369 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1371 TRACE("(%p, %p)\n", iface, pformatetc);
1373 hres = IUnknown_QueryInterface(this->dataCache,
1374 &IID_IDataObject,
1375 (void**)&cacheDataObject);
1377 if (FAILED(hres))
1378 return E_UNEXPECTED;
1380 hres = IDataObject_QueryGetData(cacheDataObject,
1381 pformatetc);
1383 IDataObject_Release(cacheDataObject);
1385 return hres;
1388 /************************************************************************
1389 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1391 * This method is meaningless if the server is not running
1393 * See Windows documentation for more details on IDataObject methods.
1395 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1396 IDataObject* iface,
1397 LPFORMATETC pformatectIn,
1398 LPFORMATETC pformatetcOut)
1400 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1402 return OLE_E_NOTRUNNING;
1405 /************************************************************************
1406 * DefaultHandler_SetData (IDataObject)
1408 * The default handler's implementation of this method delegates to
1409 * the cache.
1411 * See Windows documentation for more details on IDataObject methods.
1413 static HRESULT WINAPI DefaultHandler_SetData(
1414 IDataObject* iface,
1415 LPFORMATETC pformatetc,
1416 STGMEDIUM* pmedium,
1417 BOOL fRelease)
1419 IDataObject* cacheDataObject = NULL;
1420 HRESULT hres;
1422 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1424 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1426 hres = IUnknown_QueryInterface(this->dataCache,
1427 &IID_IDataObject,
1428 (void**)&cacheDataObject);
1430 if (FAILED(hres))
1431 return E_UNEXPECTED;
1433 hres = IDataObject_SetData(cacheDataObject,
1434 pformatetc,
1435 pmedium,
1436 fRelease);
1438 IDataObject_Release(cacheDataObject);
1440 return hres;
1443 /************************************************************************
1444 * DefaultHandler_EnumFormatEtc (IDataObject)
1446 * The default handler's implementation of this method simply delegates
1447 * to OleRegEnumFormatEtc.
1449 * See Windows documentation for more details on IDataObject methods.
1451 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1452 IDataObject* iface,
1453 DWORD dwDirection,
1454 IEnumFORMATETC** ppenumFormatEtc)
1456 HRESULT hres;
1457 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1459 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1461 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1463 return hres;
1466 /************************************************************************
1467 * DefaultHandler_DAdvise (IDataObject)
1469 * The default handler's implementation of this method simply
1470 * delegates to the DataAdviseHolder.
1472 * See Windows documentation for more details on IDataObject methods.
1474 static HRESULT WINAPI DefaultHandler_DAdvise(
1475 IDataObject* iface,
1476 FORMATETC* pformatetc,
1477 DWORD advf,
1478 IAdviseSink* pAdvSink,
1479 DWORD* pdwConnection)
1481 HRESULT hres = S_OK;
1482 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1484 TRACE("(%p, %p, %ld, %p, %p)\n",
1485 iface, pformatetc, advf, pAdvSink, pdwConnection);
1488 * Make sure we have a data advise holder before we start.
1490 if (this->dataAdviseHolder==NULL)
1492 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1495 if (SUCCEEDED(hres))
1497 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1498 iface,
1499 pformatetc,
1500 advf,
1501 pAdvSink,
1502 pdwConnection);
1505 return hres;
1508 /************************************************************************
1509 * DefaultHandler_DUnadvise (IDataObject)
1511 * The default handler's implementation of this method simply
1512 * delegates to the DataAdviseHolder.
1514 * See Windows documentation for more details on IDataObject methods.
1516 static HRESULT WINAPI DefaultHandler_DUnadvise(
1517 IDataObject* iface,
1518 DWORD dwConnection)
1520 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1522 TRACE("(%p, %ld)\n", iface, dwConnection);
1525 * If we don't have a data advise holder yet, it means that
1526 * we don't have any connections..
1528 if (this->dataAdviseHolder==NULL)
1530 return OLE_E_NOCONNECTION;
1533 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1534 dwConnection);
1537 /************************************************************************
1538 * DefaultHandler_EnumDAdvise (IDataObject)
1540 * The default handler's implementation of this method simply
1541 * delegates to the DataAdviseHolder.
1543 * See Windows documentation for more details on IDataObject methods.
1545 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1546 IDataObject* iface,
1547 IEnumSTATDATA** ppenumAdvise)
1549 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1551 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1554 * Sanity check
1556 if (ppenumAdvise == NULL)
1557 return E_POINTER;
1560 * Initialize the out parameter.
1562 *ppenumAdvise = NULL;
1565 * If we have a data advise holder object, delegate.
1567 if (this->dataAdviseHolder!=NULL)
1569 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1570 ppenumAdvise);
1573 return S_OK;
1576 /*********************************************************
1577 * Methods implementation for the IRunnableObject part
1578 * of the DefaultHandler class.
1581 /************************************************************************
1582 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1584 * See Windows documentation for more details on IUnknown methods.
1586 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1587 IRunnableObject* iface,
1588 REFIID riid,
1589 void** ppvObject)
1591 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1593 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1596 /************************************************************************
1597 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1599 * See Windows documentation for more details on IUnknown methods.
1601 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1602 IRunnableObject* iface)
1604 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1606 return IUnknown_AddRef(this->outerUnknown);
1609 /************************************************************************
1610 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1612 * See Windows documentation for more details on IUnknown methods.
1614 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1615 IRunnableObject* iface)
1617 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1619 return IUnknown_Release(this->outerUnknown);
1622 /************************************************************************
1623 * DefaultHandler_GetRunningClass (IRunnableObject)
1625 * According to Brockscmidt, Chapter 19, the default handler's
1626 * implementation of IRunnableobject does nothing until the object
1627 * is actually running.
1629 * See Windows documentation for more details on IRunnableObject methods.
1631 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1632 IRunnableObject* iface,
1633 LPCLSID lpClsid)
1635 TRACE("()\n");
1636 return S_OK;
1639 static HRESULT WINAPI DefaultHandler_Run(
1640 IRunnableObject* iface,
1641 IBindCtx* pbc)
1643 FIXME(": Stub\n");
1644 return E_NOTIMPL;
1647 /************************************************************************
1648 * DefaultHandler_IsRunning (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 BOOL WINAPI DefaultHandler_IsRunning(
1657 IRunnableObject* iface)
1659 TRACE("()\n");
1660 return S_FALSE;
1663 /************************************************************************
1664 * DefaultHandler_LockRunning (IRunnableObject)
1666 * According to Brockscmidt, Chapter 19, the default handler's
1667 * implementation of IRunnableobject does nothing until the object
1668 * is actually running.
1670 * See Windows documentation for more details on IRunnableObject methods.
1672 static HRESULT WINAPI DefaultHandler_LockRunning(
1673 IRunnableObject* iface,
1674 BOOL fLock,
1675 BOOL fLastUnlockCloses)
1677 TRACE("()\n");
1678 return S_OK;
1681 /************************************************************************
1682 * DefaultHandler_SetContainedObject (IRunnableObject)
1684 * According to Brockscmidt, Chapter 19, the default handler's
1685 * implementation of IRunnableobject does nothing until the object
1686 * is actually running.
1688 * See Windows documentation for more details on IRunnableObject methods.
1690 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1691 IRunnableObject* iface,
1692 BOOL fContained)
1694 TRACE("()\n");
1695 return S_OK;