Function _momSize() Foundation

Determines the size of a memory object.

Syntax
XPPAPIRET _momSize(MomHandle mhObj, ULONG *size);
Parameters
MomHandle mhObj
Handle of the memory object whose size is to be determined.
ULONG size
Pointer to a buffer into which the size of the memory object is written.
Return

Always returns NULL.

Description

_momSize() is used to determine the size of a memory object. For this function, it makes no difference whether or not the object is locked. Note that the functions_momAlloc() and _momResize()only define the desired minimal size of the memory object. Since a slightly larger memory object is allocated under some circumstances, _momSize() can give a value a few bytes larger than what was allocated.

Examples
/* 
Determines the minimal size of a memory object. 
*/ 
#include "xppcon.h" 
#include "stdio.h" 

MomHandle hNew; 
ULONG     size; 

hNew = _momAlloc(0); 
if (hNew != MOM_NULLHANDLE) 
{ 
_momSize(hNew, &size); 
printf("Minimal size of a memory object: %ld\n", size); 
} 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.