Microsoft Internet Security and Acceleration Server 2000

IFWXSession::EmulateClientBind Method

Allows a client that did not create a remote bind to receive a primary inbound connection.

HRESULT EmulateClientBind(
  LPSOCKADDR ClientAddress,
  DWORD ClientAddressLength,
  LPSOCKADDR ProxyAddress,
  DWORD ProxyAddressLength,
  INT Protocol,
  REFGUID ProtocolGuid,
  IFWXConnection **piConnection


[in] Pointer to a sockaddr structure that contains the address that the client used.
[in] Length, in bytes, of the ClientAddress parameter.
[in] Pointer to a sockaddr structure that contains the address to which the filter is emulating bind. This is usually an external IP address of the Firewall service and a specific port number. The EmulateClientBind method does not really bind to that address. The address is used for the bind event generated.
[in] Length, in bytes, of the ProxyAddress parameter.
[in] Protocol flags. This parameter can have the following flag values:
Value Description
FWX_PROTOCOL_TCP The request is for a TCP socket.
FWX_PROTOCOL_UDP The request is for a UDP socket.

[in] GUID identifying the protocol that the connection is part of. The GUID is the same GUID supplied to IFWXFilterAdmin::RegisterProtocolForFilter.
[out] Pointer to a buffer that receives the address of the resulting connection object.


This method should be called by a filter whose purpose is to enable a specific protocol. The filter uses this method when it needs to forward a primary connection made from an external source to a local computer that did not make a remote bind through the Firewall service. For example, this could be a local computer that is not a Firewall client.

This method will usually be called by a filter that is listening on some well-known port when it receives a connection. The filter decides (based on the source address, data exchange with the caller, a hard-coded address, and so on) that this call should be forwarded to some internal client.

The filter cannot use the BindForClient method because the well-known port is already in use and the connection was already made.

This method creates a connection object on which the caller can call the IFWXConnection::EmulateConnection method and forward the connection to the client.

Like other bind requests, any filter registered for the fwx_Bind_* events is notified about this bind and has an opportunity to deny it. It may also install a data filter. Other filters cannot emulate this bind because the caller is already emulating it.

See Also

IFWXConnection::EmulateConnection, IFWXSession::BindForClient, IFWXFilterAdmin::RegisterProtocolForFilter