BOOL CNdisApi::GetAdapterMode ( PADAPTER_MODE pMode );
Return Value:TRUE
if call was successful, FALSE
otherwise
Parameters:pMode
Pointer to the user allocated and initialized ADAPTER_MODE
structure.
Remarks:
The following fields of ADAPTER_MODE must be initialized:
ADAPTER_MODE::hAdapterHandle
– must be set to the interface handle (obtained via call to GetTcpipBoundAdaptersInfo
).
As a result of the call, the driver fills the ADAPTER_MODE::dwFlags
with a combination of the XXX_LISTEN
or XXX_TUNNEL
flags:
MSTCP_FLAG_SENT_TUNNEL
– queue all packets sent from TCP/IP to network interface. Original packet is dropped.MSTCP_FLAG_RECV_TUNNEL
– queue all packets indicated by network interface to TCP/IP. Original packet is dropped.MSTCP_FLAG_SENT_LISTEN
– queue all packets sent from TCP/IP to network interface. Original packet goes ahead.MSTCP_FLAG_RECV_LISTEN
– queue all packets indicated by network interface to TCP/IP. Original packet goes ahead.MSTCP_FLAG_FILTER_DIRECT
– In promiscuous mode TCP/IP stack receives all packets in the Ethernet segment and replies with various ICMP packets, to prevent this set this flag. All packets with destination MAC different fromFF-FF-FF-FF-FF-FF
and network interface current MAC will never reach TCP/IP.
By default, loopback packets are passed to original TCP/IP handlers without processing, to change this behavior use the flags below:
MSTCP_FLAG_LOOPBACK_FILTER
– if not set, then loopback packets are silently passed over, otherwise these packets are passed for further processing (queued for redirecting to the application if not dropped by theMSTCP_FLAG_LOOPBACK_BLOCK
below).MSTCP_FLAG_LOOPBACK_BLOCK
– if set, then loopback packets (with exception to broadcast/multicast) are silently dropped.MSTCP_FLAG_LOOPBACK_BLOCK | MSTCP_FLAG_LOOPBACK_FILTER
– does not allow loopback packet to pass silently and results blocking them (with exception to broadcast/multicast).
This member calls the filter driver with IOCTL_NDISRD_GET_ADAPTER_MODE
control code (see details below).
IOCTL_NDISRD_GET_ADAPTER_MODE
Input Buffer | _ADAPTER_MODE |
Input Buffer Size | sizeof (_ADAPTER_MODE) |
Output Buffer | _ADAPTER_MOD E |
Output Buffer Size | sizeof (_ADAPTER_MODE) |