diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 5b00500beb4..43b46a880d1 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -4622,3 +4622,53 @@ HRESULT WINAPI SHGetViewStatePropertyBag(LPCITEMIDLIST pidl, LPWSTR bag_name, return E_NOTIMPL; } + +/*********************************************************************** + * SHFormatDateTimeW [SHLWAPI.354] + * + * Produces a string representation of a time. + * + * PARAMS + * fileTime [I] Pointer to FILETIME structure specifying the time + * flags [I] Flags specifying the desired output + * buf [O] Pointer to buffer for output + * bufSize [I] Number of characters that can be contained in buffer + * + * RETURNS + * success: number of characters written to the buffer + * failure: 0 + * + */ +INT WINAPI SHFormatDateTimeW(const FILETIME UNALIGNED *fileTime, DWORD *flags, + LPWSTR buf, UINT bufSize) +{ + FIXME("%p %p %s %d STUB\n", fileTime, flags, debugstr_w(buf), bufSize); + return 0; +} + +/*********************************************************************** + * SHFormatDateTimeA [SHLWAPI.353] + * + * See SHFormatDateTimeW. + * + */ +INT WINAPI SHFormatDateTimeA(const FILETIME UNALIGNED *fileTime, DWORD *flags, + LPCSTR buf, UINT bufSize) +{ + WCHAR *bufW; + DWORD buflenW, convlen; + INT retval; + + if (!buf || !bufSize) + return 0; + + buflenW = bufSize; + bufW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * buflenW); + retval = SHFormatDateTimeW(fileTime, flags, bufW, buflenW); + + if (retval != 0) + convlen = WideCharToMultiByte(CP_ACP, 0, bufW, -1, (LPSTR) buf, bufSize, NULL, NULL); + + HeapFree(GetProcessHeap(), 0, bufW); + return retval; +} diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 87fba40d28c..7f37e732b9a 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -350,8 +350,8 @@ 350 stdcall -noname GetFileVersionInfoSizeWrapW(wstr ptr) 351 stdcall -noname GetFileVersionInfoWrapW(wstr long long ptr) 352 stdcall -noname VerQueryValueWrapW(ptr wstr ptr ptr) -353 stub -noname SHFormatDateTimeA -354 stub -noname SHFormatDateTimeW +353 stdcall -noname SHFormatDateTimeA(ptr ptr str long) +354 stdcall -noname SHFormatDateTimeW(ptr ptr wstr long) 355 stdcall -noname IUnknown_EnableModeless(ptr long) 356 stdcall -noname CreateAllAccessSecurityAttributes(ptr ptr long) 357 stdcall -noname SHGetNewLinkInfoWrapW(wstr wstr wstr long long)