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