wined3d: Figure out the index size inside drawPrimitive().
[wine/multimedia.git] / dlls / msdaps / usrmarshal.c
blob7b983f385b78def45d8b9644ea7f14933d54fa65
1 /*
2 * Misc marshaling routines
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 if(pUnkOuter)
453 FIXME("Aggregation not supported\n");
454 return CLASS_E_NOAGGREGATION;
457 hr = IBindResource_RemoteBind_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
458 pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
459 pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppUnk);
460 return hr;
463 HRESULT __RPC_STUB IBindResource_Bind_Stub(IBindResource* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
464 REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
465 IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus, IUnknown **ppUnk)
467 HRESULT hr;
468 DBIMPLICITSESSION impl_session;
469 IWineRowServer *server;
470 IMarshal *marshal;
471 IUnknown *obj;
473 TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
474 debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppUnk);
476 *ppUnk = NULL;
478 if(IsEqualGUID(rguid, &DBGUID_ROWSET))
479 hr = CoCreateInstance(&CLSID_wine_rowset_server, NULL, CLSCTX_INPROC_SERVER, &IID_IWineRowServer, (void**)&server);
480 else if(IsEqualGUID(rguid, &DBGUID_ROW))
481 hr = CoCreateInstance(&CLSID_wine_row_server, NULL, CLSCTX_INPROC_SERVER, &IID_IWineRowServer, (void**)&server);
482 else
484 hr = E_NOTIMPL;
485 FIXME("Unhandled object %s\n", debugstr_guid(rguid));
488 if(FAILED(hr)) return hr;
490 impl_session.pUnkOuter = pSessionUnkOuter;
491 impl_session.piid = piid;
492 impl_session.pSession = NULL;
494 IWineRowServer_GetMarshal(server, &marshal);
496 hr = IBindResource_Bind(This, (IUnknown*)marshal, pwszURL, dwBindURLFlags, rguid, &IID_IUnknown, pAuthenticate,
497 ppSession ? &impl_session : NULL, pdwBindStatus, &obj);
499 IMarshal_Release(marshal);
500 if(FAILED(hr))
502 IWineRowServer_Release(server);
503 return hr;
506 IWineRowServer_SetInnerUnk(server, obj);
507 hr = IUnknown_QueryInterface(obj, riid, (void**)ppUnk);
508 IUnknown_Release(obj);
510 if(ppSession) *ppSession = impl_session.pSession;
511 return hr;
514 HRESULT CALLBACK ICreateRow_CreateRow_Proxy(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
515 REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession,
516 DBBINDURLSTATUS *pdwBindStatus, LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
518 HRESULT hr;
520 TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
521 debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppwszNewURL, ppUnk);
523 if(pUnkOuter)
525 FIXME("Aggregation not supported\n");
526 return CLASS_E_NOAGGREGATION;
529 hr = ICreateRow_RemoteCreateRow_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
530 pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
531 pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppwszNewURL, ppUnk);
532 return hr;
535 HRESULT __RPC_STUB ICreateRow_CreateRow_Stub(ICreateRow* This, IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindURLFlags,
536 REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, IUnknown *pSessionUnkOuter,
537 IID *piid, IUnknown **ppSession, DBBINDURLSTATUS *pdwBindStatus,
538 LPOLESTR *ppwszNewURL, IUnknown **ppUnk)
540 HRESULT hr;
541 DBIMPLICITSESSION impl_session;
542 IWineRowServer *row_server;
543 IMarshal *marshal;
544 IUnknown *obj;
546 TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
547 debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppwszNewURL,
548 ppUnk);
550 *ppUnk = NULL;
552 hr = CoCreateInstance(&CLSID_wine_row_server, NULL, CLSCTX_INPROC_SERVER, &IID_IWineRowServer, (void**)&row_server);
553 if(FAILED(hr)) return hr;
555 impl_session.pUnkOuter = pSessionUnkOuter;
556 impl_session.piid = piid;
557 impl_session.pSession = NULL;
559 IWineRowServer_GetMarshal(row_server, &marshal);
561 hr = ICreateRow_CreateRow(This, (IUnknown*) marshal, pwszURL, dwBindURLFlags, rguid, &IID_IUnknown, pAuthenticate,
562 ppSession ? &impl_session : NULL, pdwBindStatus, ppwszNewURL, &obj);
563 IMarshal_Release(marshal);
565 if(FAILED(hr))
567 IWineRowServer_Release(row_server);
568 return hr;
571 IWineRowServer_SetInnerUnk(row_server, obj);
572 hr = IUnknown_QueryInterface(obj, riid, (void**)ppUnk);
573 IUnknown_Release(obj);
575 if(ppSession) *ppSession = impl_session.pSession;
576 return hr;
579 HRESULT CALLBACK IAccessor_AddRefAccessor_Proxy(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount)
581 FIXME("(%p)->(%08lx, %p): stub\n", This, hAccessor, pcRefCount);
582 return E_NOTIMPL;
585 HRESULT __RPC_STUB IAccessor_AddRefAccessor_Stub(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount,
586 IErrorInfo **ppErrorInfoRem)
588 FIXME("(%p)->(%08lx, %p, %p): stub\n", This, hAccessor, pcRefCount, ppErrorInfoRem);
589 return E_NOTIMPL;
592 HRESULT CALLBACK IAccessor_CreateAccessor_Proxy(IAccessor* This, DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings,
593 const DBBINDING rgBindings[], DBLENGTH cbRowSize, HACCESSOR *phAccessor,
594 DBBINDSTATUS rgStatus[])
596 HRESULT hr;
597 IErrorInfo *error;
598 DBCOUNTITEM i;
600 TRACE("(%p)->(%08x, %ld, %p, %ld, %p, %p)\n", This, dwAccessorFlags, cBindings, rgBindings,
601 cbRowSize, phAccessor, rgStatus);
603 for(i = 0; i < cBindings; i++)
605 TRACE("%ld: ord %ld val off %ld len off %ld stat off %ld part %04x mem_owner %d max_len %ld type %04x\n",
606 i, rgBindings[i].iOrdinal, rgBindings[i].obValue, rgBindings[i].obLength, rgBindings[i].obStatus,
607 rgBindings[i].dwPart, rgBindings[i].dwMemOwner, rgBindings[i].cbMaxLen, rgBindings[i].wType);
610 hr = IAccessor_RemoteCreateAccessor_Proxy(This, dwAccessorFlags, cBindings, (DBBINDING *)rgBindings,
611 cbRowSize, phAccessor, rgStatus, &error);
612 if(error)
614 SetErrorInfo(0, error);
615 IErrorInfo_Release(error);
618 TRACE("returning %08x accessor %lx\n", hr, *phAccessor);
619 return hr;
622 HRESULT __RPC_STUB IAccessor_CreateAccessor_Stub(IAccessor* This, DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings,
623 DBBINDING *rgBindings, DBLENGTH cbRowSize, HACCESSOR *phAccessor,
624 DBBINDSTATUS *rgStatus, IErrorInfo **ppErrorInfoRem)
626 HRESULT hr;
628 TRACE("(%p)->(%08x, %ld, %p, %ld, %p, %p, %p)\n", This, dwAccessorFlags, cBindings, rgBindings,
629 cbRowSize, phAccessor, rgStatus, ppErrorInfoRem);
631 *ppErrorInfoRem = NULL;
632 hr = IAccessor_CreateAccessor(This, dwAccessorFlags, cBindings, rgBindings,
633 cbRowSize, phAccessor, rgStatus);
634 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
636 return hr;
639 HRESULT CALLBACK IAccessor_GetBindings_Proxy(IAccessor* This, HACCESSOR hAccessor, DBACCESSORFLAGS *pdwAccessorFlags,
640 DBCOUNTITEM *pcBindings, DBBINDING **prgBindings)
642 FIXME("(%p): stub\n", This);
643 return E_NOTIMPL;
646 HRESULT __RPC_STUB IAccessor_GetBindings_Stub(IAccessor* This, HACCESSOR hAccessor, DBACCESSORFLAGS *pdwAccessorFlags,
647 DBCOUNTITEM *pcBindings, DBBINDING **prgBindings, IErrorInfo **ppErrorInfoRem)
649 FIXME("(%p): stub\n", This);
650 return E_NOTIMPL;
653 HRESULT CALLBACK IAccessor_ReleaseAccessor_Proxy(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount)
655 HRESULT hr;
656 IErrorInfo *error;
657 DBREFCOUNT ref;
659 TRACE("(%p)->(%lx, %p)\n", This, hAccessor, pcRefCount);
661 hr = IAccessor_RemoteReleaseAccessor_Proxy(This, hAccessor, &ref, &error);
663 if(pcRefCount) *pcRefCount = ref;
664 if(error)
666 SetErrorInfo(0, error);
667 IErrorInfo_Release(error);
669 return hr;
672 HRESULT __RPC_STUB IAccessor_ReleaseAccessor_Stub(IAccessor* This, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount,
673 IErrorInfo **ppErrorInfoRem)
675 HRESULT hr;
677 TRACE("(%p)->(%lx, %p, %p)\n", This, hAccessor, pcRefCount, ppErrorInfoRem);
679 *ppErrorInfoRem = NULL;
681 hr = IAccessor_ReleaseAccessor(This, hAccessor, pcRefCount);
683 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
684 return hr;
687 HRESULT CALLBACK IRowsetInfo_GetProperties_Proxy(IRowsetInfo* This, const ULONG cPropertyIDSets, const DBPROPIDSET rgPropertyIDSets[],
688 ULONG *pcPropertySets, DBPROPSET **prgPropertySets)
690 HRESULT hr;
691 IErrorInfo *error;
692 ULONG i;
694 TRACE("(%p)->(%d, %p, %p, %p)\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
696 for(i = 0; i < cPropertyIDSets; i++)
698 int j;
699 TRACE("%d: %s %d props\n", i, debugstr_guid(&rgPropertyIDSets[i].guidPropertySet), rgPropertyIDSets[i].cPropertyIDs);
700 for(j = 0; j < rgPropertyIDSets[i].cPropertyIDs; j++)
701 TRACE("\t%d: prop id %d\n", j, rgPropertyIDSets[i].rgPropertyIDs[j]);
704 hr = IRowsetInfo_RemoteGetProperties_Proxy(This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets, &error);
706 if(error)
708 SetErrorInfo(0, error);
709 IErrorInfo_Release(error);
711 return hr;
714 HRESULT __RPC_STUB IRowsetInfo_GetProperties_Stub(IRowsetInfo* This, ULONG cPropertyIDSets, const DBPROPIDSET *rgPropertyIDSets,
715 ULONG *pcPropertySets, DBPROPSET **prgPropertySets, IErrorInfo **ppErrorInfoRem)
717 HRESULT hr;
719 TRACE("(%p)->(%d, %p, %p, %p, %p)\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets, ppErrorInfoRem);
721 *ppErrorInfoRem = NULL;
723 hr = IRowsetInfo_GetProperties(This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
724 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
725 TRACE("returning %08x\n", hr);
726 return hr;
729 HRESULT CALLBACK IRowsetInfo_GetReferencedRowset_Proxy(IRowsetInfo* This, DBORDINAL iOrdinal, REFIID riid, IUnknown **ppReferencedRowset)
731 FIXME("(%p)->(%ld, %s, %p): stub\n", This, iOrdinal, debugstr_guid(riid), ppReferencedRowset);
732 return E_NOTIMPL;
735 HRESULT __RPC_STUB IRowsetInfo_GetReferencedRowset_Stub(IRowsetInfo* This, DBORDINAL iOrdinal, REFIID riid, IUnknown **ppReferencedRowset,
736 IErrorInfo **ppErrorInfoRem)
738 FIXME("(%p)->(%ld, %s, %p, %p): stub\n", This, iOrdinal, debugstr_guid(riid), ppReferencedRowset, ppErrorInfoRem);
739 return E_NOTIMPL;
742 HRESULT CALLBACK IRowsetInfo_GetSpecification_Proxy(IRowsetInfo* This, REFIID riid, IUnknown **ppSpecification)
744 FIXME("(%p)->(%s, %p): stub\n", This, debugstr_guid(riid), ppSpecification);
745 return E_NOTIMPL;
748 HRESULT __RPC_STUB IRowsetInfo_GetSpecification_Stub(IRowsetInfo* This, REFIID riid, IUnknown **ppSpecification, IErrorInfo **ppErrorInfoRem)
750 FIXME("(%p)->(%s, %p, %p): stub\n", This, debugstr_guid(riid), ppSpecification, ppErrorInfoRem);
751 return E_NOTIMPL;
754 HRESULT CALLBACK ICommand_Cancel_Proxy(ICommand* This)
756 FIXME("(%p): stub\n", This);
757 return E_NOTIMPL;
760 HRESULT __RPC_STUB ICommand_Cancel_Stub(ICommand* This, IErrorInfo **ppErrorInfoRem)
762 FIXME("(%p)->(%p): stub\n", This, ppErrorInfoRem);
763 return E_NOTIMPL;
766 HRESULT CALLBACK ICommand_Execute_Proxy(ICommand* This, IUnknown *pUnkOuter, REFIID riid,
767 DBPARAMS *pParams, DBROWCOUNT *pcRowsAffected, IUnknown **ppRowset)
769 HRESULT hr;
770 DBROWCOUNT affected;
772 *ppRowset = NULL;
774 TRACE("(%p)->(%p, %s, %p, %p, %p)\n", This, pUnkOuter, debugstr_guid(riid), pParams,
775 pcRowsAffected, ppRowset);
777 if(pParams)
779 FIXME("Unhandled params {%p, %ld, %08lx}\n", pParams->pData, pParams->cParamSets, pParams->hAccessor);
780 return E_NOTIMPL;
783 if(pUnkOuter)
785 FIXME("Aggregation not supported\n");
786 return CLASS_E_NOAGGREGATION;
789 hr = ICommand_RemoteExecute_Proxy(This, pUnkOuter, riid, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, &affected,
790 ppRowset);
792 TRACE("Execute returns %08x\n", hr);
794 if(pcRowsAffected) *pcRowsAffected = affected;
796 return hr;
799 HRESULT __RPC_STUB ICommand_Execute_Stub(ICommand* This, IUnknown *pUnkOuter, REFIID riid, HACCESSOR hAccessor,
800 DB_UPARAMS cParamSets, GUID *pGuid, ULONG ulGuidOffset, RMTPACK *pInputParams,
801 RMTPACK *pOutputParams, DBCOUNTITEM cBindings, DBBINDING *rgBindings,
802 DBSTATUS *rgStatus, DBROWCOUNT *pcRowsAffected, IUnknown **ppRowset)
804 IWineRowServer *rowset_server;
805 IMarshal *marshal;
806 IUnknown *obj = NULL;
807 HRESULT hr;
809 TRACE("(%p)->(%p, %s, %08lx, %ld, %p, %d, %p, %p, %ld, %p, %p, %p, %p): stub\n", This, pUnkOuter, debugstr_guid(riid),
810 hAccessor, cParamSets, pGuid, ulGuidOffset, pInputParams, pOutputParams, cBindings, rgBindings, rgStatus,
811 pcRowsAffected, ppRowset);
813 *ppRowset = NULL;
815 hr = CoCreateInstance(&CLSID_wine_rowset_server, NULL, CLSCTX_INPROC_SERVER, &IID_IWineRowServer, (void**)&rowset_server);
816 if(FAILED(hr)) return hr;
818 IWineRowServer_GetMarshal(rowset_server, &marshal);
820 hr = ICommand_Execute(This, (IUnknown*)marshal, &IID_IUnknown, NULL, pcRowsAffected, &obj);
822 IMarshal_Release(marshal);
824 if(FAILED(hr))
826 IWineRowServer_Release(rowset_server);
827 return hr;
830 IWineRowServer_SetInnerUnk(rowset_server, obj);
831 hr = IUnknown_QueryInterface(obj, riid, (void**)ppRowset);
832 IUnknown_Release(obj);
834 return hr;
837 HRESULT CALLBACK ICommand_GetDBSession_Proxy(ICommand* This, REFIID riid, IUnknown **ppSession)
839 FIXME("(%p)->(%s, %p): stub\n", This, debugstr_guid(riid), ppSession);
840 return E_NOTIMPL;
843 HRESULT __RPC_STUB ICommand_GetDBSession_Stub(ICommand* This, REFIID riid, IUnknown **ppSession, IErrorInfo **ppErrorInfoRem)
845 FIXME("(%p)->(%s, %p, %p): stub\n", This, debugstr_guid(riid), ppSession, ppErrorInfoRem);
846 return E_NOTIMPL;
849 HRESULT CALLBACK ICommandText_GetCommandText_Proxy(ICommandText* This, GUID *pguidDialect, LPOLESTR *ppwszCommand)
851 FIXME("(%p)->(%p, %p): stub\n", This, pguidDialect, ppwszCommand);
852 return E_NOTIMPL;
855 HRESULT __RPC_STUB ICommandText_GetCommandText_Stub(ICommandText* This, GUID *pguidDialect,
856 LPOLESTR *ppwszCommand, IErrorInfo **ppErrorInfoRem)
858 FIXME("(%p)->(%p, %p, %p): stub\n", This, pguidDialect, ppwszCommand, ppErrorInfoRem);
859 return E_NOTIMPL;
862 HRESULT CALLBACK ICommandText_SetCommandText_Proxy(ICommandText* This, REFGUID rguidDialect, LPCOLESTR pwszCommand)
864 HRESULT hr;
865 IErrorInfo *error;
867 TRACE("(%p)->(%s, %s)\n", This, debugstr_guid(rguidDialect), debugstr_w(pwszCommand));
869 hr = ICommandText_RemoteSetCommandText_Proxy(This, rguidDialect, pwszCommand, &error);
870 if(error)
872 SetErrorInfo(0, error);
873 IErrorInfo_Release(error);
875 return hr;
878 HRESULT __RPC_STUB ICommandText_SetCommandText_Stub(ICommandText* This, REFGUID rguidDialect, LPCOLESTR pwszCommand,
879 IErrorInfo **ppErrorInfoRem)
881 HRESULT hr;
883 TRACE("(%p)->(%s, %s, %p)\n", This, debugstr_guid(rguidDialect), debugstr_w(pwszCommand),
884 ppErrorInfoRem);
886 *ppErrorInfoRem = NULL;
887 hr = ICommandText_SetCommandText(This, rguidDialect, pwszCommand);
888 if(FAILED(hr)) GetErrorInfo(0, ppErrorInfoRem);
890 return hr;
893 HRESULT CALLBACK IDBAsynchNotify_OnLowResource_Proxy(IDBAsynchNotify* This, DB_DWRESERVE dwReserved)
895 FIXME("(%p)->(%08lx): stub\n", This, dwReserved);
896 return E_NOTIMPL;
899 HRESULT __RPC_STUB IDBAsynchNotify_OnLowResource_Stub(IDBAsynchNotify* This, DB_DWRESERVE dwReserved)
901 FIXME("(%p)->(%08lx): stub\n", This, dwReserved);
902 return E_NOTIMPL;
905 HRESULT CALLBACK IDBAsynchNotify_OnProgress_Proxy(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
906 DBCOUNTITEM ulProgress, DBCOUNTITEM ulProgressMax, DBASYNCHPHASE eAsynchPhase,
907 LPOLESTR pwszStatusText)
909 TRACE("(%p)->(%lx, %d, %ld, %ld, %d, %s)\n", This, hChapter, eOperation, ulProgress, ulProgressMax,
910 eAsynchPhase, debugstr_w(pwszStatusText));
912 return IDBAsynchNotify_RemoteOnProgress_Proxy(This, hChapter, eOperation, ulProgress, ulProgressMax, eAsynchPhase,
913 pwszStatusText);
916 HRESULT __RPC_STUB IDBAsynchNotify_OnProgress_Stub(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
917 DBCOUNTITEM ulProgress, DBCOUNTITEM ulProgressMax, DBASYNCHPHASE eAsynchPhase,
918 LPOLESTR pwszStatusText)
920 TRACE("(%p)->(%lx, %d, %ld, %ld, %d, %s)\n", This, hChapter, eOperation, ulProgress, ulProgressMax,
921 eAsynchPhase, debugstr_w(pwszStatusText));
922 return IDBAsynchNotify_OnProgress(This, hChapter, eOperation, ulProgress, ulProgressMax, eAsynchPhase,
923 pwszStatusText);
926 HRESULT CALLBACK IDBAsynchNotify_OnStop_Proxy(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
927 HRESULT hrStatus, LPOLESTR pwszStatusText)
929 TRACE("(%p)->(%lx, %d, %08x, %s)\n", This, hChapter, eOperation, hrStatus, debugstr_w(pwszStatusText));
930 return IDBAsynchNotify_RemoteOnStop_Proxy(This, hChapter, eOperation, hrStatus, pwszStatusText);
933 HRESULT __RPC_STUB IDBAsynchNotify_OnStop_Stub(IDBAsynchNotify* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
934 HRESULT hrStatus, LPOLESTR pwszStatusText)
936 TRACE("(%p)->(%lx, %d, %08x, %s)\n", This, hChapter, eOperation, hrStatus, debugstr_w(pwszStatusText));
937 return IDBAsynchNotify_OnStop(This, hChapter, eOperation, hrStatus, pwszStatusText);
940 HRESULT CALLBACK IDBAsynchStatus_Abort_Proxy(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation)
942 FIXME("(%p)->(%lx, %d): stub\n", This, hChapter, eOperation);
943 return E_NOTIMPL;
946 HRESULT __RPC_STUB IDBAsynchStatus_Abort_Stub(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
947 IErrorInfo **ppErrorInfoRem)
949 FIXME("(%p)->(%lx, %d, %p): stub\n", This, hChapter, eOperation, ppErrorInfoRem);
950 return E_NOTIMPL;
953 HRESULT CALLBACK IDBAsynchStatus_GetStatus_Proxy(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
954 DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase,
955 LPOLESTR *ppwszStatusText)
957 FIXME("(%p)->(%lx, %d, %p, %p, %p, %p): stub\n", This, hChapter, eOperation, pulProgress, pulProgressMax,
958 peAsynchPhase, ppwszStatusText);
959 return E_NOTIMPL;
962 HRESULT __RPC_STUB IDBAsynchStatus_GetStatus_Stub(IDBAsynchStatus* This, HCHAPTER hChapter, DBASYNCHOP eOperation,
963 DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase,
964 LPOLESTR *ppwszStatusText, IErrorInfo **ppErrorInfoRem)
966 FIXME("(%p)->(%lx, %d, %p, %p, %p, %p, %p): stub\n", This, hChapter, eOperation, pulProgress, pulProgressMax,
967 peAsynchPhase, ppwszStatusText, ppErrorInfoRem);
968 return E_NOTIMPL;