FwpmNetEventSubscribe2 function (fwpmu.h)
The FwpmNetEventSubscribe2 function is used to request the delivery of notifications regarding a particular net event.
Syntax
DWORD FwpmNetEventSubscribe2(
[in] HANDLE engineHandle,
[in] const FWPM_NET_EVENT_SUBSCRIPTION0 *subscription,
[in] FWPM_NET_EVENT_CALLBACK2 callback,
[in, optional] void *context,
[out] HANDLE *eventsHandle
);
Parameters
[in] engineHandle
Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
[in] subscription
An FWPM_NET_EVENT_SUBSCRIPTION0 structure which describes which notifications will be delivered.
[in] callback
Pointer to a function of type FWPM_NET_EVENT_CALLBACK2 that will be invoked when a notification is ready for delivery.
[in, optional] context
Optional context pointer. This pointer is passed to the callback function along with details of the event.
[out] 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 |
---|---|
|
The subscription was created successfully. |
|
A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. |
|
Failure to communicate with the remote or local firewall engine. |
Remarks
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.
The caller needs FWPM_ACTRL_SUBSCRIBE access to the net event's container.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 10, version 1607 [desktop apps only] |
Minimum supported server | Windows Server 2016 [desktop apps only] |
Target Platform | Windows |
Header | fwpmu.h |
Library | Fwpuclnt.lib |
DLL | Fwpuclnt.dll |