Exemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this.buffer != null)
                {
                    this.buffer.Dispose();
                    this.buffer = null;
                }
            }

            base.Dispose(disposing);
        }
Exemplo n.º 2
0
 private static IEnumerable <Sid> ParseSidsAndAttributes(int count, SafeProcessHeapBuffer sids)
 {
     using (sids)
     {
         sids.Initialize <SidAndAttributes>((uint)count);
         SidAndAttributes[] arr = sids.ReadArray <SidAndAttributes>(0, count);
         try
         {
             return(arr.Select(s => new Sid(s.Sid)).ToArray());
         }
         finally
         {
             NtHeap heap = NtHeap.Current;
             foreach (var ent in arr)
             {
                 heap.Free(HeapAllocFlags.None, ent.Sid.ToInt64());
             }
         }
     }
 }
Exemplo n.º 3
0
 public UnmanagedAvifItemData(ulong length)
     : base()
 {
     this.buffer = SafeProcessHeapBuffer.Create(length);
     this.Length = length;
 }
 public static extern Win32Error NetworkIsolationGetAppContainerConfig(
     out int pdwNumPublicAppCs,
     out SafeProcessHeapBuffer appContainerSids  // PSID_AND_ATTRIBUTES
     );