| | 1 | | using System; |
| | 2 | | using System.Runtime.InteropServices; |
| | 3 | | using SharpHoundRPC.Shared; |
| | 4 | |
|
| | 5 | | namespace SharpHoundRPC.SAMRPCNative |
| | 6 | | { |
| | 7 | | public static class SAMStructs |
| | 8 | | { |
| | 9 | | public struct ObjectAttributes : IDisposable |
| | 10 | | { |
| | 11 | | public void Dispose() |
| 0 | 12 | | { |
| 0 | 13 | | if (_objectName == IntPtr.Zero) return; |
| 0 | 14 | | Marshal.DestroyStructure(_objectName, typeof(SharedStructs.UnicodeString)); |
| 0 | 15 | | Marshal.FreeHGlobal(_objectName); |
| 0 | 16 | | _objectName = IntPtr.Zero; |
| 0 | 17 | | } |
| | 18 | |
|
| | 19 | | public int Length; |
| | 20 | | public IntPtr RootDirectory; |
| | 21 | | public uint Attributes; |
| | 22 | | public IntPtr SID; |
| | 23 | | public IntPtr Qos; |
| | 24 | | private IntPtr _objectName; |
| | 25 | | public SharedStructs.UnicodeString ObjectName; |
| | 26 | | } |
| | 27 | |
|
| | 28 | | [StructLayout(LayoutKind.Sequential)] |
| | 29 | | public struct SamRidEnumeration |
| | 30 | | { |
| | 31 | | public int Rid; |
| | 32 | | public SharedStructs.UnicodeString Name; |
| | 33 | | } |
| | 34 | | } |
| | 35 | | } |