Nikolay Sivov : oledb32: Implement IRowPosition::Initialize().
Alexandre Julliard
julliard at winehq.org
Thu Aug 1 14:25:45 CDT 2013
Module: wine
Branch: master
Commit: 0e2e8386978df1a1dfe4e1336b59924e102a251f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0e2e8386978df1a1dfe4e1336b59924e102a251f
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu Aug 1 07:53:48 2013 +0400
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 c7581b7..d789c19 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 9b87ba7..d1306e4 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
More information about the wine-cvs
mailing list