@msdn=http://msdn.microsoft.com/library/en-us/security/security/$$$.asp @pinvoke=http://pinvoke.net/$$$.htm Summary: Copies a security identifier (SID) to a buffer. !!!!C# Signature: [DllImport("advapi32.dll", SetLastError=true)] static extern bool CopySid(uint nDestinationSidLength, IntPtr pDestinationSid, IntPtr pSourceSid); [DllImport("advapi32.dll", SetLastError=true)] static extern bool CopySid(uint nDestinationSidLength, byte[] pDestinationSid, IntPtr pSourceSid); !!!!VB Signature: Declare Function CopySid Lib "advapi32.dll" (ByVal nDestinationSidLength As Integer, _ ByVal pDestinationSid As IntPtr, ByVal pSourceSid As IntPtr) As Boolean !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: private static byte[] DuplicateSid(IntPtr pSid) { uint length = UnsafeNativeMethods.GetLengthSid(pSid); byte[] bytes = new byte[length]; UnsafeNativeMethods.CopySid(length, bytes, pSid); return bytes; } !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: CopySid@msdn on MSDN
Edit advapi32.CopySid
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.