IFWXSessionFilter::Detach method

Applies to: desktop apps only

The Detach method detaches the session filter from its session. This method should release all references that the session filter object holds on the session and any related objects.

Syntax

HRESULT Detach();

Parameters

This method has no parameters.

Return value

Implementations of this method should return the following:

  • S_OK
    The method succeeded.

  • E_FAIL
    The method failed. This will cause the Firewall service to generate an alert.

Remarks

This method is typically called by the Microsoft Firewall service when the applicable session is about to be shut down.

Examples

The following is an example implementation of the Detach method.

HRESULT CMySessionFilter::Detach()
{
    // Assume that m_spSession is defined as CComPtr<IFWXSession>
    // and that IFWXSession::Release() is called 
    // by the assignment operator.
    Lock();
    m_spSession = NULL;
    Unlock();
 
    return S_OK;
}

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

See also

IFWXSessionFilter

 

 

Build date: 7/12/2010