Function _momSize() Foundation
Determines the size of a memory object.
XPPAPIRET _momSize(MomHandle mhObj, ULONG *size);
Always returns NULL.
_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.
/*
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);
}
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.