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
13,201
180
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
 
Back
Top
[FOX] Ultimate Translator
Translate