1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! ApiSet Contract for api-ms-win-core-timezone-l1
7 use shared::minwindef::{BOOL, DWORD, FILETIME, LPDWORD, LPFILETIME, USHORT};
8 use um::minwinbase::{LPSYSTEMTIME, SYSTEMTIME};
9 use um::winnt::{BOOLEAN, LONG, WCHAR};
10 pub const TIME_ZONE_ID_INVALID: DWORD = 0xFFFFFFFF;
11 STRUCT!{struct TIME_ZONE_INFORMATION {
12     Bias: LONG,
13     StandardName: [WCHAR; 32],
14     StandardDate: SYSTEMTIME,
15     StandardBias: LONG,
16     DaylightName: [WCHAR; 32],
17     DaylightDate: SYSTEMTIME,
18     DaylightBias: LONG,
19 }}
20 pub type PTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION;
21 pub type LPTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION;
22 STRUCT!{struct DYNAMIC_TIME_ZONE_INFORMATION {
23     Bias: LONG,
24     StandardName: [WCHAR; 32],
25     StandardDate: SYSTEMTIME,
26     StandardBias: LONG,
27     DaylightName: [WCHAR; 32],
28     DaylightDate: SYSTEMTIME,
29     DaylightBias: LONG,
30     TimeZoneKeyName: [WCHAR; 128],
31     DynamicDaylightTimeDisabled: BOOLEAN,
32 }}
33 pub type PDYNAMIC_TIME_ZONE_INFORMATION = *mut DYNAMIC_TIME_ZONE_INFORMATION;
34 extern "system" {
SystemTimeToTzSpecificLocalTime( lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, lpUniversalTime: *const SYSTEMTIME, lpLocalTime: LPSYSTEMTIME, ) -> BOOL35     pub fn SystemTimeToTzSpecificLocalTime(
36         lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
37         lpUniversalTime: *const SYSTEMTIME,
38         lpLocalTime: LPSYSTEMTIME,
39     ) -> BOOL;
TzSpecificLocalTimeToSystemTime( lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, lpLocalTime: *const SYSTEMTIME, lpUniversalTime: LPSYSTEMTIME, ) -> BOOL40     pub fn TzSpecificLocalTimeToSystemTime(
41         lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
42         lpLocalTime: *const SYSTEMTIME,
43         lpUniversalTime: LPSYSTEMTIME,
44     ) -> BOOL;
FileTimeToSystemTime( lpFileTime: *const FILETIME, lpSystemTime: LPSYSTEMTIME, ) -> BOOL45     pub fn FileTimeToSystemTime(
46         lpFileTime: *const FILETIME,
47         lpSystemTime: LPSYSTEMTIME,
48     ) -> BOOL;
SystemTimeToFileTime( lpSystemTime: *const SYSTEMTIME, lpFileTime: LPFILETIME, ) -> BOOL49     pub fn SystemTimeToFileTime(
50         lpSystemTime: *const SYSTEMTIME,
51         lpFileTime: LPFILETIME,
52     ) -> BOOL;
GetTimeZoneInformation( lpTimeZoneInformation: LPTIME_ZONE_INFORMATION, ) -> DWORD53     pub fn GetTimeZoneInformation(
54         lpTimeZoneInformation: LPTIME_ZONE_INFORMATION,
55     ) -> DWORD;
SetTimeZoneInformation( lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, ) -> BOOL56     pub fn SetTimeZoneInformation(
57         lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
58     ) -> BOOL;
SetDynamicTimeZoneInformation( lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, ) -> BOOL59     pub fn SetDynamicTimeZoneInformation(
60         lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
61     ) -> BOOL;
GetDynamicTimeZoneInformation( pTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, ) -> DWORD62     pub fn GetDynamicTimeZoneInformation(
63         pTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
64     ) -> DWORD;
GetTimeZoneInformationForYear( wYear: USHORT, pdtzi: PDYNAMIC_TIME_ZONE_INFORMATION, ptzi: LPTIME_ZONE_INFORMATION, ) -> BOOL65     pub fn GetTimeZoneInformationForYear(
66         wYear: USHORT,
67         pdtzi: PDYNAMIC_TIME_ZONE_INFORMATION,
68         ptzi: LPTIME_ZONE_INFORMATION,
69     ) -> BOOL;
EnumDynamicTimeZoneInformation( dwIndex: DWORD, lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, ) -> DWORD70     pub fn EnumDynamicTimeZoneInformation(
71         dwIndex: DWORD,
72         lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
73     ) -> DWORD;
GetDynamicTimeZoneInformationEffectiveYears( lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, FirstYear: LPDWORD, LastYear: LPDWORD, ) -> DWORD74     pub fn GetDynamicTimeZoneInformationEffectiveYears(
75         lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
76         FirstYear: LPDWORD,
77         LastYear: LPDWORD,
78     ) -> DWORD;
SystemTimeToTzSpecificLocalTimeEx( lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, lpUniversalTime: *const SYSTEMTIME, lpLocalTime: LPSYSTEMTIME, ) -> BOOL79     pub fn SystemTimeToTzSpecificLocalTimeEx(
80         lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
81         lpUniversalTime: *const SYSTEMTIME,
82         lpLocalTime: LPSYSTEMTIME,
83     ) -> BOOL;
TzSpecificLocalTimeToSystemTimeEx( lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, lpLocalTime: *const SYSTEMTIME, lpUniversalTime: LPSYSTEMTIME, ) -> BOOL84     pub fn TzSpecificLocalTimeToSystemTimeEx(
85         lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
86         lpLocalTime: *const SYSTEMTIME,
87         lpUniversalTime: LPSYSTEMTIME,
88     ) -> BOOL;
89 }
90