[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
This commit is contained in:
Pierre Schweitzer 2013-05-05 20:01:14 +00:00
parent 9818ea06e5
commit 648e8504fc

View file

@ -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))
{