From 6ef7adc1de009aa10923a2569e6a439345a90b45 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 22 Mar 2014 15:59:41 +0000 Subject: [PATCH] [KERNEL32] - Rename Keep argument of BasepIsRealtimeAllowed to something more accurate. - Properly document this function usage given its specific behavior. It's badly used in trunk atm, fixes will come in next commit svn path=/trunk/; revision=62542 --- reactos/dll/win32/kernel32/client/utils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/utils.c b/reactos/dll/win32/kernel32/client/utils.c index f0f102a3328..228690bba4a 100644 --- a/reactos/dll/win32/kernel32/client/utils.c +++ b/reactos/dll/win32/kernel32/client/utils.c @@ -615,10 +615,15 @@ BaseInitializeContext(IN PCONTEXT Context, /* * Checks if the privilege for Real-Time Priority is there + * Beware about this function behavior: + * - In case CheckOnly is set to TRUE, then the function will only check + * whether real time is allowed and won't grant the privilege. In that case + * it will return TRUE if allowed, FALSE otherwise. Not a state! + * It means you don't have to release privilege when calling with TRUE. */ PVOID WINAPI -BasepIsRealtimeAllowed(IN BOOLEAN Keep) +BasepIsRealtimeAllowed(IN BOOLEAN CheckOnly) { ULONG Privilege = SE_INC_BASE_PRIORITY_PRIVILEGE; PVOID State; @@ -627,7 +632,7 @@ BasepIsRealtimeAllowed(IN BOOLEAN Keep) Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State); if (!NT_SUCCESS(Status)) return NULL; - if (Keep) + if (CheckOnly) { RtlReleasePrivilege(State); State = (PVOID)TRUE;