Thanks Gabriel Ivăncescu.
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/msado15/recordset.c | 24 +++++++++--------------- dlls/msado15/tests/msado15.c | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index 7cd943f55d5..9ed5e404c9d 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -740,28 +740,22 @@ static HRESULT map_index( struct fields *fields, VARIANT *index, ULONG *ret ) { ULONG i;
- if (V_VT( index ) == VT_I4 || V_VT( index ) == VT_I2) + if (V_VT( index ) != VT_BSTR) { - if (V_VT( index ) == VT_I4) - i = V_I4 ( index ); - else - i = V_I2 ( index ); - - if (i < fields->count) + VARIANT idx; + if (VariantChangeType(index, &idx, 0, VT_UI4) == S_OK) { - *ret = i; - return S_OK; + i = V_UI4 ( &idx ); + if (i < fields->count) + { + *ret = i; + return S_OK; + } }
return MAKE_ADO_HRESULT(adErrItemNotFound); }
- if (V_VT( index ) != VT_BSTR) - { - FIXME( "variant type %u not supported\n", V_VT( index ) ); - return E_INVALIDARG; - } - for (i = 0; i < fields->count; i++) { BSTR name; diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index 860144338c0..25c9c6f8356 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -150,6 +150,23 @@ static void test_Recordset(void) ok( hr == S_OK, "got %08x\n", hr ); Field_Release(field);
+ V_VT( &index ) = VT_I1; + V_I1( &index ) = 0; + hr = Fields_get_Item( fields, index, &field ); + ok( hr == S_OK, "got %08x\n", hr ); + Field_Release(field); + + V_VT( &index ) = VT_R8; + V_R8( &index ) = 0.1; + hr = Fields_get_Item( fields, index, &field ); + ok( hr == S_OK, "got %08x\n", hr ); + Field_Release(field); + + V_VT( &index ) = VT_UNKNOWN; + V_UNKNOWN( &index ) = NULL; + hr = Fields_get_Item( fields, index, &field ); + ok( hr == MAKE_ADO_HRESULT(adErrItemNotFound), "got %08x\n", hr ); + V_VT( &index ) = VT_BSTR; V_BSTR( &index ) = name; hr = Fields_get_Item( fields, index, &field );
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=92108
Your paranoid android.
=== debiant2 (32 bit report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit Arabic:Morocco report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit German report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit French report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit Hebrew:Israel report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit Hindi:India report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit Japanese:Japan report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit Chinese:China report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x800a0cf5 in 32-bit code (0x0100727b).
=== debiant2 (32 bit WoW report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on execute access to 0x08ec8300 in 32-bit code (0x08ec8300).
=== debiant2 (64 bit WoW report) ===
msado15: msado15.c:144: Test failed: got 800a0cc1 Unhandled exception: page fault on read access to 0x00000010 in 64-bit code (0x0000000000403b01).