Marshal.ReAllocCoTaskMem(IntPtr, Int32) 方法

定義

調整先前使用 AllocCoTaskMem(Int32)配置之內存區塊的大小。

public:
 static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb);
[System.Security.SecurityCritical]
public static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb);
public static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb);
[<System.Security.SecurityCritical>]
static member ReAllocCoTaskMem : nativeint * int -> nativeint
static member ReAllocCoTaskMem : nativeint * int -> nativeint
Public Shared Function ReAllocCoTaskMem (pv As IntPtr, cb As Integer) As IntPtr

參數

pv
IntPtr

nativeint

使用 AllocCoTaskMem(Int32)配置之內存的指標。

cb
Int32

配置區塊的新大小。

傳回

IntPtr

nativeint

一個整數代表重新分配記憶體區塊的位址。 此記憶必須以 釋放。FreeCoTaskMem(IntPtr)

屬性

例外狀況

記憶體不足,無法滿足要求。

備註

ReAllocCoTaskMem 是該 Marshal 類別中兩種記憶體重新配置方法之一。 (ReAllocHGlobal 是另一個。)重新分配記憶體內容的起始與原始內容相同;然而,整個記憶體區塊可能位於不同位置。 此方法會揭露 COM CoTaskMemRealloc 函式,稱為 COM 任務記憶體分配器。

適用於

另請參閱