Microsoft Internet Security and Acceleration Server 2000

IFWXConnection::SetProtocol Method

Attempts to associate the connection object with the specified protocol.

HRESULT SetProtocol(
  REFGUID ProtocolGuid,
  DWORD dwFlags
);

Parameters

ProtocolGuid
[in] GUID of the protocol to attempt to associate with the connection.
dwFlags
[in] This flag parameter can be a combination of the following values:
Value Description
FWX_FLAG_EMULATE_PROTOCOL Indicates that the filter intends to emulate the connection if this call is successful.

For UDP and outbound TCP connections, a filter that specifies this flag must attach a data filter with fwx_dfpc_Emulation priority if the method call succeeds.

For inbound TCP connections, a filter must call the IFWXConnection::EmulateConnection method to attach a data filter.

FWX_FLAG_BIDIRECTIONAL "Receive-Send" is allowed for UDP connections. Use this flag when SetProtocol is called for a fwx_Bind_Udp event.
0 The filter will not emulate the connection.

Return Values

S_OK
The operation completed successfully.
FWX_E_PROTOCOL_RULES_DENIED
The protocol rules do not allow the user to use the protocol specified by the ProtocolGuid parameter.
FWX_E_ALREADY_EMULATED
The connection is already emulated by another filter.

Remarks

This method must be called only in the context of the IFWXSessionFilter::FirewallEventHandler method while handling an event of type fwx_Connect_Tcp, fwx_Bind_Udp, or fwx_Bind_Tcp. The method checks the user permissions for the protocol and then attempts to associate the connection with the protocol based on those permissions.

For fwx_Udp_Destination events use the IFWXUdpDestination::SetProtocol method instead.