From 56e2ac139c828a8f724c9a0939bcd49a72b418bc Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Thu, 12 Dec 2019 17:12:23 +0100 Subject: [PATCH] msado15: Implement Field_get_Attributes and Field_get_DefinedSize. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msado15/recordset.c | 16 ++++++++++++---- dlls/msado15/tests/msado15.c | 22 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index ff06b8789a4..b262243d899 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -147,14 +147,22 @@ static HRESULT WINAPI field_get_ActualSize( Field *iface, LONG *size ) static HRESULT WINAPI field_get_Attributes( Field *iface, LONG *attrs ) { - TRACE( "%p, %p\n", iface, attrs ); - return E_NOTIMPL; + struct field *field = impl_from_Field( iface ); + + TRACE( "%p, %p\n", field, attrs ); + + *attrs = field->attrs; + return S_OK; } static HRESULT WINAPI field_get_DefinedSize( Field *iface, LONG *size ) { - FIXME( "%p, %p\n", iface, size ); - return E_NOTIMPL; + struct field *field = impl_from_Field( iface ); + + TRACE( "%p, %p\n", field, size ); + + *size = field->defined_size; + return S_OK; } static HRESULT WINAPI field_get_Name( Field *iface, BSTR *str ) diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index 800eb236fe8..f9a5377c50f 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -101,7 +101,9 @@ static void test_Fields(void) Field *field, *field2; VARIANT val, index; BSTR name; - LONG refs, count; + LONG refs, count, size; + DataTypeEnum type; + FieldAttributeEnum attrs; HRESULT hr; hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset ); @@ -164,6 +166,24 @@ static void test_Fields(void) Field_Release( field2 ); SysFreeString( name ); + /* verify values set with _Append */ + hr = Field_get_Name( field, &name ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !lstrcmpW( name, L"field" ), "got %s\n", wine_dbgstr_w(name) ); + SysFreeString( name ); + type = 0xdead; + hr = Field_get_Type( field, &type ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( type == adInteger, "got %d\n", type ); + size = -1; + hr = Field_get_DefinedSize( field, &size ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( size == 4, "got %d\n", size ); + attrs = 0xdead; + hr = Field_get_Attributes( field, &attrs ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !attrs, "got %d\n", attrs ); + Field_Release( field ); Fields_Release( fields ); _Recordset_Release( recordset );