winapi_ui_automation/um/
timezoneapi.rs

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
7use shared::minwindef::{BOOL, DWORD, FILETIME, LPDWORD, LPFILETIME, USHORT};
8use um::minwinbase::{LPSYSTEMTIME, SYSTEMTIME};
9use um::winnt::{BOOLEAN, LONG, WCHAR};
10pub const TIME_ZONE_ID_INVALID: DWORD = 0xFFFFFFFF;
11STRUCT!{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}}
20pub type PTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION;
21pub type LPTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION;
22STRUCT!{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}}
33pub type PDYNAMIC_TIME_ZONE_INFORMATION = *mut DYNAMIC_TIME_ZONE_INFORMATION;
34extern "system" {
35    pub fn SystemTimeToTzSpecificLocalTime(
36        lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
37        lpUniversalTime: *const SYSTEMTIME,
38        lpLocalTime: LPSYSTEMTIME,
39    ) -> BOOL;
40    pub fn TzSpecificLocalTimeToSystemTime(
41        lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
42        lpLocalTime: *const SYSTEMTIME,
43        lpUniversalTime: LPSYSTEMTIME,
44    ) -> BOOL;
45    pub fn FileTimeToSystemTime(
46        lpFileTime: *const FILETIME,
47        lpSystemTime: LPSYSTEMTIME,
48    ) -> BOOL;
49    pub fn SystemTimeToFileTime(
50        lpSystemTime: *const SYSTEMTIME,
51        lpFileTime: LPFILETIME,
52    ) -> BOOL;
53    pub fn GetTimeZoneInformation(
54        lpTimeZoneInformation: LPTIME_ZONE_INFORMATION,
55    ) -> DWORD;
56    pub fn SetTimeZoneInformation(
57        lpTimeZoneInformation: *const TIME_ZONE_INFORMATION,
58    ) -> BOOL;
59    pub fn SetDynamicTimeZoneInformation(
60        lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
61    ) -> BOOL;
62    pub fn GetDynamicTimeZoneInformation(
63        pTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
64    ) -> DWORD;
65    pub fn GetTimeZoneInformationForYear(
66        wYear: USHORT,
67        pdtzi: PDYNAMIC_TIME_ZONE_INFORMATION,
68        ptzi: LPTIME_ZONE_INFORMATION,
69    ) -> BOOL;
70    pub fn EnumDynamicTimeZoneInformation(
71        dwIndex: DWORD,
72        lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
73    ) -> DWORD;
74    pub fn GetDynamicTimeZoneInformationEffectiveYears(
75        lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION,
76        FirstYear: LPDWORD,
77        LastYear: LPDWORD,
78    ) -> DWORD;
79    pub fn SystemTimeToTzSpecificLocalTimeEx(
80        lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
81        lpUniversalTime: *const SYSTEMTIME,
82        lpLocalTime: LPSYSTEMTIME,
83    ) -> BOOL;
84    pub fn TzSpecificLocalTimeToSystemTimeEx(
85        lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION,
86        lpLocalTime: *const SYSTEMTIME,
87        lpUniversalTime: LPSYSTEMTIME,
88    ) -> BOOL;
89}