propsys: Make VT_FILETIME handling by PropVariantChangeType more implicit.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2017-06-20 12:36:56 +08:00 committed by Alexandre Julliard
parent aa8dc616e0
commit 3a7fb75751
1 changed files with 9 additions and 13 deletions

View File

@ -36,12 +36,11 @@
WINE_DEFAULT_DEBUG_CHANNEL(propsys);
static HRESULT PROPVAR_ConvertFILETIME(PROPVARIANT *ppropvarDest,
REFPROPVARIANT propvarSrc, VARTYPE vt)
static HRESULT PROPVAR_ConvertFILETIME(const FILETIME *ft, PROPVARIANT *ppropvarDest, VARTYPE vt)
{
SYSTEMTIME time;
FileTimeToSystemTime(&propvarSrc->u.filetime, &time);
FileTimeToSystemTime(ft, &time);
switch (vt)
{
@ -272,9 +271,12 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p
FIXME("(%p, %p, %d, %d, %d): semi-stub!\n", ppropvarDest, propvarSrc,
propvarSrc->vt, flags, vt);
if(vt == propvarSrc->vt)
if (vt == propvarSrc->vt)
return PropVariantCopy(ppropvarDest, propvarSrc);
if (propvarSrc->vt == VT_FILETIME)
return PROPVAR_ConvertFILETIME(&propvarSrc->u.filetime, ppropvarDest, vt);
switch (vt)
{
case VT_I1:
@ -382,17 +384,11 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p
}
return hr;
}
}
switch (propvarSrc->vt)
{
case VT_FILETIME:
return PROPVAR_ConvertFILETIME(ppropvarDest, propvarSrc, vt);
default:
FIXME("Unhandled source type: %d\n", propvarSrc->vt);
default:
FIXME("Unhandled dest type: %d\n", vt);
return E_FAIL;
}
return E_FAIL;
}
static void PROPVAR_GUIDToWSTR(REFGUID guid, WCHAR *str)