FwpmNetEventSubscribe4 function (fwpmu.h)

Used to request the delivery of notifications regarding a particular net event.

Syntax

DWORD FwpmNetEventSubscribe4(
  HANDLE                             engineHandle,
  const FWPM_NET_EVENT_SUBSCRIPTION0 *subscription,
  FWPM_NET_EVENT_CALLBACK4           callback,
  void                               *context,
  HANDLE                             *eventsHandle
);

Parameters

engineHandle

Type: _In_ HANDLE

A handle to an open session with the filter engine. To open a session with the filter engine, call FwpmEngineOpen0.

subscription

An FWPM_NET_EVENT_SUBSCRIPTION0 structure that describes which notifications will be delivered.

callback

Pointer to a function of type FWPM_NET_EVENT_CALLBACK4, which will be invoked when a notification is ready for delivery.

context

Optional context pointer. This pointer is passed to the callback function along with details of the event.

eventsHandle

Handle to the newly created subscription. Call FwpmNetEventUnsubscribe0 to close this handle when the subscription is no longer needed.

Return value

Return code/value Description
ERROR_SUCCESS
0
The subscription was created successfully.
FWP_E_* error code
0x80320001—0x80320039
A Windows Filtering Platform (WFP)-specific error. For details, see WFP error codes.
RPC_* error code
0x80010001—0x80010122
Failure to communicate with the remote or local firewall engine.

Remarks

You can't call this function within a transaction. It will fail with FWP_E_TXN_IN_PROGRESS. For more info about transactions, see Object management.

To call this function, you need FWPM_ACTRL_SUBSCRIBE access to the net event's container.

Requirements

Requirement Value
Header fwpmu.h
Library Fwpuclnt.lib
DLL Fwpuclnt.dll