msado15: Support VT_I4/I2 for Fields Item property.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
06fb03378d
commit
38f01fe2cb
|
@ -740,6 +740,22 @@ static HRESULT map_index( struct fields *fields, VARIANT *index, ULONG *ret )
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
|
if (V_VT( index ) == VT_I4 || V_VT( index ) == VT_I2)
|
||||||
|
{
|
||||||
|
if (V_VT( index ) == VT_I4)
|
||||||
|
i = V_I4 ( index );
|
||||||
|
else
|
||||||
|
i = V_I2 ( index );
|
||||||
|
|
||||||
|
if (i < fields->count)
|
||||||
|
{
|
||||||
|
*ret = i;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MAKE_ADO_HRESULT(adErrItemNotFound);
|
||||||
|
}
|
||||||
|
|
||||||
if (V_VT( index ) != VT_BSTR)
|
if (V_VT( index ) != VT_BSTR)
|
||||||
{
|
{
|
||||||
FIXME( "variant type %u not supported\n", V_VT( index ) );
|
FIXME( "variant type %u not supported\n", V_VT( index ) );
|
||||||
|
|
|
@ -133,6 +133,23 @@ static void test_Recordset(void)
|
||||||
hr = Fields__Append( fields, name, adInteger, 4, adFldUnspecified );
|
hr = Fields__Append( fields, name, adInteger, 4, adFldUnspecified );
|
||||||
ok( hr == S_OK, "got %08x\n", hr );
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
V_VT( &index ) = VT_I4;
|
||||||
|
V_I4( &index ) = 1000;
|
||||||
|
hr = Fields_get_Item( fields, index, &field );
|
||||||
|
ok( hr == MAKE_ADO_HRESULT(adErrItemNotFound), "got %08x\n", hr );
|
||||||
|
|
||||||
|
V_VT( &index ) = VT_I4;
|
||||||
|
V_I4( &index ) = 0;
|
||||||
|
hr = Fields_get_Item( fields, index, &field );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
Field_Release(field);
|
||||||
|
|
||||||
|
V_VT( &index ) = VT_I2;
|
||||||
|
V_I4( &index ) = 0;
|
||||||
|
hr = Fields_get_Item( fields, index, &field );
|
||||||
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
Field_Release(field);
|
||||||
|
|
||||||
V_VT( &index ) = VT_BSTR;
|
V_VT( &index ) = VT_BSTR;
|
||||||
V_BSTR( &index ) = name;
|
V_BSTR( &index ) = name;
|
||||||
hr = Fields_get_Item( fields, index, &field );
|
hr = Fields_get_Item( fields, index, &field );
|
||||||
|
|
Loading…
Reference in New Issue