Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than advapi32, prefix the name with the module name and a period.
Declare Function LookupPrivilegeDisplayName Lib "advapi32.dll" (TODO) As TODO
User-Defined Types:
None.
Notes:
If it returns false, you'll need to call Marshal.GetLastWin32Error() and handle at least these errors:
const int ERROR_INSUFFICIENT_BUFFER = 122;
This is one of those "call twice" functions, so this error is just daily life. When it returns with this error, the byte count (cbDisplayName) will be set to what you need. Call EnsureCapacity on your StringBuilder and go round again.
const int ERROR_NO_SUCH_PRIVILEGE = 1313;
The privileges that Windows knows about vary from one system to another. If you run your code on a Windows version other than the one you developed it on, you'll need to handle this one.
TODO Does anyone know where to find a definitive reference for which privileges are present on a given OS? There doesn't seem to be an enumeration function
Tips & Tricks:
Please add some!
Sample Code:
Please add some!
Alternative Managed API:
Do you know one? Please contribute it!
Click to read this page
10/2/2011 2:35:57 AM - txzhgh-89.110.151.174
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).