Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Does AllocMem() give error messages?

May
12,930
170
Should I

Code:
if ( (pInfo = (PIP_ADAPTER_ADDRESSES) AllocMem(dwInfoSize)) == NULL )
{
    error(ERROR_NOT_ENOUGH_MEMORY, NULL);
    return 0;
}
or can I rely on AllocMem() to generate an error message?
 
> Code:
> ---------
> if ( (pInfo = (PIP_ADAPTER_ADDRESSES) AllocMem(dwInfoSize)) == NULL )
> {
> error(ERROR_NOT_ENOUGH_MEMORY, NULL);
> return 0;
> }
> ---------
> or can I rely on AllocMem() to generate an error message?

AllocMem does not return error messages, just a null if it can't allocate
memory. (If it can't, your system is probably toast anyway, as all of the
virtual memory will have been eaten.)

Rex
 

Similar threads

Back
Top