1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Does AllocMem() give error messages?

Discussion in 'Plugins' started by vefatica, Apr 20, 2010.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    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?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,804
    Likes Received:
    82
    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
     

Share This Page