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
4c2cc57c
Commit
4c2cc57c
authored
Apr 18, 2018
by
Qian Hong
Committed by
Alexandre Julliard
Apr 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Init TimezoneInformation registry.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d5fd0135
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
kernel_main.c
dlls/kernel32/kernel_main.c
+3
-0
kernel_private.h
dlls/kernel32/kernel_private.h
+3
-0
time.c
dlls/kernel32/time.c
+40
-0
No files found.
dlls/kernel32/kernel_main.c
View file @
4c2cc57c
...
...
@@ -88,6 +88,9 @@ static BOOL process_attach( HMODULE module )
/* Setup registry locale information */
LOCALE_InitRegistry
();
/* Setup registry timezone information */
TIMEZONE_InitRegistry
();
/* Setup computer name */
COMPUTERNAME_Init
();
...
...
dlls/kernel32/kernel_private.h
View file @
4c2cc57c
...
...
@@ -104,6 +104,9 @@ extern void COMPUTERNAME_Init(void) DECLSPEC_HIDDEN;
extern
void
LOCALE_Init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
LOCALE_InitRegistry
(
void
)
DECLSPEC_HIDDEN
;
/* time.c */
extern
void
TIMEZONE_InitRegistry
(
void
)
DECLSPEC_HIDDEN
;
/* oldconfig.c */
extern
void
convert_old_config
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/kernel32/time.c
View file @
4c2cc57c
...
...
@@ -778,6 +778,46 @@ static void TIME_ClockTimeToFileTime(clock_t unix_time, LPFILETIME filetime)
filetime
->
dwHighDateTime
=
(
DWORD
)(
secs
>>
32
);
}
/***********************************************************************
* TIMEZONE_InitRegistry
*
* Update registry contents on startup if the user timezone has changed.
* This simulates the action of the Windows control panel.
*/
void
TIMEZONE_InitRegistry
(
void
)
{
static
const
WCHAR
timezoneInformationW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'T'
,
'i'
,
'm'
,
'e'
,
'Z'
,
'o'
,
'n'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'r'
,
'm'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\0'
};
static
const
WCHAR
standardNameW
[]
=
{
'S'
,
't'
,
'a'
,
'n'
,
'd'
,
'a'
,
'r'
,
'd'
,
'N'
,
'a'
,
'm'
,
'e'
,
'\0'
};
static
const
WCHAR
timezoneKeyNameW
[]
=
{
'T'
,
'i'
,
'm'
,
'e'
,
'Z'
,
'o'
,
'n'
,
'e'
,
'K'
,
'e'
,
'y'
,
'N'
,
'a'
,
'm'
,
'e'
,
'\0'
};
DYNAMIC_TIME_ZONE_INFORMATION
tzinfo
;
UNICODE_STRING
name
;
OBJECT_ATTRIBUTES
attr
;
HANDLE
hkey
;
DWORD
tzid
;
tzid
=
GetDynamicTimeZoneInformation
(
&
tzinfo
);
if
(
tzid
==
TIME_ZONE_ID_INVALID
)
return
;
RtlInitUnicodeString
(
&
name
,
timezoneInformationW
);
InitializeObjectAttributes
(
&
attr
,
&
name
,
0
,
0
,
NULL
);
if
(
NtCreateKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
)
!=
STATUS_SUCCESS
)
return
;
RtlInitUnicodeString
(
&
name
,
standardNameW
);
NtSetValueKey
(
hkey
,
&
name
,
0
,
REG_SZ
,
tzinfo
.
StandardName
,
(
strlenW
(
tzinfo
.
StandardName
)
+
1
)
*
sizeof
(
WCHAR
));
RtlInitUnicodeString
(
&
name
,
timezoneKeyNameW
);
NtSetValueKey
(
hkey
,
&
name
,
0
,
REG_SZ
,
tzinfo
.
TimeZoneKeyName
,
(
strlenW
(
tzinfo
.
TimeZoneKeyName
)
+
1
)
*
sizeof
(
WCHAR
));
NtClose
(
hkey
);
}
/*********************************************************************
* GetProcessTimes (KERNEL32.@)
*
...
...
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