Blame winpr/include/winpr/timezone.h

Packit Service fa4841
/**
Packit Service fa4841
 * WinPR: Windows Portable Runtime
Packit Service fa4841
 * Time Zone
Packit Service fa4841
 *
Packit Service fa4841
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit Service fa4841
 *
Packit Service fa4841
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit Service fa4841
 * you may not use this file except in compliance with the License.
Packit Service fa4841
 * You may obtain a copy of the License at
Packit Service fa4841
 *
Packit Service fa4841
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit Service fa4841
 *
Packit Service fa4841
 * Unless required by applicable law or agreed to in writing, software
Packit Service fa4841
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit Service fa4841
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit Service fa4841
 * See the License for the specific language governing permissions and
Packit Service fa4841
 * limitations under the License.
Packit Service fa4841
 */
Packit Service fa4841
Packit Service fa4841
#ifndef WINPR_TIMEZONE_H
Packit Service fa4841
#define WINPR_TIMEZONE_H
Packit Service fa4841
Packit Service fa4841
#include <winpr/winpr.h>
Packit Service fa4841
#include <winpr/wtypes.h>
Packit Service fa4841
Packit Service fa4841
#include <winpr/windows.h>
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service b1ea74
extern "C"
Packit Service b1ea74
{
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#ifndef _WIN32
Packit Service fa4841
Packit Service b1ea74
	typedef struct _TIME_ZONE_INFORMATION
Packit Service b1ea74
	{
Packit Service b1ea74
		LONG Bias;
Packit Service b1ea74
		WCHAR StandardName[32];
Packit Service b1ea74
		SYSTEMTIME StandardDate;
Packit Service b1ea74
		LONG StandardBias;
Packit Service b1ea74
		WCHAR DaylightName[32];
Packit Service b1ea74
		SYSTEMTIME DaylightDate;
Packit Service b1ea74
		LONG DaylightBias;
Packit Service b1ea74
	} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
Packit Service b1ea74
Packit Service b1ea74
	typedef struct _TIME_DYNAMIC_ZONE_INFORMATION
Packit Service b1ea74
	{
Packit Service b1ea74
		LONG Bias;
Packit Service b1ea74
		WCHAR StandardName[32];
Packit Service b1ea74
		SYSTEMTIME StandardDate;
Packit Service b1ea74
		LONG StandardBias;
Packit Service b1ea74
		WCHAR DaylightName[32];
Packit Service b1ea74
		SYSTEMTIME DaylightDate;
Packit Service b1ea74
		LONG DaylightBias;
Packit Service b1ea74
		WCHAR TimeZoneKeyName[128];
Packit Service b1ea74
		BOOLEAN DynamicDaylightTimeDisabled;
Packit Service b1ea74
	} DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION,
Packit Service b1ea74
	    *LPDYNAMIC_TIME_ZONE_INFORMATION;
Packit Service b1ea74
Packit Service b1ea74
	WINPR_API DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation);
Packit Service b1ea74
	WINPR_API BOOL SetTimeZoneInformation(const TIME_ZONE_INFORMATION* lpTimeZoneInformation);
Packit Service b1ea74
	WINPR_API BOOL SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, LPFILETIME lpFileTime);
Packit Service b1ea74
	WINPR_API BOOL FileTimeToSystemTime(const FILETIME* lpFileTime, LPSYSTEMTIME lpSystemTime);
Packit Service b1ea74
	WINPR_API BOOL SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTimeZone,
Packit Service b1ea74
	                                               LPSYSTEMTIME lpUniversalTime,
Packit Service b1ea74
	                                               LPSYSTEMTIME lpLocalTime);
Packit Service b1ea74
	WINPR_API BOOL TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
Packit Service b1ea74
	                                               LPSYSTEMTIME lpLocalTime,
Packit Service b1ea74
	                                               LPSYSTEMTIME lpUniversalTime);
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
/*
Packit Service fa4841
 * GetDynamicTimeZoneInformation is provided by the SDK if _WIN32_WINNT >= 0x0600 in SDKs above 7.1A
Packit Service fa4841
 * and incorrectly if _WIN32_WINNT >= 0x0501 in older SDKs
Packit Service fa4841
 */
Packit Service b1ea74
#if !defined(_WIN32) ||                                                  \
Packit Service b1ea74
    (defined(_WIN32) && (defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0600 || \
Packit Service b1ea74
                         !defined(NTDDI_WIN8) && _WIN32_WINNT < 0x0501)) /* Windows Vista */
Packit Service fa4841
Packit Service b1ea74
	WINPR_API DWORD
Packit Service b1ea74
	GetDynamicTimeZoneInformation(PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation);
Packit Service b1ea74
	WINPR_API BOOL
Packit Service b1ea74
	SetDynamicTimeZoneInformation(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation);
Packit Service b1ea74
	WINPR_API BOOL GetTimeZoneInformationForYear(USHORT wYear, PDYNAMIC_TIME_ZONE_INFORMATION pdtzi,
Packit Service b1ea74
	                                             LPTIME_ZONE_INFORMATION ptzi);
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if !defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0601)) /* Windows 7 */
Packit Service fa4841
Packit Service b1ea74
	WINPR_API BOOL
Packit Service b1ea74
	SystemTimeToTzSpecificLocalTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation,
Packit Service b1ea74
	                                  const SYSTEMTIME* lpUniversalTime, LPSYSTEMTIME lpLocalTime);
Packit Service b1ea74
	WINPR_API BOOL
Packit Service b1ea74
	TzSpecificLocalTimeToSystemTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION* lpTimeZoneInformation,
Packit Service b1ea74
	                                  const SYSTEMTIME* lpLocalTime, LPSYSTEMTIME lpUniversalTime);
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if !defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0602)) /* Windows 8 */
Packit Service fa4841
Packit Service b1ea74
	WINPR_API DWORD EnumDynamicTimeZoneInformation(
Packit Service b1ea74
	    const DWORD dwIndex, PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation);
Packit Service b1ea74
	WINPR_API DWORD GetDynamicTimeZoneInformationEffectiveYears(
Packit Service b1ea74
	    const PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation, LPDWORD FirstYear,
Packit Service b1ea74
	    LPDWORD LastYear);
Packit Service fa4841
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service fa4841
}
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#endif /* WINPR_TIMEZONE_H */