Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fc26407e
Commit
fc26407e
authored
May 04, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Reimplement GetDateFormatA().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b127e24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
55 deletions
+31
-55
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-1
lcformat.c
dlls/kernel32/lcformat.c
+0
-53
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
locale.c
dlls/kernelbase/locale.c
+29
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
fc26407e
...
@@ -640,7 +640,7 @@
...
@@ -640,7 +640,7 @@
@ stdcall -norelay GetCurrentThreadId() KERNEL32_GetCurrentThreadId
@ stdcall -norelay GetCurrentThreadId() KERNEL32_GetCurrentThreadId
@ stdcall -import GetCurrentThreadStackLimits(ptr ptr)
@ stdcall -import GetCurrentThreadStackLimits(ptr ptr)
@ stdcall -arch=x86_64 GetCurrentUmsThread()
@ stdcall -arch=x86_64 GetCurrentUmsThread()
@ stdcall GetDateFormatA(long long ptr str ptr long)
@ stdcall
-import
GetDateFormatA(long long ptr str ptr long)
@ stdcall -import GetDateFormatEx(wstr long ptr wstr ptr long wstr)
@ stdcall -import GetDateFormatEx(wstr long ptr wstr ptr long wstr)
@ stdcall -import GetDateFormatW(long long ptr wstr ptr long)
@ stdcall -import GetDateFormatW(long long ptr wstr ptr long)
@ stdcall GetDaylightFlag()
@ stdcall GetDaylightFlag()
...
...
dlls/kernel32/lcformat.c
View file @
fc26407e
...
@@ -728,59 +728,6 @@ static INT NLS_GetDateTimeFormatA(LCID lcid, DWORD dwFlags,
...
@@ -728,59 +728,6 @@ static INT NLS_GetDateTimeFormatA(LCID lcid, DWORD dwFlags,
}
}
/******************************************************************************
/******************************************************************************
* GetDateFormatA [KERNEL32.@]
*
* Format a date for a given locale.
*
* PARAMS
* lcid [I] Locale to format for
* dwFlags [I] LOCALE_ and DATE_ flags from "winnls.h"
* lpTime [I] Date to format
* lpFormat [I] Format string, or NULL to use the system defaults
* lpDateStr [O] Destination for formatted string
* cchOut [I] Size of lpDateStr, or 0 to calculate the resulting size
*
* NOTES
* - If lpFormat is NULL, lpDateStr will be formatted according to the format
* details returned by GetLocaleInfoA() and modified by dwFlags.
* - lpFormat is a string of characters and formatting tokens. Any characters
* in the string are copied verbatim to lpDateStr, with tokens being replaced
* by the date values they represent.
* - The following tokens have special meanings in a date format string:
*| Token Meaning
*| ----- -------
*| d Single digit day of the month (no leading 0)
*| dd Double digit day of the month
*| ddd Short name for the day of the week
*| dddd Long name for the day of the week
*| M Single digit month of the year (no leading 0)
*| MM Double digit month of the year
*| MMM Short name for the month of the year
*| MMMM Long name for the month of the year
*| y Double digit year number (no leading 0)
*| yy Double digit year number
*| yyyy Four digit year number
*| gg Era string, for example 'AD'.
* - To output any literal character that could be misidentified as a token,
* enclose it in single quotes.
* - The ANSI version of this function fails if lcid is Unicode only.
*
* RETURNS
* Success: The number of character written to lpDateStr, or that would
* have been written, if cchOut is 0.
* Failure: 0. Use GetLastError() to determine the cause.
*/
INT
WINAPI
GetDateFormatA
(
LCID
lcid
,
DWORD
dwFlags
,
const
SYSTEMTIME
*
lpTime
,
LPCSTR
lpFormat
,
LPSTR
lpDateStr
,
INT
cchOut
)
{
TRACE
(
"(0x%04lx,0x%08lx,%p,%s,%p,%d)
\n
"
,
lcid
,
dwFlags
,
lpTime
,
debugstr_a
(
lpFormat
),
lpDateStr
,
cchOut
);
return
NLS_GetDateTimeFormatA
(
lcid
,
dwFlags
|
DATE_DATEVARSONLY
,
lpTime
,
lpFormat
,
lpDateStr
,
cchOut
);
}
/******************************************************************************
* GetTimeFormatA [KERNEL32.@]
* GetTimeFormatA [KERNEL32.@]
*
*
* Format a time for a given locale.
* Format a time for a given locale.
...
...
dlls/kernelbase/kernelbase.spec
View file @
fc26407e
...
@@ -499,7 +499,7 @@
...
@@ -499,7 +499,7 @@
@ stdcall -norelay GetCurrentThread() kernelbase_GetCurrentThread
@ stdcall -norelay GetCurrentThread() kernelbase_GetCurrentThread
@ stdcall -norelay GetCurrentThreadId() kernelbase_GetCurrentThreadId
@ stdcall -norelay GetCurrentThreadId() kernelbase_GetCurrentThreadId
@ stdcall GetCurrentThreadStackLimits(ptr ptr)
@ stdcall GetCurrentThreadStackLimits(ptr ptr)
@ stdcall GetDateFormatA(long long ptr str ptr long)
kernel32.GetDateFormatA
@ stdcall GetDateFormatA(long long ptr str ptr long)
@ stdcall GetDateFormatEx(wstr long ptr wstr ptr long wstr)
@ stdcall GetDateFormatEx(wstr long ptr wstr ptr long wstr)
@ stdcall GetDateFormatW(long long ptr wstr ptr long)
@ stdcall GetDateFormatW(long long ptr wstr ptr long)
@ stdcall GetDeviceDriverBaseNameA(ptr ptr long)
@ stdcall GetDeviceDriverBaseNameA(ptr ptr long)
...
...
dlls/kernelbase/locale.c
View file @
fc26407e
...
@@ -7158,6 +7158,35 @@ int WINAPI GetCurrencyFormatEx( const WCHAR *name, DWORD flags, const WCHAR *val
...
@@ -7158,6 +7158,35 @@ int WINAPI GetCurrencyFormatEx( const WCHAR *name, DWORD flags, const WCHAR *val
}
}
/******************************************************************************
* GetDateFormatA (KERNEL32.@)
*/
int
WINAPI
GetDateFormatA
(
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
=
GetDateFormatW
(
lcid
,
flags
,
time
,
formatW
,
output
,
ARRAY_SIZE
(
output
)
);
}
else
ret
=
GetDateFormatW
(
lcid
,
flags
,
time
,
NULL
,
output
,
ARRAY_SIZE
(
output
)
);
if
(
ret
)
ret
=
WideCharToMultiByte
(
cp
,
0
,
output
,
-
1
,
buffer
,
len
,
0
,
0
);
return
ret
;
}
/***********************************************************************
/***********************************************************************
* GetDateFormatW (kernelbase.@)
* GetDateFormatW (kernelbase.@)
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment