midl_user_allocate

void __RPC_FAR * __RPC_API midl_user_allocate (size_t cBytes);

cBytes
Specifies the count of bytes to allocate.

Example

void __RPC_FAR * __RPC_API midl_user_allocate(size_t cBytes) 
{ 
    return(malloc(cBytes)); 
} 
 

Remarks

Both client applications and server applications must implement the midl_user_allocate function, unless you are compiling in OSF-compatibility (/osf) mode. Applications and generated stubs call midl_user_allocate when dealing with objects referenced by pointers:

If midl_user_allocate fails to allocate memory, it must return a null pointer.

It is recommended that midl_user_allocate return a pointer that is 8 bytes aligned.

See Also

allocate, midl_user_free, pointers, ptr, ref, unique