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 は、 クラスの 2 つのメモリ再割り当てメソッドのいずれか Marshal です。 (ReAllocHGlobal はもう一方です)。再割り当てされたメモリ コンテンツの先頭は、元のコンテンツと同じです。ただし、メモリ ブロック全体を別の場所に配置できます。 このメソッドは、COM タスク メモリ アロケーターと呼ばれる COM CoTaskMemRealloc 関数を公開します。

適用対象

こちらもご覧ください