Kernel32HeapReAlloc Method
Reallocates a block of memory from a heap.
This function enables you to resize a memory block and change other memory block properties.
The allocated memory is not movable.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static IntPtr HeapReAlloc(
IntPtr hHeap,
HeapFlags flags,
IntPtr mem,
uint bytes
)
<DllImportAttribute("Kernel32.dll", SetLastError := true>]
Public Shared Function HeapReAlloc (
hHeap As IntPtr,
flags As HeapFlags,
mem As IntPtr,
bytes As UInteger
) As IntPtr
Dim hHeap As IntPtr
Dim flags As HeapFlags
Dim mem As IntPtr
Dim bytes As UInteger
Dim returnValue As IntPtr
returnValue = Kernel32.HeapReAlloc(hHeap,
flags, mem, bytes)
public:
[DllImportAttribute(L"Kernel32.dll", SetLastError = true)]
static IntPtr HeapReAlloc(
IntPtr hHeap,
HeapFlags flags,
IntPtr mem,
unsigned int bytes
)
[<DllImportAttribute("Kernel32.dll", SetLastError = true)>]
static member HeapReAlloc :
hHeap : IntPtr *
flags : HeapFlags *
mem : IntPtr *
bytes : uint32 -> IntPtr
No code example is currently available or this language may not be supported.
- hHeap IntPtr
-
A handle to the heap from which the memory is to be reallocated.
This handle is returned by either the
HeapCreate(HeapFlags, UInt32, UInt32) or GetProcessHeap function.
- flags HeapFlags
-
The heap reallocation options.
Specifying any of the HeapFlags values will override the corresponding value specified
when the heap was created with HeapCreate(HeapFlags, UInt32, UInt32).
- mem IntPtr
-
A pointer to the block of memory that the function reallocates.
This pointer is returned by an earlier call to the
HeapAlloc(IntPtr, HeapFlags, UInt32) or HeapReAlloc(IntPtr, HeapFlags, IntPtr, UInt32) function.
- bytes UInt32
-
The new size of the memory block, in bytes.
A memory block's size can be increased or decreased by using this function.
If the heap specified by the hHeap parameter is a "non-growable" heap,
bytes must be less than 0x7FFF8.
You create a non-growable heap by calling the HeapCreate(HeapFlags, UInt32, UInt32) function
passing a nonzero value to its maximumSize parameter.
IntPtr
If the function succeeds, the return value is a pointer to the reallocated memory block.
If the function fails and you have not specified
GenerateExceptions,
the return value is
Zero.
If the function fails and you have specified
GenerateExceptions,
the function may generate an exception.
The particular exception depends upon the nature of the heap corruption.