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 작업 메모리 할당자라고 하는 COM CoTaskMemRealloc 함수를 노출합니다.

적용 대상

추가 정보