[PSDK][ACTXPROXY] Add IExplorerCommand and related classes (Vista+)
[reactos.git] / dll / win32 / actxprxy / usrmarshal.c
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 #define WIN32_NO_STATUS
22 #define _INC_WINDOWS
23 #define COM_NO_WINDOWS_H
24
25 #include <stdarg.h>
26 //#include <string.h>
27
28 #define COBJMACROS
29 #define NONAMELESSUNION
30 #define NONAMELESSSTRUCT
31
32 #include <windef.h>
33 #include <winbase.h>
34 //#include "wingdi.h"
35 //#include "winuser.h"
36 //#include "winerror.h"
37 #include <objbase.h>
38 //#include "servprov.h"
39 //#include "comcat.h"
40 //#include "docobj.h"
41 #include <shobjidl.h>
42
43 #include <wine/debug.h>
44
45 WINE_DEFAULT_DEBUG_CHANNEL(actxprxy);
46
47 HRESULT CALLBACK IServiceProvider_QueryService_Proxy(
48 IServiceProvider* This,
49 REFGUID guidService,
50 REFIID riid,
51 void** ppvObject)
52 {
53 TRACE("(%p, %s, %s, %p)\n", This, debugstr_guid(guidService),
54 debugstr_guid(riid), ppvObject);
55
56 return IServiceProvider_RemoteQueryService_Proxy(This, guidService, riid,
57 (IUnknown **)ppvObject);
58 }
59
60 HRESULT __RPC_STUB IServiceProvider_QueryService_Stub(
61 IServiceProvider* This,
62 REFGUID guidService,
63 REFIID riid,
64 IUnknown** ppvObject)
65 {
66 TRACE("(%p, %s, %s, %p)\n", This, debugstr_guid(guidService),
67 debugstr_guid(riid), ppvObject);
68
69 return IServiceProvider_QueryService(This, guidService, riid,
70 (void **)ppvObject);
71 }
72
73 HRESULT CALLBACK ICatInformation_EnumClassesOfCategories_Proxy(
74 ICatInformation *This,
75 ULONG cImplemented,
76 CATID rgcatidImpl[],
77 ULONG cRequired,
78 CATID rgcatidReq[],
79 IEnumCLSID** ppenumClsid )
80 {
81 TRACE("(%p)\n", This);
82 return ICatInformation_RemoteEnumClassesOfCategories_Proxy( This, cImplemented, rgcatidImpl,
83 cRequired, rgcatidReq, ppenumClsid );
84 }
85
86 HRESULT __RPC_STUB ICatInformation_EnumClassesOfCategories_Stub(
87 ICatInformation *This,
88 ULONG cImplemented,
89 CATID rgcatidImpl[],
90 ULONG cRequired,
91 CATID rgcatidReq[],
92 IEnumCLSID** ppenumClsid )
93 {
94 TRACE("(%p)\n", This);
95 return ICatInformation_EnumClassesOfCategories( This, cImplemented, rgcatidImpl,
96 cRequired, rgcatidReq, ppenumClsid );
97 }
98
99 HRESULT CALLBACK ICatInformation_IsClassOfCategories_Proxy(
100 ICatInformation *This,
101 REFCLSID rclsid,
102 ULONG cImplemented,
103 CATID rgcatidImpl[],
104 ULONG cRequired,
105 CATID rgcatidReq[] )
106 {
107 TRACE("(%p)\n", This);
108 return ICatInformation_RemoteIsClassOfCategories_Proxy( This, rclsid, cImplemented, rgcatidImpl,
109 cRequired, rgcatidReq );
110 }
111
112 HRESULT __RPC_STUB ICatInformation_IsClassOfCategories_Stub(
113 ICatInformation *This,
114 REFCLSID rclsid,
115 ULONG cImplemented,
116 CATID rgcatidImpl[],
117 ULONG cRequired,
118 CATID rgcatidReq[] )
119 {
120 TRACE("(%p)\n", This);
121 return ICatInformation_IsClassOfCategories( This, rclsid, cImplemented, rgcatidImpl,
122 cRequired, rgcatidReq );
123 }
124
125 HRESULT CALLBACK IPrint_Print_Proxy(
126 IPrint *This,
127 DWORD grfFlags,
128 DVTARGETDEVICE **pptd,
129 PAGESET **ppPageSet,
130 STGMEDIUM *pstgmOptions,
131 IContinueCallback *pcallback,
132 LONG nFirstPage,
133 LONG *pcPagesPrinted,
134 LONG *pnLastPage )
135 {
136 TRACE("(%p)\n", This);
137 return IPrint_RemotePrint_Proxy( This, grfFlags, pptd, ppPageSet, (RemSTGMEDIUM *)pstgmOptions,
138 pcallback, nFirstPage, pcPagesPrinted, pnLastPage );
139 }
140
141 HRESULT __RPC_STUB IPrint_Print_Stub(
142 IPrint *This,
143 DWORD grfFlags,
144 DVTARGETDEVICE **pptd,
145 PAGESET **ppPageSet,
146 RemSTGMEDIUM *pstgmOptions,
147 IContinueCallback *pcallback,
148 LONG nFirstPage,
149 LONG *pcPagesPrinted,
150 LONG *pnLastPage )
151 {
152 TRACE("(%p)\n", This);
153 return IPrint_Print( This, grfFlags, pptd, ppPageSet, (STGMEDIUM *)pstgmOptions,
154 pcallback, nFirstPage, pcPagesPrinted, pnLastPage );
155 }
156
157 HRESULT CALLBACK IEnumOleDocumentViews_Next_Proxy(
158 IEnumOleDocumentViews *This,
159 ULONG cViews,
160 IOleDocumentView **rgpView,
161 ULONG *pcFetched )
162 {
163 TRACE("(%p)\n", This);
164 return IEnumOleDocumentViews_RemoteNext_Proxy( This, cViews, rgpView, pcFetched );
165 }
166
167 HRESULT __RPC_STUB IEnumOleDocumentViews_Next_Stub(
168 IEnumOleDocumentViews *This,
169 ULONG cViews,
170 IOleDocumentView **rgpView,
171 ULONG *pcFetched )
172 {
173 TRACE("(%p)\n", This);
174 return IEnumOleDocumentViews_Next( This, cViews, rgpView, pcFetched );
175 }
176
177 HRESULT CALLBACK IEnumShellItems_Next_Proxy(
178 IEnumShellItems *This,
179 ULONG celt,
180 IShellItem **rgelt,
181 ULONG *pceltFetched)
182 {
183 ULONG fetched;
184 TRACE("(%p)->(%d, %p, %p)\n", This, celt, rgelt, pceltFetched);
185 if (!pceltFetched) pceltFetched = &fetched;
186 return IEnumShellItems_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
187 }
188
189 HRESULT __RPC_STUB IEnumShellItems_Next_Stub(
190 IEnumShellItems *This,
191 ULONG celt,
192 IShellItem **rgelt,
193 ULONG *pceltFetched)
194 {
195 HRESULT hr;
196 TRACE("(%p)->(%d, %p, %p)\n", This, celt, rgelt, pceltFetched);
197 *pceltFetched = 0;
198 hr = IEnumShellItems_Next(This, celt, rgelt, pceltFetched);
199 if (hr == S_OK) *pceltFetched = celt;
200 return hr;
201 }
202
203 #ifdef __REACTOS__
204
205 HRESULT CALLBACK IEnumExplorerCommand_Next_Proxy(
206 IEnumExplorerCommand *This,
207 ULONG celt,
208 IExplorerCommand **pUICommand,
209 ULONG *pceltFetched)
210 {
211 ULONG fetched;
212 TRACE("(%p)->(%d, %p, %p)\n", This, celt, pUICommand, pceltFetched);
213 if (!pceltFetched) pceltFetched = &fetched;
214 return IEnumExplorerCommand_RemoteNext_Proxy(This, celt, pUICommand, pceltFetched);
215 }
216
217 HRESULT __RPC_STUB IEnumExplorerCommand_Next_Stub(
218 IEnumExplorerCommand *This,
219 ULONG celt,
220 IExplorerCommand **pUICommand,
221 ULONG *pceltFetched)
222 {
223 HRESULT hr;
224 TRACE("(%p)->(%d, %p, %p)\n", This, celt, pUICommand, pceltFetched);
225 *pceltFetched = 0;
226 hr = IEnumExplorerCommand_Next(This, celt, pUICommand, pceltFetched);
227 if (hr == S_OK) *pceltFetched = celt;
228 return hr;
229 }
230
231 #endif // __REACTOS__
232
233 HRESULT CALLBACK IModalWindow_Show_Proxy(
234 IModalWindow *This,
235 HWND hwndOwner)
236 {
237 TRACE("(%p)->(%p)\n", This, hwndOwner);
238 return IModalWindow_RemoteShow_Proxy(This, hwndOwner);
239 }
240
241 HRESULT __RPC_STUB IModalWindow_Show_Stub(
242 IModalWindow *This,
243 HWND hwndOwner)
244 {
245 TRACE("(%p)->(%p)\n", This, hwndOwner);
246 return IModalWindow_Show(This, hwndOwner);
247 }
248
249 HRESULT __RPC_STUB IFolderView2_GetGroupBy_Stub(
250 IFolderView2 *This,
251 PROPERTYKEY *pkey,
252 BOOL *ascending)
253 {
254 TRACE("(%p)->(%p %p)\n", This, pkey, ascending);
255 return IFolderView2_GetGroupBy(This, pkey, ascending);
256 }
257
258 HRESULT __RPC_STUB IFolderView2_GetGroupBy_Proxy(
259 IFolderView2 *This,
260 PROPERTYKEY *pkey,
261 BOOL *ascending)
262 {
263 TRACE("(%p)->(%p %p)\n", This, pkey, ascending);
264 return IFolderView2_RemoteGetGroupBy_Proxy(This, pkey, ascending);
265 }