Marshal.AllocCoTaskMem(Int32) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定したサイズのメモリ ブロックを COM タスク メモリ アロケーターから割り当てます。
public:
static IntPtr AllocCoTaskMem(int cb);
[System.Security.SecurityCritical]
public static IntPtr AllocCoTaskMem(int cb);
public static IntPtr AllocCoTaskMem(int cb);
[<System.Security.SecurityCritical>]
static member AllocCoTaskMem : int -> nativeint
static member AllocCoTaskMem : int -> nativeint
Public Shared Function AllocCoTaskMem (cb As Integer) As IntPtr
パラメーター
- cb
- Int32
割り当てるメモリ ブロックのサイズ。
返品
nativeint
割り当てられたメモリ ブロックのアドレスを表す整数。 このメモリは、 FreeCoTaskMem(IntPtr)で解放する必要があります。
- 属性
例外
要求を満たすのに十分なメモリがありません。
注釈
AllocCoTaskMem は、 Marshal クラスの 2 つのメモリ割り当て API メソッドのいずれかです。 (Marshal.AllocHGlobal はもう一方です)。返される初期メモリコンテンツは未定義であり、割り当てられたメモリは要求されたバイト数よりも大きくなる可能性があります。 このメソッドは、COM タスク メモリ アロケーターと呼ばれる COM CoTaskMemAlloc 関数を公開します。