static private ConvertIntPtrSidToByteArraySid ( |
||
binaryForm | ||
리턴 | byte[] |
internal static int CreateSidFromString(string stringSid, out byte[] resultSid) { IntPtr zero = IntPtr.Zero; int lastWin32Error; try { if (1 != Win32Native.ConvertStringSidToSid(stringSid, out zero)) { lastWin32Error = Marshal.GetLastWin32Error(); goto IL_2D; } resultSid = Win32.ConvertIntPtrSidToByteArraySid(zero); } finally { Win32Native.LocalFree(zero); } return(0); IL_2D: resultSid = null; return(lastWin32Error); }
internal SecurityIdentifier(IntPtr binaryForm, bool noDemand) : this(Win32.ConvertIntPtrSidToByteArraySid(binaryForm), 0) { }
// // Constructs a SecurityIdentifier object from an IntPtr // public SecurityIdentifier(IntPtr binaryForm) : this(Win32.ConvertIntPtrSidToByteArraySid(binaryForm), 0) { }