Share via


FwpmEngineOpen0 (Compact 2013)

3/26/2014

This function opens a session to the Windows Filtering Platform (WFP) filter engine.

Syntax

DWORD WINAPI FwpmEngineOpen0(
  __in_opt  const wchar_t* serverName,
  __in      UINT32 authnService,
  __in_opt  SEC_WINNT_AUTH_IDENTITY_W* authIdentity,
  __in_opt  const FWPM_SESSION0* session,
  __out     HANDLE* engineHandle
);

Parameters

  • serverName
    Reserved. Set to NULL.
  • authIdentity
    Pointer to an SEC_WINNT_AUTH_IDENTITY_W structure that contains the authentication and authorization credentials for accessing the filter engine. This pointer is optional and can be NULL. If this pointer is NULL, it uses the credentials of the calling thread.
  • session
    Pointer to an FWPM_SESSION0 structure that defines session-specific parameters for the session being opened. This pointer is optional and can be NULL.
  • engineHandle
    Pointer to a variable that receives a handle for the open session to the filter engine.

Return Value

Return code / value

Description

ERROR_SUCCESS

0

The session started successfully.

FWP_E_ALREADY_EXISTS

0x80320009

A session with the specified sessionKey is already open.

FWP_E_* error code

0x80320001-0x80320039

A WFP specific error. For more information, see WFP Error Codes.

RPC_* error code

0x80010001-0x80010122

A Remote Procedure Call specific error. For more information see Winerror.h.

Remarks

An application must call this function to obtain a handle for an open session to the filter engine before adding or removing any filter objects. A handle for an open session to the filter engine is also required for most of the other Windows Filtering Platform management functions.

The session automatically closes when the application ends. To explicitly close a session, call FwpmEngineClose0.

If you set session.flags to FWPM_SESSION_FLAG_DYNAMIC, any WFP objects added during the session are automatically deleted when the session ends. If the session is not dynamic, you must explicitly delete all the WFP objects added during the session.

For more information, see WFP Access Right Identifiers.

Requirements

Header

fwpmu.h

Library

fwpuclnt.dll

See Also

Reference

WFP Session Management Functions
WFP Functions
WFP Management Functions
FwpmEngineClose0

Other Resources

Windows Filtering Platform