nf_tcpIsProxy

Returns TRUE if the specified process acts as a local proxy, accepting the redirected TCP connections.
BOOL nf_tcpIsProxy(DWORD processId)

Parameters

processId
Process identifier

Remarks

If your filter redirects TCP connections to a local proxy in tcpConnectRequest event, and there is another filter in system that redirects connections to own local proxy, a filtering loop can occur. By default the hooking driver detects proxies automatically and doesn't call tcpConnectRequest event for outgoing connections of a local proxy. But when the flag NF_DISABLE_REDIRECT_PROTECTION is specified for a connection, tcpConnectRequest is called for all outgoing connections, and it is necessary to prevent the filtering loops manually. nf_tcpIsProxy returns TRUE if the process with specified id has accepted a connection established from the current process, i.e. the process with specified id acts as a local proxy handling the redirected connections. In this case it is not safe to redirect the connections of such process, because of possible filtering loops when a connection is redirected between local proxies infinitely.

Requirements

Driver type WFP, TDI
Header nfapi.h
Library nfapi.lib