Commit 60dae84b authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

propsys: Use integer conversion functions in PropVariantCompareEx.

parent c66b5ac4
......@@ -215,9 +215,81 @@ HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret)
HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc,
PROPVAR_CHANGE_FLAGS flags, VARTYPE vt)
{
HRESULT hr;
FIXME("(%p, %p, %d, %d, %d): semi-stub!\n", ppropvarDest, propvarSrc,
propvarSrc->vt, flags, vt);
switch (vt)
{
case VT_I2:
{
SHORT res;
hr = PropVariantToInt16(propvarSrc, &res);
if (SUCCEEDED(hr))
{
ppropvarDest->vt = VT_I2;
ppropvarDest->u.iVal = res;
}
return hr;
}
case VT_UI2:
{
USHORT res;
hr = PropVariantToUInt16(propvarSrc, &res);
if (SUCCEEDED(hr))
{
ppropvarDest->vt = VT_UI2;
ppropvarDest->u.uiVal = res;
}
return hr;
}
case VT_I4:
{
LONG res;
hr = PropVariantToInt32(propvarSrc, &res);
if (SUCCEEDED(hr))
{
ppropvarDest->vt = VT_I4;
ppropvarDest->u.lVal = res;
}
return hr;
}
case VT_UI4:
{
ULONG res;
hr = PropVariantToUInt32(propvarSrc, &res);
if (SUCCEEDED(hr))
{
ppropvarDest->vt = VT_UI4;
ppropvarDest->u.ulVal = res;
}
return hr;
}
case VT_I8:
{
LONGLONG res;
hr = PropVariantToInt64(propvarSrc, &res);
if (SUCCEEDED(hr))
{
ppropvarDest->vt = VT_I8;
ppropvarDest->u.hVal.QuadPart = res;
}
return hr;
}
case VT_UI8:
{
ULONGLONG res;
hr = PropVariantToUInt64(propvarSrc, &res);
if (SUCCEEDED(hr))
{
ppropvarDest->vt = VT_UI8;
ppropvarDest->u.uhVal.QuadPart = res;
}
return hr;
}
}
switch (propvarSrc->vt)
{
case VT_FILETIME:
......
......@@ -716,13 +716,13 @@ static void test_PropVariantCompare(void)
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&i4_large, &i2_0, 0, 0);
todo_wine ok(res == 1, "res=%i\n", res);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&i4_largeneg, &i2_0, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&i2_2, &i4_2, 0, 0);
todo_wine ok(res == 0, "res=%i\n", res);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&i2_2, &str_2, 0, 0);
todo_wine ok(res == 0, "res=%i\n", res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment