SetDataFilterFactory Method of the IFWXSession Interface

The SetDataFilterFactory method allows a filter to set a data filter factory for events for which the filter is not registered. This method can be used to reduce the number of events for which a filter registers.

Syntax

HRESULT SetDataFilterFactory(
		 FwxFirewallEventType eProxyEvent,
  [in]   LPSOCKADDR Address,
  [in]   DWORD AddressLength,
  [in]   IClassFactory* pIClassFactory,
  [in]   FwxDataFilterPriorityClass PriorityClass,
  [in]   IUnknown* punkFilterContext,
		 DWORD dwFlags,
  [out]  IFWXFirewallAction** ppFirewallAction
);

Parameters

eProxyEvent

The type of event for which the data filter factory is set. Can have a value from the FwxFirewallEventType enumerated type.

Address

Pointer to a sockaddr structure that contains the address and port for events which should cause a data filter to be instantiated and attached. If eProxyEvent is fwx_Connect_Tcp or fwx_Udp_Destination, the address is the remote address. If eProxyEvent is fwx_Bind_Udp or fwx_AcceptedConnection, the address is the bind address. The address must be of type AF_INET, and can be either a specific IP address or INADDR_ANY.

AddressLength

Length, in bytes, of the structure pointed to by the Address parameter.

pIClassFactory

Pointer to a class factory for objects that support the IFWXDataFilter interface.

PriorityClass

Priority class in which the data filter created will be attached. This is a value from the FwxDataFilterPriorityClass enumerated type.

punkFilterContext

Pointer to an optional interface that can be used to pass context information to the data filter. This interface will be passed to IFWXDataFilter::SetSockets. This parameter can be NULL.

dwFlags

Specifies the flags for the call. Any combination of the following values is acceptable for the dwFlags parameter.

Value Meaning

FWX_FLAG_ADDRESS_BASED

The connection for which the data filter is needed may be created by a different process by using the same address.

ppFirewallAction

Address of a buffer that received a pointer to the IFWXFirewallAction interface on the proxy action object created as a result of this call. This parameter can be NULL.

Return Value

This method returns S_OK if the call is successful; otherwise, it returns an error code.

Remarks

This method is an alternative to registering to the corresponding event, comparing the address, and calling IFWXConnection::AttachDataFilter. The Microsoft Firewall service creates a data filter by using the COM IClassFactory interface, when the specified event is detected. The data filter is then attached to the appropriate connection.

Requirements

Server Requires Windows Server 2008.
Version Requires Forefront Threat Management Gateway (TMG).
Header

Declared in Wspfwext.idl.

DLL

Requires Wspsrv.exe.

See Also

IFWXSession


Send comments about this topic to Microsoft

Build date: 11/30/2009

© 2008 Microsoft Corporation. All rights reserved.

[an error occurred while processing this directive]