IPsecKeyManagerAddAndRegister0 function (fwpmu.h)

The IPsecKeyManagerAddAndRegister0 function registers a Trusted Intermediary Agent (TIA) with IPsec.

Syntax

DWORD IPsecKeyManagerAddAndRegister0(
  [in]  HANDLE                             engineHandle,
  [in]  const IPSEC_KEY_MANAGER0           *keyManager,
  [in]  const IPSEC_KEY_MANAGER_CALLBACKS0 *keyManagerCallbacks,
  [out] HANDLE                             *keyMgmtHandle
);

Parameters

[in] engineHandle

Type: HANDLE

A handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.

[in] keyManager

Type: const IPSEC_KEY_MANAGER0*

The set of key management callbacks which IPsec will invoke.

[in] keyManagerCallbacks

Type: const IPSEC_KEY_MANAGER_CALLBACKS0*

The set of callbacks which should be invoked by IPsec at various stages of SA negotiation.

[out] keyMgmtHandle

Type: HANDLE*

Address of the newly created registration.

Return value

Type: DWORD

Return code/value Description
ERROR_SUCCESS
0
The TIA was successfully registered.
FWP_E_* error code
0x80320001—0x80320039
A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details.
RPC_* error code
0x80010001—0x80010122
Failure to communicate with the remote or local firewall engine.
FWP_E_ALREADY_EXISTS
0x80320009L
The TIA was not registered successfully because another TIA has already been registered to dictate keys.
FWP_E_INVALID_INTERVAL
0x80320021L
The TIA was not registered successfully because keyDictationTimeoutHint exceeded the maximum allowed value of 10 seconds.
SEC_E_CANNOT_INSTALL
0x80090307L
The TIA was not registered successfully because the binary image has not set the IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY property.

Remarks

If the IPSEC_KEY_MANAGER_FLAG_DICTATE_KEY flag is set for keyManager, all three callback members of keyManagerCallbacks must be specified; otherwise, only the keyNotify callback should be specified

This function cannot be called from within a transaction. It will fail with FWP_E_TXN_IN_PROGRESS. See Object Management for more information about transactions.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header fwpmu.h
Library Fwpuclnt.lib
DLL Fwpuclnt.dll

See also

IPSEC_KEY_MANAGER0

IPSEC_KEY_MANAGER_CALLBACKS0

WFP Functions