2 * Misc marshaling routinues
4 * Copyright 2009 Huw Davies
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.
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.
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
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(oledb);
40 HRESULT CALLBACK IDBCreateCommand_CreateCommand_Proxy(IDBCreateCommand* This, IUnknown *pUnkOuter,
41 REFIID riid, IUnknown **ppCommand)
46 TRACE("(%p, %p, %s, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppCommand);
47 hr = IDBCreateCommand_RemoteCreateCommand_Proxy(This, pUnkOuter, riid, ppCommand, &error);
50 SetErrorInfo(0, error);
51 IErrorInfo_Release(error);
56 HRESULT __RPC_STUB IDBCreateCommand_CreateCommand_Stub(IDBCreateCommand* This, IUnknown *pUnkOuter,
57 REFIID riid, IUnknown **ppCommand, IErrorInfo **ppErrorInfoRem)
61 TRACE("(%p, %p, %s, %p, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppCommand, ppErrorInfoRem);
63 *ppErrorInfoRem = NULL;
64 hr = IDBCreateCommand_CreateCommand(This, pUnkOuter, riid, ppCommand);
65 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
70 HRESULT CALLBACK IDBCreateSession_CreateSession_Proxy(IDBCreateSession* This, IUnknown *pUnkOuter,
71 REFIID riid, IUnknown **ppDBSession)
76 TRACE("(%p, %p, %s, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppDBSession);
77 hr = IDBCreateSession_RemoteCreateSession_Proxy(This, pUnkOuter, riid, ppDBSession, &error);
80 SetErrorInfo(0, error);
81 IErrorInfo_Release(error);
86 HRESULT __RPC_STUB IDBCreateSession_CreateSession_Stub(IDBCreateSession* This, IUnknown *pUnkOuter,
87 REFIID riid, IUnknown **ppDBSession, IErrorInfo **ppErrorInfoRem)
90 TRACE("(%p, %p, %s, %p, %p)\n", This, pUnkOuter, debugstr_guid(riid),
91 ppDBSession, ppErrorInfoRem);
93 *ppErrorInfoRem = NULL;
94 hr = IDBCreateSession_CreateSession(This, pUnkOuter, riid, ppDBSession);
95 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
100 HRESULT CALLBACK IDBProperties_GetProperties_Proxy(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
101 ULONG *pcPropertySets, DBPROPSET **prgPropertySets)
103 FIXME("(%p, %d, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets,
108 HRESULT __RPC_STUB IDBProperties_GetProperties_Stub(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET *rgPropertyIDSets,
109 ULONG *pcPropertySets, DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
111 FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets,
112 prgPropertySets, ppErrorInfoRem);
116 HRESULT CALLBACK IDBProperties_GetPropertyInfo_Proxy(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
117 ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets,
118 OLECHAR **ppDescBuffer)
120 FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
121 prgPropertyInfoSets, ppDescBuffer);
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)
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);
135 HRESULT CALLBACK IDBProperties_SetProperties_Proxy(IDBProperties* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
137 ULONG prop_set, prop, total_props = 0;
140 DBPROPSTATUS *status;
142 TRACE("(%p, %d, %p)\n", This, cPropertySets, rgPropertySets);
144 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
145 total_props += rgPropertySets[prop_set].cProperties;
147 if(total_props == 0) return S_OK;
149 status = CoTaskMemAlloc(total_props * sizeof(*status));
150 if(!status) return E_OUTOFMEMORY;
152 hr = IDBProperties_RemoteSetProperties_Proxy(This, cPropertySets, rgPropertySets,
153 total_props, status, &error);
156 SetErrorInfo(0, error);
157 IErrorInfo_Release(error);
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++];
165 CoTaskMemFree(status);
169 HRESULT __RPC_STUB IDBProperties_SetProperties_Stub(IDBProperties* This, ULONG cPropertySets, DBPROPSET *rgPropertySets,
170 ULONG cTotalProps, DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
172 ULONG prop_set, prop, total_props = 0;
175 TRACE("(%p, %d, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, cTotalProps,
176 rgPropStatus, ppErrorInfoRem);
178 *ppErrorInfoRem = NULL;
179 hr = IDBProperties_SetProperties(This, cPropertySets, rgPropertySets);
180 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
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;
189 HRESULT CALLBACK IDBInitialize_Initialize_Proxy(IDBInitialize* This)
194 TRACE("(%p)\n", This);
195 hr = IDBInitialize_RemoteInitialize_Proxy(This, &error);
198 SetErrorInfo(0, error);
199 IErrorInfo_Release(error);
204 HRESULT __RPC_STUB IDBInitialize_Initialize_Stub(IDBInitialize* This, IErrorInfo **ppErrorInfoRem)
207 TRACE("(%p, %p)\n", This, ppErrorInfoRem);
209 *ppErrorInfoRem = NULL;
210 hr = IDBInitialize_Initialize(This);
211 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
216 HRESULT CALLBACK IDBInitialize_Uninitialize_Proxy(IDBInitialize* This)
218 FIXME("(%p): stub\n", This);
222 HRESULT __RPC_STUB IDBInitialize_Uninitialize_Stub(IDBInitialize* This, IErrorInfo **ppErrorInfoRem)
224 FIXME("(%p, %p): stub\n", This, ppErrorInfoRem);
228 HRESULT CALLBACK IDBDataSourceAdmin_CreateDataSource_Proxy(IDBDataSourceAdmin* This, ULONG cPropertySets,
229 DBPROPSET rgPropertySets[], IUnknown *pUnkOuter,
230 REFIID riid, IUnknown **ppDBSession)
232 FIXME("(%p, %d, %p, %p, %s, %p): stub\n", This, cPropertySets, rgPropertySets, pUnkOuter,
233 debugstr_guid(riid), ppDBSession);
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)
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);
247 HRESULT CALLBACK IDBDataSourceAdmin_DestroyDataSource_Proxy(IDBDataSourceAdmin* This)
249 FIXME("(%p): stub\n", This);
253 HRESULT __RPC_STUB IDBDataSourceAdmin_DestroyDataSource_Stub(IDBDataSourceAdmin* This, IErrorInfo **ppErrorInfoRem)
255 FIXME("(%p, %p): stub\n", This, ppErrorInfoRem);
259 HRESULT CALLBACK IDBDataSourceAdmin_GetCreationProperties_Proxy(IDBDataSourceAdmin* This, ULONG cPropertyIDSets,
260 const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertyInfoSets,
261 DBPROPINFOSET **prgPropertyInfoSets, OLECHAR **ppDescBuffer)
263 FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
264 prgPropertyInfoSets, ppDescBuffer);
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)
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);
279 HRESULT CALLBACK IDBDataSourceAdmin_ModifyDataSource_Proxy(IDBDataSourceAdmin* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
281 FIXME("(%p, %d, %p): stub\n", This, cPropertySets, rgPropertySets);
285 HRESULT __RPC_STUB IDBDataSourceAdmin_ModifyDataSource_Stub(IDBDataSourceAdmin* This, ULONG cPropertySets,
286 DBPROPSET *rgPropertySets, IErrorInfo **ppErrorInfoRem)
288 FIXME("(%p, %d, %p, %p): stub\n", This, cPropertySets, rgPropertySets, ppErrorInfoRem);
292 HRESULT CALLBACK ISessionProperties_GetProperties_Proxy(ISessionProperties* This, ULONG cPropertyIDSets,
293 const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertySets,
294 DBPROPSET **prgPropertySets)
296 FIXME("(%p, %d, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
297 pcPropertySets, prgPropertySets);
301 HRESULT __RPC_STUB ISessionProperties_GetProperties_Stub(ISessionProperties* This, ULONG cPropertyIDSets,
302 const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertySets,
303 DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
305 FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
306 pcPropertySets, prgPropertySets, ppErrorInfoRem);
310 HRESULT CALLBACK ISessionProperties_SetProperties_Proxy(ISessionProperties* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
312 ULONG prop_set, prop, total_props = 0;
315 DBPROPSTATUS *status;
317 TRACE("(%p, %d, %p)\n", This, cPropertySets, rgPropertySets);
319 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
320 total_props += rgPropertySets[prop_set].cProperties;
322 if(total_props == 0) return S_OK;
324 status = CoTaskMemAlloc(total_props * sizeof(*status));
325 if(!status) return E_OUTOFMEMORY;
327 hr = ISessionProperties_RemoteSetProperties_Proxy(This, cPropertySets, rgPropertySets,
328 total_props, status, &error);
331 SetErrorInfo(0, error);
332 IErrorInfo_Release(error);
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++];
340 CoTaskMemFree(status);
344 HRESULT __RPC_STUB ISessionProperties_SetProperties_Stub(ISessionProperties* This, ULONG cPropertySets, DBPROPSET *rgPropertySets,
345 ULONG cTotalProps, DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
347 ULONG prop_set, prop, total_props = 0;
350 TRACE("(%p, %d, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, cTotalProps,
351 rgPropStatus, ppErrorInfoRem);
353 *ppErrorInfoRem = NULL;
354 hr = ISessionProperties_SetProperties(This, cPropertySets, rgPropertySets);
355 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
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;
364 HRESULT CALLBACK IOpenRowset_OpenRowset_Proxy(IOpenRowset* This, IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID,
365 REFIID riid, ULONG cPropertySets, DBPROPSET rgPropertySets[], IUnknown **ppRowset)
367 FIXME("(%p, %p, %p, %p, %s, %d, %p, %p): stub\n", This, pUnkOuter, pTableID, pIndexID, debugstr_guid(riid),
368 cPropertySets, rgPropertySets, ppRowset);
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)
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);
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)
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);
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);
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)
402 DBIMPLICITSESSION impl_session;
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);
407 impl_session.pUnkOuter = pSessionUnkOuter;
408 impl_session.piid = piid;
409 impl_session.pSession = NULL;
411 hr = IBindResource_Bind(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
412 ppSession ? &impl_session : NULL, pdwBindStatus, ppUnk);
414 if(ppSession) *ppSession = impl_session.pSession;
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)
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);
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);
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)
439 DBIMPLICITSESSION impl_session;
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,
445 impl_session.pUnkOuter = pSessionUnkOuter;
446 impl_session.piid = piid;
447 impl_session.pSession = NULL;
449 hr = ICreateRow_CreateRow(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
450 ppSession ? &impl_session : NULL, pdwBindStatus, ppwszNewURL, ppUnk);
452 if(ppSession) *ppSession = impl_session.pSession;