Reply To: TDI FILTER driver

Home Forums Discussions General Discussion TDI FILTER driver Reply To: TDI FILTER driver

Vadim Smirnov

Pointer to an open file object representing a local-node address. The transport uses the FsContext and, possibly, FsContext2 fields to access the state it maintains about this address.
Depending on the type of ClientEventXxx handler to be registered, this address might be or become associated with an established endpoint-to-endpoint connection made by this client.

Хендлеры ставятся в контексте address object, то есть сохранять подменять нужно не для разных потоков, а для разных address object.

Pointer to a TDI_REQUEST_KERNEL_SET_EVENT structure, defined as follows:
LONG EventType;
PVOID EventHandler;
PVOID EventContext;
The transport uses the members of this structure as follows:

Specifies the type of ClientEventXxx handler to be registered (see Comments).
Specifies the entry point of the ClientEventXxx routine to be called when this type of event occurs. This member can be NULL if the client is deregistering a previously registered event handler.
Specifies a pointer to be passed, uninterpreted by the transport, to the given ClientEventXxx routine whenever it is called. This member is NULL if EventHandler is NULL.

Можно подменить EventContext на некую собственную структуру оборачивающую address object и содержащую указатель на оригинальный ClientEventReceive.

P.S. А вообще вместо изобретения велосипеда стоило заглянуть в Resources и сходить по ссылке