ReactOS 0.4.15-dev-7907-g95bf896
timezone.c File Reference
#include <rtl.h>
#include <debug.h>
Include dependency graph for timezone.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI RtlQueryTimeZoneInformation (PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
 
NTSTATUS NTAPI RtlSetTimeZoneInformation (PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file timezone.c.

Function Documentation

◆ RtlQueryTimeZoneInformation()

NTSTATUS NTAPI RtlQueryTimeZoneInformation ( PRTL_TIME_ZONE_INFORMATION  TimeZoneInformation)

Definition at line 23 of file timezone.c.

24{
26 UNICODE_STRING StandardName;
27 UNICODE_STRING DaylightName;
29
30 DPRINT("RtlQueryTimeZoneInformation()\n");
31
33
35 sizeof(QueryTable));
36
37 StandardName.Length = 0;
38 StandardName.MaximumLength = 32 * sizeof(WCHAR);
39 StandardName.Buffer = TimeZoneInformation->StandardName;
40
41 DaylightName.Length = 0;
42 DaylightName.MaximumLength = 32 * sizeof(WCHAR);
43 DaylightName.Buffer = TimeZoneInformation->DaylightName;
44
45 QueryTable[0].Name = L"Bias";
47 QueryTable[0].EntryContext = &TimeZoneInformation->Bias;
48
49 QueryTable[1].Name = L"StandardName";
51 QueryTable[1].EntryContext = &StandardName;
52
53 QueryTable[2].Name = L"StandardBias";
55 QueryTable[2].EntryContext = &TimeZoneInformation->StandardBias;
56
57 QueryTable[3].Name = L"StandardStart";
59 QueryTable[3].EntryContext = &TimeZoneInformation->StandardDate;
60
61 QueryTable[4].Name = L"DaylightName";
63 QueryTable[4].EntryContext = &DaylightName;
64
65 QueryTable[5].Name = L"DaylightBias";
67 QueryTable[5].EntryContext = &TimeZoneInformation->DaylightBias;
68
69 QueryTable[6].Name = L"DaylightStart";
71 QueryTable[6].EntryContext = &TimeZoneInformation->DaylightDate;
72
74 L"TimeZoneInformation",
76 NULL,
77 NULL);
78
79 return Status;
80}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
Status
Definition: gdiplustypes.h:25
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:4208
#define RTL_REGISTRY_CONTROL
Definition: nt_native.h:163
#define RTL_QUERY_REGISTRY_DIRECT
Definition: nt_native.h:144
#define L(x)
Definition: ntvdm.h:50
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
#define DPRINT
Definition: sndvol32.h:71
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ RtlSetTimeZoneInformation()

NTSTATUS NTAPI RtlSetTimeZoneInformation ( PRTL_TIME_ZONE_INFORMATION  TimeZoneInformation)

Definition at line 88 of file timezone.c.

89{
92
93 DPRINT("RtlSetTimeZoneInformation()\n");
94
96
98 L"TimeZoneInformation",
99 L"Bias",
100 REG_DWORD,
101 &TimeZoneInformation->Bias,
102 sizeof(LONG));
103 if (!NT_SUCCESS(Status))
104 {
105 return Status;
106 }
107
108 Length = (wcslen(TimeZoneInformation->StandardName) + 1) * sizeof(WCHAR);
110 L"TimeZoneInformation",
111 L"StandardName",
112 REG_SZ,
113 TimeZoneInformation->StandardName,
114 (ULONG)Length);
115 if (!NT_SUCCESS(Status))
116 {
117 return Status;
118 }
119
121 L"TimeZoneInformation",
122 L"StandardBias",
123 REG_DWORD,
124 &TimeZoneInformation->StandardBias,
125 sizeof(LONG));
126 if (!NT_SUCCESS(Status))
127 {
128 return Status;
129 }
130
132 L"TimeZoneInformation",
133 L"StandardStart",
135 &TimeZoneInformation->StandardDate,
136 sizeof(SYSTEMTIME));
137 if (!NT_SUCCESS(Status))
138 {
139 return Status;
140 }
141
142 Length = (wcslen(TimeZoneInformation->DaylightName) + 1) * sizeof(WCHAR);
144 L"TimeZoneInformation",
145 L"DaylightName",
146 REG_SZ,
147 TimeZoneInformation->DaylightName,
148 (ULONG)Length);
149 if (!NT_SUCCESS(Status))
150 {
151 return Status;
152 }
153
155 L"TimeZoneInformation",
156 L"DaylightBias",
157 REG_DWORD,
158 &TimeZoneInformation->DaylightBias,
159 sizeof(LONG));
160 if (!NT_SUCCESS(Status))
161 {
162 return Status;
163 }
164
166 L"TimeZoneInformation",
167 L"DaylightStart",
169 &TimeZoneInformation->DaylightDate,
170 sizeof(SYSTEMTIME));
171
172 return Status;
173}
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG, PCWSTR, PCWSTR, ULONG, PVOID, ULONG)
#define REG_SZ
Definition: layer.c:22
#define REG_BINARY
Definition: nt_native.h:1496
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
long LONG
Definition: pedump.c:60
#define REG_DWORD
Definition: sdbapi.c:596
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59