Reply To: TDI_SET_EVENT_HANDLER

Home Forums Discussions General Discussion TDI_SET_EVENT_HANDLER Reply To: TDI_SET_EVENT_HANDLER

#5774

GeN
Participant

@hexxx wrote:

И еще вопрос, как по соединению получить remote address? Потому что в TDI_REQUEST_KERNEL_SEND нету RemoteAddress.

Пробовал слать TDI_QUERY_INFORMATION/ TDI_QUERY_DATA_LINK_ADDRESS на file object. Но в отличии от TDI_QUERY_INFORMATION, TDI_QUERY_DATA_LINK_ADDRESS говорит STATUS_NOT_IMPLEMENTED. Неужели единственный путь – это как в TdiMon’e хранить весь набор соединений?

NTSTATUS
ClientEventConnect(
IN PVOID TdiEventContext,
IN LONG RemoteAddressLength,
IN PVOID RemoteAddress,
IN LONG UserDataLength,
IN PVOID UserData,
IN LONG OptionsLength,
IN PVOID Options,
OUT CONNECTION_CONTEXT *ConnectionContext,
OUT PIRP *AcceptIrp
);

ответ понятен, надеюсь

TDI_CONNECT :

IrpSp->Parameters
Pointer to a TDI_REQUEST_KERNEL_CONNECT structure, equivalent to the TDI_REQUEST_KERNEL structure.
The RequestFlags member is irrelevant for connect requests. The transport uses the client-supplied information, such as the remote-node address to which the connection should be offered, in the buffer at RequestConnectionInformation. The transport returns information to the client-supplied buffer at ReturnConnectionInformation. Each of these buffers is formatted as a TDI_CONNECTION_INFORMATION structure.

typedef struct _TDI_CONNECTION_INFORMATION {
LONG UserDataLength;
PVOID UserData;
LONG OptionsLength;
PVOID Options;
LONG RemoteAddressLength;
PVOID RemoteAddress;
} TDI_CONNECTION_INFORMATION, *PTDI_CONNECTION_INFORMATION;