oledb32: Supply a default dst len in GetConversionSize.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2017-06-21 00:32:39 +00:00 committed by Alexandre Julliard
parent f629e9797d
commit b257f29473
2 changed files with 49 additions and 47 deletions

View File

@ -1371,6 +1371,8 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
if ((*dst_len = get_length(dst_type)))
return S_OK;
*dst_len = 110;
if(src_type == DBTYPE_VARIANT && V_VT((VARIANT*)src) == VT_NULL)
return S_OK;

View File

@ -2853,18 +2853,18 @@ static void test_getconversionsize(void)
V_VT(&var) = VT_NULL;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_VARIANT, DBTYPE_STR, NULL, &dst_len, &var);
ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
V_VT(&var) = VT_NULL;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_VARIANT, DBTYPE_WSTR, NULL, &dst_len, &var);
ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
src_len = 20;
V_VT(&var) = VT_NULL;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_VARIANT, DBTYPE_BYTES, &src_len, &dst_len, &var);
ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
VariantClear(&var);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_NUMERIC, DBTYPE_NUMERIC, NULL, &dst_len, NULL);
@ -2875,243 +2875,243 @@ static void test_getconversionsize(void)
src_len = sizeof(i4);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I4, DBTYPE_WSTR, &src_len, &dst_len, &i4);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I4, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i4);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI4, DBTYPE_WSTR, &src_len, &dst_len, &i4);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI4, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i2);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I2, DBTYPE_WSTR, &src_len, &dst_len, &i2);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I2, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i2);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI2, DBTYPE_WSTR, &src_len, &dst_len, &i2);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i1);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I1, DBTYPE_WSTR, &src_len, &dst_len, &i1);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I1, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i2);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI2, DBTYPE_WSTR, &src_len, &dst_len, &i2);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI2, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(f4);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_R4, DBTYPE_WSTR, &src_len, &dst_len, &f4);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_R4, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i8);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI8, DBTYPE_WSTR, &src_len, &dst_len, &i8);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI8, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i8);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I8, DBTYPE_WSTR, &src_len, &dst_len, &i8);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I8, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dbdate);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DATE, DBTYPE_WSTR, &src_len, &dst_len, &dbdate);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DATE, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dec);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DECIMAL, DBTYPE_WSTR, &src_len, &dst_len, &dec);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DECIMAL, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_EMPTY, DBTYPE_WSTR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i4);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I4, DBTYPE_STR, &src_len, &dst_len, &i4);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I4, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i4);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI4, DBTYPE_STR, &src_len, &dst_len, &i4);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI4, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i2);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I2, DBTYPE_STR, &src_len, &dst_len, &i2);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I2, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i2);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI2, DBTYPE_STR, &src_len, &dst_len, &i2);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i1);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I1, DBTYPE_STR, &src_len, &dst_len, &i1);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I1, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i2);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI2, DBTYPE_STR, &src_len, &dst_len, &i2);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI2, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(f4);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_R4, DBTYPE_STR, &src_len, &dst_len, &f4);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_R4, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i8);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI8, DBTYPE_STR, &src_len, &dst_len, &i8);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_UI8, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i8);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I8, DBTYPE_STR, &src_len, &dst_len, &i8);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I8, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dbdate);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DATE, DBTYPE_STR, &src_len, &dst_len, &dbdate);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DATE, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dec);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DECIMAL, DBTYPE_STR, &src_len, &dst_len, &dec);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DECIMAL, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_EMPTY, DBTYPE_STR, NULL, &dst_len, NULL);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
ok(dst_len == 110, "%ld\n", dst_len);
}
static void test_converttobytes(void)