comctl32/listview: Free ID array when removing all items.
[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     ULONG prop_set, prop, total_props = 0;
233     HRESULT hr;
234     IErrorInfo *error;
235     DBPROPSTATUS *status;
236
237     TRACE("(%p, %d, %p, %p, %s, %p)\n", This, cPropertySets, rgPropertySets, pUnkOuter,
238           debugstr_guid(riid), ppDBSession);
239
240     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
241         total_props += rgPropertySets[prop_set].cProperties;
242
243     if(total_props == 0) return S_OK;
244
245     status = CoTaskMemAlloc(total_props * sizeof(*status));
246     if(!status) return E_OUTOFMEMORY;
247
248     hr = IDBDataSourceAdmin_RemoteCreateDataSource_Proxy(This, cPropertySets, rgPropertySets, pUnkOuter,
249                                                          riid, ppDBSession, total_props, status, &error);
250     if(error)
251     {
252         SetErrorInfo(0, error);
253         IErrorInfo_Release(error);
254     }
255
256     total_props = 0;
257     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
258         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
259             rgPropertySets[prop_set].rgProperties[prop].dwStatus = status[total_props++];
260
261     CoTaskMemFree(status);
262     return hr;
263 }
264
265 HRESULT __RPC_STUB IDBDataSourceAdmin_CreateDataSource_Stub(IDBDataSourceAdmin* This, ULONG cPropertySets,
266                                                             DBPROPSET *rgPropertySets, IUnknown *pUnkOuter,
267                                                             REFIID riid, IUnknown **ppDBSession, ULONG cTotalProps,
268                                                             DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
269 {
270     ULONG prop_set, prop, total_props = 0;
271     HRESULT hr;
272
273     TRACE("(%p, %d, %p, %p, %s, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, pUnkOuter,
274           debugstr_guid(riid), ppDBSession, cTotalProps, rgPropStatus, ppErrorInfoRem);
275
276     *ppErrorInfoRem = NULL;
277     hr = IDBDataSourceAdmin_CreateDataSource(This, cPropertySets, rgPropertySets, pUnkOuter, riid, ppDBSession);
278     if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
279
280     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
281         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
282             rgPropStatus[total_props++] = rgPropertySets[prop_set].rgProperties[prop].dwStatus;
283
284     return hr;
285 }
286
287 HRESULT CALLBACK IDBDataSourceAdmin_DestroyDataSource_Proxy(IDBDataSourceAdmin* This)
288 {
289     FIXME("(%p): stub\n", This);
290     return E_NOTIMPL;
291 }
292
293 HRESULT __RPC_STUB IDBDataSourceAdmin_DestroyDataSource_Stub(IDBDataSourceAdmin* This, IErrorInfo **ppErrorInfoRem)
294 {
295     FIXME("(%p, %p): stub\n", This, ppErrorInfoRem);
296     return E_NOTIMPL;
297 }
298
299 HRESULT CALLBACK IDBDataSourceAdmin_GetCreationProperties_Proxy(IDBDataSourceAdmin* This, ULONG cPropertyIDSets,
300                                                                 const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertyInfoSets,
301                                                                 DBPROPINFOSET **prgPropertyInfoSets, OLECHAR **ppDescBuffer)
302 {
303     FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
304           prgPropertyInfoSets, ppDescBuffer);
305     return E_NOTIMPL;
306 }
307
308 HRESULT __RPC_STUB IDBDataSourceAdmin_GetCreationProperties_Stub(IDBDataSourceAdmin* This, ULONG cPropertyIDSets,
309                                                                  const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertyInfoSets,
310                                                                  DBPROPINFOSET **prgPropertyInfoSets, DBCOUNTITEM *pcOffsets,
311                                                                  DBBYTEOFFSET **prgDescOffsets, ULONG *pcbDescBuffer,
312                                                                  OLECHAR **ppDescBuffer, IErrorInfo **ppErrorInfoRem)
313 {
314     FIXME("(%p, %d, %p, %p, %p, %p, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
315           prgPropertyInfoSets, pcOffsets, prgDescOffsets, pcbDescBuffer, ppDescBuffer, ppErrorInfoRem);
316     return E_NOTIMPL;
317 }
318
319 HRESULT CALLBACK IDBDataSourceAdmin_ModifyDataSource_Proxy(IDBDataSourceAdmin* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
320 {
321     FIXME("(%p, %d, %p): stub\n", This, cPropertySets, rgPropertySets);
322     return E_NOTIMPL;
323 }
324
325 HRESULT __RPC_STUB IDBDataSourceAdmin_ModifyDataSource_Stub(IDBDataSourceAdmin* This, ULONG cPropertySets,
326                                                             DBPROPSET *rgPropertySets, IErrorInfo **ppErrorInfoRem)
327 {
328     FIXME("(%p, %d, %p, %p): stub\n", This, cPropertySets, rgPropertySets, ppErrorInfoRem);
329     return E_NOTIMPL;
330 }
331
332 HRESULT CALLBACK ISessionProperties_GetProperties_Proxy(ISessionProperties* This, ULONG cPropertyIDSets,
333                                                         const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertySets,
334                                                         DBPROPSET **prgPropertySets)
335 {
336     FIXME("(%p, %d, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
337           pcPropertySets, prgPropertySets);
338     return E_NOTIMPL;
339 }
340
341 HRESULT __RPC_STUB ISessionProperties_GetProperties_Stub(ISessionProperties* This, ULONG cPropertyIDSets,
342                                                          const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertySets,
343                                                          DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
344 {
345     FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
346           pcPropertySets, prgPropertySets, ppErrorInfoRem);
347     return E_NOTIMPL;
348 }
349
350 HRESULT CALLBACK ISessionProperties_SetProperties_Proxy(ISessionProperties* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
351 {
352     ULONG prop_set, prop, total_props = 0;
353     HRESULT hr;
354     IErrorInfo *error;
355     DBPROPSTATUS *status;
356
357     TRACE("(%p, %d, %p)\n", This, cPropertySets, rgPropertySets);
358
359     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
360         total_props += rgPropertySets[prop_set].cProperties;
361
362     if(total_props == 0) return S_OK;
363
364     status = CoTaskMemAlloc(total_props * sizeof(*status));
365     if(!status) return E_OUTOFMEMORY;
366
367     hr = ISessionProperties_RemoteSetProperties_Proxy(This, cPropertySets, rgPropertySets,
368                                                       total_props, status, &error);
369     if(error)
370     {
371         SetErrorInfo(0, error);
372         IErrorInfo_Release(error);
373     }
374
375     total_props = 0;
376     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
377         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
378             rgPropertySets[prop_set].rgProperties[prop].dwStatus = status[total_props++];
379
380     CoTaskMemFree(status);
381     return hr;
382 }
383
384 HRESULT __RPC_STUB ISessionProperties_SetProperties_Stub(ISessionProperties* This, ULONG cPropertySets, DBPROPSET *rgPropertySets,
385                                                          ULONG cTotalProps, DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
386 {
387     ULONG prop_set, prop, total_props = 0;
388     HRESULT hr;
389
390     TRACE("(%p, %d, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, cTotalProps,
391           rgPropStatus, ppErrorInfoRem);
392
393     *ppErrorInfoRem = NULL;
394     hr = ISessionProperties_SetProperties(This, cPropertySets, rgPropertySets);
395     if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
396
397     for(prop_set = 0; prop_set < cPropertySets; prop_set++)
398         for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
399             rgPropStatus[total_props++] = rgPropertySets[prop_set].rgProperties[prop].dwStatus;
400
401     return hr;
402 }
403
404 HRESULT CALLBACK IOpenRowset_OpenRowset_Proxy(IOpenRowset* This, IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID,
405                                               REFIID riid, ULONG cPropertySets, DBPROPSET rgPropertySets[], IUnknown **ppRowset)
406 {
407     FIXME("(%p, %p, %p, %p, %s, %d, %p, %p): stub\n", This, pUnkOuter, pTableID, pIndexID, debugstr_guid(riid),
408           cPropertySets, rgPropertySets, ppRowset);
409     return E_NOTIMPL;
410 }
411
412 HRESULT __RPC_STUB IOpenRowset_OpenRowset_Stub(IOpenRowset* This, IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID,
413                                                REFIID riid, ULONG cPropertySets, DBPROPSET *rgPropertySets,
414                                                IUnknown **ppRowset, ULONG cTotalProps, DBPROPSTATUS *rgPropStatus,
415                                                IErrorInfo **ppErrorInfoRem)
416 {
417     FIXME("(%p, %p, %p, %p, %s, %d, %p, %p, %d, %p, %p): stub\n", This, pUnkOuter, pTableID, pIndexID, debugstr_guid(riid),
418           cPropertySets, rgPropertySets, ppRowset, cTotalProps, rgPropStatus, ppErrorInfoRem);
419     return E_NOTIMPL;
420 }
421
422 HRESULT CALLBACK IBindResource_Bind_Proxy(IBindResource* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
423                                           REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession,
424                                           DBBINDURLSTATUS *pdwBindStatus, IUnknown **ppUnk)
425 {
426     HRESULT hr;
427
428     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
429           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppUnk);
430
431     hr = IBindResource_RemoteBind_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
432                                         pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
433                                         pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppUnk);
434     return hr;
435 }
436
437 HRESULT __RPC_STUB IBindResource_Bind_Stub(IBindResource* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
438                                            REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
439                                            IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus, IUnknown **ppUnk)
440 {
441     HRESULT hr;
442     DBIMPLICITSESSION impl_session;
443
444     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
445           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppUnk);
446
447     impl_session.pUnkOuter = pSessionUnkOuter;
448     impl_session.piid = piid;
449     impl_session.pSession = NULL;
450
451     hr = IBindResource_Bind(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
452                             ppSession ? &impl_session : NULL, pdwBindStatus, ppUnk);
453
454     if(ppSession) *ppSession = impl_session.pSession;
455     return hr;
456 }
457
458 HRESULT CALLBACK ICreateRow_CreateRow_Proxy(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
459                                             REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession,
460                                             DBBINDURLSTATUS *pdwBindStatus, LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
461 {
462     HRESULT hr;
463
464     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
465           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppwszNewURL, ppUnk);
466
467     hr = ICreateRow_RemoteCreateRow_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
468                                           pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
469                                           pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppwszNewURL, ppUnk);
470     return hr;
471 }
472
473 HRESULT __RPC_STUB ICreateRow_CreateRow_Stub(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
474                                              REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
475                                              IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus,
476                                              LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
477 {
478     HRESULT hr;
479     DBIMPLICITSESSION impl_session;
480
481     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
482           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppwszNewURL,
483           ppUnk);
484
485     impl_session.pUnkOuter = pSessionUnkOuter;
486     impl_session.piid = piid;
487     impl_session.pSession = NULL;
488
489     hr = ICreateRow_CreateRow(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
490                               ppSession ? &impl_session : NULL, pdwBindStatus, ppwszNewURL, ppUnk);
491
492     if(ppSession) *ppSession = impl_session.pSession;
493     return hr;
494 }