Share via


ExpertAllocMemory

The ExpertAllocMemory function allocates memory for the expert.

LPVOID WINAPIExpertAllocMemory(HEXPERTKEYhExpertKey,
SIZE_TnBytes,
LPDWORDpError);

Parameters

  • hExpertKey
    Unique expert identifier. Network Monitor passes hExpertKey to the expert when it calls the Run function.
  • nBytes
    [in] Allocated memory, measured in bytes.
  • pError
    [out] Error indicator. If the function fails, the nBytes parameter contains the error code. If the error code is NMERR_EXPERT_TERMINATE, the expert must clean-up and return immediately.

Return Values

If the function is successful, the return value is a pointer to the allocated memory.

If the function is unsuccessful, the return value is NULL, and pError provides an error code that indicates the reason for the failure.

Remarks

It is important to note that an expert should use the Network Monitor memory allocation functions (including ExpertReallocMemory) for memory management. If your expert fails during run time, using these functions will allow Network Monitor to free the memory it has allocated.

Requirements

Client Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0.
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
Header

Declared in Netmon.h.

Library

Link to Nmapi.lib.

DLL Requires Nmapi.dll.