From 0e2e8386978df1a1dfe4e1336b59924e102a251f Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 1 Aug 2013 07:53:48 +0400 Subject: [PATCH] oledb32: Implement IRowPosition::Initialize(). --- dlls/oledb32/rowpos.c | 15 +++++++++++++-- include/oledberr.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/oledb32/rowpos.c b/dlls/oledb32/rowpos.c index c7581b731cb..d789c1918b5 100644 --- a/dlls/oledb32/rowpos.c +++ b/dlls/oledb32/rowpos.c @@ -23,6 +23,7 @@ #include "ole2.h" #include "oledb.h" +#include "oledberr.h" #include "oledb_private.h" #include "wine/debug.h" @@ -33,6 +34,8 @@ typedef struct { IRowPosition IRowPosition_iface; LONG ref; + + IRowset *rowset; } rowpos; static inline rowpos *impl_from_IRowPosition(IRowPosition *iface) @@ -79,7 +82,10 @@ static ULONG WINAPI rowpos_Release(IRowPosition* iface) TRACE("(%p)->(%d)\n", This, ref); if (ref == 0) + { + if (This->rowset) IRowset_Release(This->rowset); HeapFree(GetProcessHeap(), 0, This); + } return ref; } @@ -109,8 +115,12 @@ static HRESULT WINAPI rowpos_GetRowset(IRowPosition *iface, REFIID riid, IUnknow static HRESULT WINAPI rowpos_Initialize(IRowPosition *iface, IUnknown *rowset) { rowpos *This = impl_from_IRowPosition(iface); - FIXME("(%p)->(%p): stub\n", This, rowset); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, rowset); + + if (This->rowset) return DB_E_ALREADYINITIALIZED; + + return IUnknown_QueryInterface(rowset, &IID_IRowset, (void**)&This->rowset); } static HRESULT WINAPI rowpos_SetRowPosition(IRowPosition *iface, HCHAPTER chapter, @@ -148,6 +158,7 @@ HRESULT create_oledb_rowpos(IUnknown *outer, void **obj) This->IRowPosition_iface.lpVtbl = &rowpos_vtbl; This->ref = 1; + This->rowset = NULL; *obj = &This->IRowPosition_iface; diff --git a/include/oledberr.h b/include/oledberr.h index 9b87ba7737e..d1306e44e16 100644 --- a/include/oledberr.h +++ b/include/oledberr.h @@ -42,6 +42,7 @@ #define DB_E_BADPROPERTYVALUE 0x80040e44 #define DB_E_INVALID 0x80040e45 +#define DB_E_ALREADYINITIALIZED 0x80040e52 #define DB_E_DATAOVERFLOW 0x80040e57 #define DB_E_MISMATCHEDPROVIDER 0x80040e75