msi: Handle some error returns (Coverity).
[wine.git] / dlls / msdaps / usrmarshal.c
bloba2cea913f0a67cf5eb7f72ea12d8546dc46ff1ce
1 /*
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
20 #include <stdarg.h>
21 #include <string.h>
23 #define COBJMACROS
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
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"
36 #include "row_server.h"
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(oledb);
42 HRESULT CALLBACK IDBCreateCommand_CreateCommand_Proxy(IDBCreateCommand* This, IUnknown *pUnkOuter,
43 REFIID riid, IUnknown **ppCommand)
45 HRESULT hr;
46 IErrorInfo *error;
48 TRACE("(%p, %p, %s, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppCommand);
49 hr = IDBCreateCommand_RemoteCreateCommand_Proxy(This, pUnkOuter, riid, ppCommand, &error);
50 if(error)
52 SetErrorInfo(0, error);
53 IErrorInfo_Release(error);
55 return hr;
58 HRESULT __RPC_STUB IDBCreateCommand_CreateCommand_Stub(IDBCreateCommand* This, IUnknown *pUnkOuter,
59 REFIID riid, IUnknown **ppCommand, IErrorInfo **ppErrorInfoRem)
61 HRESULT hr;
63 TRACE("(%p, %p, %s, %p, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppCommand, ppErrorInfoRem);
65 *ppErrorInfoRem = NULL;
66 hr = IDBCreateCommand_CreateCommand(This, pUnkOuter, riid, ppCommand);
67 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
69 return hr;
72 HRESULT CALLBACK IDBCreateSession_CreateSession_Proxy(IDBCreateSession* This, IUnknown *pUnkOuter,
73 REFIID riid, IUnknown **ppDBSession)
75 HRESULT hr;
76 IErrorInfo *error;
78 TRACE("(%p, %p, %s, %p)\n", This, pUnkOuter, debugstr_guid(riid), ppDBSession);
79 hr = IDBCreateSession_RemoteCreateSession_Proxy(This, pUnkOuter, riid, ppDBSession, &error);
80 if(error)
82 SetErrorInfo(0, error);
83 IErrorInfo_Release(error);
85 return hr;
88 HRESULT __RPC_STUB IDBCreateSession_CreateSession_Stub(IDBCreateSession* This, IUnknown *pUnkOuter,
89 REFIID riid, IUnknown **ppDBSession, IErrorInfo **ppErrorInfoRem)
91 HRESULT hr;
92 TRACE("(%p, %p, %s, %p, %p)\n", This, pUnkOuter, debugstr_guid(riid),
93 ppDBSession, ppErrorInfoRem);
95 *ppErrorInfoRem = NULL;
96 hr = IDBCreateSession_CreateSession(This, pUnkOuter, riid, ppDBSession);
97 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
99 return hr;
102 HRESULT CALLBACK IDBProperties_GetProperties_Proxy(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
103 ULONG *pcPropertySets, DBPROPSET **prgPropertySets)
105 HRESULT hr;
106 IErrorInfo *error;
108 TRACE("(%p, %d, %p, %p, %p)\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets,
109 prgPropertySets);
110 hr = IDBProperties_RemoteGetProperties_Proxy(This, cPropertyIDSets, rgPropertyIDSets,
111 pcPropertySets, prgPropertySets, &error);
112 if(error)
114 SetErrorInfo(0, error);
115 IErrorInfo_Release(error);
117 return hr;
120 HRESULT __RPC_STUB IDBProperties_GetProperties_Stub(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET *rgPropertyIDSets,
121 ULONG *pcPropertySets, DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
123 HRESULT hr;
125 TRACE("(%p, %d, %p, %p, %p, %p)\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets,
126 prgPropertySets, ppErrorInfoRem);
127 *pcPropertySets = 0;
128 *ppErrorInfoRem = NULL;
129 hr = IDBProperties_GetProperties(This, cPropertyIDSets, rgPropertyIDSets,
130 pcPropertySets, prgPropertySets);
131 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
133 return hr;
136 HRESULT CALLBACK IDBProperties_GetPropertyInfo_Proxy(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
137 ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets,
138 OLECHAR **ppDescBuffer)
140 FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
141 prgPropertyInfoSets, ppDescBuffer);
142 return E_NOTIMPL;
145 HRESULT __RPC_STUB IDBProperties_GetPropertyInfo_Stub(IDBProperties* This, ULONG cPropertyIDSets, const DBPROPIDSET *rgPropertyIDSets,
146 ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets,
147 ULONG *pcOffsets, DBBYTEOFFSET **prgDescOffsets, ULONG *pcbDescBuffer,
148 OLECHAR **ppDescBuffer, IErrorInfo **ppErrorInfoRem)
150 FIXME("(%p, %d, %p, %p, %p, %p, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
151 prgPropertyInfoSets, pcOffsets, prgDescOffsets, pcbDescBuffer, ppDescBuffer, ppErrorInfoRem);
152 return E_NOTIMPL;
155 HRESULT CALLBACK IDBProperties_SetProperties_Proxy(IDBProperties* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
157 ULONG prop_set, prop, total_props = 0;
158 HRESULT hr;
159 IErrorInfo *error;
160 DBPROPSTATUS *status;
162 TRACE("(%p, %d, %p)\n", This, cPropertySets, rgPropertySets);
164 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
165 total_props += rgPropertySets[prop_set].cProperties;
167 if(total_props == 0) return S_OK;
169 status = CoTaskMemAlloc(total_props * sizeof(*status));
170 if(!status) return E_OUTOFMEMORY;
172 hr = IDBProperties_RemoteSetProperties_Proxy(This, cPropertySets, rgPropertySets,
173 total_props, status, &error);
174 if(error)
176 SetErrorInfo(0, error);
177 IErrorInfo_Release(error);
180 total_props = 0;
181 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
182 for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
183 rgPropertySets[prop_set].rgProperties[prop].dwStatus = status[total_props++];
185 CoTaskMemFree(status);
186 return hr;
189 HRESULT __RPC_STUB IDBProperties_SetProperties_Stub(IDBProperties* This, ULONG cPropertySets, DBPROPSET *rgPropertySets,
190 ULONG cTotalProps, DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
192 ULONG prop_set, prop, total_props = 0;
193 HRESULT hr;
195 TRACE("(%p, %d, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, cTotalProps,
196 rgPropStatus, ppErrorInfoRem);
198 *ppErrorInfoRem = NULL;
199 hr = IDBProperties_SetProperties(This, cPropertySets, rgPropertySets);
200 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
202 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
203 for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
204 rgPropStatus[total_props++] = rgPropertySets[prop_set].rgProperties[prop].dwStatus;
206 return hr;
209 HRESULT CALLBACK IDBInitialize_Initialize_Proxy(IDBInitialize* This)
211 HRESULT hr;
212 IErrorInfo *error;
214 TRACE("(%p)\n", This);
215 hr = IDBInitialize_RemoteInitialize_Proxy(This, &error);
216 if(error)
218 SetErrorInfo(0, error);
219 IErrorInfo_Release(error);
221 return hr;
224 HRESULT __RPC_STUB IDBInitialize_Initialize_Stub(IDBInitialize* This, IErrorInfo **ppErrorInfoRem)
226 HRESULT hr;
227 TRACE("(%p, %p)\n", This, ppErrorInfoRem);
229 *ppErrorInfoRem = NULL;
230 hr = IDBInitialize_Initialize(This);
231 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
233 return hr;
236 HRESULT CALLBACK IDBInitialize_Uninitialize_Proxy(IDBInitialize* This)
238 FIXME("(%p): stub\n", This);
239 return E_NOTIMPL;
242 HRESULT __RPC_STUB IDBInitialize_Uninitialize_Stub(IDBInitialize* This, IErrorInfo **ppErrorInfoRem)
244 FIXME("(%p, %p): stub\n", This, ppErrorInfoRem);
245 return E_NOTIMPL;
248 HRESULT CALLBACK IDBDataSourceAdmin_CreateDataSource_Proxy(IDBDataSourceAdmin* This, ULONG cPropertySets,
249 DBPROPSET rgPropertySets[], IUnknown *pUnkOuter,
250 REFIID riid, IUnknown **ppDBSession)
252 ULONG prop_set, prop, total_props = 0;
253 HRESULT hr;
254 IErrorInfo *error;
255 DBPROPSTATUS *status;
257 TRACE("(%p, %d, %p, %p, %s, %p)\n", This, cPropertySets, rgPropertySets, pUnkOuter,
258 debugstr_guid(riid), ppDBSession);
260 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
261 total_props += rgPropertySets[prop_set].cProperties;
263 if(total_props == 0) return S_OK;
265 status = CoTaskMemAlloc(total_props * sizeof(*status));
266 if(!status) return E_OUTOFMEMORY;
268 hr = IDBDataSourceAdmin_RemoteCreateDataSource_Proxy(This, cPropertySets, rgPropertySets, pUnkOuter,
269 riid, ppDBSession, total_props, status, &error);
270 if(error)
272 SetErrorInfo(0, error);
273 IErrorInfo_Release(error);
276 total_props = 0;
277 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
278 for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
279 rgPropertySets[prop_set].rgProperties[prop].dwStatus = status[total_props++];
281 CoTaskMemFree(status);
282 return hr;
285 HRESULT __RPC_STUB IDBDataSourceAdmin_CreateDataSource_Stub(IDBDataSourceAdmin* This, ULONG cPropertySets,
286 DBPROPSET *rgPropertySets, IUnknown *pUnkOuter,
287 REFIID riid, IUnknown **ppDBSession, ULONG cTotalProps,
288 DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
290 ULONG prop_set, prop, total_props = 0;
291 HRESULT hr;
293 TRACE("(%p, %d, %p, %p, %s, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, pUnkOuter,
294 debugstr_guid(riid), ppDBSession, cTotalProps, rgPropStatus, ppErrorInfoRem);
296 *ppErrorInfoRem = NULL;
297 hr = IDBDataSourceAdmin_CreateDataSource(This, cPropertySets, rgPropertySets, pUnkOuter, riid, ppDBSession);
298 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
300 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
301 for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
302 rgPropStatus[total_props++] = rgPropertySets[prop_set].rgProperties[prop].dwStatus;
304 return hr;
307 HRESULT CALLBACK IDBDataSourceAdmin_DestroyDataSource_Proxy(IDBDataSourceAdmin* This)
309 FIXME("(%p): stub\n", This);
310 return E_NOTIMPL;
313 HRESULT __RPC_STUB IDBDataSourceAdmin_DestroyDataSource_Stub(IDBDataSourceAdmin* This, IErrorInfo **ppErrorInfoRem)
315 FIXME("(%p, %p): stub\n", This, ppErrorInfoRem);
316 return E_NOTIMPL;
319 HRESULT CALLBACK IDBDataSourceAdmin_GetCreationProperties_Proxy(IDBDataSourceAdmin* This, ULONG cPropertyIDSets,
320 const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertyInfoSets,
321 DBPROPINFOSET **prgPropertyInfoSets, OLECHAR **ppDescBuffer)
323 FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
324 prgPropertyInfoSets, ppDescBuffer);
325 return E_NOTIMPL;
328 HRESULT __RPC_STUB IDBDataSourceAdmin_GetCreationProperties_Stub(IDBDataSourceAdmin* This, ULONG cPropertyIDSets,
329 const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertyInfoSets,
330 DBPROPINFOSET **prgPropertyInfoSets, DBCOUNTITEM *pcOffsets,
331 DBBYTEOFFSET **prgDescOffsets, ULONG *pcbDescBuffer,
332 OLECHAR **ppDescBuffer, IErrorInfo **ppErrorInfoRem)
334 FIXME("(%p, %d, %p, %p, %p, %p, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
335 prgPropertyInfoSets, pcOffsets, prgDescOffsets, pcbDescBuffer, ppDescBuffer, ppErrorInfoRem);
336 return E_NOTIMPL;
339 HRESULT CALLBACK IDBDataSourceAdmin_ModifyDataSource_Proxy(IDBDataSourceAdmin* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
341 FIXME("(%p, %d, %p): stub\n", This, cPropertySets, rgPropertySets);
342 return E_NOTIMPL;
345 HRESULT __RPC_STUB IDBDataSourceAdmin_ModifyDataSource_Stub(IDBDataSourceAdmin* This, ULONG cPropertySets,
346 DBPROPSET *rgPropertySets, IErrorInfo **ppErrorInfoRem)
348 FIXME("(%p, %d, %p, %p): stub\n", This, cPropertySets, rgPropertySets, ppErrorInfoRem);
349 return E_NOTIMPL;
352 HRESULT CALLBACK ISessionProperties_GetProperties_Proxy(ISessionProperties* This, ULONG cPropertyIDSets,
353 const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertySets,
354 DBPROPSET **prgPropertySets)
356 FIXME("(%p, %d, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
357 pcPropertySets, prgPropertySets);
358 return E_NOTIMPL;
361 HRESULT __RPC_STUB ISessionProperties_GetProperties_Stub(ISessionProperties* This, ULONG cPropertyIDSets,
362 const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertySets,
363 DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
365 FIXME("(%p, %d, %p, %p, %p, %p): stub\n", This, cPropertyIDSets, rgPropertyIDSets,
366 pcPropertySets, prgPropertySets, ppErrorInfoRem);
367 return E_NOTIMPL;
370 HRESULT CALLBACK ISessionProperties_SetProperties_Proxy(ISessionProperties* This, ULONG cPropertySets, DBPROPSET rgPropertySets[])
372 ULONG prop_set, prop, total_props = 0;
373 HRESULT hr;
374 IErrorInfo *error;
375 DBPROPSTATUS *status;
377 TRACE("(%p, %d, %p)\n", This, cPropertySets, rgPropertySets);
379 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
380 total_props += rgPropertySets[prop_set].cProperties;
382 if(total_props == 0) return S_OK;
384 status = CoTaskMemAlloc(total_props * sizeof(*status));
385 if(!status) return E_OUTOFMEMORY;
387 hr = ISessionProperties_RemoteSetProperties_Proxy(This, cPropertySets, rgPropertySets,
388 total_props, status, &error);
389 if(error)
391 SetErrorInfo(0, error);
392 IErrorInfo_Release(error);
395 total_props = 0;
396 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
397 for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
398 rgPropertySets[prop_set].rgProperties[prop].dwStatus = status[total_props++];
400 CoTaskMemFree(status);
401 return hr;
404 HRESULT __RPC_STUB ISessionProperties_SetProperties_Stub(ISessionProperties* This, ULONG cPropertySets, DBPROPSET *rgPropertySets,
405 ULONG cTotalProps, DBPROPSTATUS *rgPropStatus, IErrorInfo **ppErrorInfoRem)
407 ULONG prop_set, prop, total_props = 0;
408 HRESULT hr;
410 TRACE("(%p, %d, %p, %d, %p, %p)\n", This, cPropertySets, rgPropertySets, cTotalProps,
411 rgPropStatus, ppErrorInfoRem);
413 *ppErrorInfoRem = NULL;
414 hr = ISessionProperties_SetProperties(This, cPropertySets, rgPropertySets);
415 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
417 for(prop_set = 0; prop_set < cPropertySets; prop_set++)
418 for(prop = 0; prop < rgPropertySets[prop_set].cProperties; prop++)
419 rgPropStatus[total_props++] = rgPropertySets[prop_set].rgProperties[prop].dwStatus;
421 return hr;
424 HRESULT CALLBACK IOpenRowset_OpenRowset_Proxy(IOpenRowset* This, IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID,
425 REFIID riid, ULONG cPropertySets, DBPROPSET rgPropertySets[], IUnknown **ppRowset)
427 FIXME("(%p, %p, %p, %p, %s, %d, %p, %p): stub\n", This, pUnkOuter, pTableID, pIndexID, debugstr_guid(riid),
428 cPropertySets, rgPropertySets, ppRowset);
429 return E_NOTIMPL;
432 HRESULT __RPC_STUB IOpenRowset_OpenRowset_Stub(IOpenRowset* This, IUnknown *pUnkOuter, DBID *pTableID, DBID *pIndexID,
433 REFIID riid, ULONG cPropertySets, DBPROPSET *rgPropertySets,
434 IUnknown **ppRowset, ULONG cTotalProps, DBPROPSTATUS *rgPropStatus,
435 IErrorInfo **ppErrorInfoRem)
437 FIXME("(%p, %p, %p, %p, %s, %d, %p, %p, %d, %p, %p): stub\n", This, pUnkOuter, pTableID, pIndexID, debugstr_guid(riid),
438 cPropertySets, rgPropertySets, ppRowset, cTotalProps, rgPropStatus, ppErrorInfoRem);
439 return E_NOTIMPL;
442 HRESULT CALLBACK IBindResource_Bind_Proxy(IBindResource* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
443 REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession,
444 DBBINDURLSTATUS *pdwBindStatus, IUnknown **ppUnk)
446 HRESULT hr;
448 TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
449 debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppUnk);
451 hr = IBindResource_RemoteBind_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
452 pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
453 pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppUnk);
454 return hr;
457 HRESULT __RPC_STUB IBindResource_Bind_Stub(IBindResource* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
458 REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
459 IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus, IUnknown **ppUnk)
461 HRESULT hr;
462 DBIMPLICITSESSION impl_session;
464 TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
465 debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppUnk);
467 impl_session.pUnkOuter = pSessionUnkOuter;
468 impl_session.piid = piid;
469 impl_session.pSession = NULL;
471 hr = IBindResource_Bind(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
472 ppSession ? &impl_session : NULL, pdwBindStatus, ppUnk);
474 if(ppSession) *ppSession = impl_session.pSession;
475 return hr;
478 HRESULT CALLBACK ICreateRow_CreateRow_Proxy(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
479 REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession,
480 DBBINDURLSTATUS *pdwBindStatus, LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
482 HRESULT hr;
484 TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
485 debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppwszNewURL, ppUnk);
487 if(pUnkOuter)
489 FIXME("Aggregation not supported\n");
490 return CLASS_E_NOAGGREGATION;
493 hr = ICreateRow_RemoteCreateRow_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
494 pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
495 pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppwszNewURL, ppUnk);
496 return hr;
499 HRESULT __RPC_STUB ICreateRow_CreateRow_Stub(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
500 REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
501 IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus,
502 LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
504 HRESULT hr;
505 DBIMPLICITSESSION impl_session;
506 IWineRowServer *row_server;
507 IMarshal *marshal;
508 IUnknown *obj;
510 TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
511 debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppwszNewURL,
512 ppUnk);
514 *ppUnk = NULL;
516 hr = CoCreateInstance(&CLSID_wine_row_server, NULL, CLSCTX_INPROC_SERVER, &IID_IWineRowServer, (void**)&row_server);
517 if(FAILED(hr)) return hr;
519 impl_session.pUnkOuter = pSessionUnkOuter;
520 impl_session.piid = piid;
521 impl_session.pSession = NULL;
523 IWineRowServer_GetMarshal(row_server, &marshal);
525 hr = ICreateRow_CreateRow(This, (IUnknown*) marshal, pwszURL, dwBindURLFlags, rguid, &IID_IUnknown, pAuthenticate,
526 ppSession ? &impl_session : NULL, pdwBindStatus, ppwszNewURL, &obj);
527 IMarshal_Release(marshal);
529 if(FAILED(hr))
531 IWineRowServer_Release(row_server);
532 return hr;
535 IWineRowServer_SetInnerUnk(row_server, obj);
536 hr = IUnknown_QueryInterface(obj, riid, (void**)ppUnk);
537 IUnknown_Release(obj);
539 if(ppSession) *ppSession = impl_session.pSession;
540 return hr;
543 HRESULT CALLBACK IAccessor_AddRefAccessor_Proxy(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount)
545 FIXME("(%p)->(%08lx, %p): stub\n", This, hAccessor, pcRefCount);
546 return E_NOTIMPL;
549 HRESULT __RPC_STUB IAccessor_AddRefAccessor_Stub(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount,
550 IErrorInfo **ppErrorInfoRem)
552 FIXME("(%p)->(%08lx, %p, %p): stub\n", This, hAccessor, pcRefCount, ppErrorInfoRem);
553 return E_NOTIMPL;
556 HRESULT CALLBACK IAccessor_CreateAccessor_Proxy(IAccessor* This, DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings,
557 const DBBINDING rgBindings[], DBLENGTH cbRowSize, HACCESSOR *phAccessor,
558 DBBINDSTATUS rgStatus[])
560 HRESULT hr;
561 IErrorInfo *error;
562 DBCOUNTITEM i;
564 TRACE("(%p)->(%08x, %d, %p, %d, %p, %p)\n", This, dwAccessorFlags, cBindings, rgBindings,
565 cbRowSize, phAccessor, rgStatus);
567 for(i = 0; i < cBindings; i++)
569 TRACE("%d: ord %d val off %d len off %d stat off %d part %04x mem_owner %d max_len %d type %04x\n",
570 i, rgBindings[i].iOrdinal, rgBindings[i].obValue, rgBindings[i].obLength, rgBindings[i].obStatus,
571 rgBindings[i].dwPart, rgBindings[i].dwMemOwner, rgBindings[i].cbMaxLen, rgBindings[i].wType);
574 hr = IAccessor_RemoteCreateAccessor_Proxy(This, dwAccessorFlags, cBindings, (DBBINDING *)rgBindings,
575 cbRowSize, phAccessor, rgStatus, &error);
576 if(error)
578 SetErrorInfo(0, error);
579 IErrorInfo_Release(error);
582 TRACE("returning %08x accessor %lx\n", hr, *phAccessor);
583 return hr;
586 HRESULT __RPC_STUB IAccessor_CreateAccessor_Stub(IAccessor* This, DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings,
587 DBBINDING *rgBindings, DBLENGTH cbRowSize, HACCESSOR *phAccessor,
588 DBBINDSTATUS *rgStatus, IErrorInfo **ppErrorInfoRem)
590 HRESULT hr;
592 TRACE("(%p)->(%08x, %d, %p, %d, %p, %p, %p)\n", This, dwAccessorFlags, cBindings, rgBindings,
593 cbRowSize, phAccessor, rgStatus, ppErrorInfoRem);
595 *ppErrorInfoRem = NULL;
596 hr = IAccessor_CreateAccessor(This, dwAccessorFlags, cBindings, rgBindings,
597 cbRowSize, phAccessor, rgStatus);
598 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
600 return hr;
603 HRESULT CALLBACK IAccessor_GetBindings_Proxy(IAccessor* This, HACCESSOR hAccessor, DBACCESSORFLAGS *pdwAccessorFlags,
604 DBCOUNTITEM *pcBindings, DBBINDING **prgBindings)
606 FIXME("(%p): stub\n", This);
607 return E_NOTIMPL;
610 HRESULT __RPC_STUB IAccessor_GetBindings_Stub(IAccessor* This, HACCESSOR hAccessor, DBACCESSORFLAGS *pdwAccessorFlags,
611 DBCOUNTITEM *pcBindings, DBBINDING **prgBindings, IErrorInfo **ppErrorInfoRem)
613 FIXME("(%p): stub\n", This);
614 return E_NOTIMPL;
617 HRESULT CALLBACK IAccessor_ReleaseAccessor_Proxy(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount)
619 HRESULT hr;
620 IErrorInfo *error;
621 DBREFCOUNT ref;
623 TRACE("(%p)->(%lx, %p)\n", This, hAccessor, pcRefCount);
625 hr = IAccessor_RemoteReleaseAccessor_Proxy(This, hAccessor, &ref, &error);
627 if(pcRefCount) *pcRefCount = ref;
628 if(error)
630 SetErrorInfo(0, error);
631 IErrorInfo_Release(error);
633 return hr;
636 HRESULT __RPC_STUB IAccessor_ReleaseAccessor_Stub(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount,
637 IErrorInfo **ppErrorInfoRem)
639 HRESULT hr;
641 TRACE("(%p)->(%lx, %p, %p)\n", This, hAccessor, pcRefCount, ppErrorInfoRem);
643 *ppErrorInfoRem = NULL;
645 hr = IAccessor_ReleaseAccessor(This, hAccessor, pcRefCount);
647 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
648 return hr;
651 HRESULT CALLBACK IRowsetInfo_GetProperties_Proxy(IRowsetInfo* This, const ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
652 ULONG *pcPropertySets, DBPROPSET **prgPropertySets)
654 HRESULT hr;
655 IErrorInfo *error;
656 ULONG i;
658 TRACE("(%p)->(%d, %p, %p, %p)\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
660 for(i = 0; i < cPropertyIDSets; i++)
662 int j;
663 TRACE("%d: %s %d props\n", i, debugstr_guid(&rgPropertyIDSets[i].guidPropertySet), rgPropertyIDSets[i].cPropertyIDs);
664 for(j = 0; j < rgPropertyIDSets[i].cPropertyIDs; j++)
665 TRACE("\t%d: prop id %d\n", j, rgPropertyIDSets[i].rgPropertyIDs[j]);
668 hr = IRowsetInfo_RemoteGetProperties_Proxy(This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets, &error);
670 if(error)
672 SetErrorInfo(0, error);
673 IErrorInfo_Release(error);
675 return hr;
678 HRESULT __RPC_STUB IRowsetInfo_GetProperties_Stub(IRowsetInfo* This, ULONG cPropertyIDSets, const DBPROPIDSET *rgPropertyIDSets,
679 ULONG *pcPropertySets, DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
681 HRESULT hr;
683 TRACE("(%p)->(%d, %p, %p, %p, %p)\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets, ppErrorInfoRem);
685 *ppErrorInfoRem = NULL;
687 hr = IRowsetInfo_GetProperties(This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
688 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
689 TRACE("returning %08x\n", hr);
690 return hr;
693 HRESULT CALLBACK IRowsetInfo_GetReferencedRowset_Proxy(IRowsetInfo* This, DBORDINAL iOrdinal, REFIID riid, IUnknown **ppReferencedRowset)
695 FIXME("(%p)->(%d, %s, %p): stub\n", This, iOrdinal, debugstr_guid(riid), ppReferencedRowset);
696 return E_NOTIMPL;
699 HRESULT __RPC_STUB IRowsetInfo_GetReferencedRowset_Stub(IRowsetInfo* This, DBORDINAL iOrdinal, REFIID riid, IUnknown **ppReferencedRowset,
700 IErrorInfo **ppErrorInfoRem)
702 FIXME("(%p)->(%d, %s, %p, %p): stub\n", This, iOrdinal, debugstr_guid(riid), ppReferencedRowset, ppErrorInfoRem);
703 return E_NOTIMPL;
706 HRESULT CALLBACK IRowsetInfo_GetSpecification_Proxy(IRowsetInfo* This, REFIID riid, IUnknown **ppSpecification)
708 FIXME("(%p)->(%s, %p): stub\n", This, debugstr_guid(riid), ppSpecification);
709 return E_NOTIMPL;
712 HRESULT __RPC_STUB IRowsetInfo_GetSpecification_Stub(IRowsetInfo* This, REFIID riid, IUnknown **ppSpecification, IErrorInfo **ppErrorInfoRem)
714 FIXME("(%p)->(%s, %p, %p): stub\n", This, debugstr_guid(riid), ppSpecification, ppErrorInfoRem);
715 return E_NOTIMPL;
718 HRESULT CALLBACK ICommand_Cancel_Proxy(ICommand* This)
720 FIXME("(%p): stub\n", This);
721 return E_NOTIMPL;
724 HRESULT __RPC_STUB ICommand_Cancel_Stub(ICommand* This, IErrorInfo **ppErrorInfoRem)
726 FIXME("(%p)->(%p): stub\n", This, ppErrorInfoRem);
727 return E_NOTIMPL;
730 HRESULT CALLBACK ICommand_Execute_Proxy(ICommand* This, IUnknown *pUnkOuter, REFIID riid,
731 DBPARAMS *pParams, DBROWCOUNT *pcRowsAffected, IUnknown **ppRowset)
733 FIXME("(%p)->(%p, %s, %p, %p, %p): stub\n", This, pUnkOuter, debugstr_guid(riid), pParams,
734 pcRowsAffected, ppRowset);
735 if(pParams) TRACE("params {%p, %d, %08lx}\n", pParams->pData, pParams->cParamSets, pParams->hAccessor);
737 return E_NOTIMPL;
740 HRESULT __RPC_STUB ICommand_Execute_Stub(ICommand* This, IUnknown *pUnkOuter, REFIID riid, HACCESSOR hAccessor,
741 DB_UPARAMS cParamSets, GUID *pGuid, ULONG ulGuidOffset, RMTPACK *pInputParams,
742 RMTPACK *pOutputParams, DBCOUNTITEM cBindings, DBBINDING *rgBindings,
743 DBSTATUS *rgStatus, DBROWCOUNT *pcRowsAffected, IUnknown **ppRowset)
745 FIXME("(%p)->(%p, %s, %08lx, %d, %p, %d, %p, %p, %d, %p, %p, %p, %p): stub\n", This, pUnkOuter, debugstr_guid(riid),
746 hAccessor, cParamSets, pGuid, ulGuidOffset, pInputParams, pOutputParams, cBindings, rgBindings, rgStatus,
747 pcRowsAffected, ppRowset);
748 return E_NOTIMPL;
751 HRESULT CALLBACK ICommand_GetDBSession_Proxy(ICommand* This, REFIID riid, IUnknown **ppSession)
753 FIXME("(%p)->(%s, %p): stub\n", This, debugstr_guid(riid), ppSession);
754 return E_NOTIMPL;
757 HRESULT __RPC_STUB ICommand_GetDBSession_Stub(ICommand* This, REFIID riid, IUnknown **ppSession, IErrorInfo **ppErrorInfoRem)
759 FIXME("(%p)->(%s, %p, %p): stub\n", This, debugstr_guid(riid), ppSession, ppErrorInfoRem);
760 return E_NOTIMPL;
763 HRESULT CALLBACK ICommandText_GetCommandText_Proxy(ICommandText* This, GUID *pguidDialect, LPOLESTR *ppwszCommand)
765 FIXME("(%p)->(%p, %p): stub\n", This, pguidDialect, ppwszCommand);
766 return E_NOTIMPL;
769 HRESULT __RPC_STUB ICommandText_GetCommandText_Stub(ICommandText* This, GUID *pguidDialect,
770 LPOLESTR *ppwszCommand, IErrorInfo **ppErrorInfoRem)
772 FIXME("(%p)->(%p, %p, %p): stub\n", This, pguidDialect, ppwszCommand, ppErrorInfoRem);
773 return E_NOTIMPL;
776 HRESULT CALLBACK ICommandText_SetCommandText_Proxy(ICommandText* This, REFGUID rguidDialect, LPCOLESTR pwszCommand)
778 HRESULT hr;
779 IErrorInfo *error;
781 TRACE("(%p)->(%s, %s)\n", This, debugstr_guid(rguidDialect), debugstr_w(pwszCommand));
783 hr = ICommandText_RemoteSetCommandText_Proxy(This, rguidDialect, pwszCommand, &error);
784 if(error)
786 SetErrorInfo(0, error);
787 IErrorInfo_Release(error);
789 return hr;
792 HRESULT __RPC_STUB ICommandText_SetCommandText_Stub(ICommandText* This, REFGUID rguidDialect, LPCOLESTR pwszCommand,
793 IErrorInfo **ppErrorInfoRem)
795 HRESULT hr;
797 TRACE("(%p)->(%s, %s, %p)\n", This, debugstr_guid(rguidDialect), debugstr_w(pwszCommand),
798 ppErrorInfoRem);
800 *ppErrorInfoRem = NULL;
801 hr = ICommandText_SetCommandText(This, rguidDialect, pwszCommand);
802 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
804 return hr;
807 HRESULT CALLBACK IDBAsynchNotify_OnLowResource_Proxy(IDBAsynchNotify* This, DB_DWRESERVE dwReserved)
809 FIXME("(%p)->(%08x): stub\n", This, dwReserved);
810 return E_NOTIMPL;
813 HRESULT __RPC_STUB IDBAsynchNotify_OnLowResource_Stub(IDBAsynchNotify* This, DB_DWRESERVE dwReserved)
815 FIXME("(%p)->(%08x): stub\n", This, dwReserved);
816 return E_NOTIMPL;
819 HRESULT CALLBACK IDBAsynchNotify_OnProgress_Proxy(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
820 DBCOUNTITEM ulProgress, DBCOUNTITEM ulProgressMax, DBASYNCHPHASE eAsynchPhase,
821 LPOLESTR pwszStatusText)
823 FIXME("(%p)->(%lx, %d, %d, %d, %d, %s): stub\n", This, hChapter, eOperation, ulProgress, ulProgressMax,
824 eAsynchPhase, debugstr_w(pwszStatusText));
825 return E_NOTIMPL;
828 HRESULT __RPC_STUB IDBAsynchNotify_OnProgress_Stub(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
829 DBCOUNTITEM ulProgress, DBCOUNTITEM ulProgressMax, DBASYNCHPHASE eAsynchPhase,
830 LPOLESTR pwszStatusText)
832 FIXME("(%p)->(%lx, %d, %d, %d, %d, %s): stub\n", This, hChapter, eOperation, ulProgress, ulProgressMax,
833 eAsynchPhase, debugstr_w(pwszStatusText));
834 return E_NOTIMPL;
837 HRESULT CALLBACK IDBAsynchNotify_OnStop_Proxy(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
838 HRESULT hrStatus, LPOLESTR pwszStatusText)
840 FIXME("(%p)->(%lx, %d, %08x, %s): stub\n", This, hChapter, eOperation, hrStatus, debugstr_w(pwszStatusText));
841 return E_NOTIMPL;
844 HRESULT __RPC_STUB IDBAsynchNotify_OnStop_Stub(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
845 HRESULT hrStatus, LPOLESTR pwszStatusText)
847 FIXME("(%p)->(%lx, %d, %08x, %s): stub\n", This, hChapter, eOperation, hrStatus, debugstr_w(pwszStatusText));
848 return E_NOTIMPL;
851 HRESULT CALLBACK IDBAsynchStatus_Abort_Proxy(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation)
853 FIXME("(%p)->(%lx, %d): stub\n", This, hChapter, eOperation);
854 return E_NOTIMPL;
857 HRESULT __RPC_STUB IDBAsynchStatus_Abort_Stub(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
858 IErrorInfo **ppErrorInfoRem)
860 FIXME("(%p)->(%lx, %d, %p): stub\n", This, hChapter, eOperation, ppErrorInfoRem);
861 return E_NOTIMPL;
864 HRESULT CALLBACK IDBAsynchStatus_GetStatus_Proxy(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
865 DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase,
866 LPOLESTR *ppwszStatusText)
868 FIXME("(%p)->(%lx, %d, %p, %p, %p, %p): stub\n", This, hChapter, eOperation, pulProgress, pulProgressMax,
869 peAsynchPhase, ppwszStatusText);
870 return E_NOTIMPL;
873 HRESULT __RPC_STUB IDBAsynchStatus_GetStatus_Stub(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
874 DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase,
875 LPOLESTR *ppwszStatusText, IErrorInfo **ppErrorInfoRem)
877 FIXME("(%p)->(%lx, %d, %p, %p, %p, %p, %p): stub\n", This, hChapter, eOperation, pulProgress, pulProgressMax,
878 peAsynchPhase, ppwszStatusText, ppErrorInfoRem);
879 return E_NOTIMPL;