using static Vanara.PInvoke.Rpc; namespace Vanara.PInvoke; public static partial class FwpUClnt { /// The FwpmCalloutAdd0 function adds a new callout object 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_CALLOUT0* /// The callout object to be added. /// /// /// Type: PSECURITY_DESCRIPTOR /// The security information associated with the callout. /// /// /// Type: UINT32* /// Runtime identifier for this callout. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The callout was successfully added. /// /// /// FWP_E_INVALID_PARAMETER 0x80320035 /// FWPM_TUNNEL_FLAG_POINT_TO_POINT was not set and conditions other than local/remote address were specified. /// /// /// 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_CALLOUT0 structure are assigned by the system, not the caller, and are ignored in the call to /// FwpmCalloutAdd0. 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 callout's container, FWPM_ACTRL_ADD_LINK access to the provider (if any), and /// FWPM_ACTRL_ADD_LINK access to the applicable layer. See Access Control for more information. /// /// To add a filter that references a callout, invoke the functions in the following order. /// /// /// Call FwpsCalloutRegister (documented in the Windows Driver Kit (WDK)), to register the callout with the filter engine. /// /// /// Call FwpmCalloutAdd0 to add the callout to the system. /// /// /// Call FwpmFilterAdd0 to add the filter that references the callout to the system. /// /// /// /// By default filters that reference callouts that have been added but have not yet registered with the filter engine are treated as /// Block filters. /// /// /// FwpmCalloutAdd0 is a specific implementation of FwpmCalloutAdd. 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-fwpmcalloutadd0 DWORD FwpmCalloutAdd0( [in] HFWPENG engineHandle, // [in] const FWPM_CALLOUT0 *callout, [in, optional] PSECURITY_DESCRIPTOR sd, [out, optional] UINT32 *id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutAdd0")] public static extern Win32Error FwpmCalloutAdd0([In] HFWPENG engineHandle, in FWPM_CALLOUT0 callout, [In, Optional] PSECURITY_DESCRIPTOR sd, out uint id); /// The FwpmCalloutCreateEnumHandle0 function creates a handle used to enumerate a set of callout objects. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_CALLOUT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Handle of the newly created 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 callout objects are returned. /// /// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to /// FwpmCalloutCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call /// FwpmCalloutCreateEnumHandle0 and FwpmCalloutEnum0 from within the same explicit transaction. /// /// The caller must call FwpmCalloutDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_ENUM access to the callouts' containers and FWPM_ACTRL_READ access to the callouts. Only callouts /// to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information. /// /// /// FwpmCalloutCreateEnumHandle0 is a specific implementation of FwpmCalloutCreateEnumHandle. 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-fwpmcalloutcreateenumhandle0 DWORD FwpmCalloutCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_CALLOUT_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutCreateEnumHandle0")] public static extern Win32Error FwpmCalloutCreateEnumHandle0([In] HFWPENG engineHandle, in FWPM_CALLOUT_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// The FwpmCalloutCreateEnumHandle0 function creates a handle used to enumerate a set of callout objects. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_CALLOUT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Handle of the newly created 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 callout objects are returned. /// /// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to /// FwpmCalloutCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call /// FwpmCalloutCreateEnumHandle0 and FwpmCalloutEnum0 from within the same explicit transaction. /// /// The caller must call FwpmCalloutDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_ENUM access to the callouts' containers and FWPM_ACTRL_READ access to the callouts. Only callouts /// to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information. /// /// /// FwpmCalloutCreateEnumHandle0 is a specific implementation of FwpmCalloutCreateEnumHandle. 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-fwpmcalloutcreateenumhandle0 DWORD FwpmCalloutCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_CALLOUT_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutCreateEnumHandle0")] public static extern Win32Error FwpmCalloutCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// The FwpmCalloutDeleteById0 function removes a callout object 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: UINT32 /// /// The runtime identifier for the callout being removed from the system. This identifier was received from the system when the /// application called FwpmCalloutAdd0 for this object. /// /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The callout 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. /// /// /// /// /// /// An applications's callouts cannot be removed from the system as long as there are filters in the system that specify the callouts for /// an action. /// /// /// 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 callout. See Access Control for more information. /// /// FwpmCalloutDeleteById0 is a specific implementation of FwpmCalloutDeleteById. 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-fwpmcalloutdeletebyid0 DWORD FwpmCalloutDeleteById0( [in] HANDLE // engineHandle, [in] UINT32 id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutDeleteById0")] public static extern Win32Error FwpmCalloutDeleteById0([In] HFWPENG engineHandle, uint id); /// The FwpmCalloutDeleteByKey0 function removes a callout object 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 callout being removed from the system. This GUID was specified in the calloutKey member of the /// callout parameter when the application called FwpmCalloutAdd0 for this object. /// /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The callout 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. /// /// /// /// /// /// An applications's callouts cannot be removed from the system as long as there are filters in the system that specify the callouts for /// an action. /// /// /// 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 callout. See Access Control for more information. /// /// FwpmCalloutDeleteByKey0 is a specific implementation of FwpmCalloutDeleteByKey. 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-fwpmcalloutdeletebykey0 DWORD FwpmCalloutDeleteByKey0( [in] HANDLE // engineHandle, [in] const GUID *key ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutDeleteByKey0")] public static extern Win32Error FwpmCalloutDeleteByKey0([In] HFWPENG engineHandle, in Guid key); /// The FwpmCalloutDestroyEnumHandle0 function frees a handle returned by FwpmCalloutCreateEnumHandle0. /// /// 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 callout enumeration created by a call to FwpmCalloutCreateEnumHandle0. /// /// /// 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. /// /// /// /// /// FwpmCalloutDestroyEnumHandle0 is a specific implementation of FwpmCalloutDestroyEnumHandle. 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-fwpmcalloutdestroyenumhandle0 DWORD FwpmCalloutDestroyEnumHandle0( // [in] HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutDestroyEnumHandle0")] public static extern Win32Error FwpmCalloutDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// The FwpmCalloutEnum0 function returns the next page of results from the callout 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 callout enumeration created by a call to FwpmCalloutCreateEnumHandle0. /// /// /// Type: UINT32 /// The number of callout objects requested. /// /// /// Type: FWP_CALLOUT0*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of callouts returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The callouts 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. /// FwpmCalloutEnum0 works on a snapshot of the callouts taken at the time the enumeration handle was created. /// /// FwpmCalloutEnum0 is a specific implementation of FwpmCalloutEnum. 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-fwpmcalloutenum0 DWORD FwpmCalloutEnum0( [in] HFWPENG engineHandle, // [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_CALLOUT0 ***entries, [out] UINT32 *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutEnum0")] public static extern Win32Error FwpmCalloutEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// The FwpmCalloutEnum0 function returns the next page of results from the callout enumerator. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWP_CALLOUT0*** /// Addresses of the enumeration entries. /// /// /// Type: FWPM_CALLOUT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The callouts 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 callout objects are returned. /// FwpmCalloutEnum0 works on a snapshot of the callouts taken at the time the enumeration handle was created. /// /// FwpmCalloutEnum0 is a specific implementation of FwpmCalloutEnum. See WFP Version-Independent Names and Targeting Specific /// Versions of Windows for more information. /// /// [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutEnum0")] public static Win32Error FwpmCalloutEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_CALLOUT_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmCalloutCreateEnumHandle0, FwpmCalloutEnum0, FwpmCalloutDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// The FwpmCalloutGetById0 function retrieves a callout object. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT32 /// /// The runtime identifier for the callout. This identifier was received from the system when the application called FwpmCalloutAdd0 for /// this object. /// /// /// /// Type: FWPM_CALLOUT0** /// Information about the state associated with the callout. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The callout 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 callout. See Access Control for more information. /// /// FwpmCalloutGetById0 is a specific implementation of FwpmCalloutGetById. 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-fwpmcalloutgetbyid0 DWORD FwpmCalloutGetById0( [in] HANDLE // engineHandle, [in] UINT32 id, [out] FWPM_CALLOUT0 **callout ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutGetById0")] public static Win32Error FwpmCalloutGetById0([In] HFWPENG engineHandle, uint id, out SafeFwpmStruct callout) => FwpmGenericGetById(FwpmCalloutGetById0, engineHandle, id, out callout); /// The FwpmCalloutGetByKey0 function retrieves a callout 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 callout. This GUID was specified in the calloutKey member of the callout parameter when the /// application called FwpmCalloutAdd0 for this object. /// /// /// /// Type: FWPM_CALLOUT0** /// Information about the state associated with the callout. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The callout 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 callout. See Access Control for more information. /// /// FwpmCalloutGetByKey0 is a specific implementation of FwpmCalloutGetByKey. 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-fwpmcalloutgetbykey0 DWORD FwpmCalloutGetByKey0( [in] HANDLE // engineHandle, [in] const GUID *key, [out] FWPM_CALLOUT0 **callout ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutGetByKey0")] public static Win32Error FwpmCalloutGetByKey0([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmStruct callout) => FwpmGenericGetByKey(FwpmCalloutGetByKey0, engineHandle, key, out callout); /// The FwpmCalloutGetSecurityInfoByKey0 function retrieves a copy of the security descriptor for a callout 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* /// /// Pointer to a GUID that uniquely identifies the callout. This GUID was specified in the calloutKey member of the callout /// parameter when the application called FwpmCalloutAdd0 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 /// callouts 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. /// /// /// FwpmCalloutGetSecurityInfoByKey0 is a specific implementation of FwpmCalloutGetSecurityInfoByKey. 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-fwpmcalloutgetsecurityinfobykey0 DWORD // FwpmCalloutGetSecurityInfoByKey0( [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.FwpmCalloutGetSecurityInfoByKey0")] public static extern Win32Error FwpmCalloutGetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, [In] SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// /// The FwpmCalloutSetSecurityInfoByKey0 function sets specified security information in the security descriptor of a callout 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* /// /// Pointer to a GUID that uniquely identifies the callout. This GUID was specified in the calloutKey member of the callout /// parameter when the application called FwpmCalloutAdd0 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 /// callouts 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. /// /// /// FwpmCalloutSetSecurityInfoByKey0 is a specific implementation of FwpmCalloutSetSecurityInfoByKey. 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-fwpmcalloutsetsecurityinfobykey0 DWORD // FwpmCalloutSetSecurityInfoByKey0( [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.FwpmCalloutSetSecurityInfoByKey0")] public static extern Win32Error FwpmCalloutSetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, [In] SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// /// The FwpmCalloutSubscribeChanges0 function is used to request the delivery of notifications regarding changes in a particular callout. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_CALLOUT_SUBSCRIPTION0* /// The notifications which will be delivered. /// /// /// Type: FWPM_CALLOUT_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 callout's container and FWPM_ACTRL_READ access to the callout. The /// subscriber will only get notifications for callouts to which it has FWPM_ACTRL_READ access. See Access Control for more information. /// /// /// FwpmCalloutSubscribeChanges0 is a specific implementation of FwpmCalloutSubscribeChanges. 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-fwpmcalloutsubscribechanges0 DWORD FwpmCalloutSubscribeChanges0( // [in] HFWPENG engineHandle, [in] const FWPM_CALLOUT_SUBSCRIPTION0 *subscription, [in] FWPM_CALLOUT_CHANGE_CALLBACK0 callback, [in, // optional] void *context, [out] HANDLE *changeHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutSubscribeChanges0")] public static extern Win32Error FwpmCalloutSubscribeChanges0([In] HFWPENG engineHandle, in FWPM_CALLOUT_SUBSCRIPTION0 subscription, [In] FWPM_CALLOUT_CHANGE_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPCALLOUTCHANGE changeHandle); /// The FwpmCalloutSubscriptionsGet0 function retrieves an array of all the current callout 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_CALLOUT_SUBSCRIPTION0*** /// Addresses of the current callout 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 callout's container. See Access Control for more information. /// /// FwpmCalloutSubscriptionsGet0 is a specific implementation of FwpmCalloutSubscriptionsGet. 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-fwpmcalloutsubscriptionsget0 DWORD FwpmCalloutSubscriptionsGet0( // [in] HFWPENG engineHandle, [out] FWPM_CALLOUT_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutSubscriptionsGet0")] public static extern Win32Error FwpmCalloutSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries); /// The FwpmCalloutSubscriptionsGet0 function retrieves an array of all the current callout 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_CALLOUT_SUBSCRIPTION0*** /// Addresses of the current callout 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 caller needs FWPM_ACTRL_READ access to the callout's container. See Access Control for more information. /// /// FwpmCalloutSubscriptionsGet0 is a specific implementation of FwpmCalloutSubscriptionsGet. See WFP Version-Independent Names /// and Targeting Specific Versions of Windows for more information. /// /// [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutSubscriptionsGet0")] public static Win32Error FwpmCalloutSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) => FwpmGenericGetSubs(FwpmCalloutSubscriptionsGet0, engineHandle, out entries); /// /// The FwpmCalloutUnsubscribeChanges0 function is used to cancel a callout 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 FwpmCalloutSubscribeChanges0. /// /// /// 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 the callback 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. /// /// /// FwpmCalloutUnsubscribeChanges0 is a specific implementation of FwpmCalloutUnsubscribeChanges. 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-fwpmcalloutunsubscribechanges0 DWORD FwpmCalloutUnsubscribeChanges0( // [in] HFWPENG engineHandle, [in] HANDLE changeHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmCalloutUnsubscribeChanges0")] public static extern Win32Error FwpmCalloutUnsubscribeChanges0([In] HFWPENG engineHandle, [In] HFWPCALLOUTCHANGE changeHandle); /// The FwpmConnectionCreateEnumHandle0 function creates a handle used to enumerate a set of connection objects. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_CONNECTION_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle for the 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 connection objects are returned. /// The caller must free the returned handle by a call to FwpmConnectionDestroyEnumHandle0. /// /// The caller needs FWPM_ACTRL_ENUM access to the connection objects' containers and FWPM_ACTRL_READ access to the connection /// objects. See Access Control for more information. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectioncreateenumhandle0 DWORD // FwpmConnectionCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const FWPM_CONNECTION_ENUM_TEMPLATE0 *enumTemplate, [out] // HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionCreateEnumHandle0")] public static extern Win32Error FwpmConnectionCreateEnumHandle0([In] HFWPENG engineHandle, in FWPM_CONNECTION_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// The FwpmConnectionCreateEnumHandle0 function creates a handle used to enumerate a set of connection objects. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_CONNECTION_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle for the 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 connection objects are returned. /// The caller must free the returned handle by a call to FwpmConnectionDestroyEnumHandle0. /// /// The caller needs FWPM_ACTRL_ENUM access to the connection objects' containers and FWPM_ACTRL_READ access to the connection /// objects. See Access Control for more information. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectioncreateenumhandle0 DWORD // FwpmConnectionCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const FWPM_CONNECTION_ENUM_TEMPLATE0 *enumTemplate, [out] // HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionCreateEnumHandle0")] public static extern Win32Error FwpmConnectionCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// The FwpmConnectionDestroyEnumHandle0 function frees a handle returned by FwpmConnectionCreateEnumHandle0. /// /// 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 connection object 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. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectiondestroyenumhandle0 DWORD // FwpmConnectionDestroyEnumHandle0( [in] HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionDestroyEnumHandle0")] public static extern Win32Error FwpmConnectionDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// The FwpmConnectionEnum0 function returns the next page of results from the connection object 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 context enumeration created by a call to FwpmConnectionCreateEnumHandle0. /// /// /// Type: UINT32 /// Number of connection objects requested. /// /// /// Type: FWPM_CONNECTION0*** /// Addresses of enumeration entries. /// /// Type: UINT32* /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The connection objects 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. /// FwpmConnectionEnum0 works on a snapshot of the connection objects taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectionenum0 DWORD FwpmConnectionEnum0( [in] HANDLE // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_CONNECTION0 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionEnum0")] public static extern Win32Error FwpmConnectionEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// The FwpmConnectionEnum0 function returns the next page of results from the connection object enumerator. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_CONNECTION0*** /// Addresses of enumeration entries. /// /// /// Type: FWPM_CONNECTION_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The connection objects 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 connection objects are returned. /// FwpmConnectionEnum0 works on a snapshot of the connection objects taken at the time the enumeration handle was created. /// [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionEnum0")] public static Win32Error FwpmConnectionEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_CONNECTION_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmConnectionCreateEnumHandle0, FwpmConnectionEnum0, FwpmConnectionDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// The FwpmConnectionGetById0 function retrieves a connection object. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// The run-time identifier for the connection. /// /// /// Type: FWPM_CONNECTION0** /// The connection information. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The connection object 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-fwpmconnectiongetbyid0 DWORD FwpmConnectionGetById0( [in] HANDLE // engineHandle, [in] UINT64 id, [out] FWPM_CONNECTION0 **connection ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionGetById0")] public static Win32Error FwpmConnectionGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmStruct connection) => FwpmGenericGetById(FwpmConnectionGetById0, engineHandle, id, out connection); /// /// The FwpmConnectionGetSecurityInfo0 function retrieves a copy of the security descriptor for a connection object change event. /// /// /// 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: 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 successfully retrieved. /// /// /// 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 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. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectiongetsecurityinfo0 DWORD FwpmConnectionGetSecurityInfo0( // [in] HFWPENG engineHandle, [in] SECURITY_INFORMATION securityInfo, [out] PSID *sidOwner, [out] PSID *sidGroup, [out] PACL *dacl, [out] // PACL *sacl, [out] PSECURITY_DESCRIPTOR *securityDescriptor ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionGetSecurityInfo0")] public static extern Win32Error FwpmConnectionGetSecurityInfo0([In] HFWPENG engineHandle, [In] SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// /// The FwpmConnectionSetSecurityInfo0 function sets specified security information in the security descriptor for a connection /// object change event. /// /// /// Type: HANDLE /// A handle to 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 information was successfully set. /// /// /// 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. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectionsetsecurityinfo0 DWORD FwpmConnectionSetSecurityInfo0( // [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.FwpmConnectionSetSecurityInfo0")] public static extern Win32Error FwpmConnectionSetSecurityInfo0([In] HFWPENG engineHandle, [In] SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// /// The FwpmConnectionSubscribe0 function is used to request the delivery of notifications about changes to a connection object. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_CONNECTION_SUBSCRIPTION0* /// The notifications which will be delivered. /// /// /// Type: FWPM_CONNECTION_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 connection object's container. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectionsubscribe0 DWORD FwpmConnectionSubscribe0( [in] HANDLE // engineHandle, [in] const FWPM_CONNECTION_SUBSCRIPTION0 *subscription, [in] FWPM_CONNECTION_CALLBACK0 callback, [in, optional] void // *context, [out] HANDLE *eventsHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionSubscribe0")] public static extern Win32Error FwpmConnectionSubscribe0([In] HFWPENG engineHandle, in FWPM_CONNECTION_SUBSCRIPTION0 subscription, [In] FWPM_CONNECTION_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPCONNEVENT eventsHandle); /// /// The FwpmConnectionSubscriptionsGet0 function retrieves an array of all the current connection object 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_CONNECTION_SUBSCRIPTION0*** /// The current connection object 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. // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectionsubscriptionsget0 DWORD // FwpmConnectionSubscriptionsGet0( [in] HFWPENG engineHandle, [out] FWPM_CONNECTION_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionSubscriptionsGet0")] public static extern Win32Error FwpmConnectionSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries); /// /// The FwpmConnectionSubscriptionsGet0 function retrieves an array of all the current connection object 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_CONNECTION_SUBSCRIPTION0*** /// The current connection object 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. // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectionsubscriptionsget0 DWORD // FwpmConnectionSubscriptionsGet0( [in] HFWPENG engineHandle, [out] FWPM_CONNECTION_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionSubscriptionsGet0")] public static Win32Error FwpmConnectionSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) => FwpmGenericGetSubs(FwpmConnectionSubscriptionsGet0, engineHandle, out entries); /// /// The FwpmConnectionUnsubscribe0 function is used to cancel a connection object change 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 FwpmConnectionSubscribe0. /// 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. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmconnectionunsubscribe0 DWORD FwpmConnectionUnsubscribe0( [in] // HFWPENG engineHandle, [in, out] HANDLE eventsHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmConnectionUnsubscribe0")] public static extern Win32Error FwpmConnectionUnsubscribe0([In] HFWPENG engineHandle, [In, Out] HFWPCONNEVENT eventsHandle); /// The FwpmEngineClose0 function closes a session to a filter engine. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The session was closed 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. /// /// /// /// /// /// After an application has completed adding or removing system objects, it may call the FwpmEngineClose0 function to close the /// open session to the filter engine. /// /// A filter engine session is also closed when a client process terminates. /// If this function is called with a transaction in progress, the transaction will be aborted. /// /// FwpmEngineClose0 is a specific implementation of FwpmEngineClose. 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-fwpmengineclose0 DWORD FwpmEngineClose0( [in] HFWPENG engineHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmEngineClose0")] public static extern Win32Error FwpmEngineClose0([In] HFWPENG engineHandle); /// The FwpmEngineOpen0 function opens a session to the filter engine. /// /// Type: const wchar_t* /// This value must be NULL. /// /// /// Type: UINT32 /// Specifies the authentication service to use. Allowed services are RPC_C_AUTHN_WINNT and RPC_C_AUTHN_DEFAULT. /// /// /// Type: SEC_WINNT_AUTH_IDENTITY_W* /// /// The authentication and authorization credentials for accessing the filter engine. This pointer is optional and can be NULL. If /// this pointer is NULL, the calling thread's credentials are used. /// /// /// /// Type: FWPM_SESSION0* /// Session-specific parameters for the session being opened. This pointer is optional and can be NULL. /// /// /// Type: HANDLE* /// Handle for the open session to the filter engine. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The session was started successfully. /// /// /// FWP_E_ALREADY_EXISTS 0x80320009 /// A session with the specified sessionKey is already opened. /// /// /// 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. /// /// /// /// /// /// A user application must call FwpmEngineOpen0 to obtain a handle for open session to the filter engine before adding or /// removing any filter objects. A handle for an open session to the filter engine is also required for most of the other Windows /// Filtering Platform management functions. /// /// The session is automatically closed when the program ends. To explicitly close a session, call FwpmEngineClose0. /// /// If session. flags is set to FWPM_SESSION_FLAG_DYNAMIC, any WFP objects added during the session are /// automatically deleted when the session ends. If the session is not dynamic, the caller needs to explicitly delete all WFP objects /// added during the session. /// /// The caller needs FWPM_ACTRL_OPEN access to the filter engine. See Access Control for more information. /// FwpmEngineOpen0 is intended for use in non-impersonated mode only. /// /// FwpmEngineOpen0 is a specific implementation of FwpmEngineOpen. See WFP Version-Independent Names and Targeting Specific /// Versions of Windows for more information. /// /// Examples /// The following C++ example uses FwpmEngineOpen0 to open a filter session. /// /// // Open a session to the filter engine HFWPENG engineHandle = NULL; DWORD result = ERROR_SUCCESS; printf("Opening the filter engine.\n"); result = FwpmEngineOpen0( NULL, RPC_C_AUTHN_WINNT, NULL, NULL, &engineHandle ); if (result != ERROR_SUCCESS) printf("FwpmEngineOpen0 failed. Return value: %d.\n", result); else printf("Filter engine opened successfully.\n"); /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmengineopen0 DWORD FwpmEngineOpen0( [in, optional] const wchar_t // *serverName, [in] UINT32 authnService, [in, optional] SEC_WINNT_AUTH_IDENTITY_W *authIdentity, [in, optional] const FWPM_SESSION0 // *session, [out] HANDLE *engineHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmEngineOpen0")] public static extern Win32Error FwpmEngineOpen0([Optional] string serverName, RPC_C_AUTHN authnService, in SEC_WINNT_AUTH_IDENTITY authIdentity, in FWPM_SESSION0 session, out SafeHFWPENG engineHandle); /// The FwpmEngineOpen0 function opens a session to the filter engine. /// /// Type: const wchar_t* /// This value must be NULL. /// /// /// Type: UINT32 /// Specifies the authentication service to use. Allowed services are RPC_C_AUTHN_WINNT and RPC_C_AUTHN_DEFAULT. /// /// /// Type: SEC_WINNT_AUTH_IDENTITY_W* /// /// The authentication and authorization credentials for accessing the filter engine. This pointer is optional and can be NULL. If /// this pointer is NULL, the calling thread's credentials are used. /// /// /// /// Type: FWPM_SESSION0* /// Session-specific parameters for the session being opened. This pointer is optional and can be NULL. /// /// /// Type: HANDLE* /// Handle for the open session to the filter engine. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The session was started successfully. /// /// /// FWP_E_ALREADY_EXISTS 0x80320009 /// A session with the specified sessionKey is already opened. /// /// /// 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. /// /// /// /// /// /// A user application must call FwpmEngineOpen0 to obtain a handle for open session to the filter engine before adding or /// removing any filter objects. A handle for an open session to the filter engine is also required for most of the other Windows /// Filtering Platform management functions. /// /// The session is automatically closed when the program ends. To explicitly close a session, call FwpmEngineClose0. /// /// If session. flags is set to FWPM_SESSION_FLAG_DYNAMIC, any WFP objects added during the session are /// automatically deleted when the session ends. If the session is not dynamic, the caller needs to explicitly delete all WFP objects /// added during the session. /// /// The caller needs FWPM_ACTRL_OPEN access to the filter engine. See Access Control for more information. /// FwpmEngineOpen0 is intended for use in non-impersonated mode only. /// /// FwpmEngineOpen0 is a specific implementation of FwpmEngineOpen. See WFP Version-Independent Names and Targeting Specific /// Versions of Windows for more information. /// /// Examples /// The following C++ example uses FwpmEngineOpen0 to open a filter session. /// /// // Open a session to the filter engine HFWPENG engineHandle = NULL; DWORD result = ERROR_SUCCESS; printf("Opening the filter engine.\n"); result = FwpmEngineOpen0( NULL, RPC_C_AUTHN_WINNT, NULL, NULL, &engineHandle ); if (result != ERROR_SUCCESS) printf("FwpmEngineOpen0 failed. Return value: %d.\n", result); else printf("Filter engine opened successfully.\n"); /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmengineopen0 DWORD FwpmEngineOpen0( [in, optional] const wchar_t // *serverName, [in] UINT32 authnService, [in, optional] SEC_WINNT_AUTH_IDENTITY_W *authIdentity, [in, optional] const FWPM_SESSION0 // *session, [out] HANDLE *engineHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmEngineOpen0")] public static extern Win32Error FwpmEngineOpen0([Optional] string serverName, RPC_C_AUTHN authnService, [In, Optional] IntPtr authIdentity, [In, Optional] IntPtr session, out SafeHFWPENG engineHandle); /// /// The FwpmFreeMemory0 function is used to release memory resources allocated by the Windows Filtering Platform (WFP) functions. /// /// /// Type: void** /// Address of the pointer to be freed. /// /// None /// /// FwpmFreeMemory0 is used to free memory returned by the various Fwpm* functions, such as FwpmFilterGetByKey0. /// /// Fwpm* functions that return a HANDLE, such as FwpmCalloutCreateEnumHandle0, have specific functions to release memory. /// /// If the caller passes a pointer that is not valid, the behavior is undefined. /// /// FwpmFreeMemory0 is a specific implementation of FwpmFreeMemory. 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-fwpmfreememory0 void FwpmFreeMemory0( [in, out] void **p ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmFreeMemory0")] public static extern void FwpmFreeMemory0(ref IntPtr p); /// /// The FwpmIPsecTunnelAdd0 function adds a new Internet Protocol Security (IPsec) tunnel mode policy to the system. /// /// NoteFwpmIPsecTunnelAdd0 is the specific implementation of FwpmIPsecTunnelAdd used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmIPsecTunnelAdd1 is /// available. For Windows 8, FwpmIPsecTunnelAdd2 is available. /// /// /// /// Type: HANDLE /// A handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT32 /// Possible values: /// /// /// IPsec tunnel flag /// Meaning /// /// /// FWPM_TUNNEL_FLAG_POINT_TO_POINT /// Adds a point-to-point tunnel to the system. /// /// /// /// /// Type: FWPM_PROVIDER_CONTEXT0* /// The Main Mode policy for the IPsec tunnel. /// /// /// Type: FWPM_PROVIDER_CONTEXT0* /// The Quick Mode policy for the IPsec tunnel. /// /// /// Type: UINT32 /// Number of filter conditions present in the filterConditions parameter. /// /// /// Type: FWPM_FILTER_CONDITION0* /// Array of filter conditions that describe the traffic which should be tunneled by IPsec. /// /// /// Type: PSECURITY_DESCRIPTOR /// The security information associated with the IPsec tunnel. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec tunnel mode policy was successfully added. /// /// /// FWP_E_INVALID_PARAMETER 0x80320035 /// FWPM_TUNNEL_FLAG_POINT_TO_POINT was not set and conditions other than local/remote address were specified. /// /// /// 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. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmipsectunneladd0 DWORD FwpmIPsecTunnelAdd0( [in] HANDLE // engineHandle, [in] UINT32 flags, [in, optional] const FWPM_PROVIDER_CONTEXT0 *mainModePolicy, [in] const FWPM_PROVIDER_CONTEXT0 // *tunnelPolicy, [in] UINT32 numFilterConditions, [in] const FWPM_FILTER_CONDITION0 *filterConditions, [in, optional] // PSECURITY_DESCRIPTOR sd ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmIPsecTunnelAdd0")] public static extern Win32Error FwpmIPsecTunnelAdd0([In] HFWPENG engineHandle, FWPM_TUNNEL_FLAG flags, in FWPM_PROVIDER_CONTEXT0 mainModePolicy, in FWPM_PROVIDER_CONTEXT0 tunnelPolicy, uint numFilterConditions, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] FWPM_FILTER_CONDITION0[] filterConditions, [In, Optional] PSECURITY_DESCRIPTOR sd); /// /// The FwpmIPsecTunnelAdd0 function adds a new Internet Protocol Security (IPsec) tunnel mode policy to the system. /// /// NoteFwpmIPsecTunnelAdd0 is the specific implementation of FwpmIPsecTunnelAdd used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmIPsecTunnelAdd1 is /// available. For Windows 8, FwpmIPsecTunnelAdd2 is available. /// /// /// /// Type: HANDLE /// A handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT32 /// Possible values: /// /// /// IPsec tunnel flag /// Meaning /// /// /// FWPM_TUNNEL_FLAG_POINT_TO_POINT /// Adds a point-to-point tunnel to the system. /// /// /// /// /// Type: FWPM_PROVIDER_CONTEXT0* /// The Main Mode policy for the IPsec tunnel. /// /// /// Type: FWPM_PROVIDER_CONTEXT0* /// The Quick Mode policy for the IPsec tunnel. /// /// /// Type: UINT32 /// Number of filter conditions present in the filterConditions parameter. /// /// /// Type: FWPM_FILTER_CONDITION0* /// Array of filter conditions that describe the traffic which should be tunneled by IPsec. /// /// /// Type: PSECURITY_DESCRIPTOR /// The security information associated with the IPsec tunnel. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec tunnel mode policy was successfully added. /// /// /// FWP_E_INVALID_PARAMETER 0x80320035 /// FWPM_TUNNEL_FLAG_POINT_TO_POINT was not set and conditions other than local/remote address were specified. /// /// /// 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. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmipsectunneladd0 DWORD FwpmIPsecTunnelAdd0( [in] HANDLE // engineHandle, [in] UINT32 flags, [in, optional] const FWPM_PROVIDER_CONTEXT0 *mainModePolicy, [in] const FWPM_PROVIDER_CONTEXT0 // *tunnelPolicy, [in] UINT32 numFilterConditions, [in] const FWPM_FILTER_CONDITION0 *filterConditions, [in, optional] // PSECURITY_DESCRIPTOR sd ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmIPsecTunnelAdd0")] public static extern Win32Error FwpmIPsecTunnelAdd0([In] HFWPENG engineHandle, FWPM_TUNNEL_FLAG flags, [In, Optional] IntPtr mainModePolicy, in FWPM_PROVIDER_CONTEXT0 tunnelPolicy, uint numFilterConditions, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] FWPM_FILTER_CONDITION0[] filterConditions, [In, Optional] PSECURITY_DESCRIPTOR sd); /// The FwpmNetEventCreateEnumHandle0 function creates a handle used to enumerate a set of network events. /// /// 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_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// The handle for network event 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 network event objects are returned. /// The caller must call FwpmNetEventDestroyEnumHandle0 to free the returned handle. /// /// 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_ENUM access to the events' containers. See Access Control for more information. /// /// FwpmNetEventCreateEnumHandle0 is a specific implementation of FwpmNetEventCreateEnumHandle. 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-fwpmneteventcreateenumhandle0 DWORD FwpmNetEventCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_NET_EVENT_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventCreateEnumHandle0")] public static extern Win32Error FwpmNetEventCreateEnumHandle0([In] HFWPENG engineHandle, in FWPM_NET_EVENT_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// The FwpmNetEventCreateEnumHandle0 function creates a handle used to enumerate a set of network events. /// /// 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_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// The handle for network event 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 network event objects are returned. /// The caller must call FwpmNetEventDestroyEnumHandle0 to free the returned handle. /// /// 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_ENUM access to the events' containers. See Access Control for more information. /// /// FwpmNetEventCreateEnumHandle0 is a specific implementation of FwpmNetEventCreateEnumHandle. 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-fwpmneteventcreateenumhandle0 DWORD FwpmNetEventCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_NET_EVENT_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventCreateEnumHandle0")] public static extern Win32Error FwpmNetEventCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// The FwpmNetEventDestroyEnumHandle0 function frees a handle returned by FwpmNetEventCreateEnumHandle0. /// /// 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 network event enumeration created by a call to FwpmNetEventCreateEnumHandle0. /// /// /// 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. /// /// /// /// /// FwpmNetEventDestroyEnumHandle0 is a specific implementation of FwpmNetEventDestroyEnumHandle. 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-fwpmneteventdestroyenumhandle0 DWORD FwpmNetEventDestroyEnumHandle0( // [in] HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventDestroyEnumHandle0")] public static extern Win32Error FwpmNetEventDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// /// The FwpmNetEventEnum0 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum0 is the specific implementation of FwpmNetEventEnum used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmNetEventEnum1 is /// available. For Windows 8, FwpmNetEventEnum2 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 network event enumeration created by a call to FwpmNetEventCreateEnumHandle0. /// /// /// Type: UINT32 /// The number of enumeration entries requested. /// /// /// Type: FWPM_NET_EVENT0*** /// Addresses of enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 that uses the same enumHandle parameter will return the next set of events following those in the current /// entries buffer. /// /// /// FwpmNetEventEnum0 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventenum0 DWORD FwpmNetEventEnum0( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_NET_EVENT0 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum0")] public static extern Win32Error FwpmNetEventEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The FwpmNetEventEnum0 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum0 is the specific implementation of FwpmNetEventEnum used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmNetEventEnum1 is /// available. For Windows 8, FwpmNetEventEnum2 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_EVENT0*** /// Addresses of enumeration entries. /// /// /// Type: FWPM_NET_EVENT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 network event objects are returned. /// /// FwpmNetEventEnum0 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum0")] public static Win32Error FwpmNetEventEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_NET_EVENT_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmNetEventCreateEnumHandle0, FwpmNetEventEnum0, FwpmNetEventDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The FwpmNetEventEnum1 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum1 is the specific implementation of FwpmNetEventEnum used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 8, FwpmNetEventEnum2 is /// available. For Windows Vista, FwpmNetEventEnum0 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 network event enumeration created by a call to FwpmNetEventCreateEnumHandle0. /// /// /// Type: UINT32 /// The nmber of enumeration entries requested. /// /// /// Type: FWPM_NET_EVENT1*** /// Addresses of enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 that uses the same enumHandle parameter will return the next set of events following those in the current /// entries buffer. /// /// /// FwpmNetEventEnum1 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventenum1 DWORD FwpmNetEventEnum1( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_NET_EVENT1 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum1")] public static extern Win32Error FwpmNetEventEnum1([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The FwpmNetEventEnum1 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum1 is the specific implementation of FwpmNetEventEnum used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 8, FwpmNetEventEnum2 is /// available. For Windows Vista, FwpmNetEventEnum0 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_EVENT1*** /// Addresses of enumeration entries. /// /// /// Type: FWPM_NET_EVENT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 network event objects are returned. /// /// FwpmNetEventEnum1 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum1")] public static Win32Error FwpmNetEventEnum1([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_NET_EVENT_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmNetEventCreateEnumHandle0, FwpmNetEventEnum1, FwpmNetEventDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The FwpmNetEventEnum2 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum2 is the specific implementation of FwpmNetEventEnum used in Windows 8 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmNetEventEnum1 is /// available. For Windows Vista, FwpmNetEventEnum0 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 network event enumeration created by a call to FwpmNetEventCreateEnumHandle0. /// /// /// Type: UINT32 /// The number of enumeration entries requested. /// /// /// Type: FWPM_NET_EVENT2*** /// Addresses of enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 that uses the same enumHandle parameter will return the next set of events following those in the current /// entries buffer. /// /// /// FwpmNetEventEnum2 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventenum2 DWORD FwpmNetEventEnum2( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_NET_EVENT2 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum2")] public static extern Win32Error FwpmNetEventEnum2([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The FwpmNetEventEnum2 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum2 is the specific implementation of FwpmNetEventEnum used in Windows 8 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, FwpmNetEventEnum1 is /// available. For Windows Vista, FwpmNetEventEnum0 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_EVENT2*** /// Addresses of enumeration entries. /// /// /// Type: FWPM_NET_EVENT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 network event objects are returned. /// /// FwpmNetEventEnum2 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum2")] public static Win32Error FwpmNetEventEnum2([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_NET_EVENT_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmNetEventCreateEnumHandle0, FwpmNetEventEnum2, FwpmNetEventDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The FwpmNetEventEnum3 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum3 s the specific implementation of FwpmNetEventEnum 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, /// FwpmNetEventEnum2 is available. For Windows 7, FwpmNetEventEnum1 is available. For Windows Vista, FwpmNetEventEnum0 is available. /// /// /// /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// Handle for a network event enumeration created by a call to FwpmNetEventCreateEnumHandle0. /// The number of enumeration entries requested. /// Addresses of enumeration entries. /// The number of enumeration entries returned. /// /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 that uses the same enumHandle parameter will return the next set of events following those in the current /// entries buffer. /// /// /// FwpmNetEventEnum3 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmneteventenum3 DWORD FwpmNetEventEnum3( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_NET_EVENT3 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum3")] public static extern Win32Error FwpmNetEventEnum3([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The FwpmNetEventEnum3 function returns the next page of results from the network event enumerator. /// /// NoteFwpmNetEventEnum3 s the specific implementation of FwpmNetEventEnum 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, /// FwpmNetEventEnum2 is available. For Windows 7, FwpmNetEventEnum1 is available. For Windows Vista, FwpmNetEventEnum0 is available. /// /// /// /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// Addresses of enumeration entries. /// /// Type: FWPM_NET_EVENT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The network events were enumerated successfully. /// /// /// FWP_E_NET_EVENTS_DISABLED 0x80320013 /// The collection of network diagnostic events is disabled. Call FwpmEngineSetOption0 to enable it. /// /// /// 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 network event objects are returned. /// /// FwpmNetEventEnum3 returns only events that were logged prior to the creation of the enumHandle parameter. See Logging /// for more information. /// /// [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmNetEventEnum3")] public static Win32Error FwpmNetEventEnum3([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_NET_EVENT_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmNetEventCreateEnumHandle0, FwpmNetEventEnum3, FwpmNetEventDestroyEnumHandle0, engineHandle, out entries, enumTemplate); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error FwpmCalloutGetById0([In] HFWPENG engineHandle, uint id, out SafeFwpmMem callout); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error FwpmCalloutGetByKey0([In] HFWPENG engineHandle, [In] in Guid key, out SafeFwpmMem callout); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error FwpmConnectionGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmMem connection); }