Marshal.ReAllocHGlobal(IntPtr, IntPtr) 메서드

정의

AllocHGlobal(IntPtr)을 사용하여 이전에 할당된 메모리 블록 크기를 조정합니다.

public:
 static IntPtr ReAllocHGlobal(IntPtr pv, IntPtr cb);
[System.Security.SecurityCritical]
public static IntPtr ReAllocHGlobal (IntPtr pv, IntPtr cb);
public static IntPtr ReAllocHGlobal (IntPtr pv, IntPtr cb);
[<System.Security.SecurityCritical>]
static member ReAllocHGlobal : nativeint * nativeint -> nativeint
static member ReAllocHGlobal : nativeint * nativeint -> nativeint
Public Shared Function ReAllocHGlobal (pv As IntPtr, cb As IntPtr) As IntPtr

매개 변수

pv
IntPtr

nativeint

AllocHGlobal(IntPtr)을 사용하여 할당된 메모리에 대한 포인터입니다.

cb
IntPtr

nativeint

할당된 블록의 새 크기입니다. 이것은 포인터가 아니라 요청하는 바이트 수로, 형식 IntPtr로 캐스팅합니다. 포인터를 전달하면 크기로 처리됩니다.

반환

IntPtr

nativeint

다시 할당된 메모리에 대한 포인터입니다. 이 메모리는 FreeHGlobal(IntPtr)을 사용하여 해제되어야 합니다.

특성

예외

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

설명

ReAllocHGlobal 는 클래스의 두 메모리 재할당 API 메서드 Marshal 중 하나입니다. (Marshal.ReAllocCoTaskMem 은)입니다.

이 메서드는 Kernel32.dll Win32 GlobalReAlloc 함수를 노출합니다. 반환된 포인터는 원본과 다를 수 있습니다. 다른 경우 원래 메모리 블록의 내용이 새 블록에 복사되고 원래 메모리 블록이 해제되었습니다.

적용 대상

추가 정보