Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- M E W E L - <b>byte *emalloc(word nsize)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
BYTE *emalloc(WORD nSize)

  This function should be used by your application to allocate memory.
It is a front-end to the calloc() function. Emalloc() will attempt to
allocate some memory by calling calloc(), and if it does, the
contents of the memory block is zeroed out. If calloc() fails, then a
WM_SYSTEMERROR message is posted to all top-level windows in your
application. This gives your application the chance to free some
memory. If your application wants to handle the WM_SYSTEMERROR
message, then all of the window procs associated with all of the
top-level windows in your application should return TRUE after
attempting to free memory. If TRUE is returned as a response to the
WM_SYSTEMERROR message, then emalloc() will try to call calloc()
again to allocate memory. If this fails, then emalloc() will return
NULL to your application. If you do not handle the WM_SYSTEMERROR
message, then your MEWEL application will be terminated immediately,
as there might not be even enough memory to display a message box.

Parameters
  nSize is the number of bytes to allocate.

Returns
  Returns a pointer to the zeroed-out memory block.

See Also: MyFree

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson