mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
parent
e4ba911b02
commit
26045f1062
@ -2,6 +2,7 @@ option(WITH_DEBUG_TRANSPORT "Print transport debug messages." OFF)
|
||||
option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." OFF)
|
||||
option(WITH_DEBUG_SVC "Print static virtual channel debug messages." OFF)
|
||||
option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." OFF)
|
||||
option(WITH_DEBUG_TIMEZONE "Print timezone redirection related messages." OFF)
|
||||
option(WITH_DEBUG_KBD "Print keyboard related debug messages." OFF)
|
||||
option(WITH_DEBUG_NLA "Print authentication related debug messages." OFF)
|
||||
option(WITH_DEBUG_NEGO "Print negotiation related debug messages." OFF)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#cmakedefine WITH_DEBUG_CHANNELS
|
||||
#cmakedefine WITH_DEBUG_SVC
|
||||
#cmakedefine WITH_DEBUG_DVC
|
||||
#cmakedefine WITH_DEBUG_TIMEZONE
|
||||
#cmakedefine WITH_DEBUG_KBD
|
||||
#cmakedefine WITH_DEBUG_NLA
|
||||
#cmakedefine WITH_DEBUG_NEGO
|
||||
|
@ -230,99 +230,6 @@
|
||||
#define YORUBA 0x046A
|
||||
#define ZULU 0x0435
|
||||
|
||||
|
||||
/*
|
||||
Time zones, taken from Windows Server 2008
|
||||
|
||||
(GMT -12:00) International Date Line West
|
||||
(GMT -11:00) Midway Island, Samoa
|
||||
(GMT -10:00) Hawaii
|
||||
(GMT -09:00) Alaska
|
||||
(GMT -08:00) Pacific Time (US & Canada)
|
||||
(GMT -08:00) Tijuana, Baja California
|
||||
(GMT -07:00) Arizona
|
||||
(GMT -07:00) Chihuahua, La Paz, Mazatlan
|
||||
(GMT -07:00) Mountain Time (US & Canada)
|
||||
(GMT -06:00) Central America
|
||||
(GMT -06:00) Central Time (US & Canada)
|
||||
(GMT -06:00) Guadalajara, Mexico City, Monterrey
|
||||
(GMT -06:00) Saskatchewan
|
||||
(GMT -05:00) Bogota, Lima, Quito, Rio Branco
|
||||
(GMT -05:00) Eastern Time (US & Canada)
|
||||
(GMT -05:00) Indiana (East)
|
||||
(GMT -04:30) Caracas
|
||||
(GMT -04:00) Atlantic Time (Canada)
|
||||
(GMT -04:00) La Paz
|
||||
(GMT -04:00) Manaus
|
||||
(GMT -04:00) Santiago
|
||||
(GMT -03:30) Newfoundland
|
||||
(GMT -03:00) Brasilia
|
||||
(GMT -03:00) Buenos Aires
|
||||
(GMT -03:00) Georgetown
|
||||
(GMT -03:00) Greenland
|
||||
(GMT -03:00) Montevideo
|
||||
(GMT -02:00) Mid-Atlantic
|
||||
(GMT -01:00) Azores
|
||||
(GMT -01:00) Cape Verde Is.
|
||||
(GMT +00:00) Casablanca
|
||||
(GMT +00:00) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London
|
||||
(GMT +00:00) Monrovia, Reykjavik
|
||||
(GMT +01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
|
||||
(GMT +01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
|
||||
(GMT +01:00) Brussels, Copenhagen, Madrid, Paris
|
||||
(GMT +01:00) Sarajevo, Skopje, Warsaw, Zagreb
|
||||
(GMT +01:00) West Central Africa
|
||||
(GMT +02:00) Amman
|
||||
(GMT +02:00) Athens, Bucharest, Istanbul
|
||||
(GMT +02:00) Beirut
|
||||
(GMT +02:00) Cairo
|
||||
(GMT +02:00) Harare, Pretoria
|
||||
(GMT +02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
|
||||
(GMT +02:00) Jerusalem
|
||||
(GMT +02:00) Minsk
|
||||
(GMT +02:00) Windhoek
|
||||
(GMT +03:00) Baghdad
|
||||
(GMT +03:00) Kuwait, Riyadh
|
||||
(GMT +03:00) Moscow, St. Petersburg, Volgograd
|
||||
(GMT +03:00) Nairobi
|
||||
(GMT +03:00) Tbilisi
|
||||
(GMT +03:30) Tehran
|
||||
(GMT +04:00) Abu Dhabi, Muscat
|
||||
(GMT +04:00) Baku
|
||||
(GMT +04:00) Port Louis
|
||||
(GMT +04:00) Yerevan
|
||||
(GMT +04:30) Kabul
|
||||
(GMT +05:00) Ekaterinburg
|
||||
(GMT +05:00) Islamabad, Karachi
|
||||
(GMT +05:00) Tashkent
|
||||
(GMT +05:30) Chennai, Kolkata, Mumbai, New Delhi
|
||||
(GMT +05:30) Sri Jayawardenepura
|
||||
(GMT +05:45) Kathmandu
|
||||
(GMT +06:00) Almaty, Novosibirsk
|
||||
(GMT +06:00) Astana, Dhaka
|
||||
(GMT +06:30) Yangon (Rangoon)
|
||||
(GMT +07:00) Bangkok, Hanoi, Jakarta
|
||||
(GMT +07:00) Krasnoyarsk
|
||||
(GMT +08:00) Beijing, Chongqing, Hong Kong, Urumqi
|
||||
(GMT +08:00) Irkutsk, Ulaan Bataar
|
||||
(GMT +08:00) Kuala Lumpur, Singapore
|
||||
(GMT +08:00) Perth
|
||||
(GMT +08:00) Taipei
|
||||
(GMT +09:00) Osaka, Sapporo, Tokyo
|
||||
(GMT +09:00) Seoul
|
||||
(GMT +09:00) Yakutsk
|
||||
(GMT +09:30) Adelaide
|
||||
(GMT +09:30) Darwin
|
||||
(GMT +10:00) Brisbane
|
||||
(GMT +10:00) Canberra, Melbourne, Sydney
|
||||
(GMT +10:00) Guam, Port Moresby
|
||||
(GMT +10:00) Hobart, Vladivostok
|
||||
(GMT +11:00) Magadan, Solomon Is., New Caledonia
|
||||
(GMT +12:00) Auckland, Wellington
|
||||
(GMT +12:00) Fiji, Kamchatka, Marshall Is.
|
||||
(GMT +13:00) Nuku'alofa
|
||||
*/
|
||||
|
||||
FREERDP_API uint32 detect_keyboard_layout_from_locale(void);
|
||||
|
||||
#endif /* __LOCALES_H */
|
||||
|
@ -31,4 +31,6 @@ FREERDP_API char* xstrdup(const char* str);
|
||||
|
||||
#define xnew(_type) (_type*)xzalloc(sizeof(_type))
|
||||
|
||||
#define ARRAY_SIZE(_x) (sizeof(_x)/sizeof(*(_x)))
|
||||
|
||||
#endif /* __MEMORY_UTILS_H */
|
||||
|
36
include/freerdp/utils/time.h
Normal file
36
include/freerdp/utils/time.h
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* Time Utils
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FREERDP_TIME_UTILS_H
|
||||
#define FREERDP_TIME_UTILS_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/types.h>
|
||||
|
||||
FREERDP_API uint64 rdp_windows_gmtime();
|
||||
FREERDP_API uint64 rdp_get_windows_time_from_unix_time(time_t unix_time);
|
||||
FREERDP_API time_t rdp_get_unix_time_from_windows_time(uint64 windows_time);
|
||||
|
||||
#endif /* FREERDP_TIME_UTILS_H */
|
File diff suppressed because it is too large
Load Diff
@ -21,9 +21,11 @@
|
||||
#define __TIMEZONE_H
|
||||
|
||||
#include "rdp.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include <freerdp/utils/time.h>
|
||||
|
||||
void rdp_read_system_time(STREAM* s, SYSTEM_TIME* system_time);
|
||||
void rdp_write_system_time(STREAM* s, SYSTEM_TIME* system_time);
|
||||
@ -31,4 +33,10 @@ void rdp_get_client_time_zone(STREAM* s, rdpSettings* settings);
|
||||
boolean rdp_read_client_time_zone(STREAM* s, rdpSettings* settings);
|
||||
void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings);
|
||||
|
||||
#ifdef WITH_DEBUG_TIMEZONE
|
||||
#define DEBUG_TIMEZONE(fmt, ...) DEBUG_CLASS(TIMEZONE, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_TIMEZONE(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif /* __TIMEZONE_H */
|
||||
|
@ -46,6 +46,7 @@ set(FREERDP_UTILS_SRCS
|
||||
string.c
|
||||
svc_plugin.c
|
||||
thread.c
|
||||
time.c
|
||||
unicode.c
|
||||
wait_obj.c)
|
||||
|
||||
|
45
libfreerdp-utils/time.c
Normal file
45
libfreerdp-utils/time.c
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* Time Utils
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <freerdp/utils/time.h>
|
||||
|
||||
uint64 rdp_windows_gmtime()
|
||||
{
|
||||
time_t unix_time;
|
||||
uint64 windows_time;
|
||||
|
||||
time(&unix_time);
|
||||
windows_time = rdp_get_windows_time_from_unix_time(unix_time);
|
||||
|
||||
return windows_time;
|
||||
}
|
||||
|
||||
uint64 rdp_get_windows_time_from_unix_time(time_t unix_time)
|
||||
{
|
||||
uint64 windows_time;
|
||||
windows_time = ((uint64)unix_time * 10000000) + 621355968000000000ULL;
|
||||
return windows_time;
|
||||
}
|
||||
|
||||
time_t rdp_get_unix_time_from_windows_time(uint64 windows_time)
|
||||
{
|
||||
time_t unix_time;
|
||||
unix_time = (windows_time - 621355968000000000ULL) / 10000000;
|
||||
return unix_time;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* Time Zone Redirection Table Generator
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user