Desktop Functions: Smart Device Functions:
|
LsaEnumerateAccountRights (advapi32)
C# Signature:
[DllImport("advapi32.dll", SetLastError=true)] VB Signature:
Declare Function LsaEnumerateAccountRights Lib "advapi32.dll" (TODO) As TODO User-Defined Types:None. Notes:// NTSTATUS LsaEnumerateAccountRights( // in LSA_HANDLE PolicyHandle, // in PSID AccountSid, // out PLSA_UNICODE_STRING* UserRights, // out PULONG CountOfRights //); NTSTATUS can be converted to a Windows error using LsaNtStatusToWinError The reason behind using byte[] for a sid is a mystery to me. Has anyone documented this? I've just copied the techniques from other functions here and it seems to work. Similarly - the sample code below works, but why can't you just use an array of LSA_UNICODE_STRING ??? Tips & Tricks:Please add some! Sample Code:IntPtr rights; uint cRights = 0; uint result = LsaEnumerateAccountRights( policyHandle,
sid, privileges = new string[cRights]; for ( int i = 0; i < cRights; i++ ) {
// QUESTION: Why can't we just use an array of LSAInter.LSA_UNICODE_STRING ??? } Alternative Managed API:Do you know one? Please contribute it! Please edit this page!Do you have...
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). |
|