msdaps: Expose IRowsetLocate, IRowsetInfo and IAccessor on the client side.
[wine/hramrach.git] / dlls / msdaps / row_server.c
blob849ee788c5e712381adc5ed4387150335735d0bb
1 /*
2 * Row and rowset servers / proxies.
4 * Copyright 2010 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 static inline DBLENGTH db_type_size(DBTYPE type, DBLENGTH var_len)
44 switch(type)
46 case DBTYPE_I1:
47 case DBTYPE_UI1:
48 return 1;
49 case DBTYPE_I2:
50 case DBTYPE_UI2:
51 return 2;
52 case DBTYPE_I4:
53 case DBTYPE_UI4:
54 case DBTYPE_R4:
55 return 4;
56 case DBTYPE_I8:
57 case DBTYPE_UI8:
58 case DBTYPE_R8:
59 return 8;
60 case DBTYPE_CY:
61 return sizeof(CY);
62 case DBTYPE_FILETIME:
63 return sizeof(FILETIME);
64 case DBTYPE_BSTR:
65 return sizeof(BSTR);
66 case DBTYPE_GUID:
67 return sizeof(GUID);
68 case DBTYPE_WSTR:
69 return var_len;
70 default:
71 FIXME("Unhandled type %04x\n", type);
72 return 0;
76 typedef struct
78 const IWineRowServerVtbl *vtbl;
80 LONG ref;
82 CLSID class;
83 IMarshal *marshal;
84 IUnknown *inner_unk;
85 } server;
87 static inline server *impl_from_IWineRowServer(IWineRowServer *iface)
89 return (server *)((char*)iface - FIELD_OFFSET(server, vtbl));
92 static HRESULT WINAPI server_QueryInterface(IWineRowServer *iface, REFIID riid, void **obj)
94 server *This = impl_from_IWineRowServer(iface);
95 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
97 *obj = NULL;
99 if(IsEqualIID(riid, &IID_IUnknown) ||
100 IsEqualIID(riid, &IID_IWineRowServer))
102 *obj = iface;
104 else
106 if(!IsEqualIID(riid, &IID_IMarshal)) /* We use standard marshalling */
107 FIXME("interface %s not implemented\n", debugstr_guid(riid));
108 return E_NOINTERFACE;
111 IWineRowServer_AddRef(iface);
112 return S_OK;
115 static ULONG WINAPI server_AddRef(IWineRowServer *iface)
117 server *This = impl_from_IWineRowServer(iface);
118 TRACE("(%p)\n", This);
120 return InterlockedIncrement(&This->ref);
123 static ULONG WINAPI server_Release(IWineRowServer *iface)
125 server *This = impl_from_IWineRowServer(iface);
126 LONG ref;
128 TRACE("(%p)\n", This);
130 ref = InterlockedDecrement(&This->ref);
131 if(ref == 0)
133 IMarshal_Release(This->marshal);
134 if(This->inner_unk) IUnknown_Release(This->inner_unk);
135 HeapFree(GetProcessHeap(), 0, This);
138 return ref;
141 static HRESULT WINAPI server_SetInnerUnk(IWineRowServer *iface, IUnknown *inner)
143 server *This = impl_from_IWineRowServer(iface);
145 if(This->inner_unk) IUnknown_Release(This->inner_unk);
147 if(inner) IUnknown_AddRef(inner);
148 This->inner_unk = inner;
149 return S_OK;
152 static HRESULT WINAPI server_GetMarshal(IWineRowServer *iface, IMarshal **marshal)
154 server *This = impl_from_IWineRowServer(iface);
156 IMarshal_AddRef(This->marshal);
157 *marshal = This->marshal;
158 return S_OK;
161 static HRESULT WINAPI server_GetColumns(IWineRowServer* iface, DBORDINAL num_cols,
162 wine_getcolumns_in *in_data, wine_getcolumns_out *out_data)
164 server *This = impl_from_IWineRowServer(iface);
165 HRESULT hr;
166 DBORDINAL i;
167 DBCOLUMNACCESS *cols;
168 IRow *row;
170 TRACE("(%p)->(%d, %p, %p)\n", This, num_cols, in_data, out_data);
172 hr = IUnknown_QueryInterface(This->inner_unk, &IID_IRow, (void**)&row);
173 if(FAILED(hr)) return hr;
175 cols = CoTaskMemAlloc(num_cols * sizeof(cols[0]));
177 for(i = 0; i < num_cols; i++)
179 TRACE("%d:\tmax_len %d type %04x\n", i, in_data[i].max_len, in_data[i].type);
180 cols[i].pData = CoTaskMemAlloc(db_type_size(in_data[i].type, in_data[i].max_len));
181 cols[i].columnid = in_data[i].columnid;
182 cols[i].cbMaxLen = in_data[i].max_len;
183 cols[i].wType = in_data[i].type;
184 cols[i].bPrecision = in_data[i].precision;
185 cols[i].bScale = in_data[i].scale;
188 hr = IRow_GetColumns(row, num_cols, cols);
189 IRow_Release(row);
191 for(i = 0; i < num_cols; i++)
193 VariantInit(&out_data[i].v);
194 if(cols[i].dwStatus == DBSTATUS_S_OK)
196 V_VT(&out_data[i].v) = in_data[i].type;
197 memcpy(&V_I1(&out_data[i].v), cols[i].pData, cols[i].cbDataLen);
199 CoTaskMemFree(cols[i].pData);
200 out_data[i].data_len = cols[i].cbDataLen;
201 out_data[i].status = cols[i].dwStatus;
204 CoTaskMemFree(cols);
206 return hr;
209 static HRESULT WINAPI server_GetSourceRowset(IWineRowServer* iface, REFIID riid, IUnknown **ppRowset,
210 HROW *phRow)
212 server *This = impl_from_IWineRowServer(iface);
213 FIXME("(%p): stub\n", This);
214 return E_NOTIMPL;
217 static HRESULT WINAPI server_Open(IWineRowServer* iface, IUnknown *pUnkOuter, DBID *pColumnID,
218 REFGUID rguidColumnType, DWORD dwBindFlags, REFIID riid,
219 IUnknown **ppUnk)
221 server *This = impl_from_IWineRowServer(iface);
223 FIXME("(%p)->(%p, %p, %s, %08x, %s, %p): stub\n", This, pUnkOuter, pColumnID, debugstr_guid(rguidColumnType),
224 dwBindFlags, debugstr_guid(riid), ppUnk);
225 return E_NOTIMPL;
228 static HRESULT WINAPI server_SetColumns(IWineRowServer* iface, DBORDINAL num_cols,
229 wine_setcolumns_in *in_data, DBSTATUS *status)
231 server *This = impl_from_IWineRowServer(iface);
232 FIXME("(%p)->(%d, %p, %p): stub\n", This, num_cols, in_data, status);
233 return E_NOTIMPL;
236 static HRESULT WINAPI server_AddRefRows(IWineRowServer* iface, DBCOUNTITEM cRows,
237 const HROW rghRows[], DBREFCOUNT rgRefCounts[],
238 DBROWSTATUS rgRowStatus[])
240 server *This = impl_from_IWineRowServer(iface);
241 IRowset *rowset;
242 HRESULT hr;
244 TRACE("(%p)->(%d, %p, %p, %p)\n", This, cRows, rghRows, rgRefCounts, rgRowStatus);
246 hr = IUnknown_QueryInterface(This->inner_unk, &IID_IRowset, (void**)&rowset);
247 if(FAILED(hr)) return hr;
249 hr = IRowset_AddRefRows(rowset, cRows, rghRows, rgRefCounts, rgRowStatus);
251 IRowset_Release(rowset);
252 TRACE("returning %08x\n", hr);
253 return hr;
256 static HRESULT WINAPI server_GetData(IWineRowServer* iface, HROW hRow,
257 HACCESSOR hAccessor, BYTE *pData, DWORD size)
259 server *This = impl_from_IWineRowServer(iface);
260 FIXME("(%p)->(%08lx, %08lx, %p, %d): stub\n", This, hRow, hAccessor, pData, size);
261 return E_NOTIMPL;
264 static HRESULT WINAPI server_GetNextRows(IWineRowServer* iface, HCHAPTER hReserved, DBROWOFFSET lRowsOffset,
265 DBROWCOUNT cRows, DBCOUNTITEM *pcRowObtained, HROW **prghRows)
267 server *This = impl_from_IWineRowServer(iface);
268 IRowset *rowset;
269 HRESULT hr;
271 TRACE("(%p)->(%08lx, %d, %d, %p, %p)\n", This, hReserved, lRowsOffset, cRows, pcRowObtained, prghRows);
273 hr = IUnknown_QueryInterface(This->inner_unk, &IID_IRowset, (void**)&rowset);
274 if(FAILED(hr)) return hr;
276 *prghRows = NULL;
278 hr = IRowset_GetNextRows(rowset, hReserved, lRowsOffset, cRows, pcRowObtained, prghRows);
279 IRowset_Release(rowset);
280 TRACE("returning %08x, got %d rows\n", hr, *pcRowObtained);
281 return hr;
284 static HRESULT WINAPI server_ReleaseRows(IWineRowServer* iface, DBCOUNTITEM cRows, const HROW rghRows[],
285 DBROWOPTIONS rgRowOptions[], DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[])
287 server *This = impl_from_IWineRowServer(iface);
288 IRowset *rowset;
289 HRESULT hr;
291 TRACE("(%p)->(%d, %p, %p, %p, %p)\n", This, cRows, rghRows, rgRowOptions, rgRefCounts, rgRowStatus);
293 hr = IUnknown_QueryInterface(This->inner_unk, &IID_IRowset, (void**)&rowset);
294 if(FAILED(hr)) return hr;
296 hr = IRowset_ReleaseRows(rowset, cRows, rghRows, rgRowOptions, rgRefCounts, rgRowStatus);
297 IRowset_Release(rowset);
299 TRACE("returning %08x\n", hr);
300 return hr;
303 static HRESULT WINAPI server_RestartPosition(IWineRowServer* iface, HCHAPTER hReserved)
305 server *This = impl_from_IWineRowServer(iface);
306 FIXME("(%p)->(%08lx): stub\n", This, hReserved);
307 return E_NOTIMPL;
310 static HRESULT WINAPI server_Compare(IWineRowServer *iface, HCHAPTER hReserved, DBBKMARK cbBookmark1,
311 const BYTE *pBookmark1, DBBKMARK cbBookmark2, const BYTE *pBookmark2,
312 DBCOMPARE *pComparison)
314 server *This = impl_from_IWineRowServer(iface);
315 FIXME("(%p): stub\n", This);
316 return E_NOTIMPL;
319 static HRESULT WINAPI server_GetRowsAt(IWineRowServer *iface, HWATCHREGION hReserved1, HCHAPTER hReserved2,
320 DBBKMARK cbBookmark, const BYTE *pBookmark, DBROWOFFSET lRowsOffset,
321 DBROWCOUNT cRows, DBCOUNTITEM *pcRowsObtained, HROW **prghRows)
323 server *This = impl_from_IWineRowServer(iface);
325 FIXME("(%p)->(%08lx, %08lx, %d, %p, %d, %d, %p, %p): stub\n", This, hReserved1, hReserved2, cbBookmark, pBookmark,
326 lRowsOffset, cRows, pcRowsObtained, prghRows);
328 return E_NOTIMPL;
331 static HRESULT WINAPI server_GetRowsByBookmark(IWineRowServer *iface, HCHAPTER hReserved, DBCOUNTITEM cRows,
332 const DBBKMARK rgcbBookmarks[], const BYTE * rgpBookmarks[],
333 HROW rghRows[], DBROWSTATUS rgRowStatus[])
335 server *This = impl_from_IWineRowServer(iface);
336 FIXME("(%p): stub\n", This);
337 return E_NOTIMPL;
340 static HRESULT WINAPI server_Hash(IWineRowServer *iface, HCHAPTER hReserved, DBBKMARK cBookmarks,
341 const DBBKMARK rgcbBookmarks[], const BYTE * rgpBookmarks[],
342 DBHASHVALUE rgHashedValues[], DBROWSTATUS rgBookmarkStatus[])
344 server *This = impl_from_IWineRowServer(iface);
345 FIXME("(%p): stub\n", This);
346 return E_NOTIMPL;
349 static HRESULT WINAPI server_GetProperties(IWineRowServer* iface, ULONG cPropertyIDSets,
350 const DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropertySets,
351 DBPROPSET **prgPropertySets)
353 server *This = impl_from_IWineRowServer(iface);
354 FIXME("(%p)->(%d, %p, %p, %p)\n", This, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
355 return E_NOTIMPL;
358 static HRESULT WINAPI server_GetReferencedRowset(IWineRowServer* iface, DBORDINAL iOrdinal,
359 REFIID riid, IUnknown **ppReferencedRowset)
361 server *This = impl_from_IWineRowServer(iface);
362 FIXME("(%p): stub\n", This);
363 return E_NOTIMPL;
366 static HRESULT WINAPI server_GetSpecification(IWineRowServer* iface, REFIID riid,
367 IUnknown **ppSpecification)
369 server *This = impl_from_IWineRowServer(iface);
370 FIXME("(%p): stub\n", This);
371 return E_NOTIMPL;
374 static HRESULT WINAPI server_AddRefAccessor(IWineRowServer* iface, HACCESSOR hAccessor,
375 DBREFCOUNT *pcRefCount)
377 server *This = impl_from_IWineRowServer(iface);
378 FIXME("(%p): stub\n", This);
379 return E_NOTIMPL;
382 static HRESULT WINAPI server_CreateAccessor(IWineRowServer* iface, DBACCESSORFLAGS dwAccessorFlags,
383 DBCOUNTITEM cBindings, const DBBINDING *rgBindings, DBLENGTH cbRowSize,
384 HACCESSOR *phAccessor, DBBINDSTATUS *rgStatus)
386 server *This = impl_from_IWineRowServer(iface);
387 FIXME("(%p)->(%08x, %d, %p, %d, %p, %p): stub\n", This, dwAccessorFlags, cBindings, rgBindings, cbRowSize, phAccessor, rgStatus);
388 return E_NOTIMPL;
391 static HRESULT WINAPI server_GetBindings(IWineRowServer* iface, HACCESSOR hAccessor,
392 DBACCESSORFLAGS *pdwAccessorFlags, DBCOUNTITEM *pcBindings,
393 DBBINDING **prgBindings)
395 server *This = impl_from_IWineRowServer(iface);
396 FIXME("(%p)->(%08lx, %p, %p, %p): stub\n", This, hAccessor, pdwAccessorFlags, pcBindings, prgBindings);
397 return E_NOTIMPL;
400 static HRESULT WINAPI server_ReleaseAccessor(IWineRowServer* iface, HACCESSOR hAccessor,
401 DBREFCOUNT *pcRefCount)
403 server *This = impl_from_IWineRowServer(iface);
404 FIXME("(%p)->(%08lx, %p): stub\n", This, hAccessor, pcRefCount);
405 return E_NOTIMPL;
408 static const IWineRowServerVtbl server_vtbl =
410 server_QueryInterface,
411 server_AddRef,
412 server_Release,
413 server_SetInnerUnk,
414 server_GetMarshal,
415 server_GetColumns,
416 server_GetSourceRowset,
417 server_Open,
418 server_SetColumns,
419 server_AddRefRows,
420 server_GetData,
421 server_GetNextRows,
422 server_ReleaseRows,
423 server_RestartPosition,
424 server_Compare,
425 server_GetRowsAt,
426 server_GetRowsByBookmark,
427 server_Hash,
428 server_GetProperties,
429 server_GetReferencedRowset,
430 server_GetSpecification,
431 server_AddRefAccessor,
432 server_CreateAccessor,
433 server_GetBindings,
434 server_ReleaseAccessor
437 static HRESULT create_server(IUnknown *outer, const CLSID *class, void **obj)
439 server *server;
440 TRACE("(%p, %s, %p)\n", outer, debugstr_guid(class), obj);
442 *obj = NULL;
444 server = HeapAlloc(GetProcessHeap(), 0, sizeof(*server));
445 if(!server) return E_OUTOFMEMORY;
447 server->vtbl = &server_vtbl;
448 server->ref = 1;
449 server->class = *class;
450 server->inner_unk = NULL;
451 if(IsEqualGUID(class, &CLSID_wine_row_server))
452 create_row_marshal((IUnknown*)server, (void**)&server->marshal);
453 else if(IsEqualGUID(class, &CLSID_wine_rowset_server))
454 create_rowset_marshal((IUnknown*)server, (void**)&server->marshal);
455 else
456 ERR("create_server called with class %s\n", debugstr_guid(class));
458 *obj = server;
459 return S_OK;
462 HRESULT create_row_server(IUnknown *outer, void **obj)
464 return create_server(outer, &CLSID_wine_row_server, obj);
467 HRESULT create_rowset_server(IUnknown *outer, void **obj)
469 return create_server(outer, &CLSID_wine_rowset_server, obj);
472 typedef struct
474 const IRowVtbl *row_vtbl;
475 const IRowChangeVtbl *row_change_vtbl;
477 LONG ref;
479 IWineRowServer *server;
480 } row_proxy;
482 static inline row_proxy *impl_from_IRow(IRow *iface)
484 return (row_proxy *)((char*)iface - FIELD_OFFSET(row_proxy, row_vtbl));
487 static inline row_proxy *impl_from_IRowChange(IRowChange *iface)
489 return (row_proxy *)((char*)iface - FIELD_OFFSET(row_proxy, row_change_vtbl));
492 static HRESULT WINAPI row_QueryInterface(IRow *iface, REFIID iid, void **obj)
494 row_proxy *This = impl_from_IRow(iface);
495 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), obj);
497 if(IsEqualIID(iid, &IID_IUnknown) ||
498 IsEqualIID(iid, &IID_IRow))
500 *obj = &This->row_vtbl;
502 else if(IsEqualIID(iid, &IID_IRowChange))
504 *obj = &This->row_change_vtbl;
506 else
508 FIXME("interface %s not implemented\n", debugstr_guid(iid));
509 return E_NOINTERFACE;
512 IRow_AddRef(iface);
513 return S_OK;
516 static ULONG WINAPI row_AddRef(IRow *iface)
518 row_proxy *This = impl_from_IRow(iface);
519 TRACE("(%p)\n", This);
521 return InterlockedIncrement(&This->ref);
524 static ULONG WINAPI row_Release(IRow *iface)
526 row_proxy *This = impl_from_IRow(iface);
527 LONG ref;
529 TRACE("(%p)\n", This);
531 ref = InterlockedDecrement(&This->ref);
532 if(ref == 0)
534 if(This->server) IWineRowServer_Release(This->server);
535 HeapFree(GetProcessHeap(), 0, This);
538 return ref;
541 static HRESULT WINAPI row_GetColumns(IRow* iface, DBORDINAL cColumns, DBCOLUMNACCESS rgColumns[])
543 row_proxy *This = impl_from_IRow(iface);
544 DBORDINAL i;
545 wine_getcolumns_in *in_data;
546 wine_getcolumns_out *out_data;
547 HRESULT hr;
549 TRACE("(%p)->(%d, %p)\n", This, cColumns, rgColumns);
551 in_data = CoTaskMemAlloc(cColumns * sizeof(in_data[0]));
552 out_data = CoTaskMemAlloc(cColumns * sizeof(out_data[0]));
554 for(i = 0; i < cColumns; i++)
556 TRACE("%d:\tdata %p data_len %d status %08x max_len %d type %04x\n", i, rgColumns[i].pData,
557 rgColumns[i].cbDataLen, rgColumns[i].dwStatus, rgColumns[i].cbMaxLen, rgColumns[i].wType);
558 in_data[i].columnid = rgColumns[i].columnid;
559 in_data[i].max_len = rgColumns[i].cbMaxLen;
560 in_data[i].type = rgColumns[i].wType;
561 in_data[i].precision = rgColumns[i].bPrecision;
562 in_data[i].scale = rgColumns[i].bScale;
565 hr = IWineRowServer_GetColumns(This->server, cColumns, in_data, out_data);
567 for(i = 0; i < cColumns; i++)
569 rgColumns[i].cbDataLen = out_data[i].data_len;
570 rgColumns[i].dwStatus = out_data[i].status;
571 if(rgColumns[i].dwStatus == DBSTATUS_S_OK)
572 memcpy(rgColumns[i].pData, &V_I1(&out_data[i].v), out_data[i].data_len);
575 CoTaskMemFree(out_data);
576 CoTaskMemFree(in_data);
577 return hr;
580 static HRESULT WINAPI row_GetSourceRowset(IRow* iface, REFIID riid, IUnknown **ppRowset,
581 HROW *phRow)
583 row_proxy *This = impl_from_IRow(iface);
585 FIXME("(%p)->(%s, %p, %p): stub\n", This, debugstr_guid(riid), ppRowset, phRow);
587 return E_NOTIMPL;
590 static HRESULT WINAPI row_Open(IRow* iface, IUnknown *pUnkOuter,
591 DBID *pColumnID, REFGUID rguidColumnType,
592 DWORD dwBindFlags, REFIID riid, IUnknown **ppUnk)
594 row_proxy *This = impl_from_IRow(iface);
596 FIXME("(%p)->(%p, %p, %s, %08x, %s, %p): stub\n", This, pUnkOuter, pColumnID, debugstr_guid(rguidColumnType),
597 dwBindFlags, debugstr_guid(riid), ppUnk);
599 return E_NOTIMPL;
602 static const IRowVtbl row_vtbl =
604 row_QueryInterface,
605 row_AddRef,
606 row_Release,
607 row_GetColumns,
608 row_GetSourceRowset,
609 row_Open
612 static HRESULT WINAPI row_change_QueryInterface(IRowChange *iface, REFIID iid, void **obj)
614 row_proxy *This = impl_from_IRowChange(iface);
615 return IUnknown_QueryInterface((IUnknown *)This, iid, obj);
618 static ULONG WINAPI row_change_AddRef(IRowChange *iface)
620 row_proxy *This = impl_from_IRowChange(iface);
621 return IUnknown_AddRef((IUnknown*)This);
624 static ULONG WINAPI row_change_Release(IRowChange *iface)
626 row_proxy *This = impl_from_IRowChange(iface);
627 return IUnknown_Release((IUnknown*)This);
630 static HRESULT WINAPI row_change_SetColumns(IRowChange *iface, DBORDINAL cColumns,
631 DBCOLUMNACCESS rgColumns[])
633 row_proxy *This = impl_from_IRowChange(iface);
634 FIXME("(%p)->(%d, %p)\n", This, cColumns, rgColumns);
635 return E_NOTIMPL;
638 static const IRowChangeVtbl row_change_vtbl =
640 row_change_QueryInterface,
641 row_change_AddRef,
642 row_change_Release,
643 row_change_SetColumns
646 static HRESULT create_row_proxy(IWineRowServer *server, IUnknown **obj)
648 row_proxy *proxy;
650 TRACE("(%p, %p)\n", server, obj);
651 *obj = NULL;
653 proxy = HeapAlloc(GetProcessHeap(), 0, sizeof(*proxy));
654 if(!proxy) return E_OUTOFMEMORY;
656 proxy->row_vtbl = &row_vtbl;
657 proxy->row_change_vtbl = &row_change_vtbl;
658 proxy->ref = 1;
659 IWineRowServer_AddRef(server);
660 proxy->server = server;
662 *obj = (IUnknown*)&proxy->row_vtbl;
663 TRACE("returing %p\n", *obj);
664 return S_OK;
667 typedef struct
669 const IRowsetVtbl *rowset_vtbl;
670 const IRowsetLocateVtbl *rowsetlocate_vtbl;
671 const IRowsetInfoVtbl *rowsetinfo_vtbl;
672 const IAccessorVtbl *accessor_vtbl;
674 LONG ref;
676 IWineRowServer *server;
677 } rowset_proxy;
679 static inline rowset_proxy *impl_from_IRowset(IRowset *iface)
681 return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowset_vtbl));
684 static inline rowset_proxy *impl_from_IRowsetLocate(IRowsetLocate *iface)
686 return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowsetlocate_vtbl));
689 static inline rowset_proxy *impl_from_IRowsetInfo(IRowsetInfo *iface)
691 return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, rowsetinfo_vtbl));
694 static inline rowset_proxy *impl_from_IAccessor(IAccessor *iface)
696 return (rowset_proxy *)((char*)iface - FIELD_OFFSET(rowset_proxy, accessor_vtbl));
699 static HRESULT WINAPI rowset_QueryInterface(IRowset *iface, REFIID iid, void **obj)
701 rowset_proxy *This = impl_from_IRowset(iface);
702 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), obj);
704 *obj = NULL;
706 if(IsEqualIID(iid, &IID_IUnknown) ||
707 IsEqualIID(iid, &IID_IRowset))
709 *obj = &This->rowset_vtbl;
711 else if(IsEqualIID(iid, &IID_IRowsetLocate))
713 *obj = &This->rowsetlocate_vtbl;
715 else if(IsEqualIID(iid, &IID_IRowsetInfo))
717 *obj = &This->rowsetinfo_vtbl;
719 else if(IsEqualIID(iid, &IID_IAccessor))
721 *obj = &This->accessor_vtbl;
723 else
725 FIXME("interface %s not implemented\n", debugstr_guid(iid));
726 return E_NOINTERFACE;
729 IRowset_AddRef(iface);
730 return S_OK;
733 static ULONG WINAPI rowset_AddRef(IRowset *iface)
735 rowset_proxy *This = impl_from_IRowset(iface);
736 TRACE("(%p)\n", This);
738 return InterlockedIncrement(&This->ref);
741 static ULONG WINAPI rowset_Release(IRowset *iface)
743 rowset_proxy *This = impl_from_IRowset(iface);
744 LONG ref;
746 TRACE("(%p)\n", This);
748 ref = InterlockedDecrement(&This->ref);
749 if(ref == 0)
751 if(This->server) IWineRowServer_Release(This->server);
752 HeapFree(GetProcessHeap(), 0, This);
755 return ref;
758 static HRESULT WINAPI rowset_AddRefRows(IRowset *iface, DBCOUNTITEM cRows, const HROW rghRows[],
759 DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[])
761 rowset_proxy *This = impl_from_IRowset(iface);
762 HRESULT hr;
763 DBREFCOUNT *refs = rgRefCounts;
764 DBSTATUS *stats = rgRowStatus;
766 TRACE("(%p)->(%d, %p, %p, %p)\n", This, cRows, rghRows, rgRefCounts, rgRowStatus);
768 if(!refs) refs = CoTaskMemAlloc(cRows * sizeof(refs[0]));
769 if(!stats) stats = CoTaskMemAlloc(cRows * sizeof(stats[0]));
771 hr = IWineRowServer_AddRefRows(This->server, cRows, rghRows, refs, stats);
773 if(refs != rgRefCounts) CoTaskMemFree(refs);
774 if(stats != rgRowStatus) CoTaskMemFree(stats);
776 return hr;
779 static HRESULT WINAPI rowset_GetData(IRowset *iface, HROW hRow, HACCESSOR hAccessor, void *pData)
781 rowset_proxy *This = impl_from_IRowset(iface);
783 FIXME("(%p)->(%lx, %lx, %p): stub\n", This, hRow, hAccessor, pData);
785 return E_NOTIMPL;
788 static HRESULT WINAPI rowset_GetNextRows(IRowset *iface, HCHAPTER hReserved, DBROWOFFSET lRowsOffset,
789 DBROWCOUNT cRows, DBCOUNTITEM *pcRowObtained, HROW **prghRows)
791 rowset_proxy *This = impl_from_IRowset(iface);
792 HRESULT hr;
793 HROW *rows = NULL;
795 TRACE("(%p)->(%08lx, %d, %d, %p, %p)\n", This, hReserved, lRowsOffset, cRows, pcRowObtained, prghRows);
797 hr = IWineRowServer_GetNextRows(This->server, hReserved, lRowsOffset, cRows, pcRowObtained, &rows);
798 if(*prghRows)
800 memcpy(*prghRows, rows, *pcRowObtained * sizeof(rows[0]));
801 CoTaskMemFree(rows);
803 else
804 *prghRows = rows;
806 return hr;
809 static HRESULT WINAPI rowset_ReleaseRows(IRowset *iface, DBCOUNTITEM cRows, const HROW rghRows[],
810 DBROWOPTIONS rgRowOptions[], DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[])
812 rowset_proxy *This = impl_from_IRowset(iface);
813 HRESULT hr;
814 DBROWOPTIONS *options = rgRowOptions;
815 DBREFCOUNT *refs = rgRefCounts;
816 DBROWSTATUS *status = rgRowStatus;
818 TRACE("(%p)->(%d, %p, %p, %p, %p)\n", This, cRows, rghRows, rgRowOptions, rgRefCounts, rgRowStatus);
820 if(!options)
822 options = CoTaskMemAlloc(cRows * sizeof(options[0]));
823 memset(options, 0, cRows * sizeof(options[0]));
825 if(!refs) refs = CoTaskMemAlloc(cRows * sizeof(refs[0]));
826 if(!status) status = CoTaskMemAlloc(cRows * sizeof(status[0]));
828 hr = IWineRowServer_ReleaseRows(This->server, cRows, rghRows, options, refs, status);
830 if(status != rgRowStatus) CoTaskMemFree(status);
831 if(refs != rgRefCounts) CoTaskMemFree(refs);
832 if(options != rgRowOptions) CoTaskMemFree(options);
834 return hr;
837 static HRESULT WINAPI rowset_RestartPosition(IRowset* iface, HCHAPTER hReserved)
839 rowset_proxy *This = impl_from_IRowset(iface);
841 FIXME("(%p)->(%lx): stub\n", This, hReserved);
843 return E_NOTIMPL;
846 static const IRowsetVtbl rowset_vtbl =
848 rowset_QueryInterface,
849 rowset_AddRef,
850 rowset_Release,
851 rowset_AddRefRows,
852 rowset_GetData,
853 rowset_GetNextRows,
854 rowset_ReleaseRows,
855 rowset_RestartPosition
858 static HRESULT WINAPI rowsetlocate_QueryInterface(IRowsetLocate *iface, REFIID iid, void **obj)
860 rowset_proxy *This = impl_from_IRowsetLocate(iface);
861 return IUnknown_QueryInterface((IUnknown *)This, iid, obj);
864 static ULONG WINAPI rowsetlocate_AddRef(IRowsetLocate *iface)
866 rowset_proxy *This = impl_from_IRowsetLocate(iface);
867 return IUnknown_AddRef((IUnknown *)This);
870 static ULONG WINAPI rowsetlocate_Release(IRowsetLocate *iface)
872 rowset_proxy *This = impl_from_IRowsetLocate(iface);
873 return IUnknown_Release((IUnknown *)This);
876 static HRESULT WINAPI rowsetlocate_AddRefRows(IRowsetLocate *iface, DBCOUNTITEM cRows, const HROW rghRows[],
877 DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[])
879 rowset_proxy *This = impl_from_IRowsetLocate(iface);
880 return IRowset_AddRefRows((IRowset*)This, cRows, rghRows, rgRefCounts, rgRowStatus);
883 static HRESULT WINAPI rowsetlocate_GetData(IRowsetLocate *iface, HROW hRow, HACCESSOR hAccessor, void *pData)
885 rowset_proxy *This = impl_from_IRowsetLocate(iface);
886 return IRowset_GetData((IRowset*)This, hRow, hAccessor, pData);
889 static HRESULT WINAPI rowsetlocate_GetNextRows(IRowsetLocate *iface, HCHAPTER hReserved, DBROWOFFSET lRowsOffset,
890 DBROWCOUNT cRows, DBCOUNTITEM *pcRowObtained, HROW **prghRows)
892 rowset_proxy *This = impl_from_IRowsetLocate(iface);
893 return IRowset_GetNextRows((IRowset*)This, hReserved, lRowsOffset, cRows, pcRowObtained, prghRows);
896 static HRESULT WINAPI rowsetlocate_ReleaseRows(IRowsetLocate *iface, DBCOUNTITEM cRows, const HROW rghRows[],
897 DBROWOPTIONS rgRowOptions[], DBREFCOUNT rgRefCounts[], DBROWSTATUS rgRowStatus[])
899 rowset_proxy *This = impl_from_IRowsetLocate(iface);
900 return IRowset_ReleaseRows((IRowset*)This, cRows, rghRows, rgRowOptions, rgRefCounts, rgRowStatus);
903 static HRESULT WINAPI rowsetlocate_RestartPosition(IRowsetLocate *iface, HCHAPTER hReserved)
905 rowset_proxy *This = impl_from_IRowsetLocate(iface);
906 return IRowset_RestartPosition((IRowset*)This, hReserved);
909 static HRESULT WINAPI rowsetlocate_Compare(IRowsetLocate *iface, HCHAPTER hReserved, DBBKMARK cbBookmark1, const BYTE *pBookmark1,
910 DBBKMARK cbBookmark2, const BYTE *pBookmark2, DBCOMPARE *pComparison)
912 rowset_proxy *This = impl_from_IRowsetLocate(iface);
913 FIXME("(%p)\n", This);
914 return E_NOTIMPL;
917 static HRESULT WINAPI rowsetlocate_GetRowsAt(IRowsetLocate *iface, HWATCHREGION hReserved1, HCHAPTER hReserved2, DBBKMARK cbBookmark,
918 const BYTE *pBookmark, DBROWOFFSET lRowsOffset, DBROWCOUNT cRows, DBCOUNTITEM *pcRowsObtained,
919 HROW **prghRows)
921 rowset_proxy *This = impl_from_IRowsetLocate(iface);
922 FIXME("(%p)\n", This);
923 return E_NOTIMPL;
926 static HRESULT WINAPI rowsetlocate_GetRowsByBookmark(IRowsetLocate *iface, HCHAPTER hReserved, DBCOUNTITEM cRows, const DBBKMARK rgcbBookmarks[],
927 const BYTE * rgpBookmarks[], HROW rghRows[], DBROWSTATUS rgRowStatus[])
929 rowset_proxy *This = impl_from_IRowsetLocate(iface);
930 FIXME("(%p)\n", This);
931 return E_NOTIMPL;
934 static HRESULT WINAPI rowsetlocate_Hash(IRowsetLocate *iface, HCHAPTER hReserved, DBBKMARK cBookmarks, const DBBKMARK rgcbBookmarks[],
935 const BYTE * rgpBookmarks[], DBHASHVALUE rgHashedValues[], DBROWSTATUS rgBookmarkStatus[])
937 rowset_proxy *This = impl_from_IRowsetLocate(iface);
938 FIXME("(%p)\n", This);
939 return E_NOTIMPL;
942 static const IRowsetLocateVtbl rowsetlocate_vtbl =
944 rowsetlocate_QueryInterface,
945 rowsetlocate_AddRef,
946 rowsetlocate_Release,
947 rowsetlocate_AddRefRows,
948 rowsetlocate_GetData,
949 rowsetlocate_GetNextRows,
950 rowsetlocate_ReleaseRows,
951 rowsetlocate_RestartPosition,
952 rowsetlocate_Compare,
953 rowsetlocate_GetRowsAt,
954 rowsetlocate_GetRowsByBookmark,
955 rowsetlocate_Hash
958 static HRESULT WINAPI rowsetinfo_QueryInterface(IRowsetInfo *iface, REFIID iid, void **obj)
960 rowset_proxy *This = impl_from_IRowsetInfo(iface);
961 return IUnknown_QueryInterface((IUnknown *)This, iid, obj);
964 static ULONG WINAPI rowsetinfo_AddRef(IRowsetInfo *iface)
966 rowset_proxy *This = impl_from_IRowsetInfo(iface);
967 return IUnknown_AddRef((IUnknown *)This);
970 static ULONG WINAPI rowsetinfo_Release(IRowsetInfo *iface)
972 rowset_proxy *This = impl_from_IRowsetInfo(iface);
973 return IUnknown_Release((IUnknown *)This);
976 static HRESULT WINAPI rowsetinfo_GetProperties(IRowsetInfo *iface, const ULONG cPropertyIDSets,
977 const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertySets,
978 DBPROPSET **prgPropertySets)
980 rowset_proxy *This = impl_from_IRowsetInfo(iface);
981 FIXME("(%p)\n", This);
982 return E_NOTIMPL;
985 static HRESULT WINAPI rowsetinfo_GetReferencedRowset(IRowsetInfo *iface, DBORDINAL iOrdinal, REFIID riid,
986 IUnknown **ppReferencedRowset)
988 rowset_proxy *This = impl_from_IRowsetInfo(iface);
989 FIXME("(%p)\n", This);
990 return E_NOTIMPL;
993 static HRESULT WINAPI rowsetinfo_GetSpecification(IRowsetInfo *iface, REFIID riid, IUnknown **ppSpecification)
995 rowset_proxy *This = impl_from_IRowsetInfo(iface);
996 FIXME("(%p)\n", This);
997 return E_NOTIMPL;
1000 static const IRowsetInfoVtbl rowsetinfo_vtbl =
1002 rowsetinfo_QueryInterface,
1003 rowsetinfo_AddRef,
1004 rowsetinfo_Release,
1005 rowsetinfo_GetProperties,
1006 rowsetinfo_GetReferencedRowset,
1007 rowsetinfo_GetSpecification
1010 static HRESULT WINAPI accessor_QueryInterface(IAccessor *iface, REFIID iid, void **obj)
1012 rowset_proxy *This = impl_from_IAccessor(iface);
1013 return IUnknown_QueryInterface((IUnknown *)This, iid, obj);
1016 static ULONG WINAPI accessor_AddRef(IAccessor *iface)
1018 rowset_proxy *This = impl_from_IAccessor(iface);
1019 return IUnknown_AddRef((IUnknown *)This);
1022 static ULONG WINAPI accessor_Release(IAccessor *iface)
1024 rowset_proxy *This = impl_from_IAccessor(iface);
1025 return IUnknown_Release((IUnknown *)This);
1028 static HRESULT WINAPI accessor_AddRefAccessor(IAccessor *iface, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount)
1030 rowset_proxy *This = impl_from_IAccessor(iface);
1031 FIXME("(%p)\n", This);
1032 return E_NOTIMPL;
1035 static HRESULT WINAPI accessor_CreateAccessor(IAccessor *iface, DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings,
1036 const DBBINDING rgBindings[], DBLENGTH cbRowSize, HACCESSOR *phAccessor,
1037 DBBINDSTATUS rgStatus[])
1039 rowset_proxy *This = impl_from_IAccessor(iface);
1040 FIXME("(%p)\n", This);
1041 return E_NOTIMPL;
1044 static HRESULT WINAPI accessor_GetBindings(IAccessor *iface, HACCESSOR hAccessor, DBACCESSORFLAGS *pdwAccessorFlags,
1045 DBCOUNTITEM *pcBindings, DBBINDING **prgBindings)
1047 rowset_proxy *This = impl_from_IAccessor(iface);
1048 FIXME("(%p)\n", This);
1049 return E_NOTIMPL;
1052 static HRESULT WINAPI accessor_ReleaseAccessor(IAccessor *iface, HACCESSOR hAccessor, DBREFCOUNT *pcRefCount)
1054 rowset_proxy *This = impl_from_IAccessor(iface);
1055 FIXME("(%p)\n", This);
1056 return E_NOTIMPL;
1059 static const IAccessorVtbl accessor_vtbl =
1061 accessor_QueryInterface,
1062 accessor_AddRef,
1063 accessor_Release,
1064 accessor_AddRefAccessor,
1065 accessor_CreateAccessor,
1066 accessor_GetBindings,
1067 accessor_ReleaseAccessor
1070 HRESULT create_rowset_proxy(IWineRowServer *server, IUnknown **obj)
1072 rowset_proxy *proxy;
1074 TRACE("(%p, %p)\n", server, obj);
1075 *obj = NULL;
1077 proxy = HeapAlloc(GetProcessHeap(), 0, sizeof(*proxy));
1078 if(!proxy) return E_OUTOFMEMORY;
1080 proxy->rowset_vtbl = &rowset_vtbl;
1081 proxy->rowsetlocate_vtbl = &rowsetlocate_vtbl;
1082 proxy->rowsetinfo_vtbl = &rowsetinfo_vtbl;
1083 proxy->accessor_vtbl = &accessor_vtbl;
1084 proxy->ref = 1;
1085 IWineRowServer_AddRef(server);
1086 proxy->server = server;
1088 *obj = (IUnknown *)&proxy->rowset_vtbl;
1089 TRACE("returing %p\n", *obj);
1090 return S_OK;
1093 static HRESULT create_proxy(IWineRowServer *server, const CLSID *class, IUnknown **obj)
1095 *obj = NULL;
1097 if(IsEqualGUID(class, &CLSID_wine_row_proxy))
1098 return create_row_proxy(server, obj);
1099 else if(IsEqualGUID(class, &CLSID_wine_rowset_proxy))
1100 return create_rowset_proxy(server, obj);
1101 else
1102 FIXME("Unhandled proxy class %s\n", debugstr_guid(class));
1103 return E_NOTIMPL;
1106 /* Marshal impl */
1108 typedef struct
1110 const IMarshalVtbl *marshal_vtbl;
1112 LONG ref;
1113 CLSID unmarshal_class;
1114 IUnknown *outer;
1115 } marshal;
1117 static inline marshal *impl_from_IMarshal(IMarshal *iface)
1119 return (marshal *)((char*)iface - FIELD_OFFSET(marshal, marshal_vtbl));
1122 static HRESULT WINAPI marshal_QueryInterface(IMarshal *iface, REFIID iid, void **obj)
1124 marshal *This = impl_from_IMarshal(iface);
1125 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), obj);
1127 if(IsEqualIID(iid, &IID_IUnknown) ||
1128 IsEqualIID(iid, &IID_IMarshal))
1130 *obj = iface;
1132 else
1134 FIXME("interface %s not implemented\n", debugstr_guid(iid));
1135 *obj = NULL;
1136 return E_NOINTERFACE;
1139 IMarshal_AddRef(iface);
1140 return S_OK;
1143 static ULONG WINAPI marshal_AddRef(IMarshal *iface)
1145 marshal *This = impl_from_IMarshal(iface);
1146 TRACE("(%p)\n", This);
1147 return InterlockedIncrement(&This->ref);
1150 static ULONG WINAPI marshal_Release(IMarshal *iface)
1152 marshal *This = impl_from_IMarshal(iface);
1153 LONG ref;
1155 TRACE("(%p)\n", This);
1157 ref = InterlockedDecrement(&This->ref);
1158 if(ref == 0)
1160 HeapFree(GetProcessHeap(), 0, This);
1163 return ref;
1166 static HRESULT WINAPI marshal_GetUnmarshalClass(IMarshal *iface, REFIID iid, void *obj,
1167 DWORD dwDestContext, void *pvDestContext,
1168 DWORD mshlflags, CLSID *clsid)
1170 marshal *This = impl_from_IMarshal(iface);
1171 TRACE("(%p)->(%s, %p, %08x, %p, %08x, %p)\n", This, debugstr_guid(iid), obj, dwDestContext,
1172 pvDestContext, mshlflags, clsid);
1174 *clsid = This->unmarshal_class;
1175 return S_OK;
1178 static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, void *obj,
1179 DWORD dwDestContext, void *pvDestContext,
1180 DWORD mshlflags, DWORD *size)
1182 marshal *This = impl_from_IMarshal(iface);
1183 TRACE("(%p)->(%s, %p, %08x, %p, %08x, %p)\n", This, debugstr_guid(iid), obj, dwDestContext,
1184 pvDestContext, mshlflags, size);
1186 return CoGetMarshalSizeMax(size, &IID_IWineRowServer, This->outer, dwDestContext, pvDestContext,
1187 mshlflags);
1190 static HRESULT WINAPI marshal_MarshalInterface(IMarshal *iface, IStream *stream, REFIID iid,
1191 void *obj, DWORD dwDestContext, void *pvDestContext,
1192 DWORD mshlflags)
1194 marshal *This = impl_from_IMarshal(iface);
1195 TRACE("(%p)->(%p, %s, %p, %08x, %p, %08x)\n", This, stream, debugstr_guid(iid), obj, dwDestContext,
1196 pvDestContext, mshlflags);
1198 return CoMarshalInterface(stream, &IID_IWineRowServer, This->outer, dwDestContext, pvDestContext, mshlflags);
1201 static HRESULT WINAPI marshal_UnmarshalInterface(IMarshal *iface, IStream *stream,
1202 REFIID iid, void **obj)
1204 marshal *This = impl_from_IMarshal(iface);
1205 HRESULT hr;
1206 IWineRowServer *server;
1207 IUnknown *proxy;
1209 TRACE("(%p)->(%p, %s, %p)\n", This, stream, debugstr_guid(iid), obj);
1210 *obj = NULL;
1212 hr = CoUnmarshalInterface(stream, &IID_IWineRowServer, (void**)&server);
1213 if(SUCCEEDED(hr))
1215 hr = create_proxy(server, &This->unmarshal_class, &proxy);
1216 if(SUCCEEDED(hr))
1218 hr = IUnknown_QueryInterface(proxy, iid, obj);
1219 IUnknown_Release(proxy);
1221 IWineRowServer_Release(server);
1224 TRACE("returing %p\n", *obj);
1225 return hr;
1228 static HRESULT WINAPI marshal_ReleaseMarshalData(IMarshal *iface, IStream *stream)
1230 marshal *This = impl_from_IMarshal(iface);
1231 TRACE("(%p)->(%p)\n", This, stream);
1232 return CoReleaseMarshalData(stream);
1235 static HRESULT WINAPI marshal_DisconnectObject(IMarshal *iface, DWORD dwReserved)
1237 marshal *This = impl_from_IMarshal(iface);
1238 FIXME("(%p)->(%08x)\n", This, dwReserved);
1240 return E_NOTIMPL;
1243 static const IMarshalVtbl marshal_vtbl =
1245 marshal_QueryInterface,
1246 marshal_AddRef,
1247 marshal_Release,
1248 marshal_GetUnmarshalClass,
1249 marshal_GetMarshalSizeMax,
1250 marshal_MarshalInterface,
1251 marshal_UnmarshalInterface,
1252 marshal_ReleaseMarshalData,
1253 marshal_DisconnectObject
1256 static HRESULT create_marshal(IUnknown *outer, const CLSID *class, void **obj)
1258 marshal *marshal;
1260 TRACE("(%p, %p)\n", outer, obj);
1261 *obj = NULL;
1263 marshal = HeapAlloc(GetProcessHeap(), 0, sizeof(*marshal));
1264 if(!marshal) return E_OUTOFMEMORY;
1266 marshal->unmarshal_class = *class;
1267 marshal->outer = outer; /* don't ref outer unk */
1268 marshal->marshal_vtbl = &marshal_vtbl;
1269 marshal->ref = 1;
1271 *obj = &marshal->marshal_vtbl;
1272 TRACE("returing %p\n", *obj);
1273 return S_OK;
1276 HRESULT create_row_marshal(IUnknown *outer, void **obj)
1278 TRACE("(%p, %p)\n", outer, obj);
1279 return create_marshal(outer, &CLSID_wine_row_proxy, obj);
1282 HRESULT create_rowset_marshal(IUnknown *outer, void **obj)
1284 TRACE("(%p, %p)\n", outer, obj);
1285 return create_marshal(outer, &CLSID_wine_rowset_proxy, obj);