2 * PropVariant implementation
4 * Copyright 2008 James Hawkins for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define NONAMELESSUNION
32 #include "propvarutil.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(propsys);
38 static HRESULT PROPVAR_ConvertFILETIME(PROPVARIANT *ppropvarDest,
39 REFPROPVARIANT propvarSrc, VARTYPE vt)
43 FileTimeToSystemTime(&propvarSrc->u.filetime, &time);
49 static const char format[] = "%04d/%02d/%02d:%02d:%02d:%02d.%03d";
51 ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0,
52 lstrlenA(format) + 1);
53 if (!ppropvarDest->u.pszVal)
56 sprintf(ppropvarDest->u.pszVal, format, time.wYear, time.wMonth,
57 time.wDay, time.wHour, time.wMinute,
58 time.wSecond, time.wMilliseconds);
64 FIXME("Unhandled target type: %d\n", vt);
70 /******************************************************************
71 * PropVariantChangeType (PROPSYS.@)
73 HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc,
74 PROPVAR_CHANGE_FLAGS flags, VARTYPE vt)
76 FIXME("(%p, %p, %d, %d, %d): semi-stub!\n", ppropvarDest, propvarSrc,
77 propvarSrc->vt, flags, vt);
79 switch (propvarSrc->vt)
82 return PROPVAR_ConvertFILETIME(ppropvarDest, propvarSrc, vt);
84 FIXME("Unhandled source type: %d\n", propvarSrc->vt);