1 // Copyright © 2015-2017 winapi-rs developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
4 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
5 // All files in the project carrying such notice may not be copied, modified, or distributed
6 // except according to those terms.
7 //! ApiSet Contract for api-ms-win-core-timezone-l1
8 use shared::minwindef::{BOOL, DWORD, FILETIME, LPDWORD, LPFILETIME, USHORT};
9 use um::minwinbase::{LPSYSTEMTIME, SYSTEMTIME};
10 use um::winnt::{BOOLEAN, LONG, WCHAR};
11 pub const TIME_ZONE_ID_INVALID: DWORD = 0xFFFFFFFF;
12 STRUCT!{struct TIME_ZONE_INFORMATION {
13     Bias: LONG,
14     StandardName: [WCHAR; 32],
15     StandardDate: SYSTEMTIME,
16     StandardBias: LONG,
17     DaylightName: [WCHAR; 32],
18     DaylightDate: SYSTEMTIME,
19     DaylightBias: LONG,
20 }}
21 pub type PTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION;
22 pub type LPTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION;
23 STRUCT!{struct DYNAMIC_TIME_ZONE_INFORMATION {
24     Bias: LONG,
25     StandardName: [WCHAR; 32],
26     StandardDate: SYSTEMTIME,
27     StandardBias: LONG,
28     DaylightName: [WCHAR; 32],
29     DaylightDate: SYSTEMTIME,
30     DaylightBias: LONG,
31     TimeZoneKeyName: [WCHAR; 128],
32     DynamicDaylightTimeDisabled: BOOLEAN,
33 }}
34 pub type PDYNAMIC_TIME_ZONE_INFORMATION = *mut DYNAMIC_TIME_ZONE_INFORMATION;
35 extern "system" {
SystemTimeToTzSpecificLocalTime( lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, lpUniversalTime: *const SYSTEMTIME, lpLocalTime: LPSYSTEMTIME, ) -> BOOL36     pub fn SystemTimeToTzSpecificLocalTime(
37         lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
38         lpUniversalTime: *const SYSTEMTIME,
39         lpLocalTime: LPSYSTEMTIME,
40     ) -> BOOL;
TzSpecificLocalTimeToSystemTime( lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, lpLocalTime: *const SYSTEMTIME, lpUniversalTime: LPSYSTEMTIME, ) -> BOOL41     pub fn TzSpecificLocalTimeToSystemTime(
42         lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
43         lpLocalTime: *const SYSTEMTIME,
44         lpUniversalTime: LPSYSTEMTIME,
45     ) -> BOOL;
FileTimeToSystemTime( lpFileTime: *const FILETIME, lpSystemTime: LPSYSTEMTIME, ) -> BOOL46     pub fn FileTimeToSystemTime(
47         lpFileTime: *const FILETIME,
48         lpSystemTime: LPSYSTEMTIME,
49     ) -> BOOL;
SystemTimeToFileTime( lpSystemTime: *const SYSTEMTIME, lpFileTime: LPFILETIME, ) -> BOOL50     pub fn SystemTimeToFileTime(
51         lpSystemTime: *const SYSTEMTIME,
52         lpFileTime: LPFILETIME,
53     ) -> BOOL;
GetTimeZoneInformation( lpTimeZoneInformation: LPTIME_ZONE_INFORMATION, ) -> DWORD54     pub fn GetTimeZoneInformation(
55         lpTimeZoneInformation: LPTIME_ZONE_INFORMATION,
56     ) -> DWORD;
SetTimeZoneInformation( lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, ) -> BOOL57     pub fn SetTimeZoneInformation(
58         lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
59     ) -> BOOL;
SetDynamicTimeZoneInformation( lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, ) -> BOOL60     pub fn SetDynamicTimeZoneInformation(
61         lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
62     ) -> BOOL;
GetDynamicTimeZoneInformation( pTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, ) -> DWORD63     pub fn GetDynamicTimeZoneInformation(
64         pTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
65     ) -> DWORD;
GetTimeZoneInformationForYear( wYear: USHORT, pdtzi: PDYNAMIC_TIME_ZONE_INFORMATION, ptzi: LPTIME_ZONE_INFORMATION, ) -> BOOL66     pub fn GetTimeZoneInformationForYear(
67         wYear: USHORT,
68         pdtzi: PDYNAMIC_TIME_ZONE_INFORMATION,
69         ptzi: LPTIME_ZONE_INFORMATION,
70     ) -> BOOL;
EnumDynamicTimeZoneInformation( dwIndex: DWORD, lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, ) -> DWORD71     pub fn EnumDynamicTimeZoneInformation(
72         dwIndex: DWORD,
73         lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
74     ) -> DWORD;
GetDynamicTimeZoneInformationEffectiveYears( lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, FirstYear: LPDWORD, LastYear: LPDWORD, ) -> DWORD75     pub fn GetDynamicTimeZoneInformationEffectiveYears(
76         lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
77         FirstYear: LPDWORD,
78         LastYear: LPDWORD,
79     ) -> DWORD;
SystemTimeToTzSpecificLocalTimeEx( lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, lpUniversalTime: *const SYSTEMTIME, lpLocalTime: LPSYSTEMTIME, ) -> BOOL80     pub fn SystemTimeToTzSpecificLocalTimeEx(
81         lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
82         lpUniversalTime: *const SYSTEMTIME,
83         lpLocalTime: LPSYSTEMTIME,
84     ) -> BOOL;
TzSpecificLocalTimeToSystemTimeEx( lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, lpLocalTime: *const SYSTEMTIME, lpUniversalTime: LPSYSTEMTIME, ) -> BOOL85     pub fn TzSpecificLocalTimeToSystemTimeEx(
86         lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
87         lpLocalTime: *const SYSTEMTIME,
88         lpUniversalTime: LPSYSTEMTIME,
89     ) -> BOOL;
90 }
91