Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/msado15/recordset.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index 5ad593dce5c..2a4c23055a8 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -46,6 +46,7 @@ struct recordset VARIANT *data; CursorLocationEnum cursor_location; CursorTypeEnum cursor_type; + IUnknown *row_set; };
struct fields @@ -757,6 +758,8 @@ static void close_recordset( struct recordset *recordset ) { ULONG row, col, col_count;
+ if (recordset->row_set) IUnknown_Release(recordset->row_set); + if (!recordset->fields) return; col_count = get_column_count( recordset );
@@ -1611,15 +1614,26 @@ static HRESULT WINAPI rsconstruction_Invoke(ADORecordsetConstruction *iface, DIS static HRESULT WINAPI rsconstruction_get_Rowset(ADORecordsetConstruction *iface, IUnknown **row_set) { struct recordset *recordset = impl_from_ADORecordsetConstruction( iface ); - FIXME("%p, %p\n", recordset, row_set); - return E_NOTIMPL; + + TRACE("%p, %p\n", recordset, row_set); + + *row_set = recordset->row_set; + if (recordset->row_set) IUnknown_AddRef(recordset->row_set); + + return S_OK; }
static HRESULT WINAPI rsconstruction_put_Rowset(ADORecordsetConstruction *iface, IUnknown *row_set) { struct recordset *recordset = impl_from_ADORecordsetConstruction( iface ); - FIXME("%p, %p\n", recordset, row_set); - return E_NOTIMPL; + + TRACE("%p, %p\n", recordset, row_set); + + if (recordset->row_set) IUnknown_Release(recordset->row_set); + recordset->row_set = row_set; + if (recordset->row_set) IUnknown_AddRef(recordset->row_set); + + return S_OK; }
static HRESULT WINAPI rsconstruction_get_Chapter(ADORecordsetConstruction *iface, LONG *chapter) @@ -1679,6 +1693,7 @@ HRESULT Recordset_create( void **obj ) recordset->index = -1; recordset->cursor_location = adUseServer; recordset->cursor_type = adOpenForwardOnly; + recordset->row_set = NULL;
*obj = &recordset->Recordset_iface; TRACE( "returning iface %p\n", *obj );
On Fri, 2020-10-30 at 18:50 +1100, Alistair Leslie-Hughes wrote:
static HRESULT WINAPI rsconstruction_put_Rowset(ADORecordsetConstruction *iface, IUnknown *row_set) { struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
- FIXME("%p, %p\n", recordset, row_set);
- return E_NOTIMPL;
- TRACE("%p, %p\n", recordset, row_set);
- if (recordset->row_set) IUnknown_Release(recordset->row_set);
- recordset->row_set = row_set;
- if (recordset->row_set) IUnknown_AddRef(recordset->row_set);
- return S_OK;
}
This is supposed to turn the row_set into a Recordset object but you only store a reference. This could use some tests around the interaction between these objects.
On 30/10/20 8:09 pm, Hans Leidekker wrote:
On Fri, 2020-10-30 at 18:50 +1100, Alistair Leslie-Hughes wrote:
static HRESULT WINAPI rsconstruction_put_Rowset(ADORecordsetConstruction *iface, IUnknown *row_set) { struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
- FIXME("%p, %p\n", recordset, row_set);
- return E_NOTIMPL;
- TRACE("%p, %p\n", recordset, row_set);
- if (recordset->row_set) IUnknown_Release(recordset->row_set);
- recordset->row_set = row_set;
- if (recordset->row_set) IUnknown_AddRef(recordset->row_set);
- return S_OK; }
This is supposed to turn the row_set into a Recordset object but you only store a reference. This could use some tests around the interaction between these objects.
Based off this one, it appears the pointer is stored. How that point is used internally is another issue. I suspect that when set, the rowset point is used to get/set data.
https://docs.microsoft.com/en-us/archive/msdn-magazine/2000/july/house-of-co...
I'll attempt to add tests to illustrate how the objects relate.
Regards Alistair.