| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.Runtime.InteropServices; |
| | 4 | | using System.Security.Principal; |
| | 5 | |
|
| | 6 | | namespace SharpHoundRPC.Handles |
| | 7 | | { |
| | 8 | | public class SAMSidArray : SAMPointer |
| | 9 | | { |
| 0 | 10 | | public SAMSidArray() |
| 0 | 11 | | { |
| 0 | 12 | | } |
| | 13 | |
|
| 0 | 14 | | public SAMSidArray(IntPtr handle) : base(handle) |
| 0 | 15 | | { |
| 0 | 16 | | } |
| | 17 | |
|
| 0 | 18 | | public SAMSidArray(IntPtr handle, bool ownsHandle) : base(handle, ownsHandle) |
| 0 | 19 | | { |
| 0 | 20 | | } |
| | 21 | |
|
| | 22 | | public IEnumerable<SecurityIdentifier> GetData(int count) |
| 0 | 23 | | { |
| 0 | 24 | | for (var i = 0; i < count; i++) |
| 0 | 25 | | { |
| 0 | 26 | | var rawPtr = Marshal.ReadIntPtr(handle, Marshal.SizeOf<IntPtr>() * i); |
| 0 | 27 | | var sid = new SecurityIdentifier(rawPtr); |
| 0 | 28 | | yield return sid; |
| 0 | 29 | | } |
| 0 | 30 | | } |
| | 31 | | } |
| | 32 | | } |