Can somebody give me a complete and working example of calling the AllocateAndInitializeSid function from C# code?
I found this:
BOOL WINAPI AllocateAndInitializeSid(
__in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
__in BYTE nSubAuthorityCount,
__in DWORD dwSubAuthority0,
__in DWORD dwSubAuthority1,
__in DWORD dwSubAuthority2,
__in DWORD dwSubAuthority3,
__in DWORD dwSubAuthority4,
__in DWORD dwSubAuthority5,
__in DWORD dwSubAuthority6,
__in DWORD dwSubAuthority7,
__out PSID *pSid
);
and I don't know how to construct the signature of this method - what should I do with *PSID_IDENTIFIER_AUTHORITY* and PSID types? How should I pass them (using ref? using out?)?