Marshal.AllocCoTaskMem(Int32) 메서드

정의

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

할당될 메모리 블록 크기입니다.

반환

IntPtr

nativeint

할당된 메모리 블록 주소를 나타내는 정수입니다. 이 메모리는 FreeCoTaskMem(IntPtr)을 사용하여 해제되어야 합니다.

특성

예외

메모리가 부족하여 요청을 만족시킬 수 없습니다.

설명

AllocCoTaskMem 는 클래스의 두 메모리 할당 API 메서드 Marshal 중 하나입니다. (Marshal.AllocHGlobal 은)입니다. 반환된 초기 메모리 콘텐츠는 정의되지 않으며 할당된 메모리는 요청된 바이트 수보다 클 수 있습니다. 이 메서드는 COM 작업 메모리 할당자라고 하는 COM CoTaskMemAlloc 함수를 노출합니다.

적용 대상

추가 정보