namespace Vanara.PInvoke;
public static partial class FwpUClnt
{
/// The FwpmNetEventsGetSecurityInfo0 function retrieves a copy of the security descriptor for a network event object.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to retrieve.
/// Type: SECURITY_INFORMATION
/// The type of security information to retrieve.
///
///
/// Type: PSID*
/// The owner security identifier (SID) in the returned security descriptor.
///
///
/// Type: PSID*
/// The primary group security identifier (SID) in the returned security descriptor.
///
///
/// Type: PACL*
/// The discretionary access control list (DACL) in the returned security descriptor.
///
///
/// Type: PACL*
/// The system access control list (SACL) in the returned security descriptor.
///
///
/// Type: PSECURITY_DESCRIPTOR*
/// The returned security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
///
/// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned
/// parameters must not be freed, as they point to addresses within the securityDescriptor parameter.
///
///
/// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described
/// in the GetSecurityInfo reference topic.
///
///
/// FwpmNetEventsGetSecurityInfo0 is a specific implementation of FwpmNetEventsGetSecurityInfo. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventsgetsecurityinfo0 DWORD FwpmNetEventsGetSecurityInfo0(
// [in] HFWPENG engineHandle, [in] SECURITY_INFORMATION securityInfo, [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup,
// [out, optional] PACL *dacl, [out, optional] PACL *sacl, [out] PSECURITY_DESCRIPTOR *securityDescriptor );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventsGetSecurityInfo0")]
public static extern Win32Error FwpmNetEventsGetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo,
out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor);
///
/// The FwpmNetEventsSetSecurityInfo0 function sets specified security information in the security descriptor of a network event object.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to set.
///
///
/// Type: const SID*
/// The owner's security identifier (SID) to be set in the security descriptor.
///
///
/// Type: const SID*
/// The group's SID to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The discretionary access control list (DACL) to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The system access control list (SACL) to be set in the security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was set successfully.
///
/// -
/// 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.
///
///
///
///
///
/// 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.
///
///
/// This function cannot be called from within a dynamic session. It will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS. See Object
/// Management for more information about sessions.
///
///
/// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described
/// in the SetSecurityInfo reference topic.
///
///
/// FwpmNetEventsSetSecurityInfo0 is a specific implementation of FwpmNetEventsSetSecurityInfo. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventssetsecurityinfo0 DWORD FwpmNetEventsSetSecurityInfo0(
// [in] HFWPENG engineHandle, [in] SECURITY_INFORMATION securityInfo, [in, optional] const SID *sidOwner, [in, optional] const SID
// *sidGroup, [in, optional] const ACL *dacl, [in, optional] const ACL *sacl );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventsSetSecurityInfo0")]
public static extern Win32Error FwpmNetEventsSetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo,
[In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl);
///
/// The FwpmNetEventSubscribe0 function is used to request the delivery of notifications regarding a particular net event.
///
/// NoteFwpmNetEventSubscribe0 is the specific implementation of FwpmNetEventSubscribe used in Windows 7. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 8, FwpmNetEventSubscribe1 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_NET_EVENT_SUBSCRIPTION0*
/// The notifications which will be delivered.
///
///
/// Type: FWPM_NET_EVENT_CALLBACK0
/// Function pointer that will be invoked when a notification is ready for delivery.
///
///
/// Type: void*
/// Optional context pointer. This pointer is passed to the callback function along with details of the event.
///
///
/// Type: HANDLE*
/// Handle to the newly created subscription.
///
///
/// Type: DWORD
///
///
/// 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// 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.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventsubscribe0 DWORD FwpmNetEventSubscribe0( [in] HFWPENG
// engineHandle, [in] const FWPM_NET_EVENT_SUBSCRIPTION0 *subscription, [in] FWPM_NET_EVENT_CALLBACK0 callback, [in, optional] void
// *context, [out] HANDLE *eventsHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventSubscribe0")]
public static extern Win32Error FwpmNetEventSubscribe0([In] HFWPENG engineHandle, in FWPM_NET_EVENT_SUBSCRIPTION0 subscription,
[In] FWPM_NET_EVENT_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPMNETEVTSUB eventsHandle);
///
/// The FwpmNetEventSubscribe1 function is used to request the delivery of notifications regarding a particular net event.
///
/// NoteFwpmNetEventSubscribe1 is the specific implementation of FwpmNetEventSubscribe used in Windows 8 and later. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmNetEventSubscribe0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_NET_EVENT_SUBSCRIPTION0*
/// The notifications which will be delivered.
///
///
/// Type: FWPM_NET_EVENT_CALLBACK1
/// Function pointer that will be invoked when a notification is ready for delivery.
///
///
/// Type: void*
/// Optional context pointer. This pointer is passed to the callback function along with details of the event.
///
///
/// Type: HANDLE*
/// Handle to the newly created subscription.
///
///
/// Type: DWORD
///
///
/// 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// 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.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventsubscribe1 DWORD FwpmNetEventSubscribe1( [in] HFWPENG
// engineHandle, [in] const FWPM_NET_EVENT_SUBSCRIPTION0 *subscription, [in] FWPM_NET_EVENT_CALLBACK1 callback, [in, optional] void
// *context, [out] HANDLE *eventsHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventSubscribe1")]
public static extern Win32Error FwpmNetEventSubscribe1([In] HFWPENG engineHandle, in FWPM_NET_EVENT_SUBSCRIPTION0 subscription,
[In] FWPM_NET_EVENT_CALLBACK1 callback, [In, Optional] IntPtr context, out HFWPMNETEVTSUB eventsHandle);
///
/// The FwpmNetEventSubscribe2 function is used to request the delivery of notifications regarding a particular net event.
///
/// NoteFwpmNetEventSubscribe2 is the specific implementation of FwpmNetEventSubscribe used in Windows 10, version
/// 1607 and later. See WFP Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 8,
/// FwpmNetEventSubscribe1 is available. For Windows 7, FwpmNetEventSubscribe0 is available.
///
///
///
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
/// The notifications which will be delivered.
/// Function pointer that will be invoked when a notification is ready for delivery.
///
/// Optional context pointer. This pointer is passed to the callback function along with details of the event.
///
/// Handle to the newly created subscription.
///
///
///
/// 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// 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.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventsubscribe2 DWORD FwpmNetEventSubscribe2( [in] HFWPENG
// engineHandle, [in] const FWPM_NET_EVENT_SUBSCRIPTION0 *subscription, [in] FWPM_NET_EVENT_CALLBACK2 callback, [in, optional] void
// *context, [out] HANDLE *eventsHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventSubscribe2")]
public static extern Win32Error FwpmNetEventSubscribe2([In] HFWPENG engineHandle, in FWPM_NET_EVENT_SUBSCRIPTION0 subscription,
[In] FWPM_NET_EVENT_CALLBACK2 callback, [In, Optional] IntPtr context, out HFWPMNETEVTSUB eventsHandle);
/// The FwpmNetEventSubscriptionsGet0 function retrieves an array of all the current net event notification subscriptions.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_NET_EVENT_SUBSCRIPTION0***
/// The current net event notification subscriptions.
///
///
/// Type: UINT32*
/// The number of entries returned.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscriptions were retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The returned array (but not the individual entries in the array) must be freed through a call to FwpmFreeMemory0.
///
/// FwpmNetEventSubscriptionsGet0 is a specific implementation of FwpmNetEventSubscriptionsGet. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventsubscriptionsget0 DWORD FwpmNetEventSubscriptionsGet0(
// [in] HFWPENG engineHandle, [out] FWPM_NET_EVENT_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventSubscriptionsGet0")]
public static extern Win32Error FwpmNetEventSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries);
/// The FwpmNetEventSubscriptionsGet0 function retrieves an array of all the current net event notification subscriptions.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_NET_EVENT_SUBSCRIPTION0***
/// The current net event notification subscriptions.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscriptions were retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The returned array (but not the individual entries in the array) must be freed through a call to FwpmFreeMemory0.
///
/// FwpmNetEventSubscriptionsGet0 is a specific implementation of FwpmNetEventSubscriptionsGet. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventsubscriptionsget0 DWORD FwpmNetEventSubscriptionsGet0(
// [in] HFWPENG engineHandle, [out] FWPM_NET_EVENT_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventSubscriptionsGet0")]
public static Win32Error FwpmNetEventSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) =>
FwpmGenericGetSubs(FwpmNetEventSubscriptionsGet0, engineHandle, out entries);
/// The FwpmNetEventUnsubscribe0 function is used to cancel a net event subscription and stop receiving notifications.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle of the subscribed event notification. This is the returned handle from the call to FwpmNetEventSubscribe0.
/// This may be NULL, in which case the function will have no effect.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscription was deleted successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the callback is currently being invoked, this function will not return until it completes. Thus, when calling this function, you
/// must not hold any locks that the callback may also try to acquire lest you deadlock.
///
///
/// It is not necessary to unsubscribe before closing a session; all subscriptions are automatically canceled when the subscribing
/// session terminates.
///
///
/// 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.
///
///
/// FwpmNetEventUnsubscribe0 is a specific implementation of FwpmNetEventUnsubscribe. See WFP Version-Independent Names and
/// Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventunsubscribe0 DWORD FwpmNetEventUnsubscribe0( [in]
// HFWPENG engineHandle, [in, out] HANDLE eventsHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventUnsubscribe0")]
public static extern Win32Error FwpmNetEventUnsubscribe0([In] HFWPENG engineHandle, [In, Out] HFWPMNETEVTSUB eventsHandle);
/// The FwpmProviderAdd0 function adds a new provider to the system.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER0*
/// The provider object to be added.
///
///
/// Type: PSECURITY_DESCRIPTOR
/// Security information for the provider object.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider was successfully added.
///
/// -
/// 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.
///
///
///
///
/// If the caller supplies a null security descriptor, the system will assign a default security descriptor.
///
/// Boot-time objects are added to the Base Filtering Engine (BFE) when the TCP/IP driver starts, and are removed once the BFE finishes
/// initialization. Persistent objects are added when the BFE starts. If a policy provider has a persistent policy that is not intended
/// to be enforced if its associated service is disabled, the caller can specify an optional service name in the FWPM_PROVIDER0
/// structure. This service then owns the persistent policy object. At start, the BFE only adds the following types of persistent objects
/// to the system.
///
///
/// -
/// The object is not associated with a provider.
///
/// -
/// The object has an associated provider that does not specify a service name.
///
/// -
/// The object has an associated provider and an associated service set to auto-start.
///
///
///
/// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object
/// Management for more information about transactions.
///
/// The caller needs FWPM_ACTRL_ADD access to the provider's container. See Access Control for more information.
///
/// FwpmProviderAdd0 is a specific implementation of FwpmProviderAdd. See WFP Version-Independent Names and Targeting Specific
/// Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovideradd0 DWORD FwpmProviderAdd0( [in] HFWPENG engineHandle,
// [in] const FWPM_PROVIDER0 *provider, [in, optional] PSECURITY_DESCRIPTOR sd );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderAdd0")]
public static extern Win32Error FwpmProviderAdd0([In] HFWPENG engineHandle, in FWPM_PROVIDER0 provider, [In, Optional] PSECURITY_DESCRIPTOR sd);
/// The FwpmProviderContextAdd0 function adds a new provider context to the system.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT0*
/// The provider context object to be added.
///
///
/// Type: PSECURITY_DESCRIPTOR
/// Security information associated with the provider context object.
///
///
/// Type: UINT64*
/// Pointer to a variable that receives a runtime identifier for this provider context.
///
///
/// 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](/windows/desktop/api/fwpmtypes/ne-fwpmtypes-fwpm_provider_context_type)and the
/// [IKEEXT_IPV6_CGA](/windows/desktop/api/iketypes/ne-iketypes-ikeext_authentication_method_type) authentication method 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// Some fields in the FWPM_PROVIDER_CONTEXT0 structure are assigned by the system, not the caller, and are ignored in the call to FwpmProviderContextAdd0.
///
/// If the caller supplies a NULL security descriptor, the system will assign a default security descriptor.
///
/// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object
/// Management for more information about transactions.
///
///
/// The caller needs FWPM_ACTRL_ADD access to the provider context's container and FWPM_ACTRL_ADD_LINK access to the provider (if
/// any). See Access Control for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextadd0 DWORD FwpmProviderContextAdd0( [in] HFWPENG
// engineHandle, [in] const FWPM_PROVIDER_CONTEXT0 *providerContext, [in, optional] PSECURITY_DESCRIPTOR sd, [out, optional] UINT64 *id );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextAdd0")]
public static extern Win32Error FwpmProviderContextAdd0([In] HFWPENG engineHandle, in FWPM_PROVIDER_CONTEXT0 providerContext,
[In, Optional] PSECURITY_DESCRIPTOR sd, out ulong id);
/// The FwpmProviderContextAdd1 function adds a new provider context to the system.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT1*
/// The provider context object to be added.
///
///
/// Type: PSECURITY_DESCRIPTOR
/// Security information associated with the provider context object.
///
///
/// Type: UINT64*
/// Pointer to a variable that receives a runtime identifier for this provider context.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was successfully added.
///
/// -
/// ERROR_NOT_SUPPORTED 0x32
///
/// The [IKEEXT_IPV6_CGA](/windows/desktop/api/iketypes/ne-iketypes-ikeext_authentication_method_type) authentication method 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// Some fields in the FWPM_PROVIDER_CONTEXT1 structure are assigned by the system, not the caller, and are ignored in the call to FwpmProviderContextAdd1.
///
/// If the caller supplies a NULL security descriptor, the system will assign a default security descriptor.
///
/// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object
/// Management for more information about transactions.
///
///
/// The caller needs FWPM_ACTRL_ADD access to the provider context's container and FWPM_ACTRL_ADD_LINK access to the provider (if
/// any). See Access Control for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextadd1 DWORD FwpmProviderContextAdd1( [in] HFWPENG
// engineHandle, [in] const FWPM_PROVIDER_CONTEXT1 *providerContext, [in, optional] PSECURITY_DESCRIPTOR sd, [out, optional] UINT64 *id );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextAdd1")]
public static extern Win32Error FwpmProviderContextAdd1([In] HFWPENG engineHandle, in FWPM_PROVIDER_CONTEXT1 providerContext,
[In, Optional] PSECURITY_DESCRIPTOR sd, out ulong id);
///
/// The FwpmProviderContextAdd2 function adds a new provider context to the system.
///
/// NoteFwpmProviderContextAdd2 is the specific implementation of FwpmProviderContextAdd used in Windows 8. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmProviderContextAdd1 is
/// available. For Windows Vista, FwpmProviderContextAdd0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT2*
/// The provider context object to be added.
///
///
/// Type: PSECURITY_DESCRIPTOR
/// Security information associated with the provider context object.
///
///
/// Type: UINT64*
/// Pointer to a variable that receives a runtime identifier for this provider context.
///
///
/// 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](/windows/desktop/api/fwpmtypes/ne-fwpmtypes-fwpm_provider_context_type)and the
/// [IKEEXT_IPV6_CGA](/windows/desktop/api/iketypes/ne-iketypes-ikeext_authentication_method_type) authentication method 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// Some fields in the FWPM_PROVIDER_CONTEXT2 structure are assigned by the system, not the caller, and are ignored in the call to FwpmProviderContextAdd2.
///
/// If the caller supplies a NULL security descriptor, the system will assign a default security descriptor.
///
/// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object
/// Management for more information about transactions.
///
///
/// The caller needs FWPM_ACTRL_ADD access to the provider context's container and FWPM_ACTRL_ADD_LINK access to the provider (if
/// any). See Access Control for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextadd2 DWORD FwpmProviderContextAdd2( [in] HFWPENG
// engineHandle, [in] const FWPM_PROVIDER_CONTEXT2 *providerContext, [in, optional] PSECURITY_DESCRIPTOR sd, [out, optional] UINT64 *id );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextAdd2")]
public static extern Win32Error FwpmProviderContextAdd2([In] HFWPENG engineHandle, in FWPM_PROVIDER_CONTEXT2 providerContext,
[In, Optional] PSECURITY_DESCRIPTOR sd, out ulong id);
/// The FwpmProviderContextCreateEnumHandle0 function creates a handle used to enumerate a set of provider contexts.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: HANDLE*
/// Handle for provider context enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The enumerator was created successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all provider contexts are returned.
///
/// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to
/// FwpmProviderContextCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call
/// FwpmProviderContextCreateEnumHandle0 and FwpmProviderContextEnum0 from within the same explicit transaction.
///
/// The caller must free the returned handle by a call to FwpmProviderContextDestroyEnumHandle0.
///
/// The caller needs FWPM_ACTRL_ENUM access to the provider contexts' containers and FWPM_ACTRL_READ access to the provider
/// contexts. Only provider contexts to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information.
///
///
/// FwpmProviderContextCreateEnumHandle0 is a specific implementation of FwpmProviderContextCreateEnumHandle. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextcreateenumhandle0 DWORD
// FwpmProviderContextCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0
// *enumTemplate, [out] HANDLE *enumHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextCreateEnumHandle0")]
public static extern Win32Error FwpmProviderContextCreateEnumHandle0([In] HFWPENG engineHandle, in FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0 enumTemplate,
out HANDLE enumHandle);
/// The FwpmProviderContextCreateEnumHandle0 function creates a handle used to enumerate a set of provider contexts.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: HANDLE*
/// Handle for provider context enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The enumerator was created successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all provider contexts are returned.
///
/// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to
/// FwpmProviderContextCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call
/// FwpmProviderContextCreateEnumHandle0 and FwpmProviderContextEnum0 from within the same explicit transaction.
///
/// The caller must free the returned handle by a call to FwpmProviderContextDestroyEnumHandle0.
///
/// The caller needs FWPM_ACTRL_ENUM access to the provider contexts' containers and FWPM_ACTRL_READ access to the provider
/// contexts. Only provider contexts to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information.
///
///
/// FwpmProviderContextCreateEnumHandle0 is a specific implementation of FwpmProviderContextCreateEnumHandle. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextcreateenumhandle0 DWORD
// FwpmProviderContextCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0
// *enumTemplate, [out] HANDLE *enumHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextCreateEnumHandle0")]
public static extern Win32Error FwpmProviderContextCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate,
out HANDLE enumHandle);
/// The FwpmProviderContextDeleteById0 function removes a provider context from the system .
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: UINT64
///
/// A runtime identifier for the object being removed from the system. This is the runtime identifier that was received from the system
/// when the application called FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was successfully deleted.
///
/// -
/// 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.
///
///
///
///
///
/// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object
/// Management for more information about transactions.
///
///
/// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function
/// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this
/// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS.
///
/// The caller needs DELETE access to the provider context. See Access Control for more information.
///
/// FwpmProviderContextDeleteById0 is a specific implementation of FwpmProviderContextDeleteById. See WFP Version-Independent
/// Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextdeletebyid0 DWORD FwpmProviderContextDeleteById0(
// [in] HFWPENG engineHandle, [in] UINT64 id );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextDeleteById0")]
public static extern Win32Error FwpmProviderContextDeleteById0([In] HFWPENG engineHandle, ulong id);
/// The FwpmProviderContextDeleteByKey0 function removes a provider context from the system.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the object being removed from the system. This is a pointer to the same GUID that was specified when the
/// application called FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was successfully deleted.
///
/// -
/// 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.
///
///
///
///
///
/// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object
/// Management for more information about transactions.
///
///
/// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function
/// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this
/// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS.
///
/// The caller needs DELETE access to the provider context. See Access Control for more information.
///
/// FwpmProviderContextDeleteByKey0 is a specific implementation of FwpmProviderContextDeleteByKey. See WFP Version-Independent
/// Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextdeletebykey0 DWORD
// FwpmProviderContextDeleteByKey0( [in] HFWPENG engineHandle, [in] const GUID *key );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextDeleteByKey0")]
public static extern Win32Error FwpmProviderContextDeleteByKey0([In] HFWPENG engineHandle, [In] in Guid key);
/// The FwpmProviderContextDestroyEnumHandle0 function frees a handle returned by FwpmProviderContextCreateEnumHandle0.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle of a provider context enumeration created by a call to FwpmProviderContextCreateEnumHandle0.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The enumerator was successfully deleted.
///
/// -
/// 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.
///
///
///
///
/// FwpmProviderContextDestroyEnumHandle0 is a specific implementation of FwpmProviderContextDestroyEnumHandle. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextdestroyenumhandle0 DWORD
// FwpmProviderContextDestroyEnumHandle0( [in] HFWPENG engineHandle, [in] HANDLE enumHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextDestroyEnumHandle0")]
public static extern Win32Error FwpmProviderContextDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle);
///
/// The FwpmProviderContextEnum0 function returns the next page of results from the provider context enumerator.
///
/// NoteFwpmProviderContextEnum0 is the specific implementation of FwpmProviderContextEnum used in Windows Vista. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmProviderContextEnum1 is
/// available. For Windows 8, FwpmProviderContextEnum2 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle for a provider context enumeration created by a call to FwpmProviderContextCreateEnumHandle0.
///
///
/// Type: UINT32
/// The number of provider context objects requested.
///
///
/// Type: FWPM_PROVIDER_CONTEXT0***
/// The returned provider context objects.
///
///
/// Type: UINT32*
/// The number of provider context objects returned.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider contexts were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If the numEntriesReturned is less than the numEntriesRequested, the enumeration is exhausted.
/// The returned array of entries (but not the individual entries themselves) must be freed by a call to FwpmFreeMemory0.
/// A subsequent call using the same enumeration handle will return the next set of items following those in the last output buffer.
/// FwpmProviderContextEnum0 works on a snapshot of the provider contexts taken at the time the enumeration handle was created.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextenum0 DWORD FwpmProviderContextEnum0( [in]
// HFWPENG engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER_CONTEXT0 ***entries, [out] UINT32
// *numEntriesReturned );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextEnum0")]
public static extern Win32Error FwpmProviderContextEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested,
out SafeFwpmMem entries, out uint numEntriesReturned);
///
/// The FwpmProviderContextEnum0 function returns the next page of results from the provider context enumerator.
///
/// NoteFwpmProviderContextEnum0 is the specific implementation of FwpmProviderContextEnum used in Windows Vista. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmProviderContextEnum1 is
/// available. For Windows 8, FwpmProviderContextEnum2 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT0***
/// The returned provider context objects.
///
///
/// Type: const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider contexts were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all provider contexts are returned.
/// FwpmProviderContextEnum0 works on a snapshot of the provider contexts taken at the time the enumeration handle was created.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextenum0 DWORD FwpmProviderContextEnum0( [in]
// HFWPENG engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER_CONTEXT0 ***entries, [out] UINT32
// *numEntriesReturned );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextEnum0")]
public static Win32Error FwpmProviderContextEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0? enumTemplate = null) =>
FwpmGenericEnum(FwpmProviderContextCreateEnumHandle0, FwpmProviderContextEnum0, FwpmProviderContextDestroyEnumHandle0, engineHandle, out entries, enumTemplate);
///
/// The FwpmProviderContextEnum1 function returns the next page of results from the provider context enumerator.
///
/// NoteFwpmProviderContextEnum1 is the specific implementation of FwpmProviderContextEnum used in Windows 7. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 8, FwpmProviderContextEnum2 is
/// available. For Windows Vista, FwpmProviderContextEnum0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle for a provider context enumeration created by a call to FwpmProviderContextCreateEnumHandle0.
///
///
/// Type: UINT32
/// The number of provider context objects requested.
///
///
/// Type: FWPM_PROVIDER_CONTEXT1***
/// The returned provider context objects.
///
///
/// Type: UINT32*
/// The number of provider context objects returned.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider contexts were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If the numEntriesReturned is less than the numEntriesRequested, the enumeration is exhausted.
/// The returned array of entries (but not the individual entries themselves) must be freed by a call to FwpmFreeMemory0.
/// A subsequent call using the same enumeration handle will return the next set of items following those in the last output buffer.
/// FwpmProviderContextEnum1 works on a snapshot of the provider contexts taken at the time the enumeration handle was created.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextenum1 DWORD FwpmProviderContextEnum1( [in]
// HFWPENG engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER_CONTEXT1 ***entries, [out] UINT32
// *numEntriesReturned );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextEnum1")]
public static extern Win32Error FwpmProviderContextEnum1([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested,
out SafeFwpmMem entries, out uint numEntriesReturned);
///
/// The FwpmProviderContextEnum1 function returns the next page of results from the provider context enumerator.
///
/// NoteFwpmProviderContextEnum1 is the specific implementation of FwpmProviderContextEnum used in Windows 7. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 8, FwpmProviderContextEnum2 is
/// available. For Windows Vista, FwpmProviderContextEnum0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT1***
/// The returned provider context objects.
///
///
/// Type: const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider contexts were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all provider contexts are returned.
/// FwpmProviderContextEnum1 works on a snapshot of the provider contexts taken at the time the enumeration handle was created.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextenum1 DWORD FwpmProviderContextEnum1( [in]
// HFWPENG engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER_CONTEXT1 ***entries, [out] UINT32
// *numEntriesReturned );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextEnum1")]
public static Win32Error FwpmProviderContextEnum1([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0? enumTemplate = null) =>
FwpmGenericEnum(FwpmProviderContextCreateEnumHandle0, FwpmProviderContextEnum1, FwpmProviderContextDestroyEnumHandle0, engineHandle, out entries, enumTemplate);
///
/// The FwpmProviderContextEnum2 function returns the next page of results from the provider context enumerator.
///
/// NoteFwpmProviderContextEnum2 is the specific implementation of FwpmProviderContextEnum used in Windows 8. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmProviderContextEnum1 is
/// available. For Windows Vista, FwpmProviderContextEnum0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle for a provider context enumeration created by a call to FwpmProviderContextCreateEnumHandle0.
///
///
/// Type: UINT32
/// Number of provider context objects requested.
///
///
/// Type: FWPM_PROVIDER_CONTEXT2***
/// The returned provider context objects.
///
///
/// Type: UINT32*
/// The number of provider context objects returned.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider contexts were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If the numEntriesReturned is less than the numEntriesRequested, the enumeration is exhausted.
/// The returned array of entries (but not the individual entries themselves) must be freed by a call to FwpmFreeMemory0.
/// A subsequent call using the same enumeration handle will return the next set of items following those in the last output buffer.
/// FwpmProviderContextEnum2 works on a snapshot of the provider contexts taken at the time the enumeration handle was created.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextenum2 DWORD FwpmProviderContextEnum2( [in]
// HFWPENG engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER_CONTEXT2 ***entries, [out] UINT32
// *numEntriesReturned );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextEnum2")]
public static extern Win32Error FwpmProviderContextEnum2([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested,
out SafeFwpmMem entries, out uint numEntriesReturned);
///
/// The FwpmProviderContextEnum2 function returns the next page of results from the provider context enumerator.
///
/// NoteFwpmProviderContextEnum2 is the specific implementation of FwpmProviderContextEnum used in Windows 8. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmProviderContextEnum1 is
/// available. For Windows Vista, FwpmProviderContextEnum0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT2***
/// The returned provider context objects.
///
///
/// Type: const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider contexts were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all provider contexts are returned.
/// FwpmProviderContextEnum2 works on a snapshot of the provider contexts taken at the time the enumeration handle was created.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextenum2 DWORD FwpmProviderContextEnum2( [in]
// HFWPENG engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER_CONTEXT2 ***entries, [out] UINT32
// *numEntriesReturned );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextEnum2")]
public static Win32Error FwpmProviderContextEnum2([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0? enumTemplate = null) =>
FwpmGenericEnum(FwpmProviderContextCreateEnumHandle0, FwpmProviderContextEnum2, FwpmProviderContextDestroyEnumHandle0, engineHandle, out entries, enumTemplate);
///
/// The FwpmProviderContextGetById0 function retrieves a provider context.
///
/// NoteFwpmProviderContextGetById0 is the specific implementation of FwpmProviderContextGetById used in Windows Vista. See
/// WFP Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7,
/// FwpmProviderContextGetById1 is available. For Windows 8, FwpmProviderContextGetById2 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: UINT64
///
/// A run-time identifier for the desired object. This must be the run-time identifier that was received from the system when the
/// application called FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: FWPM_PROVIDER_CONTEXT0**
/// The provider context information.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The caller must free the returned object by a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context. See Access Control for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetbyid0 DWORD FwpmProviderContextGetById0( [in]
// HFWPENG engineHandle, [in] UINT64 id, [out] FWPM_PROVIDER_CONTEXT0 **providerContext );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetById0")]
public static Win32Error FwpmProviderContextGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmStruct providerContext) =>
FwpmGenericGetById(FwpmProviderContextGetById0, engineHandle, id, out providerContext);
///
/// The FwpmProviderContextGetById1 function retrieves a provider context.
///
/// NoteFwpmProviderContextGetById1 is the specific implementation of FwpmProviderContextGetById used in Windows 7. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 8, FwpmProviderContextGetById2
/// is available. For Windows Vista, FwpmProviderContextGetById0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: UINT64
///
/// A run-time identifier for the desired object. This must be the run-time identifier that was received from the system when the
/// application called FwpmProviderContextAdd1 for this object.
///
///
///
/// Type: FWPM_PROVIDER_CONTEXT1**
/// The provider context information.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The caller must free the returned object by a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context. See Access Control for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetbyid1 DWORD FwpmProviderContextGetById1( [in]
// HFWPENG engineHandle, [in] UINT64 id, [out] FWPM_PROVIDER_CONTEXT1 **providerContext );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetById1")]
public static Win32Error FwpmProviderContextGetById1([In] HFWPENG engineHandle, ulong id, out SafeFwpmStruct providerContext) =>
FwpmGenericGetById(FwpmProviderContextGetById1, engineHandle, id, out providerContext);
///
/// The FwpmProviderContextGetById2 function retrieves a provider context.
///
/// NoteFwpmProviderContextGetById2 is the specific implementation of FwpmProviderContextGetById used in Windows 8. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmProviderContextGetById1
/// is available. For Windows Vista, FwpmProviderContextGetById0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: UINT64
///
/// A run-time identifier for the desired object. This must be the run-time identifier that was received from the system when the
/// application called FwpmProviderContextAdd2 for this object.
///
///
///
/// Type: FWPM_PROVIDER_CONTEXT2**
/// The provider context information.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The caller must free the returned object by a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context. See Access Control for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetbyid2 DWORD FwpmProviderContextGetById2( [in]
// HFWPENG engineHandle, [in] UINT64 id, [out] FWPM_PROVIDER_CONTEXT2 **providerContext );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetById2")]
public static Win32Error FwpmProviderContextGetById2([In] HFWPENG engineHandle, ulong id, out SafeFwpmStruct providerContext) =>
FwpmGenericGetById(FwpmProviderContextGetById2, engineHandle, id, out providerContext);
/// The FwpmProviderContextGetByKey0 function retrieves a provider context.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Pointer to a GUID that uniquely identifies the provider context. This is a pointer to the same GUID that was specified when the
/// application called FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: FWPM_PROVIDER_CONTEXT0**
/// The provider context information.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The caller must free the returned object by a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context. See Access Control for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetbykey0 DWORD FwpmProviderContextGetByKey0(
// [in] HFWPENG engineHandle, [in] const GUID *key, [out] FWPM_PROVIDER_CONTEXT0 **providerContext );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetByKey0")]
public static Win32Error FwpmProviderContextGetByKey0([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmStruct providerContext) =>
FwpmGenericGetByKey(FwpmProviderContextGetByKey0, engineHandle, key, out providerContext);
/// The FwpmProviderContextGetByKey1 function retrieves a provider context.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Pointer to a GUID that uniquely identifies the provider context. This is a pointer to the same GUID that was specified when the
/// application called FwpmProviderContextAdd1 for this object.
///
///
///
/// Type: FWPM_PROVIDER_CONTEXT1**
/// The provider context information.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The caller must free the returned object by a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context. See Access Control for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetbykey1 DWORD FwpmProviderContextGetByKey1(
// [in] HFWPENG engineHandle, [in] const GUID *key, [out] FWPM_PROVIDER_CONTEXT1 **providerContext );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetByKey1")]
public static Win32Error FwpmProviderContextGetByKey1([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmStruct providerContext) =>
FwpmGenericGetByKey(FwpmProviderContextGetByKey1, engineHandle, key, out providerContext);
///
/// The FwpmProviderContextGetByKey2 function retrieves a provider context.
///
/// NoteFwpmProviderContextGetByKey2 is the specific implementation of FwpmProviderContextGetByKey used in Windows 8. See
/// WFP Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7,
/// FwpmProviderContextGetByKey1 is available. For Windows Vista, FwpmProviderContextGetByKey0 is available.
///
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Pointer to a GUID that uniquely identifies the provider context. This is a pointer to the same GUID that was specified when the
/// application called FwpmProviderContextAdd2 for this object.
///
///
///
/// Type: FWPM_PROVIDER_CONTEXT2**
/// The provider context information.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider context was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The caller must free the returned object by a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context. See Access Control for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetbykey2 DWORD FwpmProviderContextGetByKey2(
// [in] HFWPENG engineHandle, [in] const GUID *key, [out] FWPM_PROVIDER_CONTEXT2 **providerContext );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetByKey2")]
public static Win32Error FwpmProviderContextGetByKey2([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmStruct providerContext) =>
FwpmGenericGetByKey(FwpmProviderContextGetByKey2, engineHandle, key, out providerContext);
///
/// The FwpmProviderContextGetSecurityInfoByKey0 function retrieves a copy of the security descriptor for a provider context object.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the provider context. This is a pointer to the same GUID that was specified when the application called
/// FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to retrieve.
///
///
/// Type: PSID*
/// The owner security identifier (SID) in the returned security descriptor.
///
///
/// Type: PSID*
/// The primary group security identifier (SID) in the returned security descriptor.
///
///
/// Type: PACL*
/// The discretionary access control list (DACL) in the returned security descriptor.
///
///
/// Type: PACL*
/// The system access control list (SACL) in the returned security descriptor.
///
///
/// Type: PSECURITY_DESCRIPTOR*
/// The returned security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// provider contexts container.
///
///
/// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned
/// parameters must not be freed, as they point to addresses within the securityDescriptor parameter.
///
///
/// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described
/// in the GetSecurityInfo reference topic.
///
///
/// FwpmProviderContextGetSecurityInfoByKey0 is a specific implementation of FwpmProviderContextGetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetsecurityinfobykey0 DWORD
// FwpmProviderContextGetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION
// securityInfo, [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup, [out, optional] PACL *dacl, [out, optional] PACL *sacl,
// [out] PSECURITY_DESCRIPTOR *securityDescriptor );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderContextGetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, SECURITY_INFORMATION securityInfo,
out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor);
///
/// The FwpmProviderContextGetSecurityInfoByKey0 function retrieves a copy of the security descriptor for a provider context object.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the provider context. This is a pointer to the same GUID that was specified when the application called
/// FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to retrieve.
///
///
/// Type: PSID*
/// The owner security identifier (SID) in the returned security descriptor.
///
///
/// Type: PSID*
/// The primary group security identifier (SID) in the returned security descriptor.
///
///
/// Type: PACL*
/// The discretionary access control list (DACL) in the returned security descriptor.
///
///
/// Type: PACL*
/// The system access control list (SACL) in the returned security descriptor.
///
///
/// Type: PSECURITY_DESCRIPTOR*
/// The returned security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// provider contexts container.
///
///
/// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned
/// parameters must not be freed, as they point to addresses within the securityDescriptor parameter.
///
///
/// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described
/// in the GetSecurityInfo reference topic.
///
///
/// FwpmProviderContextGetSecurityInfoByKey0 is a specific implementation of FwpmProviderContextGetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextgetsecurityinfobykey0 DWORD
// FwpmProviderContextGetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION
// securityInfo, [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup, [out, optional] PACL *dacl, [out, optional] PACL *sacl,
// [out] PSECURITY_DESCRIPTOR *securityDescriptor );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextGetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderContextGetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr key, SECURITY_INFORMATION securityInfo,
out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor);
///
/// The FwpmProviderContextSetSecurityInfoByKey0 function sets specified security information in the security descriptor of a
/// provider context object.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the provider context object. This is a pointer to the same GUID that was specified when the application called
/// FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to set.
///
///
/// Type: const SID*
/// The owner's security identifier (SID) to be set in the security descriptor.
///
///
/// Type: const SID*
/// The group's SID to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The discretionary access control list (DACL) to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The system access control list (SACL) to be set in the security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was set successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// provider contexts container.
///
///
/// 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.
///
///
/// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function
/// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this
/// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS.
///
///
/// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described
/// in the SetSecurityInfo reference topic.
///
///
/// FwpmProviderContextSetSecurityInfoByKey0 is a specific implementation of FwpmProviderContextSetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextsetsecurityinfobykey0 DWORD
// FwpmProviderContextSetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION
// securityInfo, [in, optional] const SID *sidOwner, [in, optional] const SID *sidGroup, [in, optional] const ACL *dacl, [in, optional]
// const ACL *sacl );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextSetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderContextSetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, SECURITY_INFORMATION securityInfo,
[In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl);
///
/// The FwpmProviderContextSetSecurityInfoByKey0 function sets specified security information in the security descriptor of a
/// provider context object.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the provider context object. This is a pointer to the same GUID that was specified when the application called
/// FwpmProviderContextAdd0 for this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to set.
///
///
/// Type: const SID*
/// The owner's security identifier (SID) to be set in the security descriptor.
///
///
/// Type: const SID*
/// The group's SID to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The discretionary access control list (DACL) to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The system access control list (SACL) to be set in the security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was set successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// provider contexts container.
///
///
/// 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.
///
///
/// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function
/// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this
/// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS.
///
///
/// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described
/// in the SetSecurityInfo reference topic.
///
///
/// FwpmProviderContextSetSecurityInfoByKey0 is a specific implementation of FwpmProviderContextSetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextsetsecurityinfobykey0 DWORD
// FwpmProviderContextSetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION
// securityInfo, [in, optional] const SID *sidOwner, [in, optional] const SID *sidGroup, [in, optional] const ACL *dacl, [in, optional]
// const ACL *sacl );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextSetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderContextSetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr key, SECURITY_INFORMATION securityInfo,
[In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl);
///
/// The FwpmProviderContextSubscribeChanges0 function is used to request the delivery of notifications regarding changes in a
/// particular provider context.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0*
/// The notifications to be delivered.
///
///
/// Type: FWPM_PROVIDER_CONTEXT_CHANGE_CALLBACK0
/// Function pointer that will be invoked when a notification is ready for delivery.
///
///
/// Type: void*
/// Optional context pointer. This pointer is passed to the callback function along with details of the change.
///
///
/// Type: HANDLE*
/// Handle to the newly created subscription.
///
///
/// Type: DWORD
///
///
/// 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// Subscribers do not receive notifications for changes made with the same session handle used to subscribe. This is because subscribers
/// only need to see changes made by others since they already know which changes they made themselves.
///
///
/// 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 provider context's container and FWPM_ACTRL_READ access to the provider
/// context. The subscriber will only get notifications for provider contexts to which it has FWPM_ACTRL_READ access. See Access
/// Control for more information.
///
///
/// FwpmProviderContextSubscribeChanges0 is a specific implementation of FwpmProviderContextSubscribeChanges. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextsubscribechanges0 DWORD
// FwpmProviderContextSubscribeChanges0( [in] HFWPENG engineHandle, [in] const FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0 *subscription, [in]
// FWPM_PROVIDER_CONTEXT_CHANGE_CALLBACK0 callback, [in, optional] void *context, [out] HANDLE *changeHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextSubscribeChanges0")]
public static extern Win32Error FwpmProviderContextSubscribeChanges0([In] HFWPENG engineHandle, in FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0 subscription,
[In] FWPM_PROVIDER_CONTEXT_CHANGE_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPMPROVCTXSUB changeHandle);
///
/// The FwpmProviderContextSubscriptionsGet0 function retrieves an array of all the current provider context change notification subscriptions.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0***
/// The current provider context change notification subscriptions.
///
///
/// Type: UINT32*
/// The number of entries returned.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscriptions were retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The returned array (but not the individual entries in the array) must be freed through a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context's container. See Access Control for more information.
///
/// FwpmProviderContextSubscriptionsGet0 is a specific implementation of FwpmProviderContextSubscriptionsGet. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextsubscriptionsget0 DWORD
// FwpmProviderContextSubscriptionsGet0( [in] HFWPENG engineHandle, [out] FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0 ***entries, [out] UINT32
// *numEntries );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextSubscriptionsGet0")]
public static extern Win32Error FwpmProviderContextSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries);
///
/// The FwpmProviderContextSubscriptionsGet0 function retrieves an array of all the current provider context change notification subscriptions.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0***
/// The current provider context change notification subscriptions.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscriptions were retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The returned array (but not the individual entries in the array) must be freed through a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider context's container. See Access Control for more information.
///
/// FwpmProviderContextSubscriptionsGet0 is a specific implementation of FwpmProviderContextSubscriptionsGet. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextsubscriptionsget0 DWORD
// FwpmProviderContextSubscriptionsGet0( [in] HFWPENG engineHandle, [out] FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0 ***entries, [out] UINT32
// *numEntries );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextSubscriptionsGet0")]
public static Win32Error FwpmProviderContextSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) =>
FwpmGenericGetSubs(FwpmProviderContextSubscriptionsGet0, engineHandle, out entries);
///
/// The FwpmProviderContextUnsubscribeChanges0 function is used to cancel a provider context change subscription and stop
/// receiving change notifications.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle of the subscribed change notification. This is the handle returned by FwpmProviderContextSubscribeChanges0.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscription was deleted successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the callback is currently being invoked, this function will not return until it completes. Thus, when calling this function, you
/// must not hold any locks that the callback may also try to acquire lest you deadlock.
///
///
/// It is not necessary to unsubscribe before closing a session; all subscriptions are automatically canceled when the subscribing
/// session terminates.
///
///
/// 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.
///
///
/// FwpmProviderContextUnsubscribeChanges0 is a specific implementation of FwpmProviderContextUnsubscribeChanges. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercontextunsubscribechanges0 DWORD
// FwpmProviderContextUnsubscribeChanges0( [in] HFWPENG engineHandle, [in] HANDLE changeHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderContextUnsubscribeChanges0")]
public static extern Win32Error FwpmProviderContextUnsubscribeChanges0([In] HFWPENG engineHandle, [In] HFWPMPROVCTXSUB changeHandle);
/// The FwpmProviderCreateEnumHandle0 function creates a handle used to enumerate a set of providers.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: HANDLE*
/// Handle for provider enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The enumerator was created successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all providers are returned.
///
/// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to
/// FwpmProviderCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call
/// FwpmProviderCreateEnumHandle0 and FwpmProviderEnum0 from within the same explicit transaction.
///
/// The caller must free the returned handle by a call to FwpmProviderDestroyEnumHandle0.
///
/// The caller needs FWPM_ACTRL_ENUM access to the providers' containers and FWPM_ACTRL_READ access to the providers. Only
/// providers to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information.
///
///
/// FwpmProviderCreateEnumHandle0 is a specific implementation of FwpmProviderCreateEnumHandle. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercreateenumhandle0 DWORD FwpmProviderCreateEnumHandle0(
// [in] HFWPENG engineHandle, [in, optional] const FWPM_PROVIDER_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderCreateEnumHandle0")]
public static extern Win32Error FwpmProviderCreateEnumHandle0([In] HFWPENG engineHandle, in FWPM_PROVIDER_ENUM_TEMPLATE0 enumTemplate,
out HANDLE enumHandle);
/// The FwpmProviderCreateEnumHandle0 function creates a handle used to enumerate a set of providers.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: HANDLE*
/// Handle for provider enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The enumerator was created successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all providers are returned.
///
/// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to
/// FwpmProviderCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call
/// FwpmProviderCreateEnumHandle0 and FwpmProviderEnum0 from within the same explicit transaction.
///
/// The caller must free the returned handle by a call to FwpmProviderDestroyEnumHandle0.
///
/// The caller needs FWPM_ACTRL_ENUM access to the providers' containers and FWPM_ACTRL_READ access to the providers. Only
/// providers to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information.
///
///
/// FwpmProviderCreateEnumHandle0 is a specific implementation of FwpmProviderCreateEnumHandle. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidercreateenumhandle0 DWORD FwpmProviderCreateEnumHandle0(
// [in] HFWPENG engineHandle, [in, optional] const FWPM_PROVIDER_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderCreateEnumHandle0")]
public static extern Win32Error FwpmProviderCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate,
out HANDLE enumHandle);
/// The FwpmProviderDeleteByKey0 function removes a provider from the system.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the object being removed from the system. This is the same GUID that was specified when the application called FwpmProviderAdd0.
///
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider was successfully deleted.
///
/// -
/// 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.
///
///
///
///
///
/// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object
/// Management for more information about transactions.
///
///
/// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function
/// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this
/// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS.
///
/// The caller needs DELETE access to the provider. See Access Control for more information.
///
/// FwpmProviderDeleteByKey0 is a specific implementation of FwpmProviderDeleteByKey. See WFP Version-Independent Names and
/// Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmproviderdeletebykey0 DWORD FwpmProviderDeleteByKey0( [in]
// HFWPENG engineHandle, [in] const GUID *key );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderDeleteByKey0")]
public static extern Win32Error FwpmProviderDeleteByKey0([In] HFWPENG engineHandle, [In] in Guid key);
/// The FwpmProviderDestroyEnumHandle0 function frees a handle returned by FwpmProviderCreateEnumHandle0.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle of a provider enumeration created by a call to FwpmProviderCreateEnumHandle0.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The enumerator was successfully deleted.
///
/// -
/// 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.
///
///
///
///
/// FwpmProviderDestroyEnumHandle0 is a specific implementation of FwpmProviderDestroyEnumHandle. See WFP Version-Independent
/// Names and Targeting Specific Versions of Windows for more information.
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmproviderdestroyenumhandle0 DWORD FwpmProviderDestroyEnumHandle0(
// [in] HFWPENG engineHandle, [in] HANDLE enumHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderDestroyEnumHandle0")]
public static extern Win32Error FwpmProviderDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle);
/// The FwpmProviderEnum0 function returns the next page of results from the provider enumerator.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle for a provider enumeration created by a call to FwpmProviderCreateEnumHandle0.
///
///
/// Type: UINT32
/// The number of provider entries requested.
///
///
/// Type: FWPM_PROVIDER0***
/// Addresses of the enumeration entries.
///
///
/// Type: UINT32*
/// The number of provider objects returned.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The providers were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If the numEntriesReturned is less than the numEntriesRequested, the enumeration is exhausted.
/// The returned array of entries (but not the individual entries themselves) must be freed by a call to FwpmFreeMemory0.
/// A subsequent call using the same enumeration handle will return the next set of items following those in the last output buffer.
/// FwpmProviderEnum0 works on a snapshot of the providers taken at the time the enumeration handle was created.
///
/// FwpmProviderEnum0 is a specific implementation of FwpmProviderEnum. See WFP Version-Independent Names and Targeting Specific
/// Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmproviderenum0 DWORD FwpmProviderEnum0( [in] HFWPENG
// engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER0 ***entries, [out] UINT32
// *numEntriesReturned );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderEnum0")]
public static extern Win32Error FwpmProviderEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested,
out SafeFwpmMem entries, out uint numEntriesReturned);
/// The FwpmProviderEnum0 function returns the next page of results from the provider enumerator.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER0***
/// Addresses of the enumeration entries.
///
///
/// Type: FWPM_PROVIDER_ENUM_TEMPLATE0*
/// Template to selectively restrict the enumeration.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The providers were enumerated successfully.
///
/// -
/// 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.
///
///
///
///
/// If enumTemplate is NULL, all providers are returned.
/// FwpmProviderEnum0 works on a snapshot of the providers taken at the time the enumeration handle was created.
///
/// FwpmProviderEnum0 is a specific implementation of FwpmProviderEnum. See WFP Version-Independent Names and Targeting Specific
/// Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmproviderenum0 DWORD FwpmProviderEnum0( [in] HFWPENG
// engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_PROVIDER0 ***entries, [out] UINT32
// *numEntriesReturned );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderEnum0")]
public static Win32Error FwpmProviderEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_PROVIDER_ENUM_TEMPLATE0? enumTemplate = null) =>
FwpmGenericEnum(FwpmProviderCreateEnumHandle0, FwpmProviderEnum0, FwpmProviderDestroyEnumHandle0, engineHandle, out entries, enumTemplate);
/// The FwpmProviderGetByKey0 function retrieves a provider.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
/// A runtime identifier for the desired object. This is the same GUID that was specified when the application called FwpmProviderAdd0.
///
///
/// Type: FWPM_PROVIDER0**
/// The provider information.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The provider was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The caller must free the returned object by a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider. See Access Control for more information.
///
/// FwpmProviderGetByKey0 is a specific implementation of FwpmProviderGetByKey. See WFP Version-Independent Names and Targeting
/// Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidergetbykey0 DWORD FwpmProviderGetByKey0( [in] HFWPENG
// engineHandle, [in] const GUID *key, [out] FWPM_PROVIDER0 **provider );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderGetByKey0")]
public static Win32Error FwpmProviderGetByKey0([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmStruct provider) =>
FwpmGenericGetByKey(FwpmProviderGetByKey0, engineHandle, key, out provider);
/// The FwpmProviderGetSecurityInfoByKey0 function retrieves a copy of the security descriptor for a provider object.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique key of the object of interest. This must be the same GUID that was specified when the application called FwpmProviderAdd0 for
/// this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to retrieve.
///
///
/// Type: PSID*
/// The owner security identifier (SID) in the returned security descriptor.
///
///
/// Type: PSID*
/// The primary group security identifier (SID) in the returned security descriptor.
///
///
/// Type: PACL*
/// The discretionary access control list (DACL) in the returned security descriptor.
///
///
/// Type: PACL*
/// The system access control list (SACL) in the returned security descriptor.
///
///
/// Type: PSECURITY_DESCRIPTOR*
/// The returned security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// providers container.
///
///
/// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned
/// parameters must not be freed, as they point to addresses within the securityDescriptor parameter.
///
///
/// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described
/// in the GetSecurityInfo reference topic.
///
///
/// FwpmProviderGetSecurityInfoByKey0 is a specific implementation of FwpmProviderGetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidergetsecurityinfobykey0 DWORD
// FwpmProviderGetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION securityInfo,
// [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup, [out, optional] PACL *dacl, [out, optional] PACL *sacl, [out]
// PSECURITY_DESCRIPTOR *securityDescriptor );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderGetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderGetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, SECURITY_INFORMATION securityInfo,
out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor);
/// The FwpmProviderGetSecurityInfoByKey0 function retrieves a copy of the security descriptor for a provider object.
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique key of the object of interest. This must be the same GUID that was specified when the application called FwpmProviderAdd0 for
/// this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to retrieve.
///
///
/// Type: PSID*
/// The owner security identifier (SID) in the returned security descriptor.
///
///
/// Type: PSID*
/// The primary group security identifier (SID) in the returned security descriptor.
///
///
/// Type: PACL*
/// The discretionary access control list (DACL) in the returned security descriptor.
///
///
/// Type: PACL*
/// The system access control list (SACL) in the returned security descriptor.
///
///
/// Type: PSECURITY_DESCRIPTOR*
/// The returned security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was retrieved successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// providers container.
///
///
/// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned
/// parameters must not be freed, as they point to addresses within the securityDescriptor parameter.
///
///
/// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described
/// in the GetSecurityInfo reference topic.
///
///
/// FwpmProviderGetSecurityInfoByKey0 is a specific implementation of FwpmProviderGetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidergetsecurityinfobykey0 DWORD
// FwpmProviderGetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION securityInfo,
// [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup, [out, optional] PACL *dacl, [out, optional] PACL *sacl, [out]
// PSECURITY_DESCRIPTOR *securityDescriptor );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderGetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderGetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr key, SECURITY_INFORMATION securityInfo,
out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor);
///
/// The FwpmProviderSetSecurityInfoByKey0 function sets specified security information in the security descriptor of a provider object.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the provider. This is the same GUID that was specified when the application called FwpmProviderAdd0 for this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to set.
///
///
/// Type: const SID*
/// The owner's security identifier (SID) to be set in the security descriptor.
///
///
/// Type: const SID*
/// The group's SID to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The discretionary access control list (DACL) to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The system access control list (SACL) to be set in the security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was set successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// providers container.
///
///
/// 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.
///
///
/// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function
/// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this
/// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS.
///
///
/// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described
/// in the SetSecurityInfo reference topic.
///
///
/// FwpmProviderSetSecurityInfoByKey0 is a specific implementation of FwpmProviderSetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidersetsecurityinfobykey0 DWORD
// FwpmProviderSetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION securityInfo,
// [in, optional] const SID *sidOwner, [in, optional] const SID *sidGroup, [in, optional] const ACL *dacl, [in, optional] const ACL *sacl );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderSetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderSetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, SECURITY_INFORMATION securityInfo,
[In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl);
///
/// The FwpmProviderSetSecurityInfoByKey0 function sets specified security information in the security descriptor of a provider object.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: const GUID*
///
/// Unique identifier of the provider. This is the same GUID that was specified when the application called FwpmProviderAdd0 for this object.
///
///
///
/// Type: SECURITY_INFORMATION
/// The type of security information to set.
///
///
/// Type: const SID*
/// The owner's security identifier (SID) to be set in the security descriptor.
///
///
/// Type: const SID*
/// The group's SID to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The discretionary access control list (DACL) to be set in the security descriptor.
///
///
/// Type: const ACL*
/// The system access control list (SACL) to be set in the security descriptor.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The security descriptor was set successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the key parameter is NULL or if it is a NULL GUID, this function manages the security information of the
/// providers container.
///
///
/// 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.
///
///
/// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function
/// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this
/// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS.
///
///
/// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described
/// in the SetSecurityInfo reference topic.
///
///
/// FwpmProviderSetSecurityInfoByKey0 is a specific implementation of FwpmProviderSetSecurityInfoByKey. See WFP
/// Version-Independent Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidersetsecurityinfobykey0 DWORD
// FwpmProviderSetSecurityInfoByKey0( [in] HFWPENG engineHandle, [in, optional] const GUID *key, [in] SECURITY_INFORMATION securityInfo,
// [in, optional] const SID *sidOwner, [in, optional] const SID *sidGroup, [in, optional] const ACL *dacl, [in, optional] const ACL *sacl );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderSetSecurityInfoByKey0")]
public static extern Win32Error FwpmProviderSetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr key, SECURITY_INFORMATION securityInfo,
[In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl);
///
/// The FwpmProviderSubscribeChanges0 function is used to request the delivery of notifications regarding changes in a particular provider.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_SUBSCRIPTION0*
/// The notifications to be delivered.
///
///
/// Type: FWPM_PROVIDER_CHANGE_CALLBACK0
/// Function pointer that will be invoked when a notification is ready for delivery.
///
///
/// Type: void*
/// Optional context pointer. This pointer is passed to the callback function along with details of the change.
///
///
/// Type: HANDLE*
/// Handle to the newly created subscription.
///
///
/// Type: DWORD
///
///
/// 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// Subscribers do not receive notifications for changes made with the same session handle used to subscribe. This is because subscribers
/// only need to see changes made by others since they already know which changes they made themselves.
///
///
/// 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 provider's container and FWPM_ACTRL_READ access to the provider. The
/// subscriber will only get notifications for providers to which it has FWPM_ACTRL_READ access. See Access Control for more information.
///
///
/// FwpmProviderSubscribeChanges0 is a specific implementation of FwpmProviderSubscribeChanges. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidersubscribechanges0 DWORD FwpmProviderSubscribeChanges0(
// [in] HFWPENG engineHandle, [in, optional] const FWPM_PROVIDER_SUBSCRIPTION0 *subscription, [in] FWPM_PROVIDER_CHANGE_CALLBACK0
// callback, [in, optional] void *context, [out] HANDLE *changeHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderSubscribeChanges0")]
public static extern Win32Error FwpmProviderSubscribeChanges0([In] HFWPENG engineHandle, in FWPM_PROVIDER_SUBSCRIPTION0 subscription,
[In] FWPM_PROVIDER_CHANGE_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPMPROVSUB changeHandle);
///
/// The FwpmProviderSubscribeChanges0 function is used to request the delivery of notifications regarding changes in a particular provider.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_SUBSCRIPTION0*
/// The notifications to be delivered.
///
///
/// Type: FWPM_PROVIDER_CHANGE_CALLBACK0
/// Function pointer that will be invoked when a notification is ready for delivery.
///
///
/// Type: void*
/// Optional context pointer. This pointer is passed to the callback function along with details of the change.
///
///
/// Type: HANDLE*
/// Handle to the newly created subscription.
///
///
/// Type: DWORD
///
///
/// 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. See WFP Error Codes for details.
///
/// -
/// RPC_* error code 0x80010001—0x80010122
/// Failure to communicate with the remote or local firewall engine.
///
///
///
///
///
/// Subscribers do not receive notifications for changes made with the same session handle used to subscribe. This is because subscribers
/// only need to see changes made by others since they already know which changes they made themselves.
///
///
/// 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 provider's container and FWPM_ACTRL_READ access to the provider. The
/// subscriber will only get notifications for providers to which it has FWPM_ACTRL_READ access. See Access Control for more information.
///
///
/// FwpmProviderSubscribeChanges0 is a specific implementation of FwpmProviderSubscribeChanges. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidersubscribechanges0 DWORD FwpmProviderSubscribeChanges0(
// [in] HFWPENG engineHandle, [in, optional] const FWPM_PROVIDER_SUBSCRIPTION0 *subscription, [in] FWPM_PROVIDER_CHANGE_CALLBACK0
// callback, [in, optional] void *context, [out] HANDLE *changeHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderSubscribeChanges0")]
public static extern Win32Error FwpmProviderSubscribeChanges0([In] HFWPENG engineHandle, [In, Optional] IntPtr subscription,
[In] FWPM_PROVIDER_CHANGE_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPMPROVSUB changeHandle);
///
/// The FwpmProviderSubscriptionsGet0 function retrieves an array of all the current provider change notification subscriptions.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_SUBSCRIPTION0***
/// The current provider change notification subscriptions.
///
///
/// Type: UINT32*
/// Pointer to an UINT32 variable that will contain the number of entries returned.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscriptions were retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The returned array (but not the individual entries in the array) must be freed through a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider's container. See Access Control for more information.
///
/// FwpmProviderSubscriptionsGet0 is a specific implementation of FwpmProviderSubscriptionsGet. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidersubscriptionsget0 DWORD FwpmProviderSubscriptionsGet0(
// [in] HFWPENG engineHandle, [out] FWPM_PROVIDER_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderSubscriptionsGet0")]
public static extern Win32Error FwpmProviderSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries);
///
/// The FwpmProviderSubscriptionsGet0 function retrieves an array of all the current provider change notification subscriptions.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: FWPM_PROVIDER_SUBSCRIPTION0***
/// The current provider change notification subscriptions.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscriptions were retrieved successfully.
///
/// -
/// 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.
///
///
///
///
/// The returned array (but not the individual entries in the array) must be freed through a call to FwpmFreeMemory0.
/// The caller needs FWPM_ACTRL_READ access to the provider's container. See Access Control for more information.
///
/// FwpmProviderSubscriptionsGet0 is a specific implementation of FwpmProviderSubscriptionsGet. See WFP Version-Independent Names
/// and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmprovidersubscriptionsget0 DWORD FwpmProviderSubscriptionsGet0(
// [in] HFWPENG engineHandle, [out] FWPM_PROVIDER_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries );
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderSubscriptionsGet0")]
public static Win32Error FwpmProviderSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) =>
FwpmGenericGetSubs(FwpmProviderSubscriptionsGet0, engineHandle, out entries);
///
/// The FwpmProviderUnsubscribeChanges0 function is used to cancel a provider change subscription and stop receiving change notifications.
///
///
/// Type: HANDLE
/// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine.
///
///
/// Type: HANDLE
/// Handle of the subscribed change notification. This is the handle returned by the call to FwpmProviderSubscribeChanges0.
///
///
/// Type: DWORD
///
///
/// Return code/value
/// Description
///
/// -
/// ERROR_SUCCESS 0
/// The subscription was deleted successfully.
///
/// -
/// 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.
///
///
///
///
///
/// If the callback is currently being invoked, this function will not return until it completes. Thus, when calling this function, you
/// must not hold any locks that the callback may also try to acquire lest you deadlock.
///
///
/// It is not necessary to unsubscribe before closing a session; all subscriptions are automatically canceled when the subscribing
/// session terminates.
///
///
/// 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.
///
///
/// FwpmProviderUnsubscribeChanges0 is a specific implementation of FwpmProviderUnsubscribeChanges. See WFP Version-Independent
/// Names and Targeting Specific Versions of Windows for more information.
///
///
// https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmproviderunsubscribechanges0 DWORD
// FwpmProviderUnsubscribeChanges0( [in] HFWPENG engineHandle, [in] HANDLE changeHandle );
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmProviderUnsubscribeChanges0")]
public static extern Win32Error FwpmProviderUnsubscribeChanges0([In] HFWPENG engineHandle, [In] HFWPMPROVSUB changeHandle);
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
private static extern Win32Error FwpmProviderContextGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmMem providerContext);
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
private static extern Win32Error FwpmProviderContextGetById1([In] HFWPENG engineHandle, ulong id, out SafeFwpmMem providerContext);
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
private static extern Win32Error FwpmProviderContextGetById2([In] HFWPENG engineHandle, ulong id, out SafeFwpmMem providerContext);
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
private static extern Win32Error FwpmProviderContextGetByKey0([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmMem providerContext);
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
private static extern Win32Error FwpmProviderContextGetByKey1([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmMem providerContext);
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
private static extern Win32Error FwpmProviderContextGetByKey2([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmMem providerContext);
[DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)]
private static extern Win32Error FwpmProviderGetByKey0([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmMem provider);
}