mirror of
https://github.com/reactos/reactos.git
synced 2025-04-30 19:19:00 +00:00
[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
This commit is contained in:
parent
2936e38c77
commit
6ef7adc1de
1 changed files with 7 additions and 2 deletions
|
@ -615,10 +615,15 @@ BaseInitializeContext(IN PCONTEXT Context,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checks if the privilege for Real-Time Priority is there
|
* 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
|
PVOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BasepIsRealtimeAllowed(IN BOOLEAN Keep)
|
BasepIsRealtimeAllowed(IN BOOLEAN CheckOnly)
|
||||||
{
|
{
|
||||||
ULONG Privilege = SE_INC_BASE_PRIORITY_PRIVILEGE;
|
ULONG Privilege = SE_INC_BASE_PRIORITY_PRIVILEGE;
|
||||||
PVOID State;
|
PVOID State;
|
||||||
|
@ -627,7 +632,7 @@ BasepIsRealtimeAllowed(IN BOOLEAN Keep)
|
||||||
Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State);
|
Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State);
|
||||||
if (!NT_SUCCESS(Status)) return NULL;
|
if (!NT_SUCCESS(Status)) return NULL;
|
||||||
|
|
||||||
if (Keep)
|
if (CheckOnly)
|
||||||
{
|
{
|
||||||
RtlReleasePrivilege(State);
|
RtlReleasePrivilege(State);
|
||||||
State = (PVOID)TRUE;
|
State = (PVOID)TRUE;
|
||||||
|
|
Loading…
Reference in a new issue