xref: /reactos/dll/win32/actxprxy/usrmarshal.c (revision feea1bc5)
1c2c66affSColin Finck /*
2c2c66affSColin Finck  * Miscellaneous Marshaling Routines
3c2c66affSColin Finck  *
4c2c66affSColin Finck  * Copyright 2006 Robert Shearman (for CodeWeavers)
5c2c66affSColin Finck  *
6c2c66affSColin Finck  * This library is free software; you can redistribute it and/or
7c2c66affSColin Finck  * modify it under the terms of the GNU Lesser General Public
8c2c66affSColin Finck  * License as published by the Free Software Foundation; either
9c2c66affSColin Finck  * version 2.1 of the License, or (at your option) any later version.
10c2c66affSColin Finck  *
11c2c66affSColin Finck  * This library is distributed in the hope that it will be useful,
12c2c66affSColin Finck  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14c2c66affSColin Finck  * Lesser General Public License for more details.
15c2c66affSColin Finck  *
16c2c66affSColin Finck  * You should have received a copy of the GNU Lesser General Public
17c2c66affSColin Finck  * License along with this library; if not, write to the Free Software
18c2c66affSColin Finck  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19c2c66affSColin Finck  */
20c2c66affSColin Finck 
21c2c66affSColin Finck #include <stdarg.h>
22*feea1bc5SAmine Khaldi #include <string.h>
23c2c66affSColin Finck 
24c2c66affSColin Finck #define COBJMACROS
25c2c66affSColin Finck 
26*feea1bc5SAmine Khaldi #include "windef.h"
27*feea1bc5SAmine Khaldi #include "winbase.h"
28*feea1bc5SAmine Khaldi #include "wingdi.h"
29*feea1bc5SAmine Khaldi #include "winuser.h"
30*feea1bc5SAmine Khaldi #include "winerror.h"
31*feea1bc5SAmine Khaldi #include "objbase.h"
32*feea1bc5SAmine Khaldi #include "servprov.h"
33*feea1bc5SAmine Khaldi #include "comcat.h"
34*feea1bc5SAmine Khaldi #include "docobj.h"
35*feea1bc5SAmine Khaldi #include "shobjidl.h"
36c2c66affSColin Finck 
37*feea1bc5SAmine Khaldi #include "wine/debug.h"
38c2c66affSColin Finck 
39c2c66affSColin Finck WINE_DEFAULT_DEBUG_CHANNEL(actxprxy);
40c2c66affSColin Finck 
IServiceProvider_QueryService_Proxy(IServiceProvider * This,REFGUID guidService,REFIID riid,void ** ppvObject)41c2c66affSColin Finck HRESULT CALLBACK IServiceProvider_QueryService_Proxy(
42c2c66affSColin Finck     IServiceProvider* This,
43c2c66affSColin Finck     REFGUID guidService,
44c2c66affSColin Finck     REFIID riid,
45c2c66affSColin Finck     void** ppvObject)
46c2c66affSColin Finck {
47c2c66affSColin Finck     TRACE("(%p, %s, %s, %p)\n", This, debugstr_guid(guidService),
48c2c66affSColin Finck         debugstr_guid(riid), ppvObject);
49c2c66affSColin Finck 
50c2c66affSColin Finck     return IServiceProvider_RemoteQueryService_Proxy(This, guidService, riid,
51c2c66affSColin Finck         (IUnknown **)ppvObject);
52c2c66affSColin Finck }
53c2c66affSColin Finck 
IServiceProvider_QueryService_Stub(IServiceProvider * This,REFGUID guidService,REFIID riid,IUnknown ** ppvObject)54c2c66affSColin Finck HRESULT __RPC_STUB IServiceProvider_QueryService_Stub(
55c2c66affSColin Finck     IServiceProvider* This,
56c2c66affSColin Finck     REFGUID guidService,
57c2c66affSColin Finck     REFIID riid,
58c2c66affSColin Finck     IUnknown** ppvObject)
59c2c66affSColin Finck {
60c2c66affSColin Finck     TRACE("(%p, %s, %s, %p)\n", This, debugstr_guid(guidService),
61c2c66affSColin Finck         debugstr_guid(riid), ppvObject);
62c2c66affSColin Finck 
63c2c66affSColin Finck     return IServiceProvider_QueryService(This, guidService, riid,
64c2c66affSColin Finck         (void **)ppvObject);
65c2c66affSColin Finck }
66c2c66affSColin Finck 
ICatInformation_EnumClassesOfCategories_Proxy(ICatInformation * This,ULONG cImplemented,CATID rgcatidImpl[],ULONG cRequired,CATID rgcatidReq[],IEnumCLSID ** ppenumClsid)67c2c66affSColin Finck HRESULT CALLBACK ICatInformation_EnumClassesOfCategories_Proxy(
68c2c66affSColin Finck     ICatInformation *This,
69c2c66affSColin Finck     ULONG cImplemented,
70c2c66affSColin Finck     CATID rgcatidImpl[],
71c2c66affSColin Finck     ULONG cRequired,
72c2c66affSColin Finck     CATID rgcatidReq[],
73c2c66affSColin Finck     IEnumCLSID** ppenumClsid )
74c2c66affSColin Finck {
75c2c66affSColin Finck     TRACE("(%p)\n", This);
76c2c66affSColin Finck     return ICatInformation_RemoteEnumClassesOfCategories_Proxy( This, cImplemented, rgcatidImpl,
77c2c66affSColin Finck                                                                 cRequired, rgcatidReq, ppenumClsid );
78c2c66affSColin Finck }
79c2c66affSColin Finck 
ICatInformation_EnumClassesOfCategories_Stub(ICatInformation * This,ULONG cImplemented,CATID rgcatidImpl[],ULONG cRequired,CATID rgcatidReq[],IEnumCLSID ** ppenumClsid)80c2c66affSColin Finck HRESULT __RPC_STUB ICatInformation_EnumClassesOfCategories_Stub(
81c2c66affSColin Finck     ICatInformation *This,
82c2c66affSColin Finck     ULONG cImplemented,
83c2c66affSColin Finck     CATID rgcatidImpl[],
84c2c66affSColin Finck     ULONG cRequired,
85c2c66affSColin Finck     CATID rgcatidReq[],
86c2c66affSColin Finck     IEnumCLSID** ppenumClsid )
87c2c66affSColin Finck {
88c2c66affSColin Finck     TRACE("(%p)\n", This);
89c2c66affSColin Finck     return ICatInformation_EnumClassesOfCategories( This, cImplemented, rgcatidImpl,
90c2c66affSColin Finck                                                     cRequired, rgcatidReq, ppenumClsid );
91c2c66affSColin Finck }
92c2c66affSColin Finck 
ICatInformation_IsClassOfCategories_Proxy(ICatInformation * This,REFCLSID rclsid,ULONG cImplemented,CATID rgcatidImpl[],ULONG cRequired,CATID rgcatidReq[])93c2c66affSColin Finck HRESULT CALLBACK ICatInformation_IsClassOfCategories_Proxy(
94c2c66affSColin Finck     ICatInformation *This,
95c2c66affSColin Finck     REFCLSID rclsid,
96c2c66affSColin Finck     ULONG cImplemented,
97c2c66affSColin Finck     CATID rgcatidImpl[],
98c2c66affSColin Finck     ULONG cRequired,
99c2c66affSColin Finck     CATID rgcatidReq[] )
100c2c66affSColin Finck {
101c2c66affSColin Finck     TRACE("(%p)\n", This);
102c2c66affSColin Finck     return ICatInformation_RemoteIsClassOfCategories_Proxy( This, rclsid, cImplemented, rgcatidImpl,
103c2c66affSColin Finck                                                             cRequired, rgcatidReq );
104c2c66affSColin Finck }
105c2c66affSColin Finck 
ICatInformation_IsClassOfCategories_Stub(ICatInformation * This,REFCLSID rclsid,ULONG cImplemented,CATID rgcatidImpl[],ULONG cRequired,CATID rgcatidReq[])106c2c66affSColin Finck HRESULT __RPC_STUB ICatInformation_IsClassOfCategories_Stub(
107c2c66affSColin Finck     ICatInformation *This,
108c2c66affSColin Finck     REFCLSID rclsid,
109c2c66affSColin Finck     ULONG cImplemented,
110c2c66affSColin Finck     CATID rgcatidImpl[],
111c2c66affSColin Finck     ULONG cRequired,
112c2c66affSColin Finck     CATID rgcatidReq[] )
113c2c66affSColin Finck {
114c2c66affSColin Finck     TRACE("(%p)\n", This);
115c2c66affSColin Finck     return ICatInformation_IsClassOfCategories( This, rclsid, cImplemented, rgcatidImpl,
116c2c66affSColin Finck                                                 cRequired, rgcatidReq );
117c2c66affSColin Finck }
118c2c66affSColin Finck 
IPrint_Print_Proxy(IPrint * This,DWORD grfFlags,DVTARGETDEVICE ** pptd,PAGESET ** ppPageSet,STGMEDIUM * pstgmOptions,IContinueCallback * pcallback,LONG nFirstPage,LONG * pcPagesPrinted,LONG * pnLastPage)119c2c66affSColin Finck HRESULT CALLBACK IPrint_Print_Proxy(
120c2c66affSColin Finck     IPrint *This,
121c2c66affSColin Finck     DWORD grfFlags,
122c2c66affSColin Finck     DVTARGETDEVICE **pptd,
123c2c66affSColin Finck     PAGESET **ppPageSet,
124c2c66affSColin Finck     STGMEDIUM *pstgmOptions,
125c2c66affSColin Finck     IContinueCallback *pcallback,
126c2c66affSColin Finck     LONG nFirstPage,
127c2c66affSColin Finck     LONG *pcPagesPrinted,
128c2c66affSColin Finck     LONG *pnLastPage )
129c2c66affSColin Finck {
130c2c66affSColin Finck     TRACE("(%p)\n", This);
131c2c66affSColin Finck     return IPrint_RemotePrint_Proxy( This, grfFlags, pptd, ppPageSet, (RemSTGMEDIUM *)pstgmOptions,
132c2c66affSColin Finck                                      pcallback, nFirstPage, pcPagesPrinted, pnLastPage );
133c2c66affSColin Finck }
134c2c66affSColin Finck 
IPrint_Print_Stub(IPrint * This,DWORD grfFlags,DVTARGETDEVICE ** pptd,PAGESET ** ppPageSet,RemSTGMEDIUM * pstgmOptions,IContinueCallback * pcallback,LONG nFirstPage,LONG * pcPagesPrinted,LONG * pnLastPage)135c2c66affSColin Finck HRESULT __RPC_STUB IPrint_Print_Stub(
136c2c66affSColin Finck     IPrint *This,
137c2c66affSColin Finck     DWORD grfFlags,
138c2c66affSColin Finck     DVTARGETDEVICE **pptd,
139c2c66affSColin Finck     PAGESET **ppPageSet,
140c2c66affSColin Finck     RemSTGMEDIUM *pstgmOptions,
141c2c66affSColin Finck     IContinueCallback *pcallback,
142c2c66affSColin Finck     LONG nFirstPage,
143c2c66affSColin Finck     LONG *pcPagesPrinted,
144c2c66affSColin Finck     LONG *pnLastPage )
145c2c66affSColin Finck {
146c2c66affSColin Finck     TRACE("(%p)\n", This);
147c2c66affSColin Finck     return IPrint_Print( This, grfFlags, pptd, ppPageSet, (STGMEDIUM *)pstgmOptions,
148c2c66affSColin Finck                          pcallback, nFirstPage, pcPagesPrinted, pnLastPage );
149c2c66affSColin Finck }
150c2c66affSColin Finck 
IEnumOleDocumentViews_Next_Proxy(IEnumOleDocumentViews * This,ULONG cViews,IOleDocumentView ** rgpView,ULONG * pcFetched)151c2c66affSColin Finck HRESULT CALLBACK IEnumOleDocumentViews_Next_Proxy(
152c2c66affSColin Finck     IEnumOleDocumentViews *This,
153c2c66affSColin Finck     ULONG cViews,
154c2c66affSColin Finck     IOleDocumentView **rgpView,
155c2c66affSColin Finck     ULONG *pcFetched )
156c2c66affSColin Finck {
157c2c66affSColin Finck     TRACE("(%p)\n", This);
158c2c66affSColin Finck     return IEnumOleDocumentViews_RemoteNext_Proxy( This, cViews, rgpView, pcFetched );
159c2c66affSColin Finck }
160c2c66affSColin Finck 
IEnumOleDocumentViews_Next_Stub(IEnumOleDocumentViews * This,ULONG cViews,IOleDocumentView ** rgpView,ULONG * pcFetched)161c2c66affSColin Finck HRESULT __RPC_STUB IEnumOleDocumentViews_Next_Stub(
162c2c66affSColin Finck     IEnumOleDocumentViews *This,
163c2c66affSColin Finck     ULONG cViews,
164c2c66affSColin Finck     IOleDocumentView **rgpView,
165c2c66affSColin Finck     ULONG *pcFetched )
166c2c66affSColin Finck {
167c2c66affSColin Finck     TRACE("(%p)\n", This);
168c2c66affSColin Finck     return IEnumOleDocumentViews_Next( This, cViews, rgpView, pcFetched );
169c2c66affSColin Finck }
170c2c66affSColin Finck 
IEnumShellItems_Next_Proxy(IEnumShellItems * This,ULONG celt,IShellItem ** rgelt,ULONG * pceltFetched)171c2c66affSColin Finck HRESULT CALLBACK IEnumShellItems_Next_Proxy(
172c2c66affSColin Finck     IEnumShellItems *This,
173c2c66affSColin Finck     ULONG celt,
174c2c66affSColin Finck     IShellItem **rgelt,
175c2c66affSColin Finck     ULONG *pceltFetched)
176c2c66affSColin Finck {
177c2c66affSColin Finck     ULONG fetched;
178c2c66affSColin Finck     TRACE("(%p)->(%d, %p, %p)\n", This, celt, rgelt, pceltFetched);
179c2c66affSColin Finck     if (!pceltFetched) pceltFetched = &fetched;
180c2c66affSColin Finck     return IEnumShellItems_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
181c2c66affSColin Finck }
182c2c66affSColin Finck 
IEnumShellItems_Next_Stub(IEnumShellItems * This,ULONG celt,IShellItem ** rgelt,ULONG * pceltFetched)183c2c66affSColin Finck HRESULT __RPC_STUB IEnumShellItems_Next_Stub(
184c2c66affSColin Finck     IEnumShellItems *This,
185c2c66affSColin Finck     ULONG celt,
186c2c66affSColin Finck     IShellItem **rgelt,
187c2c66affSColin Finck     ULONG *pceltFetched)
188c2c66affSColin Finck {
189c2c66affSColin Finck     HRESULT hr;
190c2c66affSColin Finck     TRACE("(%p)->(%d, %p, %p)\n", This, celt, rgelt, pceltFetched);
191c2c66affSColin Finck     *pceltFetched = 0;
192c2c66affSColin Finck     hr = IEnumShellItems_Next(This, celt, rgelt, pceltFetched);
193c2c66affSColin Finck     if (hr == S_OK) *pceltFetched = celt;
194c2c66affSColin Finck     return hr;
195c2c66affSColin Finck }
196c2c66affSColin Finck 
1971d4d88b0SMark Jansen #ifdef __REACTOS__
1981d4d88b0SMark Jansen 
IEnumExplorerCommand_Next_Proxy(IEnumExplorerCommand * This,ULONG celt,IExplorerCommand ** pUICommand,ULONG * pceltFetched)1991d4d88b0SMark Jansen HRESULT CALLBACK IEnumExplorerCommand_Next_Proxy(
2001d4d88b0SMark Jansen     IEnumExplorerCommand *This,
2011d4d88b0SMark Jansen     ULONG celt,
2021d4d88b0SMark Jansen     IExplorerCommand **pUICommand,
2031d4d88b0SMark Jansen     ULONG *pceltFetched)
2041d4d88b0SMark Jansen {
2051d4d88b0SMark Jansen     ULONG fetched;
2061d4d88b0SMark Jansen     TRACE("(%p)->(%d, %p, %p)\n", This, celt, pUICommand, pceltFetched);
2071d4d88b0SMark Jansen     if (!pceltFetched) pceltFetched = &fetched;
2081d4d88b0SMark Jansen     return IEnumExplorerCommand_RemoteNext_Proxy(This, celt, pUICommand, pceltFetched);
2091d4d88b0SMark Jansen }
2101d4d88b0SMark Jansen 
IEnumExplorerCommand_Next_Stub(IEnumExplorerCommand * This,ULONG celt,IExplorerCommand ** pUICommand,ULONG * pceltFetched)2111d4d88b0SMark Jansen HRESULT __RPC_STUB IEnumExplorerCommand_Next_Stub(
2121d4d88b0SMark Jansen     IEnumExplorerCommand *This,
2131d4d88b0SMark Jansen     ULONG celt,
2141d4d88b0SMark Jansen     IExplorerCommand **pUICommand,
2151d4d88b0SMark Jansen     ULONG *pceltFetched)
2161d4d88b0SMark Jansen {
2171d4d88b0SMark Jansen     HRESULT hr;
2181d4d88b0SMark Jansen     TRACE("(%p)->(%d, %p, %p)\n", This, celt, pUICommand, pceltFetched);
2191d4d88b0SMark Jansen     *pceltFetched = 0;
2201d4d88b0SMark Jansen     hr = IEnumExplorerCommand_Next(This, celt, pUICommand, pceltFetched);
2211d4d88b0SMark Jansen     if (hr == S_OK) *pceltFetched = celt;
2221d4d88b0SMark Jansen     return hr;
2231d4d88b0SMark Jansen }
2241d4d88b0SMark Jansen 
2251d4d88b0SMark Jansen #endif // __REACTOS__
2261d4d88b0SMark Jansen 
IModalWindow_Show_Proxy(IModalWindow * This,HWND hwndOwner)227c2c66affSColin Finck HRESULT CALLBACK IModalWindow_Show_Proxy(
228c2c66affSColin Finck     IModalWindow *This,
229c2c66affSColin Finck     HWND hwndOwner)
230c2c66affSColin Finck {
231c2c66affSColin Finck     TRACE("(%p)->(%p)\n", This, hwndOwner);
232c2c66affSColin Finck     return IModalWindow_RemoteShow_Proxy(This, hwndOwner);
233c2c66affSColin Finck }
234c2c66affSColin Finck 
IModalWindow_Show_Stub(IModalWindow * This,HWND hwndOwner)235c2c66affSColin Finck HRESULT __RPC_STUB IModalWindow_Show_Stub(
236c2c66affSColin Finck     IModalWindow *This,
237c2c66affSColin Finck     HWND hwndOwner)
238c2c66affSColin Finck {
239c2c66affSColin Finck     TRACE("(%p)->(%p)\n", This, hwndOwner);
240c2c66affSColin Finck     return IModalWindow_Show(This, hwndOwner);
241c2c66affSColin Finck }
242c2c66affSColin Finck 
IFolderView2_GetGroupBy_Stub(IFolderView2 * This,PROPERTYKEY * pkey,BOOL * ascending)243c2c66affSColin Finck HRESULT __RPC_STUB IFolderView2_GetGroupBy_Stub(
244c2c66affSColin Finck     IFolderView2 *This,
245c2c66affSColin Finck     PROPERTYKEY *pkey,
246c2c66affSColin Finck     BOOL *ascending)
247c2c66affSColin Finck {
248c2c66affSColin Finck     TRACE("(%p)->(%p %p)\n", This, pkey, ascending);
249c2c66affSColin Finck     return IFolderView2_GetGroupBy(This, pkey, ascending);
250c2c66affSColin Finck }
251c2c66affSColin Finck 
IFolderView2_GetGroupBy_Proxy(IFolderView2 * This,PROPERTYKEY * pkey,BOOL * ascending)252c2c66affSColin Finck HRESULT __RPC_STUB IFolderView2_GetGroupBy_Proxy(
253c2c66affSColin Finck     IFolderView2 *This,
254c2c66affSColin Finck     PROPERTYKEY *pkey,
255c2c66affSColin Finck     BOOL *ascending)
256c2c66affSColin Finck {
257c2c66affSColin Finck     TRACE("(%p)->(%p %p)\n", This, pkey, ascending);
258c2c66affSColin Finck     return IFolderView2_RemoteGetGroupBy_Proxy(This, pkey, ascending);
259c2c66affSColin Finck }
260