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 (是 other.) 重新配置記憶體內容的開頭與原始內容相同;不過,整個記憶體區塊可以位於不同的位置。 這個方法會公開 COM CoTaskMemRealloc 函式,稱為 COM 工作記憶體配置器。

適用於

另請參閱