FwpmDynamicKeywordSubscribe0 function (fwpmu.h)

Requests the delivery of notifications regarding changes to particular dynamic keyword address (FW_DYNAMIC_KEYWORD_ADDRESS0) objects. Based on the flag passed in, notifications can be raised for only a subset of the addresses.

For more info, and code examples, see Firewall dynamic keywords.

Syntax

DWORD FwpmDynamicKeywordSubscribe0(
  DWORD                          flags,
  FWPM_DYNAMIC_KEYWORD_CALLBACK0 callback,
  void                           *context,
  HANDLE                         *subscriptionHandle
);

Parameters

flags

Type: _In_ DWORD

The following flags are defined in fwpmu.h.

FWPM_NOTIFY_ADDRESSES_AUTO_RESOLVE indicates that notifications will be delivered only for objects that have the FW_DYNAMIC_KEYWORD_ADDRESS_FLAGS_AUTO_RESOLVE flag set.

FWPM_NOTIFY_ADDRESSES_NON_AUTO_RESOLVE indicates that notifications will be delivered only for objects that don't have the FW_DYNAMIC_KEYWORD_ADDRESS_FLAGS_AUTO_RESOLVE flag set.

FWPM_NOTIFY_ADDRESSES_AUTO_RESOLVE indicates that notifications will be delivered for all dynamic keyword address objects.

callback

Type: _In_ FWPM_DYNAMIC_KEYWORD_CALLBACK0

A pointer to a callback function that you implement, which will be invoked when a notification is ready for delivery.

context

Type: _In_opt_ void*

An optional context pointer. This pointer is passed to the callback function.

subscriptionHandle

Type: _Out_ HANDLE*

The address of a handle, which is populated with a handle to the newly created subscription.

Return value

Type: DWORD

If the function succeeds, then it returns ERROR_SUCCESS. Otherwise, it returns one of the following values.

Return value Description
ERROR_INVALID_PARAMETER The flags value is zero.

Remarks

Notifications for AutoResolve dynamic keyword addresses are delivered when an object is added or deleted.

Notifications for non-AutoResolve dynamic keyword addresses are delivered when an object is added, deleted, or updated.

No data is provided to the callback function. You can use the Enumeration API if you need information about what has changed on the system.

You're responsible for closing the handle when you no longer need subscription. You must do so by calling the FwpmDynamicKeywordUnsubscribe0 function.

Your implementation of FWPM_DYNAMIC_KEYWORD_CALLBACK0 should react to changes in dynamic keyword address objects quickly, because it is scheduled on a ThreadPool thread, and could affect other wait operations.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Target Platform Windows
Header fwpmu.h
Library Fwpuclnt.lib
DLL Fwpuclnt.dll

See also