Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
6dfaf182
Commit
6dfaf182
authored
Oct 02, 2000
by
Uwe Bonnes
Committed by
Alexandre Julliard
Oct 02, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetDateFormatA: Check range and recalculate wDayOfWeek.
OLE_GetFormatA|W: Fix transformation of wDayOfWeek to LOCALE_S(ABBREV)DAYNAMEx.
parent
bf8943c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
ole2nls.c
ole/ole2nls.c
+21
-8
No files found.
ole/ole2nls.c
View file @
6dfaf182
...
...
@@ -2595,9 +2595,9 @@ static INT OLE_GetFormatA(LCID locale,
const
char
**
dgfmt
=
_dgfmt
-
1
;
/* report, for debugging */
TRACE
(
"(0x%lx,0x%lx, 0x%lx, time(d=%d,h=%d,m=%d,s=%d), fmt=%p
\'
%s
\'
, %p, len=%d)
\n
"
,
TRACE
(
"(0x%lx,0x%lx, 0x%lx, time(
y=%d m=%d wd=%d
d=%d,h=%d,m=%d,s=%d), fmt=%p
\'
%s
\'
, %p, len=%d)
\n
"
,
locale
,
flags
,
tflags
,
xtime
->
wDay
,
xtime
->
wHour
,
xtime
->
wMinute
,
xtime
->
wSecond
,
xtime
->
w
Year
,
xtime
->
wMonth
,
xtime
->
wDayOfWeek
,
xtime
->
w
Day
,
xtime
->
wHour
,
xtime
->
wMinute
,
xtime
->
wSecond
,
_format
,
_format
,
date
,
datelen
);
if
(
datelen
==
0
)
{
...
...
@@ -2658,12 +2658,12 @@ static INT OLE_GetFormatA(LCID locale,
if
(
count
==
4
)
{
GetLocaleInfoA
(
locale
,
LOCALE_SDAYNAME1
+
xtime
->
wDayOfWeek
-
1
,
+
(
xtime
->
wDayOfWeek
+
6
)
%
7
,
buf
,
sizeof
(
buf
));
}
else
if
(
count
==
3
)
{
GetLocaleInfoA
(
locale
,
LOCALE_SABBREVDAYNAME1
+
xtime
->
wDayOfWeek
-
1
,
+
(
xtime
->
wDayOfWeek
+
6
)
%
7
,
buf
,
sizeof
(
buf
));
}
else
{
sprintf
(
buf
,
dgfmt
[
count
],
xtime
->
wDay
);
...
...
@@ -2862,12 +2862,12 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags,
if
(
type
==
'd'
)
{
if
(
count
==
3
)
{
GetLocaleInfoW
(
locale
,
LOCALE_SDAYNAME1
+
xtime
->
wDayOfWeek
-
1
,
LOCALE_SDAYNAME1
+
(
xtime
->
wDayOfWeek
+
6
)
%
7
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
)
);
}
else
if
(
count
==
3
)
{
GetLocaleInfoW
(
locale
,
LOCALE_SABBREVDAYNAME1
+
xtime
->
wDayOfWeek
-
1
,
(
xtime
->
wDayOfWeek
+
6
)
%
7
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
)
);
}
else
{
wsnprintfW
(
buf
,
5
,
argarr
[
count
],
xtime
->
wDay
);
...
...
@@ -3023,6 +3023,8 @@ INT WINAPI GetDateFormatA(LCID locale,DWORD flags,
LPSYSTEMTIME
thistime
;
LCID
thislocale
;
INT
ret
;
FILETIME
ft
;
BOOL
res
;
TRACE
(
"(0x%04lx,0x%08lx,%p,%s,%p,%d)
\n
"
,
locale
,
flags
,
xtime
,
format
,
date
,
datelen
);
...
...
@@ -3041,10 +3043,20 @@ INT WINAPI GetDateFormatA(LCID locale,DWORD flags,
if
(
xtime
==
NULL
)
{
GetSystemTime
(
&
t
);
thistime
=
&
t
;
}
else
{
thistime
=
xtime
;
/* Silently correct wDayOfWeek by tranforming to FileTime and back again*/
res
=
SystemTimeToFileTime
(
xtime
,
&
ft
);
/* Check year(?)/month and date for range and set ERROR_INVALID_PARAMETER on error*/
/*FIXME: SystemTimeToFileTime doesn't yet do that ckeck*/
if
(
!
res
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
FileTimeToSystemTime
(
&
ft
,
&
t
);
};
thistime
=
&
t
;
if
(
format
==
NULL
)
{
GetLocaleInfoA
(
thislocale
,
((
flags
&
DATE_LONGDATE
)
...
...
@@ -4156,6 +4168,7 @@ GetTimeFormatA(LCID locale, /* in */
}
else
{
thistime
=
xtime
;
/* Check that hour,min and sec is in range */
}
ret
=
OLE_GetFormatA
(
thislocale
,
thisflags
,
flags
,
thistime
,
thisformat
,
timestr
,
timelen
);
...
...
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