summaryrefslogtreecommitdiff
path: root/worldtime_protocol/timezone.h
blob: ddb9a525ff53bc9ed1a9ca84ae0e7b9f478a2ebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _TIMEZONE_H
#define _TIMEZONE_H

#define TZREG "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"
#define TZREG_9X "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Time Zones"
//#define TZREG2 "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation"
#define MAX_SIZE 512

#include <vector>
#include <algorithm>

struct REG_TZI {
	DWORD Bias;
	DWORD StandardBias;
	DWORD DaylightBias;
	SYSTEMTIME StandardDate; 
	SYSTEMTIME DaylightDate;
};


struct LS_TZREG {
	TCHAR tcName[MAX_SIZE];
	TCHAR tcDisp[MAX_SIZE];
	TCHAR tcDLT[MAX_SIZE];
	TCHAR tcSTD[MAX_SIZE];
	TCHAR MapID[MAX_SIZE];
	DWORD Index;
	DWORD ActiveTimeBias;
	//TIME_ZONE_INFORMATION TZI;
	REG_TZI TZI;

	unsigned int list_index;

	bool operator<(const LS_TZREG &other);
};

typedef std::vector< LS_TZREG > TimeList;

extern TimeList timezone_list, geo_timezone_list;
bool build_timezone_list();

void convert_regdata_to_tzi(int vector_index);

#endif