DllMain Parser callback function

The DllMain export function for the parser identifies the existence of the parser, and releases resources that Network Monitor uses for the parser. DllMain must be implemented in all parser DLLs.

Syntax

BOOL WINAPI DllMain(
  _In_ HANDLE hInstance,
  _In_ ULONG  Command,
       LPVOID Reserved
);

Parameters

hInstance [in]

Handle to an instance of the parser.

Command [in]

Indicator to determine why the function is called. For a list of all possible flags, see DllMain. The parser implementation must process the following values.

Value Meaning
DLL_PROCESS_ATTACH
When DllMain is called for the first time, the DLL must call CreateProtocol to provide information to Network Monitor.
DLL_PROCESS_DETACH
When DllMain is called for the last time, the DLL must call DestroyProtocol to release the resources that the DLL uses.

Reserved

Not used now.

Return value

The parser DLL always returns TRUE.

Remarks

The operating system calls DllMain to load and unload the parser DLL. This function is based on the dynamic-link library DllMain function.

You can also use the implementation of DllMain to store an instance of a parser for use in the future. For example, you can store a parser DLL instance, and then use it for a system call in the future.

For information on See
What parsers are, and how they work with Network Monitor. Parsers
Which entry points are included in the parser DLL. Parser DLL Architecture
How to implement DllMain includes an example. Implementing DllMain

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Process.h

See also

CreateProtocol

DestroyProtocol

DllMain