Author: hbelusca
Date: Sat Mar 22 18:46:26 2014
New Revision: 62544
URL: http://svn.reactos.org/svn/reactos?rev=62544&view=rev
Log:
[KERNEL32]: Fix parameter usage in RtlAcquirePrivilege.
Modified:
trunk/reactos/dll/win32/kernel32/client/proc.c
Modified: trunk/reactos/dll/win32/kernel32/client/proc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sat Mar 22 18:46:26 2014
@@ -3874,7 +3874,7 @@
{
/* Acquire the required privilege so that the kernel won't fail the call */
PrivilegeValue = SE_LOCK_MEMORY_PRIVILEGE;
- Status = RtlAcquirePrivilege(&PrivilegeValue, TRUE, FALSE, &PrivilegeState);
+ Status = RtlAcquirePrivilege(&PrivilegeValue, 1, 0, &PrivilegeState);
if (NT_SUCCESS(Status))
{
/* Remember to release it later */
Author: pschweitzer
Date: Sat Mar 22 16:11:32 2014
New Revision: 62543
URL: http://svn.reactos.org/svn/reactos?rev=62543&view=rev
Log:
[KERNEL32]
Actually, given how the calls were done later on, it appears that our dear Alex was missing a !
So fix the if condition in BasepIsRealtimeAllowed, restore the previous arg name, and update the doc
This should fix the calls to that function.
CORE-8013 #comment Should be fixed with r62543. Please retry
Modified:
trunk/reactos/dll/win32/kernel32/client/utils.c
Modified: trunk/reactos/dll/win32/kernel32/client/utils.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Sat Mar 22 16:11:32 2014
@@ -616,14 +616,14 @@
/*
* 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
+ * - In case Keep is set to FALSE, 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.
+ * It means you don't have to release privilege when calling with FALSE.
*/
PVOID
WINAPI
-BasepIsRealtimeAllowed(IN BOOLEAN CheckOnly)
+BasepIsRealtimeAllowed(IN BOOLEAN Keep)
{
ULONG Privilege = SE_INC_BASE_PRIORITY_PRIVILEGE;
PVOID State;
@@ -632,7 +632,7 @@
Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State);
if (!NT_SUCCESS(Status)) return NULL;
- if (CheckOnly)
+ if (!Keep)
{
RtlReleasePrivilege(State);
State = (PVOID)TRUE;
Author: pschweitzer
Date: Sat Mar 22 15:59:41 2014
New Revision: 62542
URL: http://svn.reactos.org/svn/reactos?rev=62542&view=rev
Log:
[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
Modified:
trunk/reactos/dll/win32/kernel32/client/utils.c
Modified: trunk/reactos/dll/win32/kernel32/client/utils.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Sat Mar 22 15:59:41 2014
@@ -615,10 +615,15 @@
/*
* 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 @@
Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State);
if (!NT_SUCCESS(Status)) return NULL;
- if (Keep)
+ if (CheckOnly)
{
RtlReleasePrivilege(State);
State = (PVOID)TRUE;