* Sync up to trunk r55544.
[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 #include <stdarg.h>
22 #include <string.h>
23
24 #define COBJMACROS
25 #define NONAMELESSUNION
26 #define NONAMELESSSTRUCT
27
28 #include "windef.h"
29 #include "winbase.h"
30 #include "wingdi.h"
31 #include "winuser.h"
32 #include "winerror.h"
33 #include "objbase.h"
34 #include "servprov.h"
35 #include "comcat.h"
36 #include "docobj.h"
37 #include "shobjidl.h"
38
39 #include "wine/debug.h"
40
41 WINE_DEFAULT_DEBUG_CHANNEL(actxprxy);
42
43 HRESULT CALLBACK IServiceProvider_QueryService_Proxy(
44 IServiceProvider* This,
45 REFGUID guidService,
46 REFIID riid,
47 void** ppvObject)
48 {
49 TRACE("(%p, %s, %s, %p)\n", This, debugstr_guid(guidService),
50 debugstr_guid(riid), ppvObject);
51
52 return IServiceProvider_RemoteQueryService_Proxy(This, guidService, riid,
53 (IUnknown **)ppvObject);
54 }
55
56 HRESULT __RPC_STUB IServiceProvider_QueryService_Stub(
57 IServiceProvider* This,
58 REFGUID guidService,
59 REFIID riid,
60 IUnknown** ppvObject)
61 {
62 TRACE("(%p, %s, %s, %p)\n", This, debugstr_guid(guidService),
63 debugstr_guid(riid), ppvObject);
64
65 return IServiceProvider_QueryService(This, guidService, riid,
66 (void **)ppvObject);
67 }
68
69 HRESULT CALLBACK ICatInformation_EnumClassesOfCategories_Proxy(
70 ICatInformation *This,
71 ULONG cImplemented,
72 CATID rgcatidImpl[],
73 ULONG cRequired,
74 CATID rgcatidReq[],
75 IEnumCLSID** ppenumClsid )
76 {
77 TRACE("(%p)\n", This);
78 return ICatInformation_RemoteEnumClassesOfCategories_Proxy( This, cImplemented, rgcatidImpl,
79 cRequired, rgcatidReq, ppenumClsid );
80 }
81
82 HRESULT __RPC_STUB ICatInformation_EnumClassesOfCategories_Stub(
83 ICatInformation *This,
84 ULONG cImplemented,
85 CATID rgcatidImpl[],
86 ULONG cRequired,
87 CATID rgcatidReq[],
88 IEnumCLSID** ppenumClsid )
89 {
90 TRACE("(%p)\n", This);
91 return ICatInformation_EnumClassesOfCategories( This, cImplemented, rgcatidImpl,
92 cRequired, rgcatidReq, ppenumClsid );
93 }
94
95 HRESULT CALLBACK ICatInformation_IsClassOfCategories_Proxy(
96 ICatInformation *This,
97 REFCLSID rclsid,
98 ULONG cImplemented,
99 CATID rgcatidImpl[],
100 ULONG cRequired,
101 CATID rgcatidReq[] )
102 {
103 TRACE("(%p)\n", This);
104 return ICatInformation_RemoteIsClassOfCategories_Proxy( This, rclsid, cImplemented, rgcatidImpl,
105 cRequired, rgcatidReq );
106 }
107
108 HRESULT __RPC_STUB ICatInformation_IsClassOfCategories_Stub(
109 ICatInformation *This,
110 REFCLSID rclsid,
111 ULONG cImplemented,
112 CATID rgcatidImpl[],
113 ULONG cRequired,
114 CATID rgcatidReq[] )
115 {
116 TRACE("(%p)\n", This);
117 return ICatInformation_IsClassOfCategories( This, rclsid, cImplemented, rgcatidImpl,
118 cRequired, rgcatidReq );
119 }
120
121 HRESULT CALLBACK IPrint_Print_Proxy(
122 IPrint *This,
123 DWORD grfFlags,
124 DVTARGETDEVICE **pptd,
125 PAGESET **ppPageSet,
126 STGMEDIUM *pstgmOptions,
127 IContinueCallback *pcallback,
128 LONG nFirstPage,
129 LONG *pcPagesPrinted,
130 LONG *pnLastPage )
131 {
132 TRACE("(%p)\n", This);
133 return IPrint_RemotePrint_Proxy( This, grfFlags, pptd, ppPageSet, (RemSTGMEDIUM *)pstgmOptions,
134 pcallback, nFirstPage, pcPagesPrinted, pnLastPage );
135 }
136
137 HRESULT __RPC_STUB IPrint_Print_Stub(
138 IPrint *This,
139 DWORD grfFlags,
140 DVTARGETDEVICE **pptd,
141 PAGESET **ppPageSet,
142 RemSTGMEDIUM *pstgmOptions,
143 IContinueCallback *pcallback,
144 LONG nFirstPage,
145 LONG *pcPagesPrinted,
146 LONG *pnLastPage )
147 {
148 TRACE("(%p)\n", This);
149 return IPrint_Print( This, grfFlags, pptd, ppPageSet, (STGMEDIUM *)pstgmOptions,
150 pcallback, nFirstPage, pcPagesPrinted, pnLastPage );
151 }
152
153 HRESULT CALLBACK IEnumOleDocumentViews_Next_Proxy(
154 IEnumOleDocumentViews *This,
155 ULONG cViews,
156 IOleDocumentView **rgpView,
157 ULONG *pcFetched )
158 {
159 TRACE("(%p)\n", This);
160 return IEnumOleDocumentViews_RemoteNext_Proxy( This, cViews, rgpView, pcFetched );
161 }
162
163 HRESULT __RPC_STUB IEnumOleDocumentViews_Next_Stub(
164 IEnumOleDocumentViews *This,
165 ULONG cViews,
166 IOleDocumentView **rgpView,
167 ULONG *pcFetched )
168 {
169 TRACE("(%p)\n", This);
170 return IEnumOleDocumentViews_Next( This, cViews, rgpView, pcFetched );
171 }
172
173 HRESULT CALLBACK IEnumShellItems_Next_Proxy(
174 IEnumShellItems *This,
175 ULONG celt,
176 IShellItem **rgelt,
177 ULONG *pceltFetched)
178 {
179 ULONG fetched;
180 TRACE("(%p)->(%d, %p, %p)\n", This, celt, rgelt, pceltFetched);
181 if (!pceltFetched) pceltFetched = &fetched;
182 return IEnumShellItems_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
183 }
184
185 HRESULT __RPC_STUB IEnumShellItems_Next_Stub(
186 IEnumShellItems *This,
187 ULONG celt,
188 IShellItem **rgelt,
189 ULONG *pceltFetched)
190 {
191 HRESULT hr;
192 TRACE("(%p)->(%d, %p, %p)\n", This, celt, rgelt, pceltFetched);
193 *pceltFetched = 0;
194 hr = IEnumShellItems_Next(This, celt, rgelt, pceltFetched);
195 if (hr == S_OK) *pceltFetched = celt;
196 return hr;
197 }
198
199 HRESULT CALLBACK IModalWindow_Show_Proxy(
200 IModalWindow *This,
201 HWND hwndOwner)
202 {
203 TRACE("(%p)->(%p)\n", This, hwndOwner);
204 return IModalWindow_RemoteShow_Proxy(This, hwndOwner);
205 }
206
207 HRESULT __RPC_STUB IModalWindow_Show_Stub(
208 IModalWindow *This,
209 HWND hwndOwner)
210 {
211 TRACE("(%p)->(%p)\n", This, hwndOwner);
212 return IModalWindow_Show(This, hwndOwner);
213 }