IFWXFirewall::CreateNetworkSocket method

Applies to: desktop apps only

The CreateNetworkSocket method creates a socket object that works with the dynamic packet filtering scheme.

Syntax

HRESULT CreateNetworkSocket(
  [in]   INT Protocol,
  [out]  IFWXNetworkSocket **piSocket
);

Parameters

  • Protocol [in]
    Protocol flags. This parameter can have the following flag values:

    Value Meaning
    FWX_PROTOCOL_TCP

    The method will create a TCP socket.

    FWX_PROTOCOL_UDP

    The method will create a UDP socket.

     

  • piSocket [out]
    Address of a variable that receives a pointer to the IFWXNetworkSocket interface.

Return value

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

Remarks

Filters must use this interface and not call the Winsock dynamic-link library (DLL) directly to create a socket. The Forefront TMG socket object automatically opens packet filter ports required for any operation made with this socket. Sockets created with the Winsock DLL will not work with the dynamic packet filtering of Forefront TMG.

A socket created by this method is not associated with a specific user and will therefore always be successfully created regardless of Forefront TMG access policy. To create a socket that is user-specific, use the IFWXSession::CreateNetworkSocket method.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only)

Version

Forefront Threat Management Gateway (TMG) 2010

Header

Wspfwext.idl

DLL

Wspsrv.exe

See also

IFWXFirewall

 

 

Build date: 7/12/2010