Smart Device Functions:
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 LsaEnumerateAccountRights Lib "advapi32.dll" (TODO) As TODO
// NTSTATUS LsaEnumerateAccountRights(
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 ???
(Answer: Nobody knows why, but the runtime seems to screw it up)
Tips & Tricks:
Please add some!
Sample Code (C#):
// You should already have the HPolicy and SID ready
uint cRights = 0;
uint result = LsaEnumerateAccountRights( policyHandle,
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 ???
char destination = new char[structure.length / sizeof(char)];
Alternative Managed API:
Do you know one? Please contribute it!
TODO - a short description
8/5/2009 6:19:02 AM - firstname.lastname@example.org
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 11:00:13 AM - Damon Carr-184.108.40.206
Please edit this page!
Do you have...