| | 1 | | using System; |
| | 2 | | using System.Runtime.InteropServices; |
| | 3 | | using SharpHoundRPC.Shared; |
| | 4 | |
|
| | 5 | | namespace SharpHoundRPC.LSANative |
| | 6 | | { |
| | 7 | | public class LSAStructs |
| | 8 | | { |
| | 9 | | [StructLayout(LayoutKind.Sequential)] |
| | 10 | | public struct ObjectAttributes |
| | 11 | | { |
| | 12 | | public int Length; |
| | 13 | | public IntPtr RootDirectory; |
| | 14 | | public IntPtr ObjectName; |
| | 15 | | public int Attributes; |
| | 16 | | public IntPtr SecurityDescriptor; |
| | 17 | | public IntPtr SecurityQualityOfService; |
| | 18 | |
|
| | 19 | | public void Dispose() |
| 0 | 20 | | { |
| 0 | 21 | | if (ObjectName == IntPtr.Zero) return; |
| 0 | 22 | | Marshal.DestroyStructure(ObjectName, typeof(SharedStructs.UnicodeString)); |
| 0 | 23 | | Marshal.FreeHGlobal(ObjectName); |
| 0 | 24 | | ObjectName = IntPtr.Zero; |
| 0 | 25 | | } |
| | 26 | | } |
| | 27 | |
|
| | 28 | | [StructLayout(LayoutKind.Sequential)] |
| | 29 | | public struct PolicyAccountDomainInfo |
| | 30 | | { |
| | 31 | | public SharedStructs.UnicodeString DomainName; |
| | 32 | | public IntPtr DomainSid; |
| | 33 | | } |
| | 34 | |
|
| | 35 | | [StructLayout(LayoutKind.Sequential)] |
| | 36 | | public struct LSATranslatedNames |
| | 37 | | { |
| | 38 | | public SharedEnums.SidNameUse Use; |
| | 39 | | public SharedStructs.UnicodeString Name; |
| | 40 | | public int DomainIndex; |
| | 41 | | } |
| | 42 | |
|
| | 43 | | [StructLayout(LayoutKind.Sequential)] |
| | 44 | | public struct LSAReferencedDomains |
| | 45 | | { |
| | 46 | | public int Entries; |
| | 47 | | public IntPtr Domains; |
| | 48 | | } |
| | 49 | |
|
| | 50 | | [StructLayout(LayoutKind.Sequential)] |
| | 51 | | public struct LSATrustInformation |
| | 52 | | { |
| | 53 | | public SharedStructs.UnicodeString Name; |
| | 54 | | public IntPtr Sid; |
| | 55 | | } |
| | 56 | | } |
| | 57 | | } |