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.


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



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


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.


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


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


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


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.


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

Value Meaning


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


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.


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.


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

Declared in Wspfwext.idl.


Requires Wspsrv.exe.

See Also


Send comments about this topic to Microsoft

Build date: 11/30/2009

© 2008 Microsoft Corporation. All rights reserved.