FwpmProviderContextAdd3 function (fwpmu.h)
Adds a new provider context to the system.
Syntax
DWORD FwpmProviderContextAdd3(
HANDLE engineHandle,
const FWPM_PROVIDER_CONTEXT3 *providerContext,
PSECURITY_DESCRIPTOR sd,
UINT64 *id
);
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.
providerContext
Type: _In_ FWPM_PROVIDER_CONTEXT3*
The provider context object to be added.
sd
Type: _In_opt_ PSECURITY_DESCRIPTOR
Optional security information associated with the provider context object.
id
Type: _Out_opt_ UINT64*
Pointer to a variable that receives a runtime identifier for this provider context.
Return value
Type: DWORD*
Return code/value | Description |
---|---|
ERROR_SUCCESS 0 |
The provider context was successfully added. |
ERROR_NOT_SUPPORTED 0x32 |
The FWPM_IPSEC_IKE_MM_CONTEXT and the IKEEXT_IPV6_CGA authentication method are in the authenticationMethods array, but cryptographically generated address (CGA) is not enabled in the registry. |
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
Some fields in the FWPM_PROVIDER_CONTEXT2 structure are assigned by the system, not the caller, and are ignored in the call to FwpmProviderContextAdd3.
If you supply a NULL security descriptor, then the system will assign a default security descriptor.
You can't call this function within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. For more info about transactions, see Object management.
To call this function, you need FWPM_ACTRL_ADD access to the provider context's container, and FWPM_ACTRL_ADD_LINK access to the provider (if any). For more info, see Access control.
Requirements
Requirement | Value |
---|---|
Header | fwpmu.h |
Library | Fwpuclnt.lib |
DLL | Fwpuclnt.dll |