ole32: Fix build on Power PC.
[wine] / dlls / msdaps / usrmarshal.c
1 /*
2  *    Misc marshaling routinues
3  *
4  * Copyright 2009 Huw Davies
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 #include <stdarg.h>
21 #include <string.h>
22
23 #define COBJMACROS
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
26
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "winerror.h"
32 #include "objbase.h"
33 #include "oleauto.h"
34 #include "oledb.h"
35
36 #include "wine/debug.h"
37
38 WINE_DEFAULT_DEBUG_CHANNEL(oledb);
39
40 HRESULT CALLBACK IDBCreateCommand_CreateCommand_Proxy(IDBCreateCommand* This, IUnknown *pUnkOuter,
41                                                       REFIID riid, IUnknown **ppCommand)
42 {
43     HRESULT hr;
44     IErrorInfo *error;
45
46     TRACE("(%p, %p, %s, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppCommand);
47     hr = IDBCreateCommand_RemoteCreateCommand_Proxy(This, pUnkOuter, riid, ppCommand, &error);
48     if(error)
49     {
50         SetErrorInfo(0, error);
51         IErrorInfo_Release(error);
52     }
53     return hr;
54 }
55
56 HRESULT __RPC_STUB IDBCreateCommand_CreateCommand_Stub(IDBCreateCommand* This, IUnknown *pUnkOuter,
57                                                        REFIID riid, IUnknown **ppCommand, IErrorInfo **ppErrorInfoRem)
58 {
59     HRESULT hr;
60
61     TRACE("(%p, %p, %s, %p, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppCommand, ppErrorInfoRem);
62
63     *ppErrorInfoRem = NULL;
64     hr = IDBCreateCommand_CreateCommand(This, pUnkOuter, riid, ppCommand);
65     if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
66
67     return hr;
68 }
69
70 HRESULT CALLBACK IDBCreateSession_CreateSession_Proxy(IDBCreateSession* This, IUnknown *pUnkOuter,
71                                                       REFIID riid, IUnknown **ppDBSession)
72 {
73     HRESULT hr;
74     IErrorInfo *error;
75
76     TRACE("(%p, %p, %s, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppDBSession);
77     hr = IDBCreateSession_RemoteCreateSession_Proxy(This, pUnkOuter, riid, ppDBSession, &error);
78     if(error)
79     {
80         SetErrorInfo(0, error);
81         IErrorInfo_Release(error);
82     }
83     return hr;
84 }
85
86 HRESULT __RPC_STUB IDBCreateSession_CreateSession_Stub(IDBCreateSession* This, IUnknown *pUnkOuter,
87                                                        REFIID riid, IUnknown **ppDBSession, IErrorInfo **ppErrorInfoRem)
88 {
89     HRESULT hr;
90     TRACE("(%p, %p, %s, %p, %p)\n", This, pUnkOuter, debugstr_guid(riid),
91           ppDBSession, ppErrorInfoRem);
92
93     *ppErrorInfoRem = NULL;
94     hr = IDBCreateSession_CreateSession(This, pUnkOuter, riid, ppDBSession);
95     if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
96
97     return hr;
98 }
99
100 HRESULT CALLBACK IDBProperties_GetProperties_Proxy(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
101                                                    ULONG *pcPropertySets, DBPROPSET **prgPropertySets)
102 {
103     FIXME("(%p, %d, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets,
104           prgPropertySets);
105     return E_NOTIMPL;
106 }
107
108 HRESULT __RPC_STUB IDBProperties_GetProperties_Stub(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET *rgPropertyIDSets,
109                                                     ULONG *pcPropertySets, DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
110 {
111     FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets,
112           prgPropertySets, ppErrorInfoRem);
113     return E_NOTIMPL;
114 }
115
116 HRESULT CALLBACK IDBProperties_GetPropertyInfo_Proxy(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
117                                                      ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets,
118                                                      OLECHAR **ppDescBuffer)
119 {
120     FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
121           prgPropertyInfoSets, ppDescBuffer);
122     return E_NOTIMPL;
123 }
124
125 HRESULT __RPC_STUB IDBProperties_GetPropertyInfo_Stub(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET *rgPropertyIDSets,
126                                                       ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets,
127                                                       ULONG *pcOffsets, DBBYTEOFFSET **prgDescOffsets, ULONG *pcbDescBuffer,
128                                                       OLECHAR **ppDescBuffer, IErrorInfo **ppErrorInfoRem)
129 {
130     FIXME("(%p, %d, %p, %p, %p, %p, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
131           prgPropertyInfoSets, pcOffsets, prgDescOffsets, pcbDescBuffer, ppDescBuffer, ppErrorInfoRem);
132     return E_NOTIMPL;
133 }
134
135 HRESULT CALLBACK IDBProperties_SetProperties_Proxy(IDBProperties* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
136 {
137     ULONG prop_set, prop, total_props = 0;
138     HRESULT hr;
139     IErrorInfo *error;
140     DBPROPSTATUS *status;
141
142     TRACE("(%p, %d, %p)\n", This, cPropertySets, rgPropertySets);
143
144     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
145         total_props += rgPropertySets[prop_set].cProperties;
146
147     if(total_props == 0) return S_OK;
148
149     status = CoTaskMemAlloc(total_props * sizeof(*status));
150     if(!status) return E_OUTOFMEMORY;
151
152     hr = IDBProperties_RemoteSetProperties_Proxy(This, cPropertySets, rgPropertySets,
153                                                  total_props, status, &error);
154     if(error)
155     {
156         SetErrorInfo(0, error);
157         IErrorInfo_Release(error);
158     }
159
160     total_props = 0;
161     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
162         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
163             rgPropertySets[prop_set].rgProperties[prop].dwStatus = status[total_props++];
164
165     CoTaskMemFree(status);
166     return hr;
167 }
168
169 HRESULT __RPC_STUB IDBProperties_SetProperties_Stub(IDBProperties* This, ULONG cPropertySets, DBPROPSET *rgPropertySets,
170                                                     ULONG cTotalProps, DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
171 {
172     ULONG prop_set, prop, total_props = 0;
173     HRESULT hr;
174
175     TRACE("(%p, %d, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, cTotalProps,
176           rgPropStatus, ppErrorInfoRem);
177
178     *ppErrorInfoRem = NULL;
179     hr = IDBProperties_SetProperties(This, cPropertySets, rgPropertySets);
180     if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
181
182     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
183         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
184             rgPropStatus[total_props++] = rgPropertySets[prop_set].rgProperties[prop].dwStatus;
185
186     return hr;
187 }
188
189 HRESULT CALLBACK IDBInitialize_Initialize_Proxy(IDBInitialize* This)
190 {
191     HRESULT hr;
192     IErrorInfo *error;
193
194     TRACE("(%p)\n", This);
195     hr = IDBInitialize_RemoteInitialize_Proxy(This, &error);
196     if(error)
197     {
198         SetErrorInfo(0, error);
199         IErrorInfo_Release(error);
200     }
201     return hr;
202 }
203
204 HRESULT __RPC_STUB IDBInitialize_Initialize_Stub(IDBInitialize* This, IErrorInfo **ppErrorInfoRem)
205 {
206     HRESULT hr;
207     TRACE("(%p, %p)\n", This, ppErrorInfoRem);
208
209     *ppErrorInfoRem = NULL;
210     hr = IDBInitialize_Initialize(This);
211     if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
212
213     return hr;
214 }
215
216 HRESULT CALLBACK IDBInitialize_Uninitialize_Proxy(IDBInitialize* This)
217 {
218     FIXME("(%p): stub\n", This);
219     return E_NOTIMPL;
220 }
221
222 HRESULT __RPC_STUB IDBInitialize_Uninitialize_Stub(IDBInitialize* This, IErrorInfo **ppErrorInfoRem)
223 {
224     FIXME("(%p, %p): stub\n", This, ppErrorInfoRem);
225     return E_NOTIMPL;
226 }
227
228 HRESULT CALLBACK IDBDataSourceAdmin_CreateDataSource_Proxy(IDBDataSourceAdmin* This, ULONG cPropertySets,
229                                                            DBPROPSET rgPropertySets[], IUnknown *pUnkOuter,
230                                                            REFIID riid, IUnknown **ppDBSession)
231 {
232     FIXME("(%p, %d, %p, %p, %s, %p): stub\n", This, cPropertySets, rgPropertySets, pUnkOuter,
233           debugstr_guid(riid), ppDBSession);
234     return E_NOTIMPL;
235 }
236
237 HRESULT __RPC_STUB IDBDataSourceAdmin_CreateDataSource_Stub(IDBDataSourceAdmin* This, ULONG cPropertySets,
238                                                             DBPROPSET *rgPropertySets, IUnknown *pUnkOuter,
239                                                             REFIID riid, IUnknown **ppDBSession, ULONG cTotalProps,
240                                                             DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
241 {
242     FIXME("(%p, %d, %p, %p, %s, %p, %d, %p, %p): stub\n", This, cPropertySets, rgPropertySets, pUnkOuter,
243           debugstr_guid(riid), ppDBSession, cTotalProps, rgPropStatus, ppErrorInfoRem);
244     return E_NOTIMPL;
245 }
246
247 HRESULT CALLBACK IDBDataSourceAdmin_DestroyDataSource_Proxy(IDBDataSourceAdmin* This)
248 {
249     FIXME("(%p): stub\n", This);
250     return E_NOTIMPL;
251 }
252
253 HRESULT __RPC_STUB IDBDataSourceAdmin_DestroyDataSource_Stub(IDBDataSourceAdmin* This, IErrorInfo **ppErrorInfoRem)
254 {
255     FIXME("(%p, %p): stub\n", This, ppErrorInfoRem);
256     return E_NOTIMPL;
257 }
258
259 HRESULT CALLBACK IDBDataSourceAdmin_GetCreationProperties_Proxy(IDBDataSourceAdmin* This, ULONG cPropertyIDSets,
260                                                                 const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertyInfoSets,
261                                                                 DBPROPINFOSET **prgPropertyInfoSets, OLECHAR **ppDescBuffer)
262 {
263     FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
264           prgPropertyInfoSets, ppDescBuffer);
265     return E_NOTIMPL;
266 }
267
268 HRESULT __RPC_STUB IDBDataSourceAdmin_GetCreationProperties_Stub(IDBDataSourceAdmin* This, ULONG cPropertyIDSets,
269                                                                  const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertyInfoSets,
270                                                                  DBPROPINFOSET **prgPropertyInfoSets, DBCOUNTITEM *pcOffsets,
271                                                                  DBBYTEOFFSET **prgDescOffsets, ULONG *pcbDescBuffer,
272                                                                  OLECHAR **ppDescBuffer, IErrorInfo **ppErrorInfoRem)
273 {
274     FIXME("(%p, %d, %p, %p, %p, %p, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
275           prgPropertyInfoSets, pcOffsets, prgDescOffsets, pcbDescBuffer, ppDescBuffer, ppErrorInfoRem);
276     return E_NOTIMPL;
277 }
278
279 HRESULT CALLBACK IDBDataSourceAdmin_ModifyDataSource_Proxy(IDBDataSourceAdmin* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
280 {
281     FIXME("(%p, %d, %p): stub\n", This, cPropertySets, rgPropertySets);
282     return E_NOTIMPL;
283 }
284
285 HRESULT __RPC_STUB IDBDataSourceAdmin_ModifyDataSource_Stub(IDBDataSourceAdmin* This, ULONG cPropertySets,
286                                                             DBPROPSET *rgPropertySets, IErrorInfo **ppErrorInfoRem)
287 {
288     FIXME("(%p, %d, %p, %p): stub\n", This, cPropertySets, rgPropertySets, ppErrorInfoRem);
289     return E_NOTIMPL;
290 }
291
292 HRESULT CALLBACK ISessionProperties_GetProperties_Proxy(ISessionProperties* This, ULONG cPropertyIDSets,
293                                                         const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertySets,
294                                                         DBPROPSET **prgPropertySets)
295 {
296     FIXME("(%p, %d, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
297           pcPropertySets, prgPropertySets);
298     return E_NOTIMPL;
299 }
300
301 HRESULT __RPC_STUB ISessionProperties_GetProperties_Stub(ISessionProperties* This, ULONG cPropertyIDSets,
302                                                          const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertySets,
303                                                          DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
304 {
305     FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
306           pcPropertySets, prgPropertySets, ppErrorInfoRem);
307     return E_NOTIMPL;
308 }
309
310 HRESULT CALLBACK ISessionProperties_SetProperties_Proxy(ISessionProperties* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
311 {
312     ULONG prop_set, prop, total_props = 0;
313     HRESULT hr;
314     IErrorInfo *error;
315     DBPROPSTATUS *status;
316
317     TRACE("(%p, %d, %p)\n", This, cPropertySets, rgPropertySets);
318
319     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
320         total_props += rgPropertySets[prop_set].cProperties;
321
322     if(total_props == 0) return S_OK;
323
324     status = CoTaskMemAlloc(total_props * sizeof(*status));
325     if(!status) return E_OUTOFMEMORY;
326
327     hr = ISessionProperties_RemoteSetProperties_Proxy(This, cPropertySets, rgPropertySets,
328                                                       total_props, status, &error);
329     if(error)
330     {
331         SetErrorInfo(0, error);
332         IErrorInfo_Release(error);
333     }
334
335     total_props = 0;
336     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
337         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
338             rgPropertySets[prop_set].rgProperties[prop].dwStatus = status[total_props++];
339
340     CoTaskMemFree(status);
341     return hr;
342 }
343
344 HRESULT __RPC_STUB ISessionProperties_SetProperties_Stub(ISessionProperties* This, ULONG cPropertySets, DBPROPSET *rgPropertySets,
345                                                          ULONG cTotalProps, DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
346 {
347     ULONG prop_set, prop, total_props = 0;
348     HRESULT hr;
349
350     TRACE("(%p, %d, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, cTotalProps,
351           rgPropStatus, ppErrorInfoRem);
352
353     *ppErrorInfoRem = NULL;
354     hr = ISessionProperties_SetProperties(This, cPropertySets, rgPropertySets);
355     if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
356
357     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
358         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
359             rgPropStatus[total_props++] = rgPropertySets[prop_set].rgProperties[prop].dwStatus;
360
361     return hr;
362 }
363
364 HRESULT CALLBACK IOpenRowset_OpenRowset_Proxy(IOpenRowset* This, IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID,
365                                               REFIID riid, ULONG cPropertySets, DBPROPSET rgPropertySets[], IUnknown **ppRowset)
366 {
367     FIXME("(%p, %p, %p, %p, %s, %d, %p, %p): stub\n", This, pUnkOuter, pTableID, pIndexID, debugstr_guid(riid),
368           cPropertySets, rgPropertySets, ppRowset);
369     return E_NOTIMPL;
370 }
371
372 HRESULT __RPC_STUB IOpenRowset_OpenRowset_Stub(IOpenRowset* This, IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID,
373                                                REFIID riid, ULONG cPropertySets, DBPROPSET *rgPropertySets,
374                                                IUnknown **ppRowset, ULONG cTotalProps, DBPROPSTATUS *rgPropStatus,
375                                                IErrorInfo **ppErrorInfoRem)
376 {
377     FIXME("(%p, %p, %p, %p, %s, %d, %p, %p, %d, %p, %p): stub\n", This, pUnkOuter, pTableID, pIndexID, debugstr_guid(riid),
378           cPropertySets, rgPropertySets, ppRowset, cTotalProps, rgPropStatus, ppErrorInfoRem);
379     return E_NOTIMPL;
380 }
381
382 HRESULT CALLBACK IBindResource_Bind_Proxy(IBindResource* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
383                                           REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession,
384                                           DBBINDURLSTATUS *pdwBindStatus, IUnknown **ppUnk)
385 {
386     HRESULT hr;
387
388     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
389           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppUnk);
390
391     hr = IBindResource_RemoteBind_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
392                                         pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
393                                         pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppUnk);
394     return hr;
395 }
396
397 HRESULT __RPC_STUB IBindResource_Bind_Stub(IBindResource* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
398                                            REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
399                                            IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus, IUnknown **ppUnk)
400 {
401     HRESULT hr;
402     DBIMPLICITSESSION impl_session;
403
404     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
405           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppUnk);
406
407     impl_session.pUnkOuter = pSessionUnkOuter;
408     impl_session.piid = piid;
409     impl_session.pSession = NULL;
410
411     hr = IBindResource_Bind(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
412                             ppSession ? &impl_session : NULL, pdwBindStatus, ppUnk);
413
414     if(ppSession) *ppSession = impl_session.pSession;
415     return hr;
416 }
417
418 HRESULT CALLBACK ICreateRow_CreateRow_Proxy(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
419                                             REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession,
420                                             DBBINDURLSTATUS *pdwBindStatus, LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
421 {
422     HRESULT hr;
423
424     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
425           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppwszNewURL, ppUnk);
426
427     hr = ICreateRow_RemoteCreateRow_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
428                                           pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
429                                           pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppwszNewURL, ppUnk);
430     return hr;
431 }
432
433 HRESULT __RPC_STUB ICreateRow_CreateRow_Stub(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
434                                              REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
435                                              IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus,
436                                              LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
437 {
438     HRESULT hr;
439     DBIMPLICITSESSION impl_session;
440
441     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
442           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppwszNewURL,
443           ppUnk);
444
445     impl_session.pUnkOuter = pSessionUnkOuter;
446     impl_session.piid = piid;
447     impl_session.pSession = NULL;
448
449     hr = ICreateRow_CreateRow(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
450                               ppSession ? &impl_session : NULL, pdwBindStatus, ppwszNewURL, ppUnk);
451
452     if(ppSession) *ppSession = impl_session.pSession;
453     return hr;
454 }