pull/363/head
David Hall 2023-01-02 14:42:46 -07:00
parent 7a2972c6b2
commit 05292d5f8a
1 changed files with 1500 additions and 1502 deletions

View File

@ -2,12 +2,11 @@
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using Vanara.Extensions;
using Vanara.InteropServices;
namespace Vanara.PInvoke
{
namespace Vanara.PInvoke;
public static partial class Kernel32
{
/// <summary/>
@ -1388,6 +1387,9 @@ namespace Vanara.PInvoke
internal HHEAP HeapHandle { get; set; } = GetProcessHeap();
/// <inheritdoc/>
public override bool AllocZeroes => true;
/// <summary>Gets a handle to a memory allocation of the specified size.</summary>
/// <param name="size">The size, in bytes, of memory to allocate.</param>
/// <returns>A memory handle.</returns>
@ -1404,9 +1406,6 @@ namespace Vanara.PInvoke
public override IntPtr ReAllocMem(IntPtr hMem, int size) => Win32Error.ThrowLastErrorIfNull((IntPtr)HeapReAllocInternal(HeapHandle, HeapFlags.HEAP_ZERO_MEMORY, hMem, size));
private int GetSize(IntPtr ptr) => (int)HeapSize(HeapHandle, 0, ptr).Value;
/// <inheritdoc/>
protected override bool AllocZeroes => true;
}
/// <summary>Safe handle for memory heaps.</summary>
@ -1568,7 +1567,7 @@ namespace Vanara.PInvoke
HeapCompatibility Compatibility
{
get => HeapQueryInformation<HeapCompatibility>(this, HEAP_INFORMATION_CLASS.HeapCompatibilityInformation);
set => HeapSetInformation<HeapCompatibility>(this, HEAP_INFORMATION_CLASS.HeapCompatibilityInformation, value);
set => HeapSetInformation(this, HEAP_INFORMATION_CLASS.HeapCompatibilityInformation, value);
}
/// <summary>Performs an implicit conversion from <see cref="SafeHHEAP"/> to <see cref="HHEAP"/>.</summary>
@ -1595,4 +1594,3 @@ namespace Vanara.PInvoke
protected override bool InternalReleaseHandle() => HeapDestroy(this);
}
}
}