Make sure that NtSetSystemTime won't crash if the new systen time is NULL.
authorEric Kohl <eric.kohl@reactos.org>
Fri, 5 Nov 2004 11:46:02 +0000 (11:46 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 5 Nov 2004 11:46:02 +0000 (11:46 +0000)
svn path=/trunk/; revision=11539

reactos/ntoskrnl/ex/time.c

index c26edfd..3d2af13 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.21 2004/08/15 16:39:01 chorns Exp $
+/* $Id: time.c,v 1.22 2004/11/05 11:46:02 ekohl Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -37,8 +37,8 @@ ExInitTimeZoneInfo (VOID)
 
 
 NTSTATUS STDCALL
-NtSetSystemTime (IN    PLARGE_INTEGER  UnsafeNewSystemTime,
-                OUT    PLARGE_INTEGER  UnsafeOldSystemTime     OPTIONAL)
+NtSetSystemTime(IN PLARGE_INTEGER UnsafeNewSystemTime,
+               OUT PLARGE_INTEGER UnsafeOldSystemTime OPTIONAL)
      /*
       * FUNCTION: Sets the system time.
       * PARAMETERS:
@@ -56,6 +56,13 @@ NtSetSystemTime (IN  PLARGE_INTEGER  UnsafeNewSystemTime,
 
   /* FIXME: Check for SeSystemTimePrivilege */
 
+  if (UnsafeNewSystemTime == NULL)
+    {
+      /* FIXME: update time zone settings */
+
+      return STATUS_SUCCESS;
+    }
+
   Status = MmCopyFromCaller(&NewSystemTime, UnsafeNewSystemTime,
                            sizeof(NewSystemTime));
   if (!NT_SUCCESS(Status))