Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
RtlAdjustPrivilege (ntdll)
 
.
Summary
Return Type is NTSTATUS but too long type definition to wrote this page

C# Signature:

    [DllImport("ntdll.dll", SetLastError = true)]
    public static extern IntPtr RtlAdjustPrivilege(int Privilege, bool bEnablePrivilege,
    bool IsThreadPrivilege, out bool PreviousValue);

VB Signature:

  <DllImport("ntdll.dll")>
    Public Shared Function RtlAdjustPrivilege(ByVal Privilege As Integer, ByVal bEnablePrivilege As Boolean, ByVal IsThreadPrivilege As Boolean, <Out> ByRef PreviousValue As Boolean) As UInteger
    End Function

C/C++:

NTSTATUS RtlAdjustPrivilege

(
  ULONG    Privilege,
  BOOLEAN  Enable,
  BOOLEAN  CurrentThread,
  PBOOLEAN Enabled

)

DESCRIPTION:

Enables or disables a privilege from the calling thread or process.

Params:

Privilege (In) - Privilege index to change.

Enable (In) - If TRUE, then enable the privilege otherwise disable.

CurrentThread (In) - If TRUE, then enable in calling thread, otherwise process.

Enabled (Out) - Whether privilege was previously enabled or disabled.

Returns:

Success
STATUS_SUCCESS.
Failure
NTSTATUS code.

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Privilege:

SeCreateTokenPrivilege = 1

SeAssignPrimaryTokenPrivilege = 2

SeLockMemoryPrivilege = 3

SeIncreaseQuotaPrivilege = 4

SeUnsolicitedInputPrivilege = 5

SeMachineAccountPrivilege = 6

SeTcbPrivilege = 7

SeSecurityPrivilege = 8

SeTakeOwnershipPrivilege = 9

SeLoadDriverPrivilege = 10

SeSystemProfilePrivilege = 11

SeSystemtimePrivilege = 12

SeProfileSingleProcessPrivilege = 13

SeIncreaseBasePriorityPrivilege = 14

SeCreatePagefilePrivilege = 15

SeCreatePermanentPrivilege = 16

SeBackupPrivilege = 17

SeRestorePrivilege = 18

SeShutdownPrivilege = 19

SeDebugPrivilege = 20

SeAuditPrivilege = 21

SeSystemEnvironmentPrivilege = 22

SeChangeNotifyPrivilege = 23

SeRemoteShutdownPrivilege = 24

SeUndockPrivilege = 25

SeSyncAgentPrivilege = 26

SeEnableDelegationPrivilege = 27

SeManageVolumePrivilege = 28

SeImpersonatePrivilege = 29

SeCreateGlobalPrivilege = 30

SeTrustedCredManAccessPrivilege = 31

SeRelabelPrivilege = 32

SeIncreaseWorkingSetPrivilege = 33

SeTimeZonePrivilege = 34

SeCreateSymbolicLinkPrivilege = 35

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions