ExpertAllocMemory function

The ExpertAllocMemory function allocates memory for the expert.

Syntax

LPVOID WINAPI ExpertAllocMemory(
        HEXPERTKEY hExpertKey,
  _In_  SIZE_T     nBytes,
  _Out_ LPDWORD    pError
);

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 value

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

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Netmon.h
Library
Nmapi.lib
DLL
Nmapi.dll