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