Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method returns the size (in bytes) of a memory block previously allocated with the IMalloc::Allocor IMalloc::Reallocmethod.

Syntax

ULONG GetSize(
  void* 
pv 
);

Parameters

pv

[in] Pointer to the memory block for which the size is requested.

Return Value

The size of the allocated memory block in bytes or, if pvis a NULL pointer, -1.

Remarks

To get the size in bytes of a memory block, the block must have been previously allocated with IMalloc::Allocor IMalloc::Realloc. The size returned is the actual size of the allocation, which may be greater than the size requested when the allocation was made.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also