AllocPtr

Allocates memory and called by InitToken( ).

Definition

LPVOID WINAPI AllocPtr ( int nSize, WORD wFlags )  
{ 
   LPVOID lpvPtr; 
 
   if ((hMem = GlobalAlloc (wFlags, nSize)) != NULL ) 
 
   { 
      if (( lpvPtr = GlobalLock (hMem)) != NULL ) 
      return lpvPtr; 
 
      else{GlobalFree (hMem); 
      return NULL; 
      } 
   } 
   else 
   return NULL; 
}