no need to copy the buffers to the stack

svn path=/trunk/; revision=11906
This commit is contained in:
Thomas Bluemel 2004-12-02 21:22:36 +00:00
parent 9786cae211
commit 67ca81e36d

View file

@ -1,4 +1,4 @@
/* $Id: time.c,v 1.34 2004/12/01 14:24:51 ekohl Exp $ /* $Id: time.c,v 1.35 2004/12/02 21:22:36 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -338,13 +338,12 @@ SetSystemTime(CONST SYSTEMTIME *lpSystemTime)
DWORD STDCALL DWORD STDCALL
GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation) GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
{ {
TIME_ZONE_INFORMATION TimeZoneInformation;
NTSTATUS Status; NTSTATUS Status;
DPRINT("GetTimeZoneInformation()\n"); DPRINT("GetTimeZoneInformation()\n");
Status = NtQuerySystemInformation(SystemCurrentTimeZoneInformation, Status = NtQuerySystemInformation(SystemCurrentTimeZoneInformation,
&TimeZoneInformation, lpTimeZoneInformation,
sizeof(TIME_ZONE_INFORMATION), sizeof(TIME_ZONE_INFORMATION),
NULL); NULL);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -353,10 +352,6 @@ GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
return TIME_ZONE_ID_INVALID; return TIME_ZONE_ID_INVALID;
} }
memcpy(lpTimeZoneInformation,
&TimeZoneInformation,
sizeof(TIME_ZONE_INFORMATION));
return(SharedUserData->TimeZoneId); return(SharedUserData->TimeZoneId);
} }
@ -367,16 +362,11 @@ GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
BOOL STDCALL BOOL STDCALL
SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation) SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
{ {
TIME_ZONE_INFORMATION TimeZoneInformation;
NTSTATUS Status; NTSTATUS Status;
DPRINT("SetTimeZoneInformation()\n"); DPRINT("SetTimeZoneInformation()\n");
memcpy(&TimeZoneInformation, Status = RtlSetTimeZoneInformation((PTIME_ZONE_INFORMATION)lpTimeZoneInformation);
lpTimeZoneInformation,
sizeof(TIME_ZONE_INFORMATION));
Status = RtlSetTimeZoneInformation(&TimeZoneInformation);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("RtlSetTimeZoneInformation() failed (Status %lx)\n", Status); DPRINT1("RtlSetTimeZoneInformation() failed (Status %lx)\n", Status);
@ -385,7 +375,7 @@ SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
} }
Status = NtSetSystemInformation(SystemCurrentTimeZoneInformation, Status = NtSetSystemInformation(SystemCurrentTimeZoneInformation,
(PVOID)&TimeZoneInformation, (PVOID)lpTimeZoneInformation,
sizeof(TIME_ZONE_INFORMATION)); sizeof(TIME_ZONE_INFORMATION));
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {