Blame winpr/include/winpr/timezone.h

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