mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SRVSVC]
Implement NetrRemoteTOD. CORE-5423 #resolve #comment Committed in r67210. svn path=/trunk/; revision=67210
This commit is contained in:
parent
4e16ae29eb
commit
60e0daa326
1 changed files with 60 additions and 2 deletions
|
@ -28,6 +28,8 @@
|
|||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "ndk/kefuncs.h"
|
||||
#include "ndk/rtlfuncs.h"
|
||||
#include "winerror.h"
|
||||
#include "lmerr.h"
|
||||
|
||||
|
@ -446,8 +448,64 @@ NetrRemoteTOD(
|
|||
SRVSVC_HANDLE ServerName,
|
||||
LPTIME_OF_DAY_INFO *BufferPtr)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
SYSTEMTIME SystemTime;
|
||||
LARGE_INTEGER Time;
|
||||
TIME_ZONE_INFORMATION TimeZoneInfo;
|
||||
DWORD TimeZoneId;
|
||||
LPTIME_OF_DAY_INFO lpTod;
|
||||
|
||||
TRACE("NetrRemoteTOD(%p %p)\n", ServerName, BufferPtr);
|
||||
|
||||
*BufferPtr = midl_user_allocate(sizeof(TIME_OF_DAY_INFO));
|
||||
if (*BufferPtr == NULL)
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
|
||||
lpTod = *BufferPtr;
|
||||
|
||||
/* Set the seconds since 1970 */
|
||||
NtQuerySystemTime(&Time);
|
||||
RtlTimeToSecondsSince1970(&Time,
|
||||
&lpTod->tod_elapsedt);
|
||||
|
||||
/* Set the tick count */
|
||||
lpTod->tod_msecs = GetTickCount();
|
||||
|
||||
/* Set the timezone */
|
||||
TimeZoneId = GetTimeZoneInformation(&TimeZoneInfo);
|
||||
|
||||
switch (TimeZoneId)
|
||||
{
|
||||
case TIME_ZONE_ID_UNKNOWN:
|
||||
lpTod->tod_timezone = TimeZoneInfo.Bias;
|
||||
break;
|
||||
|
||||
case TIME_ZONE_ID_STANDARD:
|
||||
lpTod->tod_timezone = TimeZoneInfo.Bias + TimeZoneInfo.StandardBias;
|
||||
break;
|
||||
|
||||
case TIME_ZONE_ID_DAYLIGHT:
|
||||
lpTod->tod_timezone = TimeZoneInfo.Bias + TimeZoneInfo.DaylightBias;
|
||||
break;
|
||||
|
||||
default:
|
||||
lpTod->tod_timezone = 0;
|
||||
}
|
||||
|
||||
/* Set the ??? */
|
||||
lpTod->tod_tinterval = 310;
|
||||
|
||||
/* Set the date and time */
|
||||
GetSystemTime(&SystemTime);
|
||||
lpTod->tod_hours = SystemTime.wHour;
|
||||
lpTod->tod_mins = SystemTime.wMinute;
|
||||
lpTod->tod_secs = SystemTime.wSecond;
|
||||
lpTod->tod_hunds = SystemTime.wMilliseconds / 10;
|
||||
lpTod->tod_day = SystemTime.wDay;
|
||||
lpTod->tod_month = SystemTime.wMonth;
|
||||
lpTod->tod_year = SystemTime.wYear;
|
||||
lpTod->tod_weekday = SystemTime.wDayOfWeek;
|
||||
|
||||
return NERR_Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue