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
356d0fcc
Commit
356d0fcc
authored
Dec 12, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Reimplement EnumDynamicTimeZoneInformation() using GetTimeZoneInformationForYear().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d05798d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
63 deletions
+26
-63
locale.c
dlls/kernelbase/locale.c
+26
-0
registry.c
dlls/kernelbase/registry.c
+0
-63
No files found.
dlls/kernelbase/locale.c
View file @
356d0fcc
...
...
@@ -2952,6 +2952,32 @@ BOOL WINAPI DECLSPEC_HOTPATCH EnumDateFormatsExEx( DATEFMT_ENUMPROCEXEX proc, co
}
/******************************************************************************
* EnumDynamicTimeZoneInformation (kernelbase.@)
*/
DWORD
WINAPI
DECLSPEC_HOTPATCH
EnumDynamicTimeZoneInformation
(
DWORD
index
,
DYNAMIC_TIME_ZONE_INFORMATION
*
info
)
{
DYNAMIC_TIME_ZONE_INFORMATION
tz
;
LSTATUS
ret
;
DWORD
size
;
if
(
!
info
)
return
ERROR_INVALID_PARAMETER
;
size
=
ARRAY_SIZE
(
tz
.
TimeZoneKeyName
);
ret
=
RegEnumKeyExW
(
tz_key
,
index
,
tz
.
TimeZoneKeyName
,
&
size
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
ret
)
return
ret
;
tz
.
DynamicDaylightTimeDisabled
=
TRUE
;
if
(
!
GetTimeZoneInformationForYear
(
0
,
&
tz
,
(
TIME_ZONE_INFORMATION
*
)
info
))
return
GetLastError
();
lstrcpyW
(
info
->
TimeZoneKeyName
,
tz
.
TimeZoneKeyName
);
info
->
DynamicDaylightTimeDisabled
=
FALSE
;
return
0
;
}
/******************************************************************************
* EnumLanguageGroupLocalesW (kernelbase.@)
*/
...
...
dlls/kernelbase/registry.c
View file @
356d0fcc
...
...
@@ -3045,69 +3045,6 @@ LSTATUS WINAPI RegLoadAppKeyW(const WCHAR *file, HKEY *result, REGSAM sam, DWORD
return
ERROR_SUCCESS
;
}
/******************************************************************************
* EnumDynamicTimeZoneInformation (kernelbase.@)
*/
DWORD
WINAPI
EnumDynamicTimeZoneInformation
(
const
DWORD
index
,
DYNAMIC_TIME_ZONE_INFORMATION
*
dtzi
)
{
static
const
WCHAR
mui_stdW
[]
=
{
'M'
,
'U'
,
'I'
,
'_'
,
'S'
,
't'
,
'd'
,
0
};
static
const
WCHAR
mui_dltW
[]
=
{
'M'
,
'U'
,
'I'
,
'_'
,
'D'
,
'l'
,
't'
,
0
};
WCHAR
keyname
[
ARRAY_SIZE
(
dtzi
->
TimeZoneKeyName
)];
HKEY
time_zones_key
,
sub_key
;
LSTATUS
ret
;
DWORD
size
;
struct
tz_reg_data
{
LONG
bias
;
LONG
std_bias
;
LONG
dlt_bias
;
SYSTEMTIME
std_date
;
SYSTEMTIME
dlt_date
;
}
tz_data
;
if
(
!
dtzi
)
return
ERROR_INVALID_PARAMETER
;
ret
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion
\\
Time Zones"
,
0
,
KEY_ENUMERATE_SUB_KEYS
|
KEY_QUERY_VALUE
,
&
time_zones_key
);
if
(
ret
)
return
ret
;
sub_key
=
NULL
;
size
=
ARRAY_SIZE
(
keyname
);
ret
=
RegEnumKeyExW
(
time_zones_key
,
index
,
keyname
,
&
size
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
ret
)
goto
cleanup
;
ret
=
RegOpenKeyExW
(
time_zones_key
,
keyname
,
0
,
KEY_QUERY_VALUE
,
&
sub_key
);
if
(
ret
)
goto
cleanup
;
size
=
sizeof
(
dtzi
->
StandardName
);
ret
=
RegLoadMUIStringW
(
sub_key
,
mui_stdW
,
dtzi
->
StandardName
,
size
,
NULL
,
0
,
system_dir
);
if
(
ret
)
goto
cleanup
;
size
=
sizeof
(
dtzi
->
DaylightName
);
ret
=
RegLoadMUIStringW
(
sub_key
,
mui_dltW
,
dtzi
->
DaylightName
,
size
,
NULL
,
0
,
system_dir
);
if
(
ret
)
goto
cleanup
;
size
=
sizeof
(
tz_data
);
ret
=
RegQueryValueExA
(
sub_key
,
"TZI"
,
NULL
,
NULL
,
(
BYTE
*
)
&
tz_data
,
&
size
);
if
(
ret
)
goto
cleanup
;
dtzi
->
Bias
=
tz_data
.
bias
;
dtzi
->
StandardBias
=
tz_data
.
std_bias
;
dtzi
->
DaylightBias
=
tz_data
.
dlt_bias
;
memcpy
(
&
dtzi
->
StandardDate
,
&
tz_data
.
std_date
,
sizeof
(
tz_data
.
std_date
)
);
memcpy
(
&
dtzi
->
DaylightDate
,
&
tz_data
.
dlt_date
,
sizeof
(
tz_data
.
dlt_date
)
);
lstrcpyW
(
dtzi
->
TimeZoneKeyName
,
keyname
);
dtzi
->
DynamicDaylightTimeDisabled
=
FALSE
;
cleanup:
if
(
sub_key
)
RegCloseKey
(
sub_key
);
RegCloseKey
(
time_zones_key
);
return
ret
;
}
struct
USKEY
{
...
...
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