Changeset 6648 for trunk/src/ole32/defaulthandler.c
- Timestamp:
- Sep 5, 2001, 3:19:02 PM (24 years ago)
- File:
-
- 1 edited
-
trunk/src/ole32/defaulthandler.c (modified) (92 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/defaulthandler.c
r5602 r6648 1 /* $Id: defaulthandler.c,v 1.2 2001-09-05 13:17:08 bird Exp $ */ 1 2 /* 2 * OLE 2 default object handler3 * OLE 2 default object handler 3 4 * 4 5 * Copyright 1999 Francis Beaudet … … 25 26 * done in this area. 26 27 * 27 * - Some functions still return E_NOTIMPL they have to be 28 * - Some functions still return E_NOTIMPL they have to be 28 29 * implemented. Most of those are related to the running of the 29 30 * actual server. … … 53 54 * List all interface VTables here 54 55 */ 55 ICOM_VTABLE(IOleObject)* lpvtbl1; 56 ICOM_VTABLE(IOleObject)* lpvtbl1; 56 57 ICOM_VTABLE(IUnknown)* lpvtbl2; 57 58 ICOM_VTABLE(IDataObject)* lpvtbl3; … … 90 91 91 92 /* 92 * The IDataAdviseHolder maintains the data 93 * The IDataAdviseHolder maintains the data 93 94 * connections on behalf of the default handler. 94 95 */ … … 98 99 * Name of the container and object contained 99 100 */ 100 LPWSTR containerApp; 101 LPWSTR containerApp; 101 102 LPWSTR containerObj; 102 103 … … 106 107 107 108 /* 108 * Here, I define utility macros to help with the casting of the 109 * Here, I define utility macros to help with the casting of the 109 110 * "this" parameter. 110 111 * There is a version to accomodate all of the VTables implemented … … 112 113 */ 113 114 #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name; 114 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); 115 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); 116 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); 115 #define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); 116 #define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); 117 #define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); 117 118 118 119 /* … … 120 121 */ 121 122 static DefaultHandler* DefaultHandler_Construct(REFCLSID clsid, 122 LPUNKNOWN pUnkOuter);123 LPUNKNOWN pUnkOuter); 123 124 static void DefaultHandler_Destroy(DefaultHandler* ptrToDestroy); 124 125 … … 131 132 REFIID riid, 132 133 void** ppvObject); 133 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( 134 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( 134 135 IUnknown* iface); 135 static ULONG WINAPI DefaultHandler_NDIUnknown_Release( 136 static ULONG WINAPI DefaultHandler_NDIUnknown_Release( 136 137 IUnknown* iface); 137 138 … … 144 145 REFIID riid, 145 146 void** ppvObject); 146 static ULONG WINAPI DefaultHandler_AddRef( 147 static ULONG WINAPI DefaultHandler_AddRef( 147 148 IOleObject* iface); 148 static ULONG WINAPI DefaultHandler_Release( 149 static ULONG WINAPI DefaultHandler_Release( 149 150 IOleObject* iface); 150 151 static HRESULT WINAPI DefaultHandler_SetClientSite( 151 IOleObject* iface,152 IOleClientSite* pClientSite);152 IOleObject* iface, 153 IOleClientSite* pClientSite); 153 154 static HRESULT WINAPI DefaultHandler_GetClientSite( 154 IOleObject* iface,155 IOleClientSite** ppClientSite);155 IOleObject* iface, 156 IOleClientSite** ppClientSite); 156 157 static HRESULT WINAPI DefaultHandler_SetHostNames( 157 IOleObject* iface,158 LPCOLESTR szContainerApp, 159 LPCOLESTR szContainerObj);158 IOleObject* iface, 159 LPCOLESTR szContainerApp, 160 LPCOLESTR szContainerObj); 160 161 static HRESULT WINAPI DefaultHandler_Close( 161 IOleObject* iface, 162 DWORD dwSaveOption);162 IOleObject* iface, 163 DWORD dwSaveOption); 163 164 static HRESULT WINAPI DefaultHandler_SetMoniker( 164 IOleObject* iface, 165 DWORD dwWhichMoniker,166 IMoniker* pmk);165 IOleObject* iface, 166 DWORD dwWhichMoniker, 167 IMoniker* pmk); 167 168 static HRESULT WINAPI DefaultHandler_GetMoniker( 168 IOleObject* iface,169 DWORD dwAssign,170 DWORD dwWhichMoniker,171 IMoniker** ppmk);169 IOleObject* iface, 170 DWORD dwAssign, 171 DWORD dwWhichMoniker, 172 IMoniker** ppmk); 172 173 static HRESULT WINAPI DefaultHandler_InitFromData( 173 IOleObject* iface, 174 IDataObject* pDataObject, 175 BOOL fCreation,176 DWORD dwReserved);174 IOleObject* iface, 175 IDataObject* pDataObject, 176 BOOL fCreation, 177 DWORD dwReserved); 177 178 static HRESULT WINAPI DefaultHandler_GetClipboardData( 178 IOleObject* iface, 179 DWORD dwReserved, 180 IDataObject** ppDataObject);179 IOleObject* iface, 180 DWORD dwReserved, 181 IDataObject** ppDataObject); 181 182 static HRESULT WINAPI DefaultHandler_DoVerb( 182 IOleObject* iface, 183 LONG iVerb, 183 IOleObject* iface, 184 LONG iVerb, 184 185 #ifdef __WIN32OS2__ 185 LPMSG lpmsg, 186 LPMSG lpmsg, 186 187 #else 187 struct tagMSG* lpmsg, 188 struct tagMSG* lpmsg, 188 189 #endif 189 IOleClientSite* pActiveSite, 190 LONG lindex, 191 HWND hwndParent, 192 LPCRECT lprcPosRect);190 IOleClientSite* pActiveSite, 191 LONG lindex, 192 HWND hwndParent, 193 LPCRECT lprcPosRect); 193 194 static HRESULT WINAPI DefaultHandler_EnumVerbs( 194 IOleObject* iface, 195 IEnumOLEVERB** ppEnumOleVerb);195 IOleObject* iface, 196 IEnumOLEVERB** ppEnumOleVerb); 196 197 static HRESULT WINAPI DefaultHandler_Update( 197 IOleObject* iface);198 IOleObject* iface); 198 199 static HRESULT WINAPI DefaultHandler_IsUpToDate( 199 IOleObject* iface);200 IOleObject* iface); 200 201 static HRESULT WINAPI DefaultHandler_GetUserClassID( 201 IOleObject* iface, 202 CLSID* pClsid);202 IOleObject* iface, 203 CLSID* pClsid); 203 204 static HRESULT WINAPI DefaultHandler_GetUserType( 204 IOleObject* iface, 205 DWORD dwFormOfType, 206 LPOLESTR* pszUserType);205 IOleObject* iface, 206 DWORD dwFormOfType, 207 LPOLESTR* pszUserType); 207 208 static HRESULT WINAPI DefaultHandler_SetExtent( 208 IOleObject* iface, 209 DWORD dwDrawAspect, 210 SIZEL* psizel);209 IOleObject* iface, 210 DWORD dwDrawAspect, 211 SIZEL* psizel); 211 212 static HRESULT WINAPI DefaultHandler_GetExtent( 212 IOleObject* iface, 213 DWORD dwDrawAspect, 214 SIZEL* psizel);213 IOleObject* iface, 214 DWORD dwDrawAspect, 215 SIZEL* psizel); 215 216 static HRESULT WINAPI DefaultHandler_Advise( 216 IOleObject* iface, 217 IAdviseSink* pAdvSink, 218 DWORD* pdwConnection);217 IOleObject* iface, 218 IAdviseSink* pAdvSink, 219 DWORD* pdwConnection); 219 220 static HRESULT WINAPI DefaultHandler_Unadvise( 220 IOleObject* iface, 221 DWORD dwConnection);221 IOleObject* iface, 222 DWORD dwConnection); 222 223 static HRESULT WINAPI DefaultHandler_EnumAdvise( 223 IOleObject* iface, 224 IEnumSTATDATA** ppenumAdvise);224 IOleObject* iface, 225 IEnumSTATDATA** ppenumAdvise); 225 226 static HRESULT WINAPI DefaultHandler_GetMiscStatus( 226 IOleObject* iface, 227 DWORD dwAspect, 228 DWORD* pdwStatus);227 IOleObject* iface, 228 DWORD dwAspect, 229 DWORD* pdwStatus); 229 230 static HRESULT WINAPI DefaultHandler_SetColorScheme( 230 IOleObject* iface,231 struct tagLOGPALETTE* pLogpal);231 IOleObject* iface, 232 struct tagLOGPALETTE* pLogpal); 232 233 233 234 /* … … 239 240 REFIID riid, 240 241 void** ppvObject); 241 static ULONG WINAPI DefaultHandler_IDataObject_AddRef( 242 static ULONG WINAPI DefaultHandler_IDataObject_AddRef( 242 243 IDataObject* iface); 243 static ULONG WINAPI DefaultHandler_IDataObject_Release( 244 static ULONG WINAPI DefaultHandler_IDataObject_Release( 244 245 IDataObject* iface); 245 246 static HRESULT WINAPI DefaultHandler_GetData( 246 IDataObject* iface,247 LPFORMATETC pformatetcIn, 248 STGMEDIUM* pmedium);247 IDataObject* iface, 248 LPFORMATETC pformatetcIn, 249 STGMEDIUM* pmedium); 249 250 static HRESULT WINAPI DefaultHandler_GetDataHere( 250 IDataObject* iface, 251 LPFORMATETC pformatetc,252 STGMEDIUM* pmedium);251 IDataObject* iface, 252 LPFORMATETC pformatetc, 253 STGMEDIUM* pmedium); 253 254 static HRESULT WINAPI DefaultHandler_QueryGetData( 254 IDataObject* iface,255 LPFORMATETC pformatetc);255 IDataObject* iface, 256 LPFORMATETC pformatetc); 256 257 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( 257 IDataObject* iface, 258 LPFORMATETC pformatectIn, 259 LPFORMATETC pformatetcOut);258 IDataObject* iface, 259 LPFORMATETC pformatectIn, 260 LPFORMATETC pformatetcOut); 260 261 static HRESULT WINAPI DefaultHandler_SetData( 261 IDataObject* iface,262 LPFORMATETC pformatetc, 263 STGMEDIUM* pmedium, 264 BOOL fRelease);262 IDataObject* iface, 263 LPFORMATETC pformatetc, 264 STGMEDIUM* pmedium, 265 BOOL fRelease); 265 266 static HRESULT WINAPI DefaultHandler_EnumFormatEtc( 266 IDataObject* iface, 267 DWORD dwDirection,268 IEnumFORMATETC** ppenumFormatEtc);267 IDataObject* iface, 268 DWORD dwDirection, 269 IEnumFORMATETC** ppenumFormatEtc); 269 270 static HRESULT WINAPI DefaultHandler_DAdvise( 270 IDataObject* iface, 271 FORMATETC* pformatetc, 272 DWORD advf, 273 IAdviseSink* pAdvSink, 274 DWORD* pdwConnection);271 IDataObject* iface, 272 FORMATETC* pformatetc, 273 DWORD advf, 274 IAdviseSink* pAdvSink, 275 DWORD* pdwConnection); 275 276 static HRESULT WINAPI DefaultHandler_DUnadvise( 276 IDataObject* iface,277 DWORD dwConnection);277 IDataObject* iface, 278 DWORD dwConnection); 278 279 static HRESULT WINAPI DefaultHandler_EnumDAdvise( 279 IDataObject* iface,280 IEnumSTATDATA** ppenumAdvise);280 IDataObject* iface, 281 IEnumSTATDATA** ppenumAdvise); 281 282 282 283 /* … … 288 289 REFIID riid, 289 290 void** ppvObject); 290 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( 291 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( 291 292 IRunnableObject* iface); 292 static ULONG WINAPI DefaultHandler_IRunnableObject_Release( 293 static ULONG WINAPI DefaultHandler_IRunnableObject_Release( 293 294 IRunnableObject* iface); 294 static HRESULT WINAPI DefaultHandler_GetRunningClass( 295 IRunnableObject* iface, 296 LPCLSID lpClsid); 297 static HRESULT WINAPI DefaultHandler_Run( 295 static HRESULT WINAPI DefaultHandler_GetRunningClass( 298 296 IRunnableObject* iface, 299 IBindCtx* pbc); 300 static BOOL WINAPI DefaultHandler_IsRunning( 297 LPCLSID lpClsid); 298 static HRESULT WINAPI DefaultHandler_Run( 299 IRunnableObject* iface, 300 IBindCtx* pbc); 301 static BOOL WINAPI DefaultHandler_IsRunning( 301 302 IRunnableObject* iface); 302 static HRESULT WINAPI DefaultHandler_LockRunning( 303 IRunnableObject* iface, 304 BOOL fLock, 305 BOOL fLastUnlockCloses);306 static HRESULT WINAPI DefaultHandler_SetContainedObject( 307 IRunnableObject* iface, 308 BOOL fContained);303 static HRESULT WINAPI DefaultHandler_LockRunning( 304 IRunnableObject* iface, 305 BOOL fLock, 306 BOOL fLastUnlockCloses); 307 static HRESULT WINAPI DefaultHandler_SetContainedObject( 308 IRunnableObject* iface, 309 BOOL fContained); 309 310 310 311 … … 407 408 * IUnknown pointer can be returned to the outside. 408 409 */ 409 if ( (pUnkOuter!=NULL) && 410 if ( (pUnkOuter!=NULL) && 410 411 (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) ) 411 412 return CLASS_E_NOAGGREGATION; … … 414 415 * Try to construct a new instance of the class. 415 416 */ 416 newHandler = DefaultHandler_Construct(clsid, 417 pUnkOuter);417 newHandler = DefaultHandler_Construct(clsid, 418 pUnkOuter); 418 419 419 420 if (newHandler == 0) … … 450 451 if (newObject==0) 451 452 return newObject; 452 453 453 454 /* 454 455 * Initialize the virtual function table. … … 460 461 461 462 /* 462 * Start with one reference count. The caller of this function 463 * Start with one reference count. The caller of this function 463 464 * must release the interface pointer when it is done. 464 465 */ … … 467 468 /* 468 469 * Initialize the outer unknown 469 * We don't keep a reference on the outer unknown since, the way 470 * We don't keep a reference on the outer unknown since, the way 470 471 * aggregation works, our lifetime is at least as large as it's 471 472 * lifetime. … … 479 480 * Create a datacache object. 480 481 * We aggregate with the datacache. Make sure we pass our outer 481 * unknown as the datacache's outer unknown. 482 * unknown as the datacache's outer unknown. 482 483 */ 483 484 CreateDataCache(newObject->outerUnknown, 484 clsid,485 &IID_IUnknown,486 (void**)&newObject->dataCache);485 clsid, 486 &IID_IUnknown, 487 (void**)&newObject->dataCache); 487 488 488 489 /* … … 516 517 ptrToDestroy->containerObj = NULL; 517 518 } 518 519 519 520 /* 520 521 * Release our reference to the data cache. … … 585 586 if ( (this==0) || (ppvObject==0) ) 586 587 return E_INVALIDARG; 587 588 588 589 /* 589 590 * Initialize the return parameter. … … 594 595 * Compare the riid with the interface IDs implemented by this object. 595 596 */ 596 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 597 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 597 598 { 598 599 *ppvObject = iface; 599 600 } 600 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0) 601 else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0) 601 602 { 602 603 *ppvObject = (IOleObject*)&(this->lpvtbl1); 603 604 } 604 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) 605 else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) 605 606 { 606 607 *ppvObject = (IDataObject*)&(this->lpvtbl3); 607 608 } 608 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0) 609 else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0) 609 610 { 610 611 *ppvObject = (IRunnableObject*)&(this->lpvtbl4); … … 616 617 */ 617 618 if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK) 618 return S_OK;619 } 620 619 return S_OK; 620 } 621 621 622 /* 622 623 * Check that we obtained an interface. … … 627 628 return E_NOINTERFACE; 628 629 } 629 630 630 631 /* 631 632 * Query Interface always increases the reference count by one when it is 632 * successful. 633 * successful. 633 634 */ 634 635 IUnknown_AddRef((IUnknown*)*ppvObject); 635 636 636 return S_OK;; 637 return S_OK;; 637 638 } 638 639 … … 645 646 * to the outer unknown. 646 647 */ 647 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( 648 static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( 648 649 IUnknown* iface) 649 650 { … … 663 664 * to the outer unknown. 664 665 */ 665 static ULONG WINAPI DefaultHandler_NDIUnknown_Release( 666 static ULONG WINAPI DefaultHandler_NDIUnknown_Release( 666 667 IUnknown* iface) 667 668 { … … 682 683 return 0; 683 684 } 684 685 685 686 return this->ref; 686 687 } … … 703 704 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 704 705 705 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 706 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 706 707 } 707 708 … … 711 712 * See Windows documentation for more details on IUnknown methods. 712 713 */ 713 static ULONG WINAPI DefaultHandler_AddRef( 714 static ULONG WINAPI DefaultHandler_AddRef( 714 715 IOleObject* iface) 715 716 { … … 724 725 * See Windows documentation for more details on IUnknown methods. 725 726 */ 726 static ULONG WINAPI DefaultHandler_Release( 727 static ULONG WINAPI DefaultHandler_Release( 727 728 IOleObject* iface) 728 729 { … … 741 742 */ 742 743 static HRESULT WINAPI DefaultHandler_SetClientSite( 743 IOleObject* iface,744 IOleClientSite* pClientSite)744 IOleObject* iface, 745 IOleClientSite* pClientSite) 745 746 { 746 747 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); … … 776 777 */ 777 778 static HRESULT WINAPI DefaultHandler_GetClientSite( 778 IOleObject* iface,779 IOleClientSite** ppClientSite)779 IOleObject* iface, 780 IOleClientSite** ppClientSite) 780 781 { 781 782 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); … … 806 807 */ 807 808 static HRESULT WINAPI DefaultHandler_SetHostNames( 808 IOleObject* iface,809 LPCOLESTR szContainerApp, 810 LPCOLESTR szContainerObj)809 IOleObject* iface, 810 LPCOLESTR szContainerApp, 811 LPCOLESTR szContainerObj) 811 812 { 812 813 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 813 814 814 815 TRACE("(%p, %s, %s)\n", 815 iface,816 debugstr_w(szContainerApp), 817 debugstr_w(szContainerObj));816 iface, 817 debugstr_w(szContainerApp), 818 debugstr_w(szContainerObj)); 818 819 819 820 /* 820 821 * Be sure to cleanup before re-assinging the strings. 821 */ 822 */ 822 823 if (this->containerApp!=NULL) 823 824 { … … 860 861 */ 861 862 static HRESULT WINAPI DefaultHandler_Close( 862 IOleObject* iface, 863 DWORD dwSaveOption)863 IOleObject* iface, 864 DWORD dwSaveOption) 864 865 { 865 866 TRACE("()\n"); … … 875 876 */ 876 877 static HRESULT WINAPI DefaultHandler_SetMoniker( 877 IOleObject* iface, 878 DWORD dwWhichMoniker,879 IMoniker* pmk)878 IOleObject* iface, 879 DWORD dwWhichMoniker, 880 IMoniker* pmk) 880 881 { 881 882 TRACE("(%p, %ld, %p)\n", 882 iface, 883 dwWhichMoniker, 884 pmk);883 iface, 884 dwWhichMoniker, 885 pmk); 885 886 886 887 return S_OK; … … 895 896 */ 896 897 static HRESULT WINAPI DefaultHandler_GetMoniker( 897 IOleObject* iface,898 DWORD dwAssign,899 DWORD dwWhichMoniker,900 IMoniker** ppmk)898 IOleObject* iface, 899 DWORD dwAssign, 900 DWORD dwWhichMoniker, 901 IMoniker** ppmk) 901 902 { 902 903 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 903 904 904 905 TRACE("(%p, %ld, %ld, %p)\n", 905 iface, dwAssign, dwWhichMoniker, ppmk);906 iface, dwAssign, dwWhichMoniker, ppmk); 906 907 907 908 if (this->clientSite) 908 909 { 909 910 return IOleClientSite_GetMoniker(this->clientSite, 910 dwAssign,911 dwWhichMoniker,912 ppmk);913 911 dwAssign, 912 dwWhichMoniker, 913 ppmk); 914 914 915 } 915 916 … … 921 922 * 922 923 * This method is meaningless if the server is not running 923 * 924 * 924 925 * See Windows documentation for more details on IOleObject methods. 925 926 */ 926 927 static HRESULT WINAPI DefaultHandler_InitFromData( 927 IOleObject* iface, 928 IDataObject* pDataObject, 929 BOOL fCreation,930 DWORD dwReserved)928 IOleObject* iface, 929 IDataObject* pDataObject, 930 BOOL fCreation, 931 DWORD dwReserved) 931 932 { 932 933 TRACE("(%p, %p, %d, %ld)\n", 933 iface, pDataObject, fCreation, dwReserved);934 iface, pDataObject, fCreation, dwReserved); 934 935 935 936 return OLE_E_NOTRUNNING; … … 940 941 * 941 942 * This method is meaningless if the server is not running 942 * 943 * 943 944 * See Windows documentation for more details on IOleObject methods. 944 945 */ 945 946 static HRESULT WINAPI DefaultHandler_GetClipboardData( 946 IOleObject* iface, 947 DWORD dwReserved, 948 IDataObject** ppDataObject)947 IOleObject* iface, 948 DWORD dwReserved, 949 IDataObject** ppDataObject) 949 950 { 950 951 TRACE("(%p, %ld, %p)\n", 951 iface, dwReserved, ppDataObject);952 iface, dwReserved, ppDataObject); 952 953 953 954 return OLE_E_NOTRUNNING; … … 955 956 956 957 static HRESULT WINAPI DefaultHandler_DoVerb( 957 IOleObject* iface, 958 LONG iVerb, 958 IOleObject* iface, 959 LONG iVerb, 959 960 #ifdef __WIN32OS2__ 960 LPMSG lpmsg, 961 LPMSG lpmsg, 961 962 #else 962 struct tagMSG* lpmsg, 963 struct tagMSG* lpmsg, 963 964 #endif 964 IOleClientSite* pActiveSite, 965 LONG lindex, 966 HWND hwndParent, 967 LPCRECT lprcPosRect)965 IOleClientSite* pActiveSite, 966 LONG lindex, 967 HWND hwndParent, 968 LPCRECT lprcPosRect) 968 969 { 969 970 FIXME(": Stub\n"); … … 976 977 * The default handler implementation of this method simply delegates 977 978 * to OleRegEnumVerbs 978 * 979 * 979 980 * See Windows documentation for more details on IOleObject methods. 980 981 */ 981 982 static HRESULT WINAPI DefaultHandler_EnumVerbs( 982 IOleObject* iface, 983 IEnumOLEVERB** ppEnumOleVerb)983 IOleObject* iface, 984 IEnumOLEVERB** ppEnumOleVerb) 984 985 { 985 986 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); … … 991 992 992 993 static HRESULT WINAPI DefaultHandler_Update( 993 IOleObject* iface)994 IOleObject* iface) 994 995 { 995 996 FIXME(": Stub\n"); … … 1001 1002 * 1002 1003 * This method is meaningless if the server is not running 1003 * 1004 * 1004 1005 * See Windows documentation for more details on IOleObject methods. 1005 1006 */ 1006 1007 static HRESULT WINAPI DefaultHandler_IsUpToDate( 1007 IOleObject* iface)1008 IOleObject* iface) 1008 1009 { 1009 1010 TRACE("(%p)\n", iface); … … 1016 1017 * 1017 1018 * TODO: Map to a new class ID if emulation is active. 1018 * 1019 * 1019 1020 * See Windows documentation for more details on IOleObject methods. 1020 1021 */ 1021 1022 static HRESULT WINAPI DefaultHandler_GetUserClassID( 1022 IOleObject* iface, 1023 CLSID* pClsid)1023 IOleObject* iface, 1024 CLSID* pClsid) 1024 1025 { 1025 1026 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); … … 1043 1044 * The default handler implementation of this method simply delegates 1044 1045 * to OleRegGetUserType 1045 * 1046 * 1046 1047 * See Windows documentation for more details on IOleObject methods. 1047 1048 */ 1048 1049 static HRESULT WINAPI DefaultHandler_GetUserType( 1049 IOleObject* iface, 1050 DWORD dwFormOfType, 1051 LPOLESTR* pszUserType)1050 IOleObject* iface, 1051 DWORD dwFormOfType, 1052 LPOLESTR* pszUserType) 1052 1053 { 1053 1054 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); … … 1066 1067 */ 1067 1068 static HRESULT WINAPI DefaultHandler_SetExtent( 1068 IOleObject* iface, 1069 DWORD dwDrawAspect, 1070 SIZEL* psizel)1069 IOleObject* iface, 1070 DWORD dwDrawAspect, 1071 SIZEL* psizel) 1071 1072 { 1072 1073 TRACE("(%p, %lx, (%ld x %ld))\n", iface, … … 1084 1085 */ 1085 1086 static HRESULT WINAPI DefaultHandler_GetExtent( 1086 IOleObject* iface, 1087 DWORD dwDrawAspect, 1088 SIZEL* psizel)1087 IOleObject* iface, 1088 DWORD dwDrawAspect, 1089 SIZEL* psizel) 1089 1090 { 1090 1091 DVTARGETDEVICE* targetDevice; … … 1092 1093 HRESULT hres; 1093 1094 1094 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1095 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1095 1096 1096 1097 TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel); … … 1105 1106 * 1106 1107 * Here we would build a valid DVTARGETDEVICE structure 1107 * but, since we are calling into the data cache, we 1108 * know it's implementation and we'll skip this 1108 * but, since we are calling into the data cache, we 1109 * know it's implementation and we'll skip this 1109 1110 * extra work until later. 1110 1111 */ … … 1112 1113 1113 1114 hres = IViewObject2_GetExtent(cacheView, 1114 dwDrawAspect,1115 -1,1116 targetDevice,1117 psizel);1115 dwDrawAspect, 1116 -1, 1117 targetDevice, 1118 psizel); 1118 1119 1119 1120 /* … … 1134 1135 */ 1135 1136 static HRESULT WINAPI DefaultHandler_Advise( 1136 IOleObject* iface, 1137 IAdviseSink* pAdvSink, 1138 DWORD* pdwConnection)1137 IOleObject* iface, 1138 IAdviseSink* pAdvSink, 1139 DWORD* pdwConnection) 1139 1140 { 1140 1141 HRESULT hres = S_OK; 1141 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1142 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1142 1143 1143 1144 TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection); … … 1153 1154 if (SUCCEEDED(hres)) 1154 1155 { 1155 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder, 1156 pAdvSink, 1157 pdwConnection);1156 hres = IOleAdviseHolder_Advise(this->oleAdviseHolder, 1157 pAdvSink, 1158 pdwConnection); 1158 1159 } 1159 1160 … … 1170 1171 */ 1171 1172 static HRESULT WINAPI DefaultHandler_Unadvise( 1172 IOleObject* iface, 1173 DWORD dwConnection)1174 { 1175 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1173 IOleObject* iface, 1174 DWORD dwConnection) 1175 { 1176 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1176 1177 1177 1178 TRACE("(%p, %ld)\n", iface, dwConnection); … … 1185 1186 1186 1187 return IOleAdviseHolder_Unadvise(this->oleAdviseHolder, 1187 dwConnection);1188 dwConnection); 1188 1189 } 1189 1190 … … 1197 1198 */ 1198 1199 static HRESULT WINAPI DefaultHandler_EnumAdvise( 1199 IOleObject* iface, 1200 IEnumSTATDATA** ppenumAdvise)1201 { 1202 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1200 IOleObject* iface, 1201 IEnumSTATDATA** ppenumAdvise) 1202 { 1203 _ICOM_THIS_From_IOleObject(DefaultHandler, iface); 1203 1204 1204 1205 TRACE("(%p, %p)\n", iface, ppenumAdvise); … … 1217 1218 if (this->oleAdviseHolder==NULL) 1218 1219 return IOleAdviseHolder_EnumAdvise(this->oleAdviseHolder, 1219 ppenumAdvise);1220 ppenumAdvise); 1220 1221 1221 1222 return S_OK; … … 1231 1232 */ 1232 1233 static HRESULT WINAPI DefaultHandler_GetMiscStatus( 1233 IOleObject* iface, 1234 DWORD dwAspect, 1235 DWORD* pdwStatus)1234 IOleObject* iface, 1235 DWORD dwAspect, 1236 DWORD* pdwStatus) 1236 1237 { 1237 1238 HRESULT hres; … … 1256 1257 */ 1257 1258 static HRESULT WINAPI DefaultHandler_SetColorScheme( 1258 IOleObject* iface,1259 struct tagLOGPALETTE* pLogpal)1259 IOleObject* iface, 1260 struct tagLOGPALETTE* pLogpal) 1260 1261 { 1261 1262 TRACE("(%p, %p))\n", iface, pLogpal); … … 1274 1275 */ 1275 1276 static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface( 1276 IDataObject* iface, 1277 IDataObject* iface, 1277 1278 REFIID riid, 1278 1279 void** ppvObject) … … 1280 1281 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1281 1282 1282 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 1283 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 1283 1284 } 1284 1285 … … 1288 1289 * See Windows documentation for more details on IUnknown methods. 1289 1290 */ 1290 static ULONG WINAPI DefaultHandler_IDataObject_AddRef( 1291 static ULONG WINAPI DefaultHandler_IDataObject_AddRef( 1291 1292 IDataObject* iface) 1292 1293 { 1293 1294 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1294 1295 1295 return IUnknown_AddRef(this->outerUnknown); 1296 return IUnknown_AddRef(this->outerUnknown); 1296 1297 } 1297 1298 … … 1301 1302 * See Windows documentation for more details on IUnknown methods. 1302 1303 */ 1303 static ULONG WINAPI DefaultHandler_IDataObject_Release( 1304 static ULONG WINAPI DefaultHandler_IDataObject_Release( 1304 1305 IDataObject* iface) 1305 1306 { 1306 1307 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1307 1308 1308 return IUnknown_Release(this->outerUnknown); 1309 return IUnknown_Release(this->outerUnknown); 1309 1310 } 1310 1311 … … 1317 1318 */ 1318 1319 static HRESULT WINAPI DefaultHandler_GetData( 1319 IDataObject* iface,1320 LPFORMATETC pformatetcIn, 1321 STGMEDIUM* pmedium)1320 IDataObject* iface, 1321 LPFORMATETC pformatetcIn, 1322 STGMEDIUM* pmedium) 1322 1323 { 1323 1324 IDataObject* cacheDataObject = NULL; … … 1328 1329 TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium); 1329 1330 1330 hres = IUnknown_QueryInterface(this->dataCache, 1331 &IID_IDataObject,1332 (void**)&cacheDataObject);1331 hres = IUnknown_QueryInterface(this->dataCache, 1332 &IID_IDataObject, 1333 (void**)&cacheDataObject); 1333 1334 1334 1335 if (FAILED(hres)) … … 1336 1337 1337 1338 hres = IDataObject_GetData(cacheDataObject, 1338 pformatetcIn,1339 pmedium);1340 1339 pformatetcIn, 1340 pmedium); 1341 1341 1342 IDataObject_Release(cacheDataObject); 1342 1343 1343 1344 return hres; 1344 1345 } 1345 1346 1346 1347 static HRESULT WINAPI DefaultHandler_GetDataHere( 1347 IDataObject* iface, 1348 LPFORMATETC pformatetc,1349 STGMEDIUM* pmedium)1348 IDataObject* iface, 1349 LPFORMATETC pformatetc, 1350 STGMEDIUM* pmedium) 1350 1351 { 1351 1352 FIXME(": Stub\n"); … … 1356 1357 * DefaultHandler_QueryGetData (IDataObject) 1357 1358 * 1358 * The default handler's implementation of this method delegates to 1359 * The default handler's implementation of this method delegates to 1359 1360 * the cache. 1360 1361 * … … 1362 1363 */ 1363 1364 static HRESULT WINAPI DefaultHandler_QueryGetData( 1364 IDataObject* iface,1365 LPFORMATETC pformatetc)1365 IDataObject* iface, 1366 LPFORMATETC pformatetc) 1366 1367 { 1367 1368 IDataObject* cacheDataObject = NULL; … … 1372 1373 TRACE("(%p, %p)\n", iface, pformatetc); 1373 1374 1374 hres = IUnknown_QueryInterface(this->dataCache, 1375 &IID_IDataObject,1376 (void**)&cacheDataObject);1375 hres = IUnknown_QueryInterface(this->dataCache, 1376 &IID_IDataObject, 1377 (void**)&cacheDataObject); 1377 1378 1378 1379 if (FAILED(hres)) … … 1380 1381 1381 1382 hres = IDataObject_QueryGetData(cacheDataObject, 1382 pformatetc);1383 pformatetc); 1383 1384 1384 1385 IDataObject_Release(cacheDataObject); 1385 1386 1386 1387 return hres; 1387 1388 } … … 1395 1396 */ 1396 1397 static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( 1397 IDataObject* iface, 1398 LPFORMATETC pformatectIn, 1399 LPFORMATETC pformatetcOut)1398 IDataObject* iface, 1399 LPFORMATETC pformatectIn, 1400 LPFORMATETC pformatetcOut) 1400 1401 { 1401 1402 FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut); … … 1407 1408 * DefaultHandler_SetData (IDataObject) 1408 1409 * 1409 * The default handler's implementation of this method delegates to 1410 * The default handler's implementation of this method delegates to 1410 1411 * the cache. 1411 1412 * … … 1413 1414 */ 1414 1415 static HRESULT WINAPI DefaultHandler_SetData( 1415 IDataObject* iface,1416 LPFORMATETC pformatetc, 1417 STGMEDIUM* pmedium, 1418 BOOL fRelease)1416 IDataObject* iface, 1417 LPFORMATETC pformatetc, 1418 STGMEDIUM* pmedium, 1419 BOOL fRelease) 1419 1420 { 1420 1421 IDataObject* cacheDataObject = NULL; … … 1425 1426 TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease); 1426 1427 1427 hres = IUnknown_QueryInterface(this->dataCache, 1428 &IID_IDataObject,1429 (void**)&cacheDataObject);1428 hres = IUnknown_QueryInterface(this->dataCache, 1429 &IID_IDataObject, 1430 (void**)&cacheDataObject); 1430 1431 1431 1432 if (FAILED(hres)) … … 1433 1434 1434 1435 hres = IDataObject_SetData(cacheDataObject, 1435 pformatetc,1436 pmedium,1437 fRelease);1438 1436 pformatetc, 1437 pmedium, 1438 fRelease); 1439 1439 1440 IDataObject_Release(cacheDataObject); 1440 1441 1441 1442 return hres; 1442 1443 } … … 1451 1452 */ 1452 1453 static HRESULT WINAPI DefaultHandler_EnumFormatEtc( 1453 IDataObject* iface, 1454 DWORD dwDirection,1455 IEnumFORMATETC** ppenumFormatEtc)1454 IDataObject* iface, 1455 DWORD dwDirection, 1456 IEnumFORMATETC** ppenumFormatEtc) 1456 1457 { 1457 1458 HRESULT hres; … … 1474 1475 */ 1475 1476 static HRESULT WINAPI DefaultHandler_DAdvise( 1476 IDataObject* iface, 1477 FORMATETC* pformatetc, 1478 DWORD advf, 1479 IAdviseSink* pAdvSink, 1480 DWORD* pdwConnection)1477 IDataObject* iface, 1478 FORMATETC* pformatetc, 1479 DWORD advf, 1480 IAdviseSink* pAdvSink, 1481 DWORD* pdwConnection) 1481 1482 { 1482 1483 HRESULT hres = S_OK; 1483 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1484 1485 TRACE("(%p, %p, %ld, %p, %p)\n", 1486 iface, pformatetc, advf, pAdvSink, pdwConnection);1484 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1485 1486 TRACE("(%p, %p, %ld, %p, %p)\n", 1487 iface, pformatetc, advf, pAdvSink, pdwConnection); 1487 1488 1488 1489 /* … … 1496 1497 if (SUCCEEDED(hres)) 1497 1498 { 1498 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder, 1499 iface,1500 pformatetc, 1501 advf, 1502 pAdvSink, 1503 pdwConnection);1499 hres = IDataAdviseHolder_Advise(this->dataAdviseHolder, 1500 iface, 1501 pformatetc, 1502 advf, 1503 pAdvSink, 1504 pdwConnection); 1504 1505 } 1505 1506 … … 1516 1517 */ 1517 1518 static HRESULT WINAPI DefaultHandler_DUnadvise( 1518 IDataObject* iface,1519 DWORD dwConnection)1520 { 1521 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1519 IDataObject* iface, 1520 DWORD dwConnection) 1521 { 1522 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1522 1523 1523 1524 TRACE("(%p, %ld)\n", iface, dwConnection); … … 1532 1533 } 1533 1534 1534 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder, 1535 dwConnection);1535 return IDataAdviseHolder_Unadvise(this->dataAdviseHolder, 1536 dwConnection); 1536 1537 } 1537 1538 … … 1545 1546 */ 1546 1547 static HRESULT WINAPI DefaultHandler_EnumDAdvise( 1547 IDataObject* iface,1548 IEnumSTATDATA** ppenumAdvise)1549 { 1550 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1548 IDataObject* iface, 1549 IEnumSTATDATA** ppenumAdvise) 1550 { 1551 _ICOM_THIS_From_IDataObject(DefaultHandler, iface); 1551 1552 1552 1553 TRACE("(%p, %p)\n", iface, ppenumAdvise); … … 1568 1569 if (this->dataAdviseHolder!=NULL) 1569 1570 { 1570 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder, 1571 ppenumAdvise);1571 return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder, 1572 ppenumAdvise); 1572 1573 } 1573 1574 … … 1576 1577 1577 1578 /********************************************************* 1578 * Methods implementation for the IRunnableObject part 1579 * Methods implementation for the IRunnableObject part 1579 1580 * of the DefaultHandler class. 1580 1581 */ … … 1592 1593 _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface); 1593 1594 1594 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 1595 return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); 1595 1596 } 1596 1597 … … 1600 1601 * See Windows documentation for more details on IUnknown methods. 1601 1602 */ 1602 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( 1603 static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( 1603 1604 IRunnableObject* iface) 1604 1605 { … … 1613 1614 * See Windows documentation for more details on IUnknown methods. 1614 1615 */ 1615 static ULONG WINAPI DefaultHandler_IRunnableObject_Release( 1616 static ULONG WINAPI DefaultHandler_IRunnableObject_Release( 1616 1617 IRunnableObject* iface) 1617 1618 { … … 1624 1625 * DefaultHandler_GetRunningClass (IRunnableObject) 1625 1626 * 1626 * According to Brockscmidt, Chapter 19, the default handler's 1627 * According to Brockscmidt, Chapter 19, the default handler's 1627 1628 * implementation of IRunnableobject does nothing until the object 1628 1629 * is actually running. … … 1630 1631 * See Windows documentation for more details on IRunnableObject methods. 1631 1632 */ 1632 static HRESULT WINAPI DefaultHandler_GetRunningClass( 1633 IRunnableObject* iface, 1634 LPCLSID lpClsid)1633 static HRESULT WINAPI DefaultHandler_GetRunningClass( 1634 IRunnableObject* iface, 1635 LPCLSID lpClsid) 1635 1636 { 1636 1637 TRACE("()\n"); … … 1638 1639 } 1639 1640 1640 static HRESULT WINAPI DefaultHandler_Run( 1641 static HRESULT WINAPI DefaultHandler_Run( 1641 1642 IRunnableObject* iface, 1642 IBindCtx* pbc)1643 IBindCtx* pbc) 1643 1644 { 1644 1645 FIXME(": Stub\n"); … … 1649 1650 * DefaultHandler_IsRunning (IRunnableObject) 1650 1651 * 1651 * According to Brockscmidt, Chapter 19, the default handler's 1652 * According to Brockscmidt, Chapter 19, the default handler's 1652 1653 * implementation of IRunnableobject does nothing until the object 1653 1654 * is actually running. … … 1655 1656 * See Windows documentation for more details on IRunnableObject methods. 1656 1657 */ 1657 static BOOL WINAPI DefaultHandler_IsRunning( 1658 static BOOL WINAPI DefaultHandler_IsRunning( 1658 1659 IRunnableObject* iface) 1659 1660 { … … 1665 1666 * DefaultHandler_LockRunning (IRunnableObject) 1666 1667 * 1667 * According to Brockscmidt, Chapter 19, the default handler's 1668 * According to Brockscmidt, Chapter 19, the default handler's 1668 1669 * implementation of IRunnableobject does nothing until the object 1669 1670 * is actually running. … … 1671 1672 * See Windows documentation for more details on IRunnableObject methods. 1672 1673 */ 1673 static HRESULT WINAPI DefaultHandler_LockRunning( 1674 IRunnableObject* iface, 1675 BOOL fLock, 1676 BOOL fLastUnlockCloses)1674 static HRESULT WINAPI DefaultHandler_LockRunning( 1675 IRunnableObject* iface, 1676 BOOL fLock, 1677 BOOL fLastUnlockCloses) 1677 1678 { 1678 1679 TRACE("()\n"); … … 1683 1684 * DefaultHandler_SetContainedObject (IRunnableObject) 1684 1685 * 1685 * According to Brockscmidt, Chapter 19, the default handler's 1686 * According to Brockscmidt, Chapter 19, the default handler's 1686 1687 * implementation of IRunnableobject does nothing until the object 1687 1688 * is actually running. … … 1689 1690 * See Windows documentation for more details on IRunnableObject methods. 1690 1691 */ 1691 static HRESULT WINAPI DefaultHandler_SetContainedObject( 1692 IRunnableObject* iface, 1693 BOOL fContained)1692 static HRESULT WINAPI DefaultHandler_SetContainedObject( 1693 IRunnableObject* iface, 1694 BOOL fContained) 1694 1695 { 1695 1696 TRACE("()\n");
Note:
See TracChangeset
for help on using the changeset viewer.
