internal ForestTrustDomainInformation(int flag, LSA_FOREST_TRUST_DOMAIN_INFO domainInfo, LARGE_INTEGER time) { this.status = (ForestTrustDomainStatus)flag; this.dnsName = Marshal.PtrToStringUni(domainInfo.DNSNameBuffer, domainInfo.DNSNameLength / 2); this.nbName = Marshal.PtrToStringUni(domainInfo.NetBIOSNameBuffer, domainInfo.NetBIOSNameLength / 2); IntPtr intPtr = (IntPtr)0; int stringSidW = UnsafeNativeMethods.ConvertSidToStringSidW(domainInfo.sid, ref intPtr); if (stringSidW != 0) { try { this.sid = Marshal.PtrToStringUni(intPtr); } finally { UnsafeNativeMethods.LocalFree(intPtr); } this.time = time; return; } else { throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error()); } }
internal ForestTrustDomainInformation(int flag, LSA_FOREST_TRUST_DOMAIN_INFO domainInfo, LARGE_INTEGER time) { _status = (ForestTrustDomainStatus)flag; DnsName = Marshal.PtrToStringUni(domainInfo.DNSNameBuffer, domainInfo.DNSNameLength / 2); NetBiosName = Marshal.PtrToStringUni(domainInfo.NetBIOSNameBuffer, domainInfo.NetBIOSNameLength / 2); string sidLocal; global::Interop.BOOL result = global::Interop.Advapi32.ConvertSidToStringSid(domainInfo.sid, out sidLocal); if (result == global::Interop.BOOL.FALSE) { throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error()); } DomainSid = sidLocal; this.time = time; }
internal ForestTrustDomainInformation(int flag, LSA_FOREST_TRUST_DOMAIN_INFO domainInfo, LARGE_INTEGER time) { _status = (ForestTrustDomainStatus)flag; DnsName = Marshal.PtrToStringUni(domainInfo.DNSNameBuffer, domainInfo.DNSNameLength / 2); NetBiosName = Marshal.PtrToStringUni(domainInfo.NetBIOSNameBuffer, domainInfo.NetBIOSNameLength / 2); IntPtr ptr = (IntPtr)0; int result = UnsafeNativeMethods.ConvertSidToStringSidW(domainInfo.sid, ref ptr); if (result == 0) { throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastWin32Error()); } try { DomainSid = Marshal.PtrToStringUni(ptr) !; } finally { UnsafeNativeMethods.LocalFree(ptr); } this.time = time; }
internal TopLevelName(int flag, LSA_UNICODE_STRING val, LARGE_INTEGER time) { this.status = (TopLevelNameStatus) flag; this.name = Marshal.PtrToStringUni(val.Buffer, val.Length / 2); this.time = time; }
internal TopLevelName(int flag, LSA_UNICODE_STRING val, LARGE_INTEGER time) { _status = (TopLevelNameStatus)flag; Name = Marshal.PtrToStringUni(val.Buffer, val.Length / 2); this.time = time; }