Chapter 22. How to Use a Privilege

Remember that before you can use a privilege it must be in your token. The only way to get a privilege into your token is to have security policy grant it to you, and then to establish a fresh logon. The resulting token will have the new privilege, and it will be available for your use (in other words, don't forget to log off and log back on if you want a recent change to your groups or privileges to affect the programs you want to run).

Most functions don't require any special privileges, but if the documentation for a particular function indicates that a privilege is required, pay special attention to whether that function automatically enables the privilege or not. Some Win32 functions that use privileges can ...

Get The .NET Developer's Guide to Windows Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.