Fix French translation.
[wine/multimedia.git] / dlls / ole32 / defaulthandler.c
blob820b3812abcf5d2df649b41b2ec4ed5069cfbcb8
1 /*
2 * OLE 2 default object handler
4 * Copyright 1999 Francis Beaudet
5 * Copyright 2000 Abey George
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * NOTES:
22 * The OLE2 default object handler supports a whole whack of
23 * interfaces including:
24 * IOleObject, IDataObject, IPersistStorage, IViewObject2,
25 * IRunnableObject, IOleCache2, IOleCacheControl and much more.
27 * All the implementation details are taken from: Inside OLE
28 * second edition by Kraig Brockschmidt,
30 * TODO
31 * - This implementation of the default handler does not launch the
32 * server in the DoVerb, Update, GetData, GetDataHere and Run
33 * methods. When it is fixed to do so, all the methods will have
34 * to be revisited to allow delegating to the running object
36 * - All methods in the class that use the class ID should be
37 * aware that it is possible for a class to be treated as
38 * another one and go into emulation mode. Nothing has been
39 * done in this area.
41 * - Some functions still return E_NOTIMPL they have to be
42 * implemented. Most of those are related to the running of the
43 * actual server.
45 * - All the methods related to notification and advise sinks are
46 * in place but no notifications are sent to the sinks yet.
48 #include <assert.h>
49 #include <stdarg.h>
50 #include <string.h>
52 #include "windef.h"
53 #include "winbase.h"
54 #include "winerror.h"
55 #include "wine/unicode.h"
56 #include "ole2.h"
57 #include "wine/debug.h"
59 WINE_DEFAULT_DEBUG_CHANNEL(ole);
61 /****************************************************************************
62 * DefaultHandler
65 struct DefaultHandler
68 * List all interface VTables here
70 ICOM_VTABLE(IOleObject)* lpvtbl1;
71 ICOM_VTABLE(IUnknown)* lpvtbl2;
72 ICOM_VTABLE(IDataObject)* lpvtbl3;
73 ICOM_VTABLE(IRunnableObject)* lpvtbl4;
76 * Reference count of this object
78 ULONG ref;
81 * IUnknown implementation of the outer object.
83 IUnknown* outerUnknown;
86 * Class Id that this handler object represents.
88 CLSID clsid;
91 * IUnknown implementation of the datacache.
93 IUnknown* dataCache;
96 * Client site for the embedded object.
98 IOleClientSite* clientSite;
101 * The IOleAdviseHolder maintains the connections
102 * on behalf of the default handler.
104 IOleAdviseHolder* oleAdviseHolder;
107 * The IDataAdviseHolder maintains the data
108 * connections on behalf of the default handler.
110 IDataAdviseHolder* dataAdviseHolder;
113 * Name of the container and object contained
115 LPWSTR containerApp;
116 LPWSTR containerObj;
120 typedef struct DefaultHandler DefaultHandler;
123 * Here, I define utility macros to help with the casting of the
124 * "this" parameter.
125 * There is a version to accomodate all of the VTables implemented
126 * by this object.
128 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name;
129 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
130 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
131 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
134 * Prototypes for the methods of the DefaultHandler class.
136 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid,
137 LPUNKNOWN pUnkOuter);
138 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy);
141 * Prototypes for the methods of the DefaultHandler class
142 * that implement non delegating IUnknown methods.
144 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
145 IUnknown* iface,
146 REFIID riid,
147 void** ppvObject);
148 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
149 IUnknown* iface);
150 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
151 IUnknown* iface);
154 * Prototypes for the methods of the DefaultHandler class
155 * that implement IOleObject methods.
157 static HRESULT WINAPI DefaultHandler_QueryInterface(
158 IOleObject* iface,
159 REFIID riid,
160 void** ppvObject);
161 static ULONG WINAPI DefaultHandler_AddRef(
162 IOleObject* iface);
163 static ULONG WINAPI DefaultHandler_Release(
164 IOleObject* iface);
165 static HRESULT WINAPI DefaultHandler_SetClientSite(
166 IOleObject* iface,
167 IOleClientSite* pClientSite);
168 static HRESULT WINAPI DefaultHandler_GetClientSite(
169 IOleObject* iface,
170 IOleClientSite** ppClientSite);
171 static HRESULT WINAPI DefaultHandler_SetHostNames(
172 IOleObject* iface,
173 LPCOLESTR szContainerApp,
174 LPCOLESTR szContainerObj);
175 static HRESULT WINAPI DefaultHandler_Close(
176 IOleObject* iface,
177 DWORD dwSaveOption);
178 static HRESULT WINAPI DefaultHandler_SetMoniker(
179 IOleObject* iface,
180 DWORD dwWhichMoniker,
181 IMoniker* pmk);
182 static HRESULT WINAPI DefaultHandler_GetMoniker(
183 IOleObject* iface,
184 DWORD dwAssign,
185 DWORD dwWhichMoniker,
186 IMoniker** ppmk);
187 static HRESULT WINAPI DefaultHandler_InitFromData(
188 IOleObject* iface,
189 IDataObject* pDataObject,
190 BOOL fCreation,
191 DWORD dwReserved);
192 static HRESULT WINAPI DefaultHandler_GetClipboardData(
193 IOleObject* iface,
194 DWORD dwReserved,
195 IDataObject** ppDataObject);
196 static HRESULT WINAPI DefaultHandler_DoVerb(
197 IOleObject* iface,
198 LONG iVerb,
199 struct tagMSG* lpmsg,
200 IOleClientSite* pActiveSite,
201 LONG lindex,
202 HWND hwndParent,
203 LPCRECT lprcPosRect);
204 static HRESULT WINAPI DefaultHandler_EnumVerbs(
205 IOleObject* iface,
206 IEnumOLEVERB** ppEnumOleVerb);
207 static HRESULT WINAPI DefaultHandler_Update(
208 IOleObject* iface);
209 static HRESULT WINAPI DefaultHandler_IsUpToDate(
210 IOleObject* iface);
211 static HRESULT WINAPI DefaultHandler_GetUserClassID(
212 IOleObject* iface,
213 CLSID* pClsid);
214 static HRESULT WINAPI DefaultHandler_GetUserType(
215 IOleObject* iface,
216 DWORD dwFormOfType,
217 LPOLESTR* pszUserType);
218 static HRESULT WINAPI DefaultHandler_SetExtent(
219 IOleObject* iface,
220 DWORD dwDrawAspect,
221 SIZEL* psizel);
222 static HRESULT WINAPI DefaultHandler_GetExtent(
223 IOleObject* iface,
224 DWORD dwDrawAspect,
225 SIZEL* psizel);
226 static HRESULT WINAPI DefaultHandler_Advise(
227 IOleObject* iface,
228 IAdviseSink* pAdvSink,
229 DWORD* pdwConnection);
230 static HRESULT WINAPI DefaultHandler_Unadvise(
231 IOleObject* iface,
232 DWORD dwConnection);
233 static HRESULT WINAPI DefaultHandler_EnumAdvise(
234 IOleObject* iface,
235 IEnumSTATDATA** ppenumAdvise);
236 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
237 IOleObject* iface,
238 DWORD dwAspect,
239 DWORD* pdwStatus);
240 static HRESULT WINAPI DefaultHandler_SetColorScheme(
241 IOleObject* iface,
242 struct tagLOGPALETTE* pLogpal);
245 * Prototypes for the methods of the DefaultHandler class
246 * that implement IDataObject methods.
248 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
249 IDataObject* iface,
250 REFIID riid,
251 void** ppvObject);
252 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
253 IDataObject* iface);
254 static ULONG WINAPI DefaultHandler_IDataObject_Release(
255 IDataObject* iface);
256 static HRESULT WINAPI DefaultHandler_GetData(
257 IDataObject* iface,
258 LPFORMATETC pformatetcIn,
259 STGMEDIUM* pmedium);
260 static HRESULT WINAPI DefaultHandler_GetDataHere(
261 IDataObject* iface,
262 LPFORMATETC pformatetc,
263 STGMEDIUM* pmedium);
264 static HRESULT WINAPI DefaultHandler_QueryGetData(
265 IDataObject* iface,
266 LPFORMATETC pformatetc);
267 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
268 IDataObject* iface,
269 LPFORMATETC pformatectIn,
270 LPFORMATETC pformatetcOut);
271 static HRESULT WINAPI DefaultHandler_SetData(
272 IDataObject* iface,
273 LPFORMATETC pformatetc,
274 STGMEDIUM* pmedium,
275 BOOL fRelease);
276 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
277 IDataObject* iface,
278 DWORD dwDirection,
279 IEnumFORMATETC** ppenumFormatEtc);
280 static HRESULT WINAPI DefaultHandler_DAdvise(
281 IDataObject* iface,
282 FORMATETC* pformatetc,
283 DWORD advf,
284 IAdviseSink* pAdvSink,
285 DWORD* pdwConnection);
286 static HRESULT WINAPI DefaultHandler_DUnadvise(
287 IDataObject* iface,
288 DWORD dwConnection);
289 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
290 IDataObject* iface,
291 IEnumSTATDATA** ppenumAdvise);
294 * Prototypes for the methods of the DefaultHandler class
295 * that implement IRunnableObject methods.
297 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
298 IRunnableObject* iface,
299 REFIID riid,
300 void** ppvObject);
301 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
302 IRunnableObject* iface);
303 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
304 IRunnableObject* iface);
305 static HRESULT WINAPI DefaultHandler_GetRunningClass(
306 IRunnableObject* iface,
307 LPCLSID lpClsid);
308 static HRESULT WINAPI DefaultHandler_Run(
309 IRunnableObject* iface,
310 IBindCtx* pbc);
311 static BOOL WINAPI DefaultHandler_IsRunning(
312 IRunnableObject* iface);
313 static HRESULT WINAPI DefaultHandler_LockRunning(
314 IRunnableObject* iface,
315 BOOL fLock,
316 BOOL fLastUnlockCloses);
317 static HRESULT WINAPI DefaultHandler_SetContainedObject(
318 IRunnableObject* iface,
319 BOOL fContained);
323 * Virtual function tables for the DefaultHandler class.
325 static ICOM_VTABLE(IOleObject) DefaultHandler_IOleObject_VTable =
327 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
328 DefaultHandler_QueryInterface,
329 DefaultHandler_AddRef,
330 DefaultHandler_Release,
331 DefaultHandler_SetClientSite,
332 DefaultHandler_GetClientSite,
333 DefaultHandler_SetHostNames,
334 DefaultHandler_Close,
335 DefaultHandler_SetMoniker,
336 DefaultHandler_GetMoniker,
337 DefaultHandler_InitFromData,
338 DefaultHandler_GetClipboardData,
339 DefaultHandler_DoVerb,
340 DefaultHandler_EnumVerbs,
341 DefaultHandler_Update,
342 DefaultHandler_IsUpToDate,
343 DefaultHandler_GetUserClassID,
344 DefaultHandler_GetUserType,
345 DefaultHandler_SetExtent,
346 DefaultHandler_GetExtent,
347 DefaultHandler_Advise,
348 DefaultHandler_Unadvise,
349 DefaultHandler_EnumAdvise,
350 DefaultHandler_GetMiscStatus,
351 DefaultHandler_SetColorScheme
354 static ICOM_VTABLE(IUnknown) DefaultHandler_NDIUnknown_VTable =
356 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
357 DefaultHandler_NDIUnknown_QueryInterface,
358 DefaultHandler_NDIUnknown_AddRef,
359 DefaultHandler_NDIUnknown_Release,
362 static ICOM_VTABLE(IDataObject) DefaultHandler_IDataObject_VTable =
364 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
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 ICOM_VTABLE(IRunnableObject) DefaultHandler_IRunnableObject_VTable =
381 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
382 DefaultHandler_IRunnableObject_QueryInterface,
383 DefaultHandler_IRunnableObject_AddRef,
384 DefaultHandler_IRunnableObject_Release,
385 DefaultHandler_GetRunningClass,
386 DefaultHandler_Run,
387 DefaultHandler_IsRunning,
388 DefaultHandler_LockRunning,
389 DefaultHandler_SetContainedObject
392 /******************************************************************************
393 * OleCreateDefaultHandler [OLE32.90]
395 HRESULT WINAPI OleCreateDefaultHandler(
396 REFCLSID clsid,
397 LPUNKNOWN pUnkOuter,
398 REFIID riid,
399 LPVOID* ppvObj)
401 DefaultHandler* newHandler = NULL;
402 HRESULT hr = S_OK;
404 TRACE("(%s, %p, %s, %p)\n", debugstr_guid(clsid), pUnkOuter, debugstr_guid(riid), ppvObj);
407 * Sanity check
409 if (ppvObj==0)
410 return E_POINTER;
412 *ppvObj = 0;
415 * If this handler is constructed for aggregation, make sure
416 * the caller is requesting the IUnknown interface.
417 * This is necessary because it's the only time the non-delegating
418 * IUnknown pointer can be returned to the outside.
420 if ( (pUnkOuter!=NULL) &&
421 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) )
422 return CLASS_E_NOAGGREGATION;
425 * Try to construct a new instance of the class.
427 newHandler = DefaultHandler_Construct(clsid,
428 pUnkOuter);
430 if (newHandler == 0)
431 return E_OUTOFMEMORY;
434 * Make sure it supports the interface required by the caller.
436 hr = IUnknown_QueryInterface((IUnknown*)&(newHandler->lpvtbl2), riid, ppvObj);
439 * Release the reference obtained in the constructor. If
440 * the QueryInterface was unsuccessful, it will free the class.
442 IUnknown_Release((IUnknown*)&(newHandler->lpvtbl2));
444 return hr;
447 /*********************************************************
448 * Methods implementation for the DefaultHandler class.
450 static DefaultHandler* DefaultHandler_Construct(
451 REFCLSID clsid,
452 LPUNKNOWN pUnkOuter)
454 DefaultHandler* newObject = 0;
457 * Allocate space for the object.
459 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(DefaultHandler));
461 if (newObject==0)
462 return newObject;
465 * Initialize the virtual function table.
467 newObject->lpvtbl1 = &DefaultHandler_IOleObject_VTable;
468 newObject->lpvtbl2 = &DefaultHandler_NDIUnknown_VTable;
469 newObject->lpvtbl3 = &DefaultHandler_IDataObject_VTable;
470 newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable;
473 * Start with one reference count. The caller of this function
474 * must release the interface pointer when it is done.
476 newObject->ref = 1;
479 * Initialize the outer unknown
480 * We don't keep a reference on the outer unknown since, the way
481 * aggregation works, our lifetime is at least as large as it's
482 * lifetime.
484 if (pUnkOuter==NULL)
485 pUnkOuter = (IUnknown*)&(newObject->lpvtbl2);
487 newObject->outerUnknown = pUnkOuter;
490 * Create a datacache object.
491 * We aggregate with the datacache. Make sure we pass our outer
492 * unknown as the datacache's outer unknown.
494 CreateDataCache(newObject->outerUnknown,
495 clsid,
496 &IID_IUnknown,
497 (void**)&newObject->dataCache);
500 * Initialize the other data members of the class.
502 memcpy(&(newObject->clsid), clsid, sizeof(CLSID));
503 newObject->clientSite = NULL;
504 newObject->oleAdviseHolder = NULL;
505 newObject->dataAdviseHolder = NULL;
506 newObject->containerApp = NULL;
507 newObject->containerObj = NULL;
509 return newObject;
512 static void DefaultHandler_Destroy(
513 DefaultHandler* ptrToDestroy)
516 * Free the strings idenfitying the object
518 if (ptrToDestroy->containerApp!=NULL)
520 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerApp );
521 ptrToDestroy->containerApp = NULL;
524 if (ptrToDestroy->containerObj!=NULL)
526 HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj );
527 ptrToDestroy->containerObj = NULL;
531 * Release our reference to the data cache.
533 if (ptrToDestroy->dataCache!=NULL)
535 IUnknown_Release(ptrToDestroy->dataCache);
536 ptrToDestroy->dataCache = NULL;
540 * Same thing for the client site.
542 if (ptrToDestroy->clientSite!=NULL)
544 IOleClientSite_Release(ptrToDestroy->clientSite);
545 ptrToDestroy->clientSite = NULL;
549 * And the advise holder.
551 if (ptrToDestroy->oleAdviseHolder!=NULL)
553 IOleAdviseHolder_Release(ptrToDestroy->oleAdviseHolder);
554 ptrToDestroy->oleAdviseHolder = NULL;
558 * And the data advise holder.
560 if (ptrToDestroy->dataAdviseHolder!=NULL)
562 IDataAdviseHolder_Release(ptrToDestroy->dataAdviseHolder);
563 ptrToDestroy->dataAdviseHolder = NULL;
568 * Free the actual default handler structure.
570 HeapFree(GetProcessHeap(), 0, ptrToDestroy);
573 /*********************************************************
574 * Method implementation for the non delegating IUnknown
575 * part of the DefaultHandler class.
578 /************************************************************************
579 * DefaultHandler_NDIUnknown_QueryInterface (IUnknown)
581 * See Windows documentation for more details on IUnknown methods.
583 * This version of QueryInterface will not delegate it's implementation
584 * to the outer unknown.
586 static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface(
587 IUnknown* iface,
588 REFIID riid,
589 void** ppvObject)
591 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
594 * Perform a sanity check on the parameters.
596 if ( (this==0) || (ppvObject==0) )
597 return E_INVALIDARG;
600 * Initialize the return parameter.
602 *ppvObject = 0;
605 * Compare the riid with the interface IDs implemented by this object.
607 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
609 *ppvObject = iface;
611 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0)
613 *ppvObject = (IOleObject*)&(this->lpvtbl1);
615 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
617 *ppvObject = (IDataObject*)&(this->lpvtbl3);
619 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0)
621 *ppvObject = (IRunnableObject*)&(this->lpvtbl4);
623 else
626 * Blind aggregate the data cache to "inherit" it's interfaces.
628 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK)
629 return S_OK;
633 * Check that we obtained an interface.
635 if ((*ppvObject)==0)
637 WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid));
638 return E_NOINTERFACE;
642 * Query Interface always increases the reference count by one when it is
643 * successful.
645 IUnknown_AddRef((IUnknown*)*ppvObject);
647 return S_OK;
650 /************************************************************************
651 * DefaultHandler_NDIUnknown_AddRef (IUnknown)
653 * See Windows documentation for more details on IUnknown methods.
655 * This version of QueryInterface will not delegate it's implementation
656 * to the outer unknown.
658 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
659 IUnknown* iface)
661 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
663 this->ref++;
665 return this->ref;
668 /************************************************************************
669 * DefaultHandler_NDIUnknown_Release (IUnknown)
671 * See Windows documentation for more details on IUnknown methods.
673 * This version of QueryInterface will not delegate it's implementation
674 * to the outer unknown.
676 static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
677 IUnknown* iface)
679 _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface);
682 * Decrease the reference count on this object.
684 this->ref--;
687 * If the reference count goes down to 0, perform suicide.
689 if (this->ref==0)
691 DefaultHandler_Destroy(this);
693 return 0;
696 return this->ref;
699 /*********************************************************
700 * Methods implementation for the IOleObject part of
701 * the DefaultHandler class.
704 /************************************************************************
705 * DefaultHandler_QueryInterface (IUnknown)
707 * See Windows documentation for more details on IUnknown methods.
709 static HRESULT WINAPI DefaultHandler_QueryInterface(
710 IOleObject* iface,
711 REFIID riid,
712 void** ppvObject)
714 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
716 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
719 /************************************************************************
720 * DefaultHandler_AddRef (IUnknown)
722 * See Windows documentation for more details on IUnknown methods.
724 static ULONG WINAPI DefaultHandler_AddRef(
725 IOleObject* iface)
727 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
729 return IUnknown_AddRef(this->outerUnknown);
732 /************************************************************************
733 * DefaultHandler_Release (IUnknown)
735 * See Windows documentation for more details on IUnknown methods.
737 static ULONG WINAPI DefaultHandler_Release(
738 IOleObject* iface)
740 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
742 return IUnknown_Release(this->outerUnknown);
745 /************************************************************************
746 * DefaultHandler_SetClientSite (IOleObject)
748 * The default handler's implementation of this method only keeps the
749 * client site pointer for future reference.
751 * See Windows documentation for more details on IOleObject methods.
753 static HRESULT WINAPI DefaultHandler_SetClientSite(
754 IOleObject* iface,
755 IOleClientSite* pClientSite)
757 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
759 TRACE("(%p, %p)\n", iface, pClientSite);
762 * Make sure we release the previous client site if there
763 * was one.
765 if (this->clientSite!=NULL)
767 IOleClientSite_Release(this->clientSite);
770 this->clientSite = pClientSite;
772 if (this->clientSite!=NULL)
774 IOleClientSite_AddRef(this->clientSite);
777 return S_OK;
780 /************************************************************************
781 * DefaultHandler_GetClientSite (IOleObject)
783 * The default handler's implementation of this method returns the
784 * last pointer set in IOleObject_SetClientSite.
786 * See Windows documentation for more details on IOleObject methods.
788 static HRESULT WINAPI DefaultHandler_GetClientSite(
789 IOleObject* iface,
790 IOleClientSite** ppClientSite)
792 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
795 * Sanity check.
797 if (ppClientSite == NULL)
798 return E_POINTER;
800 *ppClientSite = this->clientSite;
802 if (this->clientSite != NULL)
804 IOleClientSite_AddRef(this->clientSite);
807 return S_OK;
810 /************************************************************************
811 * DefaultHandler_SetHostNames (IOleObject)
813 * The default handler's implementation of this method just stores
814 * the strings and returns S_OK.
816 * See Windows documentation for more details on IOleObject methods.
818 static HRESULT WINAPI DefaultHandler_SetHostNames(
819 IOleObject* iface,
820 LPCOLESTR szContainerApp,
821 LPCOLESTR szContainerObj)
823 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
825 TRACE("(%p, %s, %s)\n",
826 iface,
827 debugstr_w(szContainerApp),
828 debugstr_w(szContainerObj));
831 * Be sure to cleanup before re-assinging the strings.
833 if (this->containerApp!=NULL)
835 HeapFree( GetProcessHeap(), 0, this->containerApp );
836 this->containerApp = NULL;
839 if (this->containerObj!=NULL)
841 HeapFree( GetProcessHeap(), 0, this->containerObj );
842 this->containerObj = NULL;
846 * Copy the string supplied.
848 if (szContainerApp != NULL)
850 if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
851 (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
852 strcpyW( this->containerApp, szContainerApp );
855 if (szContainerObj != NULL)
857 if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
858 (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
859 strcpyW( this->containerObj, szContainerObj );
861 return S_OK;
864 /************************************************************************
865 * DefaultHandler_Close (IOleObject)
867 * The default handler's implementation of this method is meaningless
868 * without a running server so it does nothing.
870 * See Windows documentation for more details on IOleObject methods.
872 static HRESULT WINAPI DefaultHandler_Close(
873 IOleObject* iface,
874 DWORD dwSaveOption)
876 TRACE("()\n");
877 return S_OK;
880 /************************************************************************
881 * DefaultHandler_SetMoniker (IOleObject)
883 * The default handler's implementation of this method does nothing.
885 * See Windows documentation for more details on IOleObject methods.
887 static HRESULT WINAPI DefaultHandler_SetMoniker(
888 IOleObject* iface,
889 DWORD dwWhichMoniker,
890 IMoniker* pmk)
892 TRACE("(%p, %ld, %p)\n",
893 iface,
894 dwWhichMoniker,
895 pmk);
897 return S_OK;
900 /************************************************************************
901 * DefaultHandler_GetMoniker (IOleObject)
903 * Delegate this request to the client site if we have one.
905 * See Windows documentation for more details on IOleObject methods.
907 static HRESULT WINAPI DefaultHandler_GetMoniker(
908 IOleObject* iface,
909 DWORD dwAssign,
910 DWORD dwWhichMoniker,
911 IMoniker** ppmk)
913 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
915 TRACE("(%p, %ld, %ld, %p)\n",
916 iface, dwAssign, dwWhichMoniker, ppmk);
918 if (this->clientSite)
920 return IOleClientSite_GetMoniker(this->clientSite,
921 dwAssign,
922 dwWhichMoniker,
923 ppmk);
927 return E_UNSPEC;
930 /************************************************************************
931 * DefaultHandler_InitFromData (IOleObject)
933 * This method is meaningless if the server is not running
935 * See Windows documentation for more details on IOleObject methods.
937 static HRESULT WINAPI DefaultHandler_InitFromData(
938 IOleObject* iface,
939 IDataObject* pDataObject,
940 BOOL fCreation,
941 DWORD dwReserved)
943 TRACE("(%p, %p, %d, %ld)\n",
944 iface, pDataObject, fCreation, dwReserved);
946 return OLE_E_NOTRUNNING;
949 /************************************************************************
950 * DefaultHandler_GetClipboardData (IOleObject)
952 * This method is meaningless if the server is not running
954 * See Windows documentation for more details on IOleObject methods.
956 static HRESULT WINAPI DefaultHandler_GetClipboardData(
957 IOleObject* iface,
958 DWORD dwReserved,
959 IDataObject** ppDataObject)
961 TRACE("(%p, %ld, %p)\n",
962 iface, dwReserved, ppDataObject);
964 return OLE_E_NOTRUNNING;
967 static HRESULT WINAPI DefaultHandler_DoVerb(
968 IOleObject* iface,
969 LONG iVerb,
970 struct tagMSG* lpmsg,
971 IOleClientSite* pActiveSite,
972 LONG lindex,
973 HWND hwndParent,
974 LPCRECT lprcPosRect)
976 FIXME(": Stub\n");
977 return E_NOTIMPL;
980 /************************************************************************
981 * DefaultHandler_EnumVerbs (IOleObject)
983 * The default handler implementation of this method simply delegates
984 * to OleRegEnumVerbs
986 * See Windows documentation for more details on IOleObject methods.
988 static HRESULT WINAPI DefaultHandler_EnumVerbs(
989 IOleObject* iface,
990 IEnumOLEVERB** ppEnumOleVerb)
992 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
994 TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
996 return OleRegEnumVerbs(&this->clsid, ppEnumOleVerb);
999 static HRESULT WINAPI DefaultHandler_Update(
1000 IOleObject* iface)
1002 FIXME(": Stub\n");
1003 return E_NOTIMPL;
1006 /************************************************************************
1007 * DefaultHandler_IsUpToDate (IOleObject)
1009 * This method is meaningless if the server is not running
1011 * See Windows documentation for more details on IOleObject methods.
1013 static HRESULT WINAPI DefaultHandler_IsUpToDate(
1014 IOleObject* iface)
1016 TRACE("(%p)\n", iface);
1018 return OLE_E_NOTRUNNING;
1021 /************************************************************************
1022 * DefaultHandler_GetUserClassID (IOleObject)
1024 * TODO: Map to a new class ID if emulation is active.
1026 * See Windows documentation for more details on IOleObject methods.
1028 static HRESULT WINAPI DefaultHandler_GetUserClassID(
1029 IOleObject* iface,
1030 CLSID* pClsid)
1032 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1034 TRACE("(%p, %p)\n", iface, pClsid);
1037 * Sanity check.
1039 if (pClsid==NULL)
1040 return E_POINTER;
1042 memcpy(pClsid, &this->clsid, sizeof(CLSID));
1044 return S_OK;
1047 /************************************************************************
1048 * DefaultHandler_GetUserType (IOleObject)
1050 * The default handler implementation of this method simply delegates
1051 * to OleRegGetUserType
1053 * See Windows documentation for more details on IOleObject methods.
1055 static HRESULT WINAPI DefaultHandler_GetUserType(
1056 IOleObject* iface,
1057 DWORD dwFormOfType,
1058 LPOLESTR* pszUserType)
1060 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1062 TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
1064 return OleRegGetUserType(&this->clsid, dwFormOfType, pszUserType);
1067 /************************************************************************
1068 * DefaultHandler_SetExtent (IOleObject)
1070 * This method is meaningless if the server is not running
1072 * See Windows documentation for more details on IOleObject methods.
1074 static HRESULT WINAPI DefaultHandler_SetExtent(
1075 IOleObject* iface,
1076 DWORD dwDrawAspect,
1077 SIZEL* psizel)
1079 TRACE("(%p, %lx, (%ld x %ld))\n", iface,
1080 dwDrawAspect, psizel->cx, psizel->cy);
1081 return OLE_E_NOTRUNNING;
1084 /************************************************************************
1085 * DefaultHandler_GetExtent (IOleObject)
1087 * The default handler's implementation of this method returns uses
1088 * the cache to locate the aspect and extract the extent from it.
1090 * See Windows documentation for more details on IOleObject methods.
1092 static HRESULT WINAPI DefaultHandler_GetExtent(
1093 IOleObject* iface,
1094 DWORD dwDrawAspect,
1095 SIZEL* psizel)
1097 DVTARGETDEVICE* targetDevice;
1098 IViewObject2* cacheView = NULL;
1099 HRESULT hres;
1101 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1103 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
1105 hres = IUnknown_QueryInterface(this->dataCache, &IID_IViewObject2, (void**)&cacheView);
1107 if (FAILED(hres))
1108 return E_UNEXPECTED;
1111 * Prepare the call to the cache's GetExtent method.
1113 * Here we would build a valid DVTARGETDEVICE structure
1114 * but, since we are calling into the data cache, we
1115 * know it's implementation and we'll skip this
1116 * extra work until later.
1118 targetDevice = NULL;
1120 hres = IViewObject2_GetExtent(cacheView,
1121 dwDrawAspect,
1123 targetDevice,
1124 psizel);
1127 * Cleanup
1129 IViewObject2_Release(cacheView);
1131 return hres;
1134 /************************************************************************
1135 * DefaultHandler_Advise (IOleObject)
1137 * The default handler's implementation of this method simply
1138 * delegates to the OleAdviseHolder.
1140 * See Windows documentation for more details on IOleObject methods.
1142 static HRESULT WINAPI DefaultHandler_Advise(
1143 IOleObject* iface,
1144 IAdviseSink* pAdvSink,
1145 DWORD* pdwConnection)
1147 HRESULT hres = S_OK;
1148 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1150 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
1153 * Make sure we have an advise holder before we start.
1155 if (this->oleAdviseHolder==NULL)
1157 hres = CreateOleAdviseHolder(&this->oleAdviseHolder);
1160 if (SUCCEEDED(hres))
1162 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder,
1163 pAdvSink,
1164 pdwConnection);
1167 return hres;
1170 /************************************************************************
1171 * DefaultHandler_Unadvise (IOleObject)
1173 * The default handler's implementation of this method simply
1174 * delegates to the OleAdviseHolder.
1176 * See Windows documentation for more details on IOleObject methods.
1178 static HRESULT WINAPI DefaultHandler_Unadvise(
1179 IOleObject* iface,
1180 DWORD dwConnection)
1182 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1184 TRACE("(%p, %ld)\n", iface, dwConnection);
1187 * If we don't have an advise holder yet, it means we don't have
1188 * a connection.
1190 if (this->oleAdviseHolder==NULL)
1191 return OLE_E_NOCONNECTION;
1193 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder,
1194 dwConnection);
1197 /************************************************************************
1198 * DefaultHandler_EnumAdvise (IOleObject)
1200 * The default handler's implementation of this method simply
1201 * delegates to the OleAdviseHolder.
1203 * See Windows documentation for more details on IOleObject methods.
1205 static HRESULT WINAPI DefaultHandler_EnumAdvise(
1206 IOleObject* iface,
1207 IEnumSTATDATA** ppenumAdvise)
1209 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1211 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1214 * Sanity check
1216 if (ppenumAdvise==NULL)
1217 return E_POINTER;
1220 * Initialize the out parameter.
1222 *ppenumAdvise = NULL;
1224 if (this->oleAdviseHolder==NULL)
1225 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder,
1226 ppenumAdvise);
1228 return S_OK;
1231 /************************************************************************
1232 * DefaultHandler_GetMiscStatus (IOleObject)
1234 * The default handler's implementation of this method simply delegates
1235 * to OleRegGetMiscStatus.
1237 * See Windows documentation for more details on IOleObject methods.
1239 static HRESULT WINAPI DefaultHandler_GetMiscStatus(
1240 IOleObject* iface,
1241 DWORD dwAspect,
1242 DWORD* pdwStatus)
1244 HRESULT hres;
1245 _ICOM_THIS_From_IOleObject(DefaultHandler, iface);
1247 TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
1249 hres = OleRegGetMiscStatus(&(this->clsid), dwAspect, pdwStatus);
1251 if (FAILED(hres))
1252 *pdwStatus = 0;
1254 return S_OK;
1257 /************************************************************************
1258 * DefaultHandler_SetExtent (IOleObject)
1260 * This method is meaningless if the server is not running
1262 * See Windows documentation for more details on IOleObject methods.
1264 static HRESULT WINAPI DefaultHandler_SetColorScheme(
1265 IOleObject* iface,
1266 struct tagLOGPALETTE* pLogpal)
1268 TRACE("(%p, %p))\n", iface, pLogpal);
1269 return OLE_E_NOTRUNNING;
1272 /*********************************************************
1273 * Methods implementation for the IDataObject part of
1274 * the DefaultHandler class.
1277 /************************************************************************
1278 * DefaultHandler_IDataObject_QueryInterface (IUnknown)
1280 * See Windows documentation for more details on IUnknown methods.
1282 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface(
1283 IDataObject* iface,
1284 REFIID riid,
1285 void** ppvObject)
1287 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1289 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1292 /************************************************************************
1293 * DefaultHandler_IDataObject_AddRef (IUnknown)
1295 * See Windows documentation for more details on IUnknown methods.
1297 static ULONG WINAPI DefaultHandler_IDataObject_AddRef(
1298 IDataObject* iface)
1300 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1302 return IUnknown_AddRef(this->outerUnknown);
1305 /************************************************************************
1306 * DefaultHandler_IDataObject_Release (IUnknown)
1308 * See Windows documentation for more details on IUnknown methods.
1310 static ULONG WINAPI DefaultHandler_IDataObject_Release(
1311 IDataObject* iface)
1313 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1315 return IUnknown_Release(this->outerUnknown);
1318 /************************************************************************
1319 * DefaultHandler_GetData
1321 * Get Data from a source dataobject using format pformatetcIn->cfFormat
1322 * See Windows documentation for more details on GetData.
1323 * Default handler's implementation of this method delegates to the cache.
1325 static HRESULT WINAPI DefaultHandler_GetData(
1326 IDataObject* iface,
1327 LPFORMATETC pformatetcIn,
1328 STGMEDIUM* pmedium)
1330 IDataObject* cacheDataObject = NULL;
1331 HRESULT hres;
1333 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1335 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium);
1337 hres = IUnknown_QueryInterface(this->dataCache,
1338 &IID_IDataObject,
1339 (void**)&cacheDataObject);
1341 if (FAILED(hres))
1342 return E_UNEXPECTED;
1344 hres = IDataObject_GetData(cacheDataObject,
1345 pformatetcIn,
1346 pmedium);
1348 IDataObject_Release(cacheDataObject);
1350 return hres;
1353 static HRESULT WINAPI DefaultHandler_GetDataHere(
1354 IDataObject* iface,
1355 LPFORMATETC pformatetc,
1356 STGMEDIUM* pmedium)
1358 FIXME(": Stub\n");
1359 return E_NOTIMPL;
1362 /************************************************************************
1363 * DefaultHandler_QueryGetData (IDataObject)
1365 * The default handler's implementation of this method delegates to
1366 * the cache.
1368 * See Windows documentation for more details on IDataObject methods.
1370 static HRESULT WINAPI DefaultHandler_QueryGetData(
1371 IDataObject* iface,
1372 LPFORMATETC pformatetc)
1374 IDataObject* cacheDataObject = NULL;
1375 HRESULT hres;
1377 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1379 TRACE("(%p, %p)\n", iface, pformatetc);
1381 hres = IUnknown_QueryInterface(this->dataCache,
1382 &IID_IDataObject,
1383 (void**)&cacheDataObject);
1385 if (FAILED(hres))
1386 return E_UNEXPECTED;
1388 hres = IDataObject_QueryGetData(cacheDataObject,
1389 pformatetc);
1391 IDataObject_Release(cacheDataObject);
1393 return hres;
1396 /************************************************************************
1397 * DefaultHandler_GetCanonicalFormatEtc (IDataObject)
1399 * This method is meaningless if the server is not running
1401 * See Windows documentation for more details on IDataObject methods.
1403 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
1404 IDataObject* iface,
1405 LPFORMATETC pformatectIn,
1406 LPFORMATETC pformatetcOut)
1408 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut);
1410 return OLE_E_NOTRUNNING;
1413 /************************************************************************
1414 * DefaultHandler_SetData (IDataObject)
1416 * The default handler's implementation of this method delegates to
1417 * the cache.
1419 * See Windows documentation for more details on IDataObject methods.
1421 static HRESULT WINAPI DefaultHandler_SetData(
1422 IDataObject* iface,
1423 LPFORMATETC pformatetc,
1424 STGMEDIUM* pmedium,
1425 BOOL fRelease)
1427 IDataObject* cacheDataObject = NULL;
1428 HRESULT hres;
1430 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1432 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease);
1434 hres = IUnknown_QueryInterface(this->dataCache,
1435 &IID_IDataObject,
1436 (void**)&cacheDataObject);
1438 if (FAILED(hres))
1439 return E_UNEXPECTED;
1441 hres = IDataObject_SetData(cacheDataObject,
1442 pformatetc,
1443 pmedium,
1444 fRelease);
1446 IDataObject_Release(cacheDataObject);
1448 return hres;
1451 /************************************************************************
1452 * DefaultHandler_EnumFormatEtc (IDataObject)
1454 * The default handler's implementation of this method simply delegates
1455 * to OleRegEnumFormatEtc.
1457 * See Windows documentation for more details on IDataObject methods.
1459 static HRESULT WINAPI DefaultHandler_EnumFormatEtc(
1460 IDataObject* iface,
1461 DWORD dwDirection,
1462 IEnumFORMATETC** ppenumFormatEtc)
1464 HRESULT hres;
1465 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1467 TRACE("(%p, %lx, %p)\n", iface, dwDirection, ppenumFormatEtc);
1469 hres = OleRegEnumFormatEtc(&(this->clsid), dwDirection, ppenumFormatEtc);
1471 return hres;
1474 /************************************************************************
1475 * DefaultHandler_DAdvise (IDataObject)
1477 * The default handler's implementation of this method simply
1478 * delegates to the DataAdviseHolder.
1480 * See Windows documentation for more details on IDataObject methods.
1482 static HRESULT WINAPI DefaultHandler_DAdvise(
1483 IDataObject* iface,
1484 FORMATETC* pformatetc,
1485 DWORD advf,
1486 IAdviseSink* pAdvSink,
1487 DWORD* pdwConnection)
1489 HRESULT hres = S_OK;
1490 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1492 TRACE("(%p, %p, %ld, %p, %p)\n",
1493 iface, pformatetc, advf, pAdvSink, pdwConnection);
1496 * Make sure we have a data advise holder before we start.
1498 if (this->dataAdviseHolder==NULL)
1500 hres = CreateDataAdviseHolder(&this->dataAdviseHolder);
1503 if (SUCCEEDED(hres))
1505 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder,
1506 iface,
1507 pformatetc,
1508 advf,
1509 pAdvSink,
1510 pdwConnection);
1513 return hres;
1516 /************************************************************************
1517 * DefaultHandler_DUnadvise (IDataObject)
1519 * The default handler's implementation of this method simply
1520 * delegates to the DataAdviseHolder.
1522 * See Windows documentation for more details on IDataObject methods.
1524 static HRESULT WINAPI DefaultHandler_DUnadvise(
1525 IDataObject* iface,
1526 DWORD dwConnection)
1528 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1530 TRACE("(%p, %ld)\n", iface, dwConnection);
1533 * If we don't have a data advise holder yet, it means that
1534 * we don't have any connections..
1536 if (this->dataAdviseHolder==NULL)
1538 return OLE_E_NOCONNECTION;
1541 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder,
1542 dwConnection);
1545 /************************************************************************
1546 * DefaultHandler_EnumDAdvise (IDataObject)
1548 * The default handler's implementation of this method simply
1549 * delegates to the DataAdviseHolder.
1551 * See Windows documentation for more details on IDataObject methods.
1553 static HRESULT WINAPI DefaultHandler_EnumDAdvise(
1554 IDataObject* iface,
1555 IEnumSTATDATA** ppenumAdvise)
1557 _ICOM_THIS_From_IDataObject(DefaultHandler, iface);
1559 TRACE("(%p, %p)\n", iface, ppenumAdvise);
1562 * Sanity check
1564 if (ppenumAdvise == NULL)
1565 return E_POINTER;
1568 * Initialize the out parameter.
1570 *ppenumAdvise = NULL;
1573 * If we have a data advise holder object, delegate.
1575 if (this->dataAdviseHolder!=NULL)
1577 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder,
1578 ppenumAdvise);
1581 return S_OK;
1584 /*********************************************************
1585 * Methods implementation for the IRunnableObject part
1586 * of the DefaultHandler class.
1589 /************************************************************************
1590 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1592 * See Windows documentation for more details on IUnknown methods.
1594 static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface(
1595 IRunnableObject* iface,
1596 REFIID riid,
1597 void** ppvObject)
1599 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1601 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject);
1604 /************************************************************************
1605 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1607 * See Windows documentation for more details on IUnknown methods.
1609 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef(
1610 IRunnableObject* iface)
1612 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1614 return IUnknown_AddRef(this->outerUnknown);
1617 /************************************************************************
1618 * DefaultHandler_IRunnableObject_QueryInterface (IUnknown)
1620 * See Windows documentation for more details on IUnknown methods.
1622 static ULONG WINAPI DefaultHandler_IRunnableObject_Release(
1623 IRunnableObject* iface)
1625 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface);
1627 return IUnknown_Release(this->outerUnknown);
1630 /************************************************************************
1631 * DefaultHandler_GetRunningClass (IRunnableObject)
1633 * According to Brockscmidt, Chapter 19, the default handler's
1634 * implementation of IRunnableobject does nothing until the object
1635 * is actually running.
1637 * See Windows documentation for more details on IRunnableObject methods.
1639 static HRESULT WINAPI DefaultHandler_GetRunningClass(
1640 IRunnableObject* iface,
1641 LPCLSID lpClsid)
1643 TRACE("()\n");
1644 return S_OK;
1647 static HRESULT WINAPI DefaultHandler_Run(
1648 IRunnableObject* iface,
1649 IBindCtx* pbc)
1651 FIXME(": Stub\n");
1652 return E_NOTIMPL;
1655 /************************************************************************
1656 * DefaultHandler_IsRunning (IRunnableObject)
1658 * According to Brockscmidt, Chapter 19, the default handler's
1659 * implementation of IRunnableobject does nothing until the object
1660 * is actually running.
1662 * See Windows documentation for more details on IRunnableObject methods.
1664 static BOOL WINAPI DefaultHandler_IsRunning(
1665 IRunnableObject* iface)
1667 TRACE("()\n");
1668 return S_FALSE;
1671 /************************************************************************
1672 * DefaultHandler_LockRunning (IRunnableObject)
1674 * According to Brockscmidt, Chapter 19, the default handler's
1675 * implementation of IRunnableobject does nothing until the object
1676 * is actually running.
1678 * See Windows documentation for more details on IRunnableObject methods.
1680 static HRESULT WINAPI DefaultHandler_LockRunning(
1681 IRunnableObject* iface,
1682 BOOL fLock,
1683 BOOL fLastUnlockCloses)
1685 TRACE("()\n");
1686 return S_OK;
1689 /************************************************************************
1690 * DefaultHandler_SetContainedObject (IRunnableObject)
1692 * According to Brockscmidt, Chapter 19, the default handler's
1693 * implementation of IRunnableobject does nothing until the object
1694 * is actually running.
1696 * See Windows documentation for more details on IRunnableObject methods.
1698 static HRESULT WINAPI DefaultHandler_SetContainedObject(
1699 IRunnableObject* iface,
1700 BOOL fContained)
1702 TRACE("()\n");
1703 return S_OK;