Commit dc37b66d authored by Alexandre Julliard's avatar Alexandre Julliard

kernelbase: Reimplement GetTimeFormatA().

parent fc26407e
......@@ -14,7 +14,6 @@ C_SRCS = \
file.c \
heap.c \
kernel_main.c \
lcformat.c \
locale.c \
lzexpand.c \
module.c \
......
......@@ -869,7 +869,7 @@
@ stdcall -import GetThreadUILanguage()
@ stdcall GetTickCount()
@ stdcall -ret64 GetTickCount64()
@ stdcall GetTimeFormatA(long long ptr str ptr long)
@ stdcall -import GetTimeFormatA(long long ptr str ptr long)
@ stdcall -import GetTimeFormatEx(wstr long ptr wstr ptr long)
@ stdcall -import GetTimeFormatW(long long ptr wstr ptr long)
@ stdcall -import GetTimeZoneInformation(ptr)
......
......@@ -755,7 +755,7 @@
@ stdcall GetThreadUILanguage()
@ stdcall GetTickCount()
@ stdcall -ret64 GetTickCount64()
@ stdcall GetTimeFormatA(long long ptr str ptr long) kernel32.GetTimeFormatA
@ stdcall GetTimeFormatA(long long ptr str ptr long)
@ stdcall GetTimeFormatEx(wstr long ptr wstr ptr long)
@ stdcall GetTimeFormatW(long long ptr wstr ptr long)
@ stdcall GetTimeZoneInformation(ptr)
......
......@@ -7226,6 +7226,35 @@ int WINAPI GetDateFormatEx( const WCHAR *name, DWORD flags, const SYSTEMTIME *sy
}
/******************************************************************************
* GetTimeFormatA (kernelbase.@)
*/
int WINAPI GetTimeFormatA( LCID lcid, DWORD flags, const SYSTEMTIME *time,
const char *format, char *buffer, int len )
{
UINT cp = get_lcid_codepage( lcid, flags );
WCHAR formatW[128], output[128];
int ret;
TRACE( "(0x%04lx,0x%08lx,%p,%s,%p,%d)\n", lcid, flags, time, debugstr_a(format), buffer, len );
if (len < 0 || (len && !buffer))
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
if (format)
{
MultiByteToWideChar( cp, 0, format, -1, formatW, ARRAY_SIZE(formatW) );
ret = GetTimeFormatW( lcid, flags, time, formatW, output, ARRAY_SIZE(output) );
}
else ret = GetTimeFormatW( lcid, flags, time, NULL, output, ARRAY_SIZE(output) );
if (ret) ret = WideCharToMultiByte( cp, 0, output, -1, buffer, len, 0, 0 );
return ret;
}
/***********************************************************************
* GetTimeFormatW (kernelbase.@)
*/
......
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