From 648e8504fc7fd8eb1184fceaf73d71a4f73e6c59 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 5 May 2013 20:01:14 +0000 Subject: [PATCH] [KERNEL32] Also "fix" hack of RtlAcquirePrivilege in SetSystemTime(). Spotted by Thomas. Note for syssetup/rtl/kernel32 devs: Make it crystal clear that this is a hack and has to be deleted once RAP is fine. Also note that for SetLocalTime() and 2nd stage, syssetup acquires the privilege itself in SetSystemLocalTime() before calling SetLocalTime(). This will also have to be deleted once RAP is working fine. Otherwise it will keep failing: it is not possible to acquire a privilege already held. svn path=/trunk/; revision=58953 --- reactos/dll/win32/kernel32/client/time.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/time.c b/reactos/dll/win32/kernel32/client/time.c index 1302d3ca068..c9669fa5d30 100644 --- a/reactos/dll/win32/kernel32/client/time.c +++ b/reactos/dll/win32/kernel32/client/time.c @@ -386,7 +386,7 @@ SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime) } else { - DPRINT1("Workaround RtlAcquirePrivilege failure!\n"); + DPRINT1("HACK: Workaround RtlAcquirePrivilege failure! Remove me once RAP is fine\n"); Status = NtSetSystemTime(&NewSystemTime, NULL); } @@ -427,12 +427,16 @@ SetSystemTime(IN CONST SYSTEMTIME *lpSystemTime) } Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State); - Status = STATUS_SUCCESS; if (NT_SUCCESS(Status)) { Status = NtSetSystemTime(&NewSystemTime, NULL); RtlReleasePrivilege(State); } + else + { + DPRINT1("HACK: Workaround RtlAcquirePrivilege failure! Remove me once RAP is fine\n"); + Status = NtSetSystemTime(&NewSystemTime, NULL); + } if (!NT_SUCCESS(Status)) {