- Use InterlockedIncrement for the ipid counter instead of a critical
[wine/multimedia.git] / dlls / ole32 / defaulthandler.c
blob205000d3ed7be373994c6f83eb6d642b72981f70
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 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerApp );
518 ptrToDestroy->containerApp = NULL;
519 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj );
520 ptrToDestroy->containerObj = NULL;
523 * Release our reference to the data cache.
525 if (ptrToDestroy->dataCache!=NULL)
527 IUnknown_Release(ptrToDestroy->dataCache);
528 ptrToDestroy->dataCache = NULL;
532 * Same thing for the client site.
534 if (ptrToDestroy->clientSite!=NULL)
536 IOleClientSite_Release(ptrToDestroy->clientSite);
537 ptrToDestroy->clientSite = NULL;
541 * And the advise holder.
543 if (ptrToDestroy->oleAdviseHolder!=NULL)
545 IOleAdviseHolder_Release(ptrToDestroy->oleAdviseHolder);
546 ptrToDestroy->oleAdviseHolder = NULL;
550 * And the data advise holder.
552 if (ptrToDestroy->dataAdviseHolder!=NULL)
554 IDataAdviseHolder_Release(ptrToDestroy->dataAdviseHolder);
555 ptrToDestroy->dataAdviseHolder = NULL;
560 * Free the actual default handler structure.
562 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
565 /*********************************************************
566 * Method implementation for the non delegating IUnknown
567 * part of the DefaultHandler class.
570 /************************************************************************
571 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
573 * See Windows documentation for more details on IUnknown methods.
575 * This version of QueryInterface will not delegate it's implementation
576 * to the outer unknown.
578 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
579 IUnknown* iface,
580 REFIID riid,
581 void** ppvObject)
583 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
586 * Perform a sanity check on the parameters.
588 if ( (this==0) || (ppvObject==0) )
589 return E_INVALIDARG;
592 * Initialize the return parameter.
594 *ppvObject = 0;
597 * Compare the riid with the interface IDs implemented by this object.
599 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
601 *ppvObject = iface;
603 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
605 *ppvObject = (IOleObject*)&(this->lpvtbl1);
607 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
609 *ppvObject = (IDataObject*)&(this->lpvtbl3);
611 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
613 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
615 else
618 * Blind aggregate the data cache to "inherit" it's interfaces.
620 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK)
621 return S_OK;
625 * Check that we obtained an interface.
627 if ((*ppvObject)==0)
629 WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid));
630 return E_NOINTERFACE;
634 * Query Interface always increases the reference count by one when it is
635 * successful.
637 IUnknown_AddRef((IUnknown*)*ppvObject);
639 return S_OK;
642 /************************************************************************
643 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
645 * See Windows documentation for more details on IUnknown methods.
647 * This version of QueryInterface will not delegate it's implementation
648 * to the outer unknown.
650 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
651 IUnknown* iface)
653 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
654 return InterlockedIncrement(&this->ref);
657 /************************************************************************
658 * DefaultHandler_NDIUnknown_Release (IUnknown)
660 * See Windows documentation for more details on IUnknown methods.
662 * This version of QueryInterface will not delegate it's implementation
663 * to the outer unknown.
665 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
666 IUnknown* iface)
668 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
669 ULONG ref;
672 * Decrease the reference count on this object.
674 ref = InterlockedDecrement(&this->ref);
677 * If the reference count goes down to 0, perform suicide.
679 if (ref == 0) DefaultHandler_Destroy(this);
681 return ref;
684 /*********************************************************
685 * Methods implementation for the IOleObject part of
686 * the DefaultHandler class.
689 /************************************************************************
690 * DefaultHandler_QueryInterface (IUnknown)
692 * See Windows documentation for more details on IUnknown methods.
694 static HRESULT WINAPI DefaultHandler_QueryInterface(
695 IOleObject* iface,
696 REFIID riid,
697 void** ppvObject)
699 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
701 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
704 /************************************************************************
705 * DefaultHandler_AddRef (IUnknown)
707 * See Windows documentation for more details on IUnknown methods.
709 static ULONG WINAPI DefaultHandler_AddRef(
710 IOleObject* iface)
712 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
714 return IUnknown_AddRef(this->outerUnknown);
717 /************************************************************************
718 * DefaultHandler_Release (IUnknown)
720 * See Windows documentation for more details on IUnknown methods.
722 static ULONG WINAPI DefaultHandler_Release(
723 IOleObject* iface)
725 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
727 return IUnknown_Release(this->outerUnknown);
730 /************************************************************************
731 * DefaultHandler_SetClientSite (IOleObject)
733 * The default handler's implementation of this method only keeps the
734 * client site pointer for future reference.
736 * See Windows documentation for more details on IOleObject methods.
738 static HRESULT WINAPI DefaultHandler_SetClientSite(
739 IOleObject* iface,
740 IOleClientSite* pClientSite)
742 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
744 TRACE("(%p, %p)\n", iface, pClientSite);
747 * Make sure we release the previous client site if there
748 * was one.
750 if (this->clientSite!=NULL)
752 IOleClientSite_Release(this->clientSite);
755 this->clientSite = pClientSite;
757 if (this->clientSite!=NULL)
759 IOleClientSite_AddRef(this->clientSite);
762 return S_OK;
765 /************************************************************************
766 * DefaultHandler_GetClientSite (IOleObject)
768 * The default handler's implementation of this method returns the
769 * last pointer set in IOleObject_SetClientSite.
771 * See Windows documentation for more details on IOleObject methods.
773 static HRESULT WINAPI DefaultHandler_GetClientSite(
774 IOleObject* iface,
775 IOleClientSite** ppClientSite)
777 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
780 * Sanity check.
782 if (ppClientSite == NULL)
783 return E_POINTER;
785 *ppClientSite = this->clientSite;
787 if (this->clientSite != NULL)
789 IOleClientSite_AddRef(this->clientSite);
792 return S_OK;
795 /************************************************************************
796 * DefaultHandler_SetHostNames (IOleObject)
798 * The default handler's implementation of this method just stores
799 * the strings and returns S_OK.
801 * See Windows documentation for more details on IOleObject methods.
803 static HRESULT WINAPI DefaultHandler_SetHostNames(
804 IOleObject* iface,
805 LPCOLESTR szContainerApp,
806 LPCOLESTR szContainerObj)
808 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
810 TRACE("(%p, %s, %s)\n",
811 iface,
812 debugstr_w(szContainerApp),
813 debugstr_w(szContainerObj));
816 * Be sure to cleanup before re-assinging the strings.
818 HeapFree( GetProcessHeap(), 0, this->containerApp );
819 this->containerApp = NULL;
820 HeapFree( GetProcessHeap(), 0, this->containerObj );
821 this->containerObj = NULL;
824 * Copy the string supplied.
826 if (szContainerApp != NULL)
828 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
829 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
830 strcpyW( this->containerApp, szContainerApp );
833 if (szContainerObj != NULL)
835 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
836 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
837 strcpyW( this->containerObj, szContainerObj );
839 return S_OK;
842 /************************************************************************
843 * DefaultHandler_Close (IOleObject)
845 * The default handler's implementation of this method is meaningless
846 * without a running server so it does nothing.
848 * See Windows documentation for more details on IOleObject methods.
850 static HRESULT WINAPI DefaultHandler_Close(
851 IOleObject* iface,
852 DWORD dwSaveOption)
854 TRACE("()\n");
855 return S_OK;
858 /************************************************************************
859 * DefaultHandler_SetMoniker (IOleObject)
861 * The default handler's implementation of this method does nothing.
863 * See Windows documentation for more details on IOleObject methods.
865 static HRESULT WINAPI DefaultHandler_SetMoniker(
866 IOleObject* iface,
867 DWORD dwWhichMoniker,
868 IMoniker* pmk)
870 TRACE("(%p, %ld, %p)\n",
871 iface,
872 dwWhichMoniker,
873 pmk);
875 return S_OK;
878 /************************************************************************
879 * DefaultHandler_GetMoniker (IOleObject)
881 * Delegate this request to the client site if we have one.
883 * See Windows documentation for more details on IOleObject methods.
885 static HRESULT WINAPI DefaultHandler_GetMoniker(
886 IOleObject* iface,
887 DWORD dwAssign,
888 DWORD dwWhichMoniker,
889 IMoniker** ppmk)
891 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
893 TRACE("(%p, %ld, %ld, %p)\n",
894 iface, dwAssign, dwWhichMoniker, ppmk);
896 if (this->clientSite)
898 return IOleClientSite_GetMoniker(this->clientSite,
899 dwAssign,
900 dwWhichMoniker,
901 ppmk);
905 return E_FAIL;
908 /************************************************************************
909 * DefaultHandler_InitFromData (IOleObject)
911 * This method is meaningless if the server is not running
913 * See Windows documentation for more details on IOleObject methods.
915 static HRESULT WINAPI DefaultHandler_InitFromData(
916 IOleObject* iface,
917 IDataObject* pDataObject,
918 BOOL fCreation,
919 DWORD dwReserved)
921 TRACE("(%p, %p, %d, %ld)\n",
922 iface, pDataObject, fCreation, dwReserved);
924 return OLE_E_NOTRUNNING;
927 /************************************************************************
928 * DefaultHandler_GetClipboardData (IOleObject)
930 * This method is meaningless if the server is not running
932 * See Windows documentation for more details on IOleObject methods.
934 static HRESULT WINAPI DefaultHandler_GetClipboardData(
935 IOleObject* iface,
936 DWORD dwReserved,
937 IDataObject** ppDataObject)
939 TRACE("(%p, %ld, %p)\n",
940 iface, dwReserved, ppDataObject);
942 return OLE_E_NOTRUNNING;
945 static HRESULT WINAPI DefaultHandler_DoVerb(
946 IOleObject* iface,
947 LONG iVerb,
948 struct tagMSG* lpmsg,
949 IOleClientSite* pActiveSite,
950 LONG lindex,
951 HWND hwndParent,
952 LPCRECT lprcPosRect)
954 FIXME(": Stub\n");
955 return E_NOTIMPL;
958 /************************************************************************
959 * DefaultHandler_EnumVerbs (IOleObject)
961 * The default handler implementation of this method simply delegates
962 * to OleRegEnumVerbs
964 * See Windows documentation for more details on IOleObject methods.
966 static HRESULT WINAPI DefaultHandler_EnumVerbs(
967 IOleObject* iface,
968 IEnumOLEVERB** ppEnumOleVerb)
970 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
972 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
974 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
977 static HRESULT WINAPI DefaultHandler_Update(
978 IOleObject* iface)
980 FIXME(": Stub\n");
981 return E_NOTIMPL;
984 /************************************************************************
985 * DefaultHandler_IsUpToDate (IOleObject)
987 * This method is meaningless if the server is not running
989 * See Windows documentation for more details on IOleObject methods.
991 static HRESULT WINAPI DefaultHandler_IsUpToDate(
992 IOleObject* iface)
994 TRACE("(%p)\n", iface);
996 return OLE_E_NOTRUNNING;
999 /************************************************************************
1000 * DefaultHandler_GetUserClassID (IOleObject)
1002 * TODO: Map to a new class ID if emulation is active.
1004 * See Windows documentation for more details on IOleObject methods.
1006 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1007 IOleObject* iface,
1008 CLSID* pClsid)
1010 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1012 TRACE("(%p, %p)\n", iface, pClsid);
1015 * Sanity check.
1017 if (pClsid==NULL)
1018 return E_POINTER;
1020 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1022 return S_OK;
1025 /************************************************************************
1026 * DefaultHandler_GetUserType (IOleObject)
1028 * The default handler implementation of this method simply delegates
1029 * to OleRegGetUserType
1031 * See Windows documentation for more details on IOleObject methods.
1033 static HRESULT WINAPI DefaultHandler_GetUserType(
1034 IOleObject* iface,
1035 DWORD dwFormOfType,
1036 LPOLESTR* pszUserType)
1038 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1040 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1042 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1045 /************************************************************************
1046 * DefaultHandler_SetExtent (IOleObject)
1048 * This method is meaningless if the server is not running
1050 * See Windows documentation for more details on IOleObject methods.
1052 static HRESULT WINAPI DefaultHandler_SetExtent(
1053 IOleObject* iface,
1054 DWORD dwDrawAspect,
1055 SIZEL* psizel)
1057 TRACE("(%p, %lx, (%ld x %ld))\n", iface,
1058 dwDrawAspect, psizel->cx, psizel->cy);
1059 return OLE_E_NOTRUNNING;
1062 /************************************************************************
1063 * DefaultHandler_GetExtent (IOleObject)
1065 * The default handler's implementation of this method returns uses
1066 * the cache to locate the aspect and extract the extent from it.
1068 * See Windows documentation for more details on IOleObject methods.
1070 static HRESULT WINAPI DefaultHandler_GetExtent(
1071 IOleObject* iface,
1072 DWORD dwDrawAspect,
1073 SIZEL* psizel)
1075 DVTARGETDEVICE* targetDevice;
1076 IViewObject2* cacheView = NULL;
1077 HRESULT hres;
1079 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1081 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1083 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1085 if (FAILED(hres))
1086 return E_UNEXPECTED;
1089 * Prepare the call to the cache's GetExtent method.
1091 * Here we would build a valid DVTARGETDEVICE structure
1092 * but, since we are calling into the data cache, we
1093 * know it's implementation and we'll skip this
1094 * extra work until later.
1096 targetDevice = NULL;
1098 hres = IViewObject2_GetExtent(cacheView,
1099 dwDrawAspect,
1101 targetDevice,
1102 psizel);
1105 * Cleanup
1107 IViewObject2_Release(cacheView);
1109 return hres;
1112 /************************************************************************
1113 * DefaultHandler_Advise (IOleObject)
1115 * The default handler's implementation of this method simply
1116 * delegates to the OleAdviseHolder.
1118 * See Windows documentation for more details on IOleObject methods.
1120 static HRESULT WINAPI DefaultHandler_Advise(
1121 IOleObject* iface,
1122 IAdviseSink* pAdvSink,
1123 DWORD* pdwConnection)
1125 HRESULT hres = S_OK;
1126 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1128 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1131 * Make sure we have an advise holder before we start.
1133 if (this->oleAdviseHolder==NULL)
1135 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1138 if (SUCCEEDED(hres))
1140 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1141 pAdvSink,
1142 pdwConnection);
1145 return hres;
1148 /************************************************************************
1149 * DefaultHandler_Unadvise (IOleObject)
1151 * The default handler's implementation of this method simply
1152 * delegates to the OleAdviseHolder.
1154 * See Windows documentation for more details on IOleObject methods.
1156 static HRESULT WINAPI DefaultHandler_Unadvise(
1157 IOleObject* iface,
1158 DWORD dwConnection)
1160 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1162 TRACE("(%p, %ld)\n", iface, dwConnection);
1165 * If we don't have an advise holder yet, it means we don't have
1166 * a connection.
1168 if (this->oleAdviseHolder==NULL)
1169 return OLE_E_NOCONNECTION;
1171 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1172 dwConnection);
1175 /************************************************************************
1176 * DefaultHandler_EnumAdvise (IOleObject)
1178 * The default handler's implementation of this method simply
1179 * delegates to the OleAdviseHolder.
1181 * See Windows documentation for more details on IOleObject methods.
1183 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1184 IOleObject* iface,
1185 IEnumSTATDATA** ppenumAdvise)
1187 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1189 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1192 * Sanity check
1194 if (ppenumAdvise==NULL)
1195 return E_POINTER;
1198 * Initialize the out parameter.
1200 *ppenumAdvise = NULL;
1202 if (this->oleAdviseHolder==NULL)
1203 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1204 ppenumAdvise);
1206 return S_OK;
1209 /************************************************************************
1210 * DefaultHandler_GetMiscStatus (IOleObject)
1212 * The default handler's implementation of this method simply delegates
1213 * to OleRegGetMiscStatus.
1215 * See Windows documentation for more details on IOleObject methods.
1217 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1218 IOleObject* iface,
1219 DWORD dwAspect,
1220 DWORD* pdwStatus)
1222 HRESULT hres;
1223 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1225 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1227 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1229 if (FAILED(hres))
1230 *pdwStatus = 0;
1232 return S_OK;
1235 /************************************************************************
1236 * DefaultHandler_SetExtent (IOleObject)
1238 * This method is meaningless if the server is not running
1240 * See Windows documentation for more details on IOleObject methods.
1242 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1243 IOleObject* iface,
1244 struct tagLOGPALETTE* pLogpal)
1246 TRACE("(%p, %p))\n", iface, pLogpal);
1247 return OLE_E_NOTRUNNING;
1250 /*********************************************************
1251 * Methods implementation for the IDataObject part of
1252 * the DefaultHandler class.
1255 /************************************************************************
1256 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1258 * See Windows documentation for more details on IUnknown methods.
1260 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1261 IDataObject* iface,
1262 REFIID riid,
1263 void** ppvObject)
1265 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1267 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1270 /************************************************************************
1271 * DefaultHandler_IDataObject_AddRef (IUnknown)
1273 * See Windows documentation for more details on IUnknown methods.
1275 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1276 IDataObject* iface)
1278 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1280 return IUnknown_AddRef(this->outerUnknown);
1283 /************************************************************************
1284 * DefaultHandler_IDataObject_Release (IUnknown)
1286 * See Windows documentation for more details on IUnknown methods.
1288 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1289 IDataObject* iface)
1291 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1293 return IUnknown_Release(this->outerUnknown);
1296 /************************************************************************
1297 * DefaultHandler_GetData
1299 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1300 * See Windows documentation for more details on GetData.
1301 * Default handler's implementation of this method delegates to the cache.
1303 static HRESULT WINAPI DefaultHandler_GetData(
1304 IDataObject* iface,
1305 LPFORMATETC pformatetcIn,
1306 STGMEDIUM* pmedium)
1308 IDataObject* cacheDataObject = NULL;
1309 HRESULT hres;
1311 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1313 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1315 hres = IUnknown_QueryInterface(this->dataCache,
1316 &IID_IDataObject,
1317 (void**)&cacheDataObject);
1319 if (FAILED(hres))
1320 return E_UNEXPECTED;
1322 hres = IDataObject_GetData(cacheDataObject,
1323 pformatetcIn,
1324 pmedium);
1326 IDataObject_Release(cacheDataObject);
1328 return hres;
1331 static HRESULT WINAPI DefaultHandler_GetDataHere(
1332 IDataObject* iface,
1333 LPFORMATETC pformatetc,
1334 STGMEDIUM* pmedium)
1336 FIXME(": Stub\n");
1337 return E_NOTIMPL;
1340 /************************************************************************
1341 * DefaultHandler_QueryGetData (IDataObject)
1343 * The default handler's implementation of this method delegates to
1344 * the cache.
1346 * See Windows documentation for more details on IDataObject methods.
1348 static HRESULT WINAPI DefaultHandler_QueryGetData(
1349 IDataObject* iface,
1350 LPFORMATETC pformatetc)
1352 IDataObject* cacheDataObject = NULL;
1353 HRESULT hres;
1355 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1357 TRACE("(%p, %p)\n", iface, pformatetc);
1359 hres = IUnknown_QueryInterface(this->dataCache,
1360 &IID_IDataObject,
1361 (void**)&cacheDataObject);
1363 if (FAILED(hres))
1364 return E_UNEXPECTED;
1366 hres = IDataObject_QueryGetData(cacheDataObject,
1367 pformatetc);
1369 IDataObject_Release(cacheDataObject);
1371 return hres;
1374 /************************************************************************
1375 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1377 * This method is meaningless if the server is not running
1379 * See Windows documentation for more details on IDataObject methods.
1381 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1382 IDataObject* iface,
1383 LPFORMATETC pformatectIn,
1384 LPFORMATETC pformatetcOut)
1386 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1388 return OLE_E_NOTRUNNING;
1391 /************************************************************************
1392 * DefaultHandler_SetData (IDataObject)
1394 * The default handler's implementation of this method delegates to
1395 * the cache.
1397 * See Windows documentation for more details on IDataObject methods.
1399 static HRESULT WINAPI DefaultHandler_SetData(
1400 IDataObject* iface,
1401 LPFORMATETC pformatetc,
1402 STGMEDIUM* pmedium,
1403 BOOL fRelease)
1405 IDataObject* cacheDataObject = NULL;
1406 HRESULT hres;
1408 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1410 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1412 hres = IUnknown_QueryInterface(this->dataCache,
1413 &IID_IDataObject,
1414 (void**)&cacheDataObject);
1416 if (FAILED(hres))
1417 return E_UNEXPECTED;
1419 hres = IDataObject_SetData(cacheDataObject,
1420 pformatetc,
1421 pmedium,
1422 fRelease);
1424 IDataObject_Release(cacheDataObject);
1426 return hres;
1429 /************************************************************************
1430 * DefaultHandler_EnumFormatEtc (IDataObject)
1432 * The default handler's implementation of this method simply delegates
1433 * to OleRegEnumFormatEtc.
1435 * See Windows documentation for more details on IDataObject methods.
1437 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1438 IDataObject* iface,
1439 DWORD dwDirection,
1440 IEnumFORMATETC** ppenumFormatEtc)
1442 HRESULT hres;
1443 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1445 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1447 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1449 return hres;
1452 /************************************************************************
1453 * DefaultHandler_DAdvise (IDataObject)
1455 * The default handler's implementation of this method simply
1456 * delegates to the DataAdviseHolder.
1458 * See Windows documentation for more details on IDataObject methods.
1460 static HRESULT WINAPI DefaultHandler_DAdvise(
1461 IDataObject* iface,
1462 FORMATETC* pformatetc,
1463 DWORD advf,
1464 IAdviseSink* pAdvSink,
1465 DWORD* pdwConnection)
1467 HRESULT hres = S_OK;
1468 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1470 TRACE("(%p, %p, %ld, %p, %p)\n",
1471 iface, pformatetc, advf, pAdvSink, pdwConnection);
1474 * Make sure we have a data advise holder before we start.
1476 if (this->dataAdviseHolder==NULL)
1478 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1481 if (SUCCEEDED(hres))
1483 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1484 iface,
1485 pformatetc,
1486 advf,
1487 pAdvSink,
1488 pdwConnection);
1491 return hres;
1494 /************************************************************************
1495 * DefaultHandler_DUnadvise (IDataObject)
1497 * The default handler's implementation of this method simply
1498 * delegates to the DataAdviseHolder.
1500 * See Windows documentation for more details on IDataObject methods.
1502 static HRESULT WINAPI DefaultHandler_DUnadvise(
1503 IDataObject* iface,
1504 DWORD dwConnection)
1506 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1508 TRACE("(%p, %ld)\n", iface, dwConnection);
1511 * If we don't have a data advise holder yet, it means that
1512 * we don't have any connections..
1514 if (this->dataAdviseHolder==NULL)
1516 return OLE_E_NOCONNECTION;
1519 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1520 dwConnection);
1523 /************************************************************************
1524 * DefaultHandler_EnumDAdvise (IDataObject)
1526 * The default handler's implementation of this method simply
1527 * delegates to the DataAdviseHolder.
1529 * See Windows documentation for more details on IDataObject methods.
1531 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1532 IDataObject* iface,
1533 IEnumSTATDATA** ppenumAdvise)
1535 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1537 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1540 * Sanity check
1542 if (ppenumAdvise == NULL)
1543 return E_POINTER;
1546 * Initialize the out parameter.
1548 *ppenumAdvise = NULL;
1551 * If we have a data advise holder object, delegate.
1553 if (this->dataAdviseHolder!=NULL)
1555 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1556 ppenumAdvise);
1559 return S_OK;
1562 /*********************************************************
1563 * Methods implementation for the IRunnableObject part
1564 * of the DefaultHandler class.
1567 /************************************************************************
1568 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1570 * See Windows documentation for more details on IUnknown methods.
1572 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1573 IRunnableObject* iface,
1574 REFIID riid,
1575 void** ppvObject)
1577 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1579 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1582 /************************************************************************
1583 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1585 * See Windows documentation for more details on IUnknown methods.
1587 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1588 IRunnableObject* iface)
1590 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1592 return IUnknown_AddRef(this->outerUnknown);
1595 /************************************************************************
1596 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1598 * See Windows documentation for more details on IUnknown methods.
1600 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1601 IRunnableObject* iface)
1603 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1605 return IUnknown_Release(this->outerUnknown);
1608 /************************************************************************
1609 * DefaultHandler_GetRunningClass (IRunnableObject)
1611 * According to Brockscmidt, Chapter 19, the default handler's
1612 * implementation of IRunnableobject does nothing until the object
1613 * is actually running.
1615 * See Windows documentation for more details on IRunnableObject methods.
1617 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1618 IRunnableObject* iface,
1619 LPCLSID lpClsid)
1621 TRACE("()\n");
1622 return S_OK;
1625 static HRESULT WINAPI DefaultHandler_Run(
1626 IRunnableObject* iface,
1627 IBindCtx* pbc)
1629 FIXME(": Stub\n");
1630 return E_NOTIMPL;
1633 /************************************************************************
1634 * DefaultHandler_IsRunning (IRunnableObject)
1636 * According to Brockscmidt, Chapter 19, the default handler's
1637 * implementation of IRunnableobject does nothing until the object
1638 * is actually running.
1640 * See Windows documentation for more details on IRunnableObject methods.
1642 static BOOL WINAPI DefaultHandler_IsRunning(
1643 IRunnableObject* iface)
1645 TRACE("()\n");
1646 return S_FALSE;
1649 /************************************************************************
1650 * DefaultHandler_LockRunning (IRunnableObject)
1652 * According to Brockscmidt, Chapter 19, the default handler's
1653 * implementation of IRunnableobject does nothing until the object
1654 * is actually running.
1656 * See Windows documentation for more details on IRunnableObject methods.
1658 static HRESULT WINAPI DefaultHandler_LockRunning(
1659 IRunnableObject* iface,
1660 BOOL fLock,
1661 BOOL fLastUnlockCloses)
1663 TRACE("()\n");
1664 return S_OK;
1667 /************************************************************************
1668 * DefaultHandler_SetContainedObject (IRunnableObject)
1670 * According to Brockscmidt, Chapter 19, the default handler's
1671 * implementation of IRunnableobject does nothing until the object
1672 * is actually running.
1674 * See Windows documentation for more details on IRunnableObject methods.
1676 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1677 IRunnableObject* iface,
1678 BOOL fContained)
1680 TRACE("()\n");
1681 return S_OK;