ReactOS 0.4.17-dev-287-geecfbae
timezoneapi.h File Reference
#include <minwindef.h>
#include <minwinbase.h>
Include dependency graph for timezoneapi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _TIME_ZONE_INFORMATION
 
struct  _TIME_DYNAMIC_ZONE_INFORMATION
 

Macros

#define _TIMEZONEAPI_H_
 
#define TIME_ZONE_ID_INVALID   0xFFFFFFFF
 

Typedefs

typedef struct _TIME_ZONE_INFORMATION TIME_ZONE_INFORMATION
 
typedef struct _TIME_ZONE_INFORMATIONPTIME_ZONE_INFORMATION
 
typedef struct _TIME_ZONE_INFORMATIONLPTIME_ZONE_INFORMATION
 
typedef struct _TIME_DYNAMIC_ZONE_INFORMATION DYNAMIC_TIME_ZONE_INFORMATION
 
typedef struct _TIME_DYNAMIC_ZONE_INFORMATIONPDYNAMIC_TIME_ZONE_INFORMATION
 

Functions

WINBASEAPI _Success_ (return==ERROR_SUCCESS) DWORD WINAPI EnumDynamicTimeZoneInformation(_In_ CONST DWORD dwIndex
 Deletes the virtual mapping and optionally gives back the page & dirty bit.
 
WINBASEAPI BOOL WINAPI FileTimeToSystemTime (CONST FILETIME *, LPSYSTEMTIME)
 
WINBASEAPI _Success_ (return !=TIME_ZONE_ID_INVALID) DWORD WINAPI GetDynamicTimeZoneInformation(_Out_ PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation)
 
WINBASEAPI DWORD WINAPI GetTimeZoneInformation (LPTIME_ZONE_INFORMATION)
 
WINBASEAPI BOOL WINAPI SetDynamicTimeZoneInformation (_In_ CONST DYNAMIC_TIME_ZONE_INFORMATION *lpTimeZoneInformation)
 
WINBASEAPI BOOL WINAPI SetTimeZoneInformation (CONST TIME_ZONE_INFORMATION *)
 
WINBASEAPI BOOL WINAPI SystemTimeToFileTime (const SYSTEMTIME *, LPFILETIME)
 
WINBASEAPI BOOL WINAPI SystemTimeToTzSpecificLocalTime (CONST TIME_ZONE_INFORMATION *, CONST SYSTEMTIME *, LPSYSTEMTIME)
 
WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime (CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation, CONST SYSTEMTIME *lpLocalTime, LPSYSTEMTIME lpUniversalTime)
 

Variables

WINBASEAPI _Out_ PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation
 
WINBASEAPI _Out_ LPDWORD FirstYear
 
WINBASEAPI _Out_ LPDWORD _Out_ LPDWORD LastYear
 
_In_opt_ PDYNAMIC_TIME_ZONE_INFORMATION pdtzi
 
_In_opt_ PDYNAMIC_TIME_ZONE_INFORMATION _Out_ LPTIME_ZONE_INFORMATION ptzi
 
WINBASEAPI _In_ CONST FILETIMElocalFileTime
 
WINBASEAPI _In_ CONST FILETIME _Out_ SYSTEMTIMElocalSystemTime
 
WINBASEAPI _In_ CONST SYSTEMTIMElpUniversalTime
 
WINBASEAPI _In_ CONST SYSTEMTIME _Out_ LPSYSTEMTIME lpLocalTime
 

Macro Definition Documentation

◆ _TIMEZONEAPI_H_

#define _TIMEZONEAPI_H_

Definition at line 10 of file timezoneapi.h.

◆ TIME_ZONE_ID_INVALID

#define TIME_ZONE_ID_INVALID   0xFFFFFFFF

Definition at line 21 of file timezoneapi.h.

Typedef Documentation

◆ DYNAMIC_TIME_ZONE_INFORMATION

◆ LPTIME_ZONE_INFORMATION

◆ PDYNAMIC_TIME_ZONE_INFORMATION

◆ PTIME_ZONE_INFORMATION

◆ TIME_ZONE_INFORMATION

Function Documentation

◆ _Success_() [1/2]

Definition at line 1028 of file fsctrl.c.

3189{
3191
3192 PVPB Vpb = Vcb->Vpb;
3193 PVPB OldVpb;
3194
3195 BOOLEAN Remount = FALSE;
3196
3197 PAGED_CODE();
3198
3199 UNREFERENCED_PARAMETER( IrpContext );
3200
3201 //
3202 // Check whether we are looking for a device only Mvcb.
3203 //
3204
3205 for (Link = CdData.VcbQueue.Flink;
3206 Link != &CdData.VcbQueue;
3207 Link = Link->Flink) {
3208
3209 *OldVcb = CONTAINING_RECORD( Link, VCB, VcbLinks );
3210
3211 //
3212 // Skip ourselves.
3213 //
3214
3215 if (Vcb == *OldVcb) { continue; }
3216
3217 //
3218 // Look at the Vpb and state of the previous Vcb.
3219 //
3220
3221 OldVpb = (*OldVcb)->Vpb;
3222
3223 if ((OldVpb != Vpb) &&
3224 (OldVpb->RealDevice == Vpb->RealDevice) &&
3225 ((*OldVcb)->VcbCondition == VcbNotMounted)) {
3226
3227 //
3228 // If the current disk is a raw disk then it can match a previous music or
3229 // raw disk.
3230 //
3231
3232 if (FlagOn( Vcb->VcbState, VCB_STATE_AUDIO_DISK)) {
3233
3234 if (FlagOn( (*OldVcb)->VcbState, VCB_STATE_AUDIO_DISK )) {
3235
3236 //
3237 // If we have both TOC then fail the remount if the lengths
3238 // are different or they don't match.
3239 //
3240
3241 if ((Vcb->TocLength != (*OldVcb)->TocLength) ||
3242 ((Vcb->TocLength != 0) &&
3243 !RtlEqualMemory( Vcb->CdromToc,
3244 (*OldVcb)->CdromToc,
3245 Vcb->TocLength ))) {
3246
3247 continue;
3248 }
3249
3250 Remount = TRUE;
3251 break;
3252 }
3253
3254 //
3255 // The current disk is not a raw disk. Go ahead and compare
3256 // serial numbers, volume label and TOC.
3257 //
3258
3259 }
3260 else if ((OldVpb->SerialNumber == Vpb->SerialNumber) &&
3261 (Vcb->TocLength == (*OldVcb)->TocLength) &&
3262 ((Vcb->TocLength == 0) || RtlEqualMemory( Vcb->CdromToc,
3263 (*OldVcb)->CdromToc,
3264 Vcb->TocLength )) &&
3265 (Vpb->VolumeLabelLength == OldVpb->VolumeLabelLength) &&
3266 (RtlEqualMemory( OldVpb->VolumeLabel,
3267 Vpb->VolumeLabel,
3268 Vpb->VolumeLabelLength ))) {
3269 //
3270 // Remember the old Vcb. Then set the return value to
3271 // TRUE and break.
3272 //
3273
3274 Remount = TRUE;
3275 break;
3276 }
3277 }
3278 }
3279
3280 return Remount;
3281}
#define PAGED_CODE()
unsigned char BOOLEAN
Definition: actypes.h:127
CD_DATA CdData
Definition: cddata.c:42
#define VCB_STATE_AUDIO_DISK
Definition: cdstruc.h:712
@ VcbNotMounted
Definition: cdstruc.h:490
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1676
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define Vcb
Definition: cdprocs.h:1415
LIST_ENTRY VcbQueue
Definition: cdstruc.h:334
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: cdstruc.h:498
Definition: iotypes.h:189
WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH/sizeof(WCHAR)]
Definition: iotypes.h:198
USHORT VolumeLabelLength
Definition: iotypes.h:193
ULONG SerialNumber
Definition: iotypes.h:196
struct _DEVICE_OBJECT * RealDevice
Definition: iotypes.h:195
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
static int Link(const char **args)
Definition: vfdcmd.c:2414

◆ _Success_() [2/2]

WINBASEAPI _Success_ ( return  = ERROR_SUCCESS)

Deletes the virtual mapping and optionally gives back the page & dirty bit.

Parameters
Process- The process this address belongs to, or NULL if system address.
Address- The address to unmap.
WasDirty- Optional param receiving the dirty bit of the PTE.
Page- Optional param receiving the page number previously mapped to this address.
Returns
Whether there was actually a page mapped at the given address.

Definition at line 57 of file firmware.c.

207{
210
211 /* Check input parameters */
212 if (FirmwareType == NULL)
213 {
215 return FALSE;
216 }
217
218 /* Query firmware type */
220 &BootInfo,
221 sizeof(BootInfo),
222 0);
223 if (!NT_SUCCESS(Status))
224 {
226 return FALSE;
227 }
228
229 *FirmwareType = BootInfo.FirmwareType;
230 return TRUE;
231}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
Status
Definition: gdiplustypes.h:24
@ SystemBootEnvironmentInformation
Definition: extypes.h:309
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:167
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)

◆ FileTimeToSystemTime()

WINBASEAPI BOOL WINAPI FileTimeToSystemTime ( CONST FILETIME ,
LPSYSTEMTIME   
)

◆ GetTimeZoneInformation()

WINBASEAPI DWORD WINAPI GetTimeZoneInformation ( LPTIME_ZONE_INFORMATION  lpTimeZoneInformation)

Definition at line 262 of file timezone.c.

263{
264 RTL_TIME_ZONE_INFORMATION TimeZoneInformation;
266
267 DPRINT("GetTimeZoneInformation()\n");
268
270 &TimeZoneInformation,
272 NULL);
273 if (!NT_SUCCESS(Status))
274 {
277 }
278
279 lpTimeZoneInformation->Bias = TimeZoneInformation.Bias;
280
282 TimeZoneInformation.StandardName,
292 lpTimeZoneInformation->StandardBias = TimeZoneInformation.StandardBias;
293
295 TimeZoneInformation.DaylightName,
305 lpTimeZoneInformation->DaylightBias = TimeZoneInformation.DaylightBias;
306
308}
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
static DWORD TIME_ZoneID(const TIME_ZONE_INFORMATION *pTzi)
Definition: timezone.c:217
@ SystemCurrentTimeZoneInformation
Definition: ntddk_ex.h:59
wcsncpy
#define DPRINT
Definition: sndvol32.h:73
WORD wMilliseconds
Definition: minwinbase.h:263
WORD wSecond
Definition: minwinbase.h:262
WORD wMinute
Definition: minwinbase.h:261
WORD wDayOfWeek
Definition: minwinbase.h:258
USHORT Milliseconds
Definition: env_spec_w32.h:717
USHORT Weekday
Definition: env_spec_w32.h:718
#define TIME_ZONE_ID_INVALID
Definition: timezoneapi.h:21
WINBASEAPI _Out_ PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation
Definition: timezoneapi.h:54

Referenced by _ftime64(), _tzset(), AllSysInfo(), common_ftime_s(), create_date(), date_parse(), get_currenttimezone(), get_localdatetime(), NetrRemoteTOD(), ParseLogonHours(), PrintLogonHours(), SetTimeZoneName(), ShowTimeZoneList(), SystemTimeToTzSpecificLocalTime(), test_FileTimeToLocalFileTime(), test_GetDynamicTimeZoneInformation(), test_GetTimeZoneInformation(), test_GetTimeZoneInformationForYear(), test_localtime(), test_mktime(), test_RtlQueryTimeZoneInformation(), tzset_from_system_nolock(), and TzSpecificLocalTimeToSystemTime().

◆ SetDynamicTimeZoneInformation()

WINBASEAPI BOOL WINAPI SetDynamicTimeZoneInformation ( _In_ CONST DYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation)

◆ SetTimeZoneInformation()

WINBASEAPI BOOL WINAPI SetTimeZoneInformation ( CONST TIME_ZONE_INFORMATION lpTimeZoneInformation)

Definition at line 316 of file timezone.c.

317{
318 RTL_TIME_ZONE_INFORMATION TimeZoneInformation;
320
321 DPRINT("SetTimeZoneInformation()\n");
322
323 TimeZoneInformation.Bias = lpTimeZoneInformation->Bias;
324
325 wcsncpy(TimeZoneInformation.StandardName,
327 ARRAYSIZE(TimeZoneInformation.StandardName));
336 TimeZoneInformation.StandardBias = lpTimeZoneInformation->StandardBias;
337
338 wcsncpy(TimeZoneInformation.DaylightName,
340 ARRAYSIZE(TimeZoneInformation.DaylightName));
349 TimeZoneInformation.DaylightBias = lpTimeZoneInformation->DaylightBias;
350
351 Status = RtlSetTimeZoneInformation(&TimeZoneInformation);
352 if (!NT_SUCCESS(Status))
353 {
354 DPRINT1("RtlSetTimeZoneInformation() failed (Status %lx)\n", Status);
356 return FALSE;
357 }
358
360 (PVOID)&TimeZoneInformation,
362 if (!NT_SUCCESS(Status))
363 {
364 DPRINT1("NtSetSystemInformation() failed (Status %lx)\n", Status);
366 return FALSE;
367 }
368
369 return TRUE;
370}
NTSYSAPI NTSTATUS NTAPI NtSetSystemInformation(IN INT SystemInformationClass, IN PVOID SystemInformation, IN ULONG SystemInformationLength)
#define DPRINT1
Definition: precomp.h:8
NTSYSAPI NTSTATUS NTAPI RtlSetTimeZoneInformation(_In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)

Referenced by SetLocalTimeZone(), and test_RtlQueryTimeZoneInformation().

◆ SystemTimeToFileTime()

WINBASEAPI BOOL WINAPI SystemTimeToFileTime ( const SYSTEMTIME ,
LPFILETIME   
)

◆ SystemTimeToTzSpecificLocalTime()

WINBASEAPI BOOL WINAPI SystemTimeToTzSpecificLocalTime ( CONST TIME_ZONE_INFORMATION lpTimeZoneInformation,
CONST SYSTEMTIME lpUniversalTime,
LPSYSTEMTIME  lpLocalTime 
)

Definition at line 377 of file timezone.c.

380{
382 FILETIME FileTime;
383 LONGLONG llTime;
384 LONG lBias;
385
387 {
388 TzInfo = *lpTimeZoneInformation;
389 }
390 else
391 {
393 return FALSE;
394 }
395
397 return FALSE;
398
399 if (!SystemTimeToFileTime(lpUniversalTime, &FileTime))
400 return FALSE;
401
402 FILETIME2LL(&FileTime, llTime)
403
404 if (!TIME_GetTimezoneBias(&TzInfo, &FileTime, FALSE, &lBias))
405 return FALSE;
406
407 /* convert minutes to 100-nanoseconds-ticks */
408 llTime -= (LONGLONG)lBias * TICKSPERMIN;
409
410 LL2FILETIME( llTime, &FileTime)
411
412 return FileTimeToSystemTime(&FileTime, lpLocalTime);
413}
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:183
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
Definition: time.c:153
#define TICKSPERMIN
Definition: timezone.c:21
#define FILETIME2LL(pft, ll)
Definition: timezone.c:26
static BOOL TIME_GetTimezoneBias(const TIME_ZONE_INFORMATION *pTZinfo, FILETIME *lpFileTime, BOOL islocal, LONG *pBias)
Definition: timezone.c:239
#define LL2FILETIME(ll, pft)
Definition: timezone.c:23
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
Definition: timezone.c:262
long LONG
Definition: pedump.c:60
WINBASEAPI _In_ CONST SYSTEMTIME _Out_ LPSYSTEMTIME lpLocalTime
Definition: timezoneapi.h:158
WINBASEAPI _In_ CONST SYSTEMTIME * lpUniversalTime
Definition: timezoneapi.h:157
int64_t LONGLONG
Definition: typedefs.h:68

Referenced by convert_file_time_to_time_t(), convert_filetime_to_time_t(), GetDriverDateString(), GetFileModifyTime(), is_dst(), CInstalledApplicationInfo::RetrieveInstallDate(), test_query_process_times(), and BtrfsScrub::UpdateTextBox().

◆ TzSpecificLocalTimeToSystemTime()

WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime ( CONST TIME_ZONE_INFORMATION lpTimeZoneInformation,
CONST SYSTEMTIME lpLocalTime,
LPSYSTEMTIME  lpUniversalTime 
)

Definition at line 421 of file timezone.c.

424{
425 FILETIME ft;
426 LONG lBias;
427 LONGLONG t;
429
431 {
432 tzinfo = *lpTimeZoneInformation;
433 }
434 else
435 {
437 return FALSE;
438 }
439
441 return FALSE;
442 FILETIME2LL( &ft, t)
443 if (!TIME_GetTimezoneBias(&tzinfo, &ft, TRUE, &lBias))
444 return FALSE;
445 /* convert minutes to 100-nanoseconds-ticks */
446 t += (LONGLONG)lBias * TICKSPERMIN;
447 LL2FILETIME( t, &ft)
449}
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by common_futime(), parse_filetime(), test_SHFormatDateTimeA(), test_SHFormatDateTimeW(), and variant_date_to_number().

Variable Documentation

◆ FirstYear

Definition at line 80 of file timezoneapi.h.

◆ LastYear

Definition at line 81 of file timezoneapi.h.

◆ localFileTime

Definition at line 107 of file timezoneapi.h.

◆ localSystemTime

WINBASEAPI _In_ CONST SYSTEMTIME * localSystemTime

Definition at line 108 of file timezoneapi.h.

◆ lpLocalTime

◆ lpTimeZoneInformation

◆ lpUniversalTime

◆ pdtzi

Definition at line 96 of file timezoneapi.h.

◆ ptzi