diff --git "a/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\ntpclient.c" "b/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\ntpclient.c" index 7442b49150..37a1af1272 100644 --- "a/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\ntpclient.c" +++ "b/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\ntpclient.c" @@ -4,6 +4,7 @@ * FILE: dll/cpl/timedate/ntpclient.c * PURPOSE: Queries the NTP server * COPYRIGHT: Copyright 2006 Ged Murphy + * Copyright 2017 Doug Lyons * */ @@ -107,6 +108,9 @@ ReceiveData(PINFO pInfo) FD_SET readFDS; INT Ret; ULONG ulTime = 0; + time_t orig_format; + time_t local_time; + time_t gmt_time; /* Monitor socket for incoming connections */ FD_ZERO(&readFDS); @@ -129,7 +133,15 @@ ReceiveData(PINFO pInfo) NULL, NULL); if (Ret != SOCKET_ERROR) - ulTime = ntohl(ulTime); + ulTime = ntohl(pInfo->RecvPacket.TransmitTimestamp.dwInteger); + + time(&orig_format); + gmt_time = mktime(gmtime(&orig_format)); + + time(&orig_format); + local_time = mktime(localtime(&orig_format)); + + ulTime -= gmt_time - local_time; } return ulTime; diff --git "a/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\timedate.h" "b/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\timedate.h" index 7442b49150..37a1af1272 100644 --- "a/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\timedate.h" +++ "b/D:\\ReactOS\\reactos\\dll\\cpl\\timedate\\timedate.h" @@ -18,6 +18,7 @@ #include #include "resource.h" +#include "time.h" #define MAX_KEY_LENGTH 255 #define MAX_VALUE_NAME 16383