namespace Vanara.PInvoke; public static partial class FwpUClnt { /// The FwpmSessionCreateEnumHandle0 function creates a handle used to enumerate a set of session objects. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SESSION_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Handle for filter 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 session objects are returned. /// The caller must free the returned handle by a call to the FwpmSessionDestroyEnumHandle0. /// /// FwpmSessionCreateEnumHandle0 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 filter engine. See Access Control for more information. /// /// FwpmSessionCreateEnumHandle0 is a specific implementation of FwpmSessionCreateEnumHandle. 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-fwpmsessioncreateenumhandle0 DWORD FwpmSessionCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_SESSION_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSessionCreateEnumHandle0")] public static extern Win32Error FwpmSessionCreateEnumHandle0([In] HFWPENG engineHandle, in FWPM_SESSION_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// The FwpmSessionCreateEnumHandle0 function creates a handle used to enumerate a set of session objects. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SESSION_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Handle for filter 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 session objects are returned. /// The caller must free the returned handle by a call to the FwpmSessionDestroyEnumHandle0. /// /// FwpmSessionCreateEnumHandle0 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 filter engine. See Access Control for more information. /// /// FwpmSessionCreateEnumHandle0 is a specific implementation of FwpmSessionCreateEnumHandle. 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-fwpmsessioncreateenumhandle0 DWORD FwpmSessionCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_SESSION_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSessionCreateEnumHandle0")] public static extern Win32Error FwpmSessionCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// The FwpmSessionDestroyEnumHandle0 function frees a handle returned by FwpmSessionCreateEnumHandle0. /// /// 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 session enumeration created by a call to FwpmSessionCreateEnumHandle0. /// /// /// 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. /// /// /// /// /// FwpmSessionDestroyEnumHandle0 is a specific implementation of FwpmSessionDestroyEnumHandle. 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-fwpmsessiondestroyenumhandle0 DWORD FwpmSessionDestroyEnumHandle0( // [in] HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSessionDestroyEnumHandle0")] public static extern Win32Error FwpmSessionDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// The FwpmSessionEnum0 function returns the next page of results from the session 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 session enumeration created by a call to FwpmSessionCreateEnumHandle0. /// /// /// Type: UINT32 /// The number of session entries requested. /// /// /// Type: FWPM_SESSION0*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of session objects returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The sessions 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. /// FwpmSessionEnum0 works on a snapshot of the sessions taken at the time the enumeration handle was created. /// /// FwpmSessionEnum0 is a specific implementation of FwpmSessionEnum. 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-fwpmsessionenum0 DWORD FwpmSessionEnum0( [in] HFWPENG engineHandle, // [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_SESSION0 ***entries, [out] UINT32 *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSessionEnum0")] public static extern Win32Error FwpmSessionEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// The FwpmSessionEnum0 function returns the next page of results from the session enumerator. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SESSION0*** /// Addresses of the enumeration entries. /// /// /// Type: FWPM_SESSION_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The sessions 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 session objects are returned. /// FwpmSessionEnum0 works on a snapshot of the sessions taken at the time the enumeration handle was created. /// /// FwpmSessionEnum0 is a specific implementation of FwpmSessionEnum. 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-fwpmsessionenum0 DWORD FwpmSessionEnum0( [in] HFWPENG engineHandle, // [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_SESSION0 ***entries, [out] UINT32 *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSessionEnum0")] public static Win32Error FwpmSessionEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_SESSION_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmSessionCreateEnumHandle0, FwpmSessionEnum0, FwpmSessionDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// The FwpmSubLayerAdd0 function adds a new sublayer 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_SUBLAYER0* /// The sublayer to be added. /// /// /// Type: PSECURITY_DESCRIPTOR /// Security information for the sublayer object. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The sublayer was successfully added. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// If the caller supplies a null security descriptor, the system will assign a default security descriptor. /// /// 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 sublayers's container and FWPM_ACTRL_ADD_LINK access to the provider (if any). /// See Access Control for more information. /// /// /// FwpmSubLayerAdd0 is a specific implementation of FwpmSubLayerAdd. See WFP Version-Independent Names and Targeting Specific /// Versions of Windows for more information. /// /// Examples /// The following C++ example illustrates initialization of a sublayer object and adding the sublayer key to a filter object. /// /// #include <windows.h> #include <fwpmu.h> #include <rpc.h> #include <stdio.h> #pragma comment(lib, "Fwpuclnt.lib") #pragma comment(lib, "Rpcrt4.lib") void main() { FWPM_FILTER0 fwpFilter; FWPM_SUBLAYER0 fwpFilterSubLayer; HFWPENG engineHandle = NULL; DWORD result = ERROR_SUCCESS; RPC_STATUS rpcStatus = RPC_S_OK; memset(&fwpFilterSubLayer, 0, sizeof(fwpFilterSubLayer)); rpcStatus = UuidCreate(&fwpFilterSubLayer.subLayerKey); if (RPC_S_OK != rpcStatus) { printf("UuidCreate failed (%d).\n", rpcStatus); return; } result = FwpmEngineOpen0( NULL, RPC_C_AUTHN_WINNT, NULL, NULL, &engineHandle ); if (result != ERROR_SUCCESS) { printf("FwpmEngineOpen0 failed.\n"); return; } fwpFilterSubLayer.displayData.name = L"MyFilterSublayer"; fwpFilterSubLayer.displayData.description = L"My filter sublayer"; fwpFilterSubLayer.flags = 0; fwpFilterSubLayer.weight = 0x100; printf("Adding filter sublayer.\n"); result = FwpmSubLayerAdd0(engineHandle, &fwpFilterSubLayer, NULL); if (result != ERROR_SUCCESS) { printf("FwpmSubLayerAdd0 failed (%d).\n", result); return; } // Add sublayer key to a filter. memset(&fwpFilter, 0, sizeof(FWPM_FILTER0)); if (&fwpFilterSubLayer.subLayerKey != NULL) fwpFilter.subLayerKey = fwpFilterSubLayer.subLayerKey; // Finish initializing filter... return; } /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmsublayeradd0 DWORD FwpmSubLayerAdd0( [in] HFWPENG engineHandle, // [in] const FWPM_SUBLAYER0 *subLayer, [in, optional] PSECURITY_DESCRIPTOR sd ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerAdd0")] public static extern Win32Error FwpmSubLayerAdd0([In] HFWPENG engineHandle, in FWPM_SUBLAYER0 subLayer, [In, Optional] PSECURITY_DESCRIPTOR sd); /// The FwpmSubLayerCreateEnumHandle0 function creates a handle used to enumerate a set of sublayers. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SUBLAYER_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Handle for sublayer 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 sublayers are returned. /// /// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to /// FwpmSubLayerCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call /// FwpmSubLayerCreateEnumHandle0 and FwpmSubLayerEnum0 from within the same explicit transaction. /// /// The caller must free the returned handle by a call to FwpmSubLayerDestroyEnumHandle0. /// /// The caller needs FWPM_ACTRL_ENUM access to the sublayers' containers and FWPM_ACTRL_READ access to the sub-layers. Only /// sublayers to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information. /// /// /// FwpmSubLayerCreateEnumHandle0 is a specific implementation of FwpmSubLayerCreateEnumHandle. 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-fwpmsublayercreateenumhandle0 DWORD FwpmSubLayerCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_SUBLAYER_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerCreateEnumHandle0")] public static extern Win32Error FwpmSubLayerCreateEnumHandle0([In] HFWPENG engineHandle, in FWPM_SUBLAYER_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// The FwpmSubLayerCreateEnumHandle0 function creates a handle used to enumerate a set of sublayers. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SUBLAYER_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Handle for sublayer 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 sublayers are returned. /// /// The enumerator is not "live", meaning it does not reflect changes made to the system after the call to /// FwpmSubLayerCreateEnumHandle0 returns. If you need to ensure that the results are current, you must call /// FwpmSubLayerCreateEnumHandle0 and FwpmSubLayerEnum0 from within the same explicit transaction. /// /// The caller must free the returned handle by a call to FwpmSubLayerDestroyEnumHandle0. /// /// The caller needs FWPM_ACTRL_ENUM access to the sublayers' containers and FWPM_ACTRL_READ access to the sub-layers. Only /// sublayers to which the caller has FWPM_ACTRL_READ access will be returned. See Access Control for more information. /// /// /// FwpmSubLayerCreateEnumHandle0 is a specific implementation of FwpmSubLayerCreateEnumHandle. 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-fwpmsublayercreateenumhandle0 DWORD FwpmSubLayerCreateEnumHandle0( // [in] HFWPENG engineHandle, [in, optional] const FWPM_SUBLAYER_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerCreateEnumHandle0")] public static extern Win32Error FwpmSubLayerCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// The FwpmSubLayerDeleteByKey0 function deletes a sublayer from the system by its key. /// /// 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 sublayer to be removed from the system. This is the same GUID that was specified when the application called FwpmSubLayerAdd0. /// /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The sublayer was successfully deleted. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// This function cannot be called from within a read-only transaction. It will fail with FWP_E_INCOMPATIBLE_TXN. See Object /// Management for more information about transactions. /// /// /// This function can be called within a dynamic session if the corresponding object was added during the same session. If this function /// is called for an object that was added during a different dynamic session, it will fail with FWP_E_WRONG_SESSION. If this /// function is called for an object that was not added during a dynamic session, it will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS. /// /// The caller needs DELETE access to the sub-layer. See Access Control for more information. /// /// FwpmSubLayerDeleteByKey0 is a specific implementation of FwpmSubLayerDeleteByKey. 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-fwpmsublayerdeletebykey0 DWORD FwpmSubLayerDeleteByKey0( [in] // HFWPENG engineHandle, [in] const GUID *key ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerDeleteByKey0")] public static extern Win32Error FwpmSubLayerDeleteByKey0([In] HFWPENG engineHandle, in Guid key); /// The FwpmSubLayerDestroyEnumHandle0 function frees a handle returned by FwpmSubLayerCreateEnumHandle0. /// /// 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 sublayer enumeration created by a call to FwpmSubLayerCreateEnumHandle0. /// /// /// 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. /// /// /// /// /// FwpmSubLayerDestroyEnumHandle0 is a specific implementation of FwpmSubLayerDestroyEnumHandle. 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-fwpmsublayerdestroyenumhandle0 DWORD FwpmSubLayerDestroyEnumHandle0( // [in] HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerDestroyEnumHandle0")] public static extern Win32Error FwpmSubLayerDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// The FwpmSubLayerEnum0 function returns the next page of results from the sublayer 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 sublayer enumeration created by a call to FwpmSubLayerCreateEnumHandle0. /// /// /// Type: UINT32 /// The number of sublayer entries requested. /// /// /// Type: FWPM_SUBLAYER0*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of sublayer objects returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The sublayers 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. /// FwpmSubLayerEnum0 works on a snapshot of the sublayers taken at the time the enumeration handle was created. /// /// FwpmSubLayerEnum0 is a specific implementation of FwpmSubLayerEnum. 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-fwpmsublayerenum0 DWORD FwpmSubLayerEnum0( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_SUBLAYER0 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerEnum0")] public static extern Win32Error FwpmSubLayerEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// The FwpmSubLayerEnum0 function returns the next page of results from the sublayer enumerator. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SUBLAYER0*** /// Addresses of the enumeration entries. /// /// /// Type: FWPM_SUBLAYER_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The sublayers 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 sublayers are returned. /// FwpmSubLayerEnum0 works on a snapshot of the sublayers taken at the time the enumeration handle was created. /// /// FwpmSubLayerEnum0 is a specific implementation of FwpmSubLayerEnum. 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-fwpmsublayerenum0 DWORD FwpmSubLayerEnum0( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] FWPM_SUBLAYER0 ***entries, [out] UINT32 // *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerEnum0")] public static Win32Error FwpmSubLayerEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, FWPM_SUBLAYER_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(FwpmSubLayerCreateEnumHandle0, FwpmSubLayerEnum0, FwpmSubLayerDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// The FwpmSubLayerGetByKey0 function retrieves a sublayer by its key. /// /// 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 sublayer. This is the same GUID that was specified when the application called FwpmSubLayerAdd0. /// /// /// Type: FWPM_SUBLAYER0** /// The sublayer information. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The sublayer 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 sublayer. See Access Control for more information. /// /// FwpmSubLayerGetByKey0 is a specific implementation of FwpmSubLayerGetByKey. 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-fwpmsublayergetbykey0 DWORD FwpmSubLayerGetByKey0( [in] HFWPENG // engineHandle, [in] const GUID *key, [out] FWPM_SUBLAYER0 **subLayer ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerGetByKey0")] public static Win32Error FwpmSubLayerGetByKey0([In] HFWPENG engineHandle, in Guid key, out SafeFwpmStruct subLayer) => FwpmGenericGetByKey(FwpmSubLayerGetByKey0, engineHandle, key, out subLayer); /// The FwpmSubLayerGetSecurityInfoByKey0 function retrieves a copy of the security descriptor for a sublayer. /// /// 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 sublayer. This must be the same GUID that was specified when the application called FwpmSubLayerAdd0. /// /// /// 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 /// sublayers 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. /// /// /// FwpmSubLayerGetSecurityInfoByKey0 is a specific implementation of FwpmSubLayerGetSecurityInfoByKey. 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-fwpmsublayergetsecurityinfobykey0 DWORD // FwpmSubLayerGetSecurityInfoByKey0( [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.FwpmSubLayerGetSecurityInfoByKey0")] public static extern Win32Error FwpmSubLayerGetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// The FwpmSubLayerGetSecurityInfoByKey0 function retrieves a copy of the security descriptor for a sublayer. /// /// 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 sublayer. This must be the same GUID that was specified when the application called FwpmSubLayerAdd0. /// /// /// 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 /// sublayers 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. /// /// /// FwpmSubLayerGetSecurityInfoByKey0 is a specific implementation of FwpmSubLayerGetSecurityInfoByKey. 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-fwpmsublayergetsecurityinfobykey0 DWORD // FwpmSubLayerGetSecurityInfoByKey0( [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.FwpmSubLayerGetSecurityInfoByKey0")] public static extern Win32Error FwpmSubLayerGetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr key, SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// /// The FwpmSubLayerSetSecurityInfoByKey0 function sets specified security information in the security descriptor of a sublayer. /// /// /// 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 sublayer. This must be the same GUID that was specified when the application called FwpmSubLayerAdd0. /// /// /// 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 /// sublayers 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. /// /// /// FwpmSubLayerSetSecurityInfoByKey0 is a specific implementation of FwpmSubLayerSetSecurityInfoByKey. 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-fwpmsublayersetsecurityinfobykey0 DWORD // FwpmSubLayerSetSecurityInfoByKey0( [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.FwpmSubLayerSetSecurityInfoByKey0")] public static extern Win32Error FwpmSubLayerSetSecurityInfoByKey0([In] HFWPENG engineHandle, in Guid key, SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// /// The FwpmSubLayerSetSecurityInfoByKey0 function sets specified security information in the security descriptor of a sublayer. /// /// /// 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 sublayer. This must be the same GUID that was specified when the application called FwpmSubLayerAdd0. /// /// /// 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 /// sublayers 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. /// /// /// FwpmSubLayerSetSecurityInfoByKey0 is a specific implementation of FwpmSubLayerSetSecurityInfoByKey. 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-fwpmsublayersetsecurityinfobykey0 DWORD // FwpmSubLayerSetSecurityInfoByKey0( [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.FwpmSubLayerSetSecurityInfoByKey0")] public static extern Win32Error FwpmSubLayerSetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr key, SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// /// The FwpmSubLayerSubscribeChanges0 function is used to request the delivery of notifications regarding changes in a particular sublayer. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SUBLAYER_SUBSCRIPTION0* /// The notifications to be delivered. /// /// /// Type: FWPM_SUBLAYER_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 sublayer's container and FWPM_ACTRL_READ access to the sub-layer. The /// subscriber will only get notifications for sublayers to which it has FWPM_ACTRL_READ access. See Access Control for more information. /// /// /// FwpmSubLayerSubscribeChanges0 is a specific implementation of FwpmSubLayerSubscribeChanges. 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-fwpmsublayersubscribechanges0 DWORD FwpmSubLayerSubscribeChanges0( // [in] HFWPENG engineHandle, [in] const FWPM_SUBLAYER_SUBSCRIPTION0 *subscription, [in] FWPM_SUBLAYER_CHANGE_CALLBACK0 callback, [in, // optional] void *context, [out] HANDLE *changeHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerSubscribeChanges0")] public static extern Win32Error FwpmSubLayerSubscribeChanges0([In] HFWPENG engineHandle, in FWPM_SUBLAYER_SUBSCRIPTION0 subscription, [In] FWPM_SUBLAYER_CHANGE_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPMSUBLAYERSUB changeHandle); /// /// The FwpmSubLayerSubscriptionsGet0 function retrieves an array of all the current sub-layer 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_SUBLAYER_SUBSCRIPTION0*** /// The current sublayer 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 sublayer's container. See Access Control for more information. /// /// FwpmSubLayerSubscriptionsGet0 is a specific implementation of FwpmSubLayerSubscriptionsGet. 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-fwpmsublayersubscriptionsget0 DWORD FwpmSubLayerSubscriptionsGet0( // [in] HFWPENG engineHandle, [out] FWPM_SUBLAYER_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerSubscriptionsGet0")] public static extern Win32Error FwpmSubLayerSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries); /// /// The FwpmSubLayerSubscriptionsGet0 function retrieves an array of all the current sub-layer 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_SUBLAYER_SUBSCRIPTION0*** /// The current sublayer change notification subscriptions. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The subscriptions were retrieved successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// The returned array (but not the individual entries in the array) must be freed through a call to FwpmFreeMemory0. /// The caller needs FWPM_ACTRL_READ access to the sublayer's container. See Access Control for more information. /// /// FwpmSubLayerSubscriptionsGet0 is a specific implementation of FwpmSubLayerSubscriptionsGet. 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-fwpmsublayersubscriptionsget0 DWORD FwpmSubLayerSubscriptionsGet0( // [in] HFWPENG engineHandle, [out] FWPM_SUBLAYER_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerSubscriptionsGet0")] public static Win32Error FwpmSubLayerSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) => FwpmGenericGetSubs(FwpmSubLayerSubscriptionsGet0, engineHandle, out entries); /// /// The FwpmSubLayerUnsubscribeChanges0 function is used to cancel a sublayer 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 returned handle from the call to FwpmSubLayerSubscribeChanges0. /// /// /// 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. /// /// /// FwpmSubLayerUnsubscribeChanges0 is a specific implementation of FwpmSubLayerUnsubscribeChanges. 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-fwpmsublayerunsubscribechanges0 DWORD // FwpmSubLayerUnsubscribeChanges0( [in] HFWPENG engineHandle, [in] HANDLE changeHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSubLayerUnsubscribeChanges0")] public static extern Win32Error FwpmSubLayerUnsubscribeChanges0([In] HFWPENG engineHandle, [In] HFWPMSUBLAYERSUB changeHandle); /// The FwpmSystemPortsGet0 function retrieves an array of all of the system port types. /// /// Type: HANDLE /// Optional handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: FWPM_SYSTEM_PORTS0** /// The array of system port types. /// /// /// 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. /// /// FwpmSystemPortsGet0 is a specific implementation of FwpmSystemPortsGet. 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-fwpmsystemportsget0 DWORD FwpmSystemPortsGet0( [in, optional] // HFWPENG engineHandle, [out] FWPM_SYSTEM_PORTS0 **sysPorts ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSystemPortsGet0")] public static Win32Error FwpmSystemPortsGet0([In, Optional] HFWPENG engineHandle, out SafeFwpmStruct sysPorts) { Win32Error err = FwpmSystemPortsGet0(engineHandle, out SafeFwpmMem mem); sysPorts = mem; return err; } /// /// The FwpmSystemPortsSubscribe0 function is used to request the delivery of notifications regarding a particular system port. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: void* /// Reserved. /// /// /// Type: FWPM_SYSTEM_PORTS_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 system port. /// /// /// 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. /// /// /// FwpmSystemPortsSubscribe0 is a specific implementation of FwpmSystemPortsSubscribe. 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-fwpmsystemportssubscribe0 DWORD FwpmSystemPortsSubscribe0( [in, // optional] HFWPENG engineHandle, void *reserved, [in] FWPM_SYSTEM_PORTS_CALLBACK0 callback, [in, optional] void *context, [out] HANDLE // *sysPortsHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSystemPortsSubscribe0")] public static extern Win32Error FwpmSystemPortsSubscribe0([In, Optional] HFWPENG engineHandle, [In, Optional] IntPtr reserved, [In] FWPM_SYSTEM_PORTS_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPMSYSPORTSUB sysPortsHandle); /// The FwpmSystemPortsUnsubscribe0 function is used to cancel a system port 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 system port notification. This is the returned handle from the call to FwpmSystemPortsSubscribe0. /// /// /// 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. /// /// /// /// /// /// Unsubscribing with an invalid object handle will result in a return value of ERROR_SUCCESS, but the actual subscription will persist /// until the unsubscribe API is called with valid parameters. /// /// /// 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. /// /// /// FwpmSystemPortsUnsubscribe0 is a specific implementation of FwpmSystemPortsUnsubscribe. 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-fwpmsystemportsunsubscribe0 DWORD FwpmSystemPortsUnsubscribe0( [in, // optional] HFWPENG engineHandle, [in, out] HANDLE sysPortsHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmSystemPortsUnsubscribe0")] public static extern Win32Error FwpmSystemPortsUnsubscribe0([In, Optional] HFWPENG engineHandle, [In, Out] HFWPMSYSPORTSUB sysPortsHandle); /// The FwpmTransactionAbort0 function causes the current transaction within the current session to abort and rollback. /// /// 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 transaction was aborted. /// /// /// 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 can only be called from within a transaction. Otherwise, it will fail with FWP_E_NO_TXN_IN_PROGRESS. /// /// FwpmTransactionAbort0 is a specific implementation of FwpmTransactionAbort. 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-fwpmtransactionabort0 DWORD FwpmTransactionAbort0( [in] HFWPENG // engineHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmTransactionAbort0")] public static extern Win32Error FwpmTransactionAbort0([In] HFWPENG engineHandle); /// The FwpmTransactionBegin0 function begins an explicit transaction within the current session. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT32 /// Possible values: /// /// /// Transaction flag /// Meaning /// /// /// 0 /// Begin read/write transaction. /// /// /// FWPM_TXN_READ_ONLY /// Begin read-only transaction. /// /// /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The transaction was started 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. /// /// /// For a read-only transaction, the caller needs FWPM_ACTRL_BEGIN_READ_TXN access to the filter engine. For a read/write transaction, /// the caller needs FWPM_ACTRL_BEGIN_WRITE_TXN access to the filter engine. See Access Control for more information. /// /// /// FwpmTransactionBegin0 is a specific implementation of FwpmTransactionBegin. See WFP Version-Independent Names and Targeting /// Specific Versions of Windows for more information. /// /// Examples /// The following C++ example illustrates wrapping the FwpmFilterAdd0 function in an FWP transaction. /// /// #include <windows.h> #include <fwpmu.h> #include <stdio.h> #pragma comment(lib, "Fwpuclnt.lib") void main() { HFWPENG engineHandle = NULL; FWPM_FILTER0 fwpFilter; RtlZeroMemory(&fwpFilter, sizeof(FWPM_FILTER0)); fwpFilter.layerKey = FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4; fwpFilter.action.type = FWP_ACTION_BLOCK; fwpFilter.weight.type = FWP_EMPTY; fwpFilter.numFilterConditions = 0; DWORD result = ERROR_SUCCESS; DWORD fwpTxStatus = ERROR_SUCCESS; printf("Opening filter engine.\n"); result = FwpmEngineOpen0(NULL, RPC_C_AUTHN_WINNT, NULL, NULL, &engineHandle); if (result != ERROR_SUCCESS) { printf("FwpmEngineOpen0 failed (%d).\n", result); return; } printf("Adding filter to permit traffic for Application 1.\n"); fwpTxStatus = FwpmTransactionBegin0(engineHandle, NULL); if (fwpTxStatus != ERROR_SUCCESS) { printf("FwpmTransactionBegin0 failed (%d).\n", fwpTxStatus); return; } result = FwpmFilterAdd0(engineHandle, &fwpFilter, NULL, NULL); if (result != ERROR_SUCCESS) { printf("FwpmFilterAdd0 failed (%d).\n", result); return; } result = FwpmTransactionCommit0(engineHandle); if (result != ERROR_SUCCESS) { printf("FwpmTransactionCommit0 failed (%d).\n", result); return; } else { printf("Filter transaction (adding a filter) committed successfully.\n"); } return; } // ---------------------------------------------------------------------- /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-fwpmtransactionbegin0 DWORD FwpmTransactionBegin0( [in] HFWPENG // engineHandle, [in] UINT32 flags ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmTransactionBegin0")] public static extern Win32Error FwpmTransactionBegin0([In] HFWPENG engineHandle, [In] FWPM_TXN flags); /// The FwpmTransactionCommit0 function commits the current transaction within the current session. /// /// 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 transaction was committed 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 can only be called from within a transaction. Otherwise, it will fail with FWP_E_NO_TXN_IN_PROGRESS. /// /// FwpmTransactionCommit0 is a specific implementation of FwpmTransactionCommit. 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-fwpmtransactioncommit0 DWORD FwpmTransactionCommit0( [in] HFWPENG // engineHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmTransactionCommit0")] public static extern Win32Error FwpmTransactionCommit0([In] HFWPENG engineHandle); /// The FwpmvSwitchEventsGetSecurityInfo0 function retrieves a copy of the security descriptor for a vSwitch 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. /// /// /// FwpmvSwitchEventsGetSecurityInfo0 is a specific implementation of FwpmvSwitchEventsGetSecurityInfo. 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-fwpmvswitcheventsgetsecurityinfo0 DWORD // FwpmvSwitchEventsGetSecurityInfo0( [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.FwpmvSwitchEventsGetSecurityInfo0")] public static extern Win32Error FwpmvSwitchEventsGetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// /// The FwpmvSwitchEventsSetSecurityInfo0 function sets specified security information in the security descriptor for a vSwitch 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. /// /// /// FwpmvSwitchEventsSetSecurityInfo0 is a specific implementation of FwpmvSwitchEventsSetSecurityInfo. 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-fwpmvswitcheventssetsecurityinfo0 DWORD // FwpmvSwitchEventsSetSecurityInfo0( [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.FwpmvSwitchEventsSetSecurityInfo0")] public static extern Win32Error FwpmvSwitchEventsSetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// /// The FwpmvSwitchEventSubscribe0 function is used to request the delivery of notifications regarding a particular vSwitch event. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const FWPM_VSWITCH_EVENT_SUBSCRIPTION0* /// The notifications which will be delivered. /// /// /// Type: FWPM_VSWITCH_EVENT_CALLBACK0 /// Function pointer that will be invoked when a notification is ready for delivery. /// /// /// Type: void* /// Optional context pointer. This pointer is passed to the callback function along with details of the event. /// /// /// Type: HANDLE* /// Handle to the newly created subscription. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The subscription was created successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// This function cannot be called from within a transaction. It will fail with FWP_E_TXN_IN_PROGRESS. See Object Management for /// more information about transactions. /// /// The caller needs FWPM_ACTRL_SUBSCRIBE access to the virtual switch event's container. /// /// FwpmvSwitchEventSubscribe0 is a specific implementation of FwpmvSwitchEventSubscribe. 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-fwpmvswitcheventsubscribe0 DWORD FwpmvSwitchEventSubscribe0( [in] // HFWPENG engineHandle, [in] const FWPM_VSWITCH_EVENT_SUBSCRIPTION0 *subscription, [in] FWPM_VSWITCH_EVENT_CALLBACK0 callback, [in, // optional] void *context, [out] HANDLE *subscriptionHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmvSwitchEventSubscribe0")] public static extern Win32Error FwpmvSwitchEventSubscribe0([In] HFWPENG engineHandle, in FWPM_VSWITCH_EVENT_SUBSCRIPTION0 subscription, [In] FWPM_VSWITCH_EVENT_CALLBACK0 callback, [In, Optional] IntPtr context, out HFWPMSWITCHEVTSUB subscriptionHandle); /// The FwpmvSwitchEventUnsubscribe0 function is used to cancel a vSwitch 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 FwpmvSwitchEventSubscribe0. /// 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. /// /// /// FwpmvSwitchEventUnsubscribe0 is a specific implementation of FwpmvSwitchEventUnsubscribe. 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-fwpmvswitcheventunsubscribe0 DWORD FwpmvSwitchEventUnsubscribe0( // [in] HFWPENG engineHandle, [in, out] HANDLE subscriptionHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.FwpmvSwitchEventUnsubscribe0")] public static extern Win32Error FwpmvSwitchEventUnsubscribe0([In] HFWPENG engineHandle, [In, Out] HFWPMSWITCHEVTSUB subscriptionHandle); /// /// /// The IkeextGetStatistics0 function retrieves Internet Key Exchange (IKE) and Authenticated Internet Protocol (AuthIP) statistics. /// /// /// NoteIkeextGetStatistics0 is the specific implementation of IkeextGetStatistics used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IkeextGetStatistics1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// Type: IKEEXT_STATISTICS0* /// The top-level object of IKE/AuthIP statistics organization. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The information 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 needs FWPM_ACTRL_READ_STATS access to the IKE/AuthIP security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextgetstatistics0 DWORD IkeextGetStatistics0( [in] HFWPENG // engineHandle, [out] IKEEXT_STATISTICS0 *ikeextStatistics ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextGetStatistics0")] public static extern Win32Error IkeextGetStatistics0([In] HFWPENG engineHandle, out IKEEXT_STATISTICS0 ikeextStatistics); /// /// /// The IkeextGetStatistics1 function retrieves Internet Key Exchange (IKE) and Authenticated Internet Protocol (AuthIP) statistics. /// /// /// NoteIkeextGetStatistics1 is the specific implementation of IkeextGetStatistics used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IkeextGetStatistics0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// Type: IKEEXT_STATISTICS1* /// The top-level object of IKE/AuthIP statistics organization. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The information 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 needs FWPM_ACTRL_READ_STATS access to the IKE/AuthIP security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextgetstatistics1 DWORD IkeextGetStatistics1( [in] HFWPENG // engineHandle, [out] IKEEXT_STATISTICS1 *ikeextStatistics ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextGetStatistics1")] public static extern Win32Error IkeextGetStatistics1([In] HFWPENG engineHandle, out IKEEXT_STATISTICS1 ikeextStatistics); /// /// The IkeextSaCreateEnumHandle0 function creates a handle used to enumerate a set of Internet Key Exchange (IKE) and /// Authenticated Internet Protocol (AuthIP) security association (SA) objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// Type: IKEEXT_SA_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle of the newly created enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumeration 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 IKE/AuthIP SA objects are returned. /// The caller must call IkeextSaDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_ENUM and FWPM_ACTRL_READ access to the IKE/AuthIP security associations database. See Access /// Control for more information. /// /// /// IkeextSaCreateEnumHandle0 is a specific implementation of IkeextSaCreateEnumHandle. 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-ikeextsacreateenumhandle0 DWORD IkeextSaCreateEnumHandle0( [in] // HFWPENG engineHandle, [in, optional] const IKEEXT_SA_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaCreateEnumHandle0")] public static extern Win32Error IkeextSaCreateEnumHandle0([In] HFWPENG engineHandle, in IKEEXT_SA_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// /// The IkeextSaCreateEnumHandle0 function creates a handle used to enumerate a set of Internet Key Exchange (IKE) and /// Authenticated Internet Protocol (AuthIP) security association (SA) objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// Type: IKEEXT_SA_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle of the newly created enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumeration 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 IKE/AuthIP SA objects are returned. /// The caller must call IkeextSaDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_ENUM and FWPM_ACTRL_READ access to the IKE/AuthIP security associations database. See Access /// Control for more information. /// /// /// IkeextSaCreateEnumHandle0 is a specific implementation of IkeextSaCreateEnumHandle. 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-ikeextsacreateenumhandle0 DWORD IkeextSaCreateEnumHandle0( [in] // HFWPENG engineHandle, [in, optional] const IKEEXT_SA_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaCreateEnumHandle0")] public static extern Win32Error IkeextSaCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// /// The IkeextSaDbGetSecurityInfo0 function retrieves a copy of the security descriptor for a security association (SA) database. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// Type: SECURITY_INFORMATION /// The type of security information to retrieve. /// /// /// Type: PSID* /// The owner security identifier (SID) in the returned security descriptor. /// /// /// Type: PSID* /// The primary group security identifier (SID) in the returned security descriptor. /// /// /// Type: PACL* /// The discretionary access control list (DACL) in the returned security descriptor. /// /// /// Type: PACL* /// The system access control list (SACL) in the returned security descriptor. /// /// /// Type: PSECURITY_DESCRIPTOR* /// The returned security descriptor. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The security descriptor was retrieved successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned /// parameters must not be freed, as they point to addresses within the securityDescriptor parameter. /// /// /// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described /// in the GetSecurityInfo reference topic. /// /// /// IkeextSaDbGetSecurityInfo0 is a specific implementation of IkeextSaDbGetSecurityInfo. 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-ikeextsadbgetsecurityinfo0 DWORD IkeextSaDbGetSecurityInfo0( [in] // HFWPENG engineHandle, [in] SECURITY_INFORMATION securityInfo, [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup, [out, // optional] PACL *dacl, [out, optional] PACL *sacl, [out] PSECURITY_DESCRIPTOR *securityDescriptor ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaDbGetSecurityInfo0")] public static extern Win32Error IkeextSaDbGetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// /// The IkeextSaDbSetSecurityInfo0 function sets specified security information in the security descriptor of the IKE/AuthIP /// security association database. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// 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 set successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described /// in the SetSecurityInfo reference topic. /// /// /// IkeextSaDbSetSecurityInfo0 is a specific implementation of IkeextSaDbSetSecurityInfo. 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-ikeextsadbsetsecurityinfo0 DWORD IkeextSaDbSetSecurityInfo0( [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.IkeextSaDbSetSecurityInfo0")] public static extern Win32Error IkeextSaDbSetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// The IkeextSaDeleteById0 function removes a security association (SA) from the database. /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// Type: UINT64 /// The SA identifier. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SA was removed 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. /// /// /// /// /// IkeextSaDeleteById0 is a specific implementation of IkeextSaDeleteById. 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-ikeextsadeletebyid0 DWORD IkeextSaDeleteById0( [in] HFWPENG // engineHandle, [in] UINT64 id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaDeleteById0")] public static extern Win32Error IkeextSaDeleteById0([In] HFWPENG engineHandle, ulong id); /// The IkeextSaDestroyEnumHandle0 function frees a handle returned by IkeextSaCreateEnumHandle0. /// /// Type: HANDLE /// Handle for an open session to the filter engine generated by a previous call to FwpmEngineOpen0. /// /// /// Type: HANDLE /// Handle of the enumeration to destroy. Previously created by a call to IkeextSaCreateEnumHandle0. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumeration 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. /// /// /// /// /// IkeextSaDestroyEnumHandle0 is a specific implementation of IkeextSaDestroyEnumHandle. 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-ikeextsadestroyenumhandle0 DWORD IkeextSaDestroyEnumHandle0( [in] // HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaDestroyEnumHandle0")] public static extern Win32Error IkeextSaDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// /// The IkeextSaEnum0 function returns the next page of results from the IKE/AuthIP security association (SA) enumerator. /// /// NoteIkeextSaEnum0 is the specific implementation of IkeextSaEnum used in Windows Vista. See WFP Version-Independent /// Names and Targeting Specific Versions of Windows for more information. For Windows 7, IkeextSaEnum1 is available. For Windows 8, /// IkeextSaEnum2 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 an IKE/AuthIP SA enumeration. Call IkeextSaCreateEnumHandle0 to obtain an enumeration handle. /// /// /// Type: UINT32 /// Number of enumeration entries requested. /// /// /// Type: IKEEXT_SA_DETAILS0*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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. /// IkeextSaEnum0 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsaenum0 DWORD IkeextSaEnum0( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IKEEXT_SA_DETAILS0 ***entries, [out] UINT32 *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaEnum0")] public static extern Win32Error IkeextSaEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The IkeextSaEnum0 function returns the next page of results from the IKE/AuthIP security association (SA) enumerator. /// /// NoteIkeextSaEnum0 is the specific implementation of IkeextSaEnum used in Windows Vista. See WFP Version-Independent /// Names and Targeting Specific Versions of Windows for more information. For Windows 7, IkeextSaEnum1 is available. For Windows 8, /// IkeextSaEnum2 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IKEEXT_SA_DETAILS0*** /// Addresses of the enumeration entries. /// /// /// Type: IKEEXT_SA_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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 IKE/AuthIP SA objects are returned. /// IkeextSaEnum0 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsaenum0 DWORD IkeextSaEnum0( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IKEEXT_SA_DETAILS0 ***entries, [out] UINT32 *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaEnum0")] public static Win32Error IkeextSaEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, IKEEXT_SA_ENUM_TEMPLATE0? enumTemplate) => FwpmGenericEnum(IkeextSaCreateEnumHandle0, IkeextSaEnum0, IkeextSaDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The IkeextSaEnum1 function returns the next page of results from the IKE/AuthIP security association (SA) enumerator. /// /// NoteIkeextSaEnum1 is the specific implementation of IkeextSaEnum used in Windows 7. See WFP Version-Independent Names /// and Targeting Specific Versions of Windows for more information. For Windows 8, IkeextSaEnum2 is available. For Windows Vista, /// IkeextSaEnum0 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 an IKE/AuthIP SA enumeration. Call IkeextSaCreateEnumHandle0 to obtain an enumeration handle. /// /// /// Type: UINT32 /// Number of enumeration entries requested. /// /// /// Type: IKEEXT_SA_DETAILS1*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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. /// IkeextSaEnum1 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsaenum1 DWORD IkeextSaEnum1( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IKEEXT_SA_DETAILS1 ***entries, [out] UINT32 *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaEnum1")] public static extern Win32Error IkeextSaEnum1([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The IkeextSaEnum1 function returns the next page of results from the IKE/AuthIP security association (SA) enumerator. /// /// NoteIkeextSaEnum1 is the specific implementation of IkeextSaEnum used in Windows 7. See WFP Version-Independent Names /// and Targeting Specific Versions of Windows for more information. For Windows 8, IkeextSaEnum2 is available. For Windows Vista, /// IkeextSaEnum0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IKEEXT_SA_DETAILS1*** /// Addresses of the enumeration entries. /// /// /// Type: IKEEXT_SA_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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 IKE/AuthIP SA objects are returned. /// IkeextSaEnum1 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsaenum1 DWORD IkeextSaEnum1( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IKEEXT_SA_DETAILS1 ***entries, [out] UINT32 *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaEnum1")] public static Win32Error IkeextSaEnum1([In] HFWPENG engineHandle, out SafeFwpmArray entries, IKEEXT_SA_ENUM_TEMPLATE0? enumTemplate) => FwpmGenericEnum(IkeextSaCreateEnumHandle0, IkeextSaEnum1, IkeextSaDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The IkeextSaEnum2 function returns the next page of results from the IKE/AuthIP security association (SA) enumerator. /// /// NoteIkeextSaEnum2 is the specific implementation of IkeextSaEnum used in Windows 8. See WFP Version-Independent Names /// and Targeting Specific Versions of Windows for more information. For Windows 7, IkeextSaEnum1 is available. For Windows Vista, /// IkeextSaEnum0 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 an IKE/AuthIP SA enumeration. Call IkeextSaCreateEnumHandle0 to obtain an enumeration handle. /// /// /// Type: UINT32 /// Number of enumeration entries requested. /// /// /// Type: IKEEXT_SA_DETAILS2*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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. /// IkeextSaEnum2 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsaenum2 DWORD IkeextSaEnum2( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IKEEXT_SA_DETAILS2 ***entries, [out] UINT32 *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaEnum2")] public static extern Win32Error IkeextSaEnum2([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The IkeextSaEnum2 function returns the next page of results from the IKE/AuthIP security association (SA) enumerator. /// /// NoteIkeextSaEnum2 is the specific implementation of IkeextSaEnum used in Windows 8. See WFP Version-Independent Names /// and Targeting Specific Versions of Windows for more information. For Windows 7, IkeextSaEnum1 is available. For Windows Vista, /// IkeextSaEnum0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IKEEXT_SA_DETAILS2*** /// Addresses of the enumeration entries. /// /// /// Type: IKEEXT_SA_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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 IKE/AuthIP SA objects are returned. /// IkeextSaEnum2 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsaenum2 DWORD IkeextSaEnum2( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IKEEXT_SA_DETAILS2 ***entries, [out] UINT32 *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaEnum2")] public static Win32Error IkeextSaEnum2([In] HFWPENG engineHandle, out SafeFwpmArray entries, IKEEXT_SA_ENUM_TEMPLATE0? enumTemplate) => FwpmGenericEnum(IkeextSaCreateEnumHandle0, IkeextSaEnum2, IkeextSaDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The IkeextSaGetById0 function retrieves an IKE/AuthIP security association (SA) from the database. /// /// NoteIkeextSaGetById0 is the specific implementation of IkeextSaGetById used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7, IkeextSaGetById1 is /// available. For Windows 8, IkeextSaGetById2 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// The SA identifier. /// /// /// Type: IKEEXT_SA_DETAILS0** /// Address of the SA details. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SA 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 sa by a call to FwpmFreeMemory0. /// The caller needs FWPM_ACTRL_READ access to the IKE/AuthIP security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsagetbyid0 DWORD IkeextSaGetById0( [in] HFWPENG engineHandle, // [in] UINT64 id, [out] IKEEXT_SA_DETAILS0 **sa ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaGetById0")] public static Win32Error IkeextSaGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmStruct sa) => FwpmGenericGetById(IkeextSaGetById0, engineHandle, id, out sa); /// /// The IkeextSaGetById1 function retrieves an IKE/AuthIP security association (SA) from the database. /// /// NoteIkeextSaGetById1 is the specific implementation of IkeextSaGetById used in Windows 7. See WFP Version-Independent /// Names and Targeting Specific Versions of Windows for more information. For Windows 8, IkeextSaGetById2 is available. For Windows /// Vista, IkeextSaGetById0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// The SA identifier. /// /// /// Type: GUID* /// /// Optional pointer to the SA lookup context propagated from the SA to data connections flowing over that SA. It is made available to /// any application that queries socket security properties using the Winsock API WSAQuerySocketSecurity function, allowing the /// application to obtain detailed IPsec authentication information for its connection. /// /// /// /// Type: IKEEXT_SA_DETAILS1** /// Address of the SA details. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SA 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 sa by a call to FwpmFreeMemory0. /// The caller needs FWPM_ACTRL_READ access to the IKE/AuthIP security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsagetbyid1 DWORD IkeextSaGetById1( [in] HFWPENG engineHandle, // [in] UINT64 id, [in, optional] GUID *saLookupContext, [out] IKEEXT_SA_DETAILS1 **sa ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaGetById1")] public static Win32Error IkeextSaGetById1([In] HFWPENG engineHandle, ulong id, Guid? saLookupContext, out SafeFwpmStruct sa) { using SafeCoTaskMemStruct pCtx = saLookupContext; Win32Error err = IkeextSaGetById1(engineHandle, id, (IntPtr)pCtx, out SafeFwpmMem mem); sa = mem; return err; } /// /// The IkeextSaGetById2 function retrieves an IKE/AuthIP security association (SA) from the database. /// /// NoteIkeextSaGetById2 is the specific implementation of IkeextSaGetById used in Windows 8. See WFP Version-Independent /// Names and Targeting Specific Versions of Windows for more information. For Windows 7, IkeextSaGetById1 is available. For Windows /// Vista, IkeextSaGetById0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// The SA identifier. /// /// /// Type: GUID* /// /// Optional pointer to the SA lookup context propagated from the SA to data connections flowing over that SA. It is made available to /// any application that queries socket security properties using the Winsock API WSAQuerySocketSecurity function, allowing the /// application to obtain detailed IPsec authentication information for its connection. /// /// /// /// Type: IKEEXT_SA_DETAILS2** /// Address of the SA details. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SA 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 sa by a call to FwpmFreeMemory0. /// The caller needs FWPM_ACTRL_READ access to the IKE/AuthIP security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ikeextsagetbyid2 DWORD IkeextSaGetById2( [in] HFWPENG engineHandle, // [in] UINT64 id, [in, optional] GUID *saLookupContext, [out] IKEEXT_SA_DETAILS2 **sa ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IkeextSaGetById2")] public static Win32Error IkeextSaGetById2([In] HFWPENG engineHandle, ulong id, Guid? saLookupContext, out SafeFwpmStruct sa) { using SafeCoTaskMemStruct pCtx = saLookupContext; Win32Error err = IkeextSaGetById2(engineHandle, id, (IntPtr)pCtx, out SafeFwpmMem mem); sa = mem; return err; } /// /// The IPsecDospGetSecurityInfo0 function retrieves a copy of the security descriptor for the IPsec DoS Protection database. /// /// /// 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 retrieved successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned /// parameters must not be freed, as they point to addresses within the securityDescriptor parameter. /// /// /// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described /// in the GetSecurityInfo reference topic. /// /// /// IPsecDospGetSecurityInfo0 is a specific implementation of IPsecDospGetSecurityInfo. 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-ipsecdospgetsecurityinfo0 DWORD IPsecDospGetSecurityInfo0( [in] // HFWPENG engineHandle, [in] SECURITY_INFORMATION securityInfo, [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup, [out, // optional] PACL *dacl, [out, optional] PACL *sacl, [out] PSECURITY_DESCRIPTOR *securityDescriptor ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecDospGetSecurityInfo0")] public static extern Win32Error IPsecDospGetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// The IPsecDospGetStatistics0 function retrieves Internet Protocol Security (IPsec) DoS Protection statistics. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_DOSP_STATISTICS0* /// Top-level object of IPsec DoS Protection statistics organization. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec DoS Protection statistics were successfully returned. /// /// /// 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_READ_STATS access to the IPsec DoS Protection component. See Access Control for more information. /// /// IPsecDospGetStatistics0 is a specific implementation of IPsecDospGetStatistics. 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-ipsecdospgetstatistics0 DWORD IPsecDospGetStatistics0( [in] HFWPENG // engineHandle, [out] IPSEC_DOSP_STATISTICS0 *idpStatistics ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecDospGetStatistics0")] public static extern Win32Error IPsecDospGetStatistics0([In] HFWPENG engineHandle, out IPSEC_DOSP_STATISTICS0 idpStatistics); /// /// The IPsecDospSetSecurityInfo0 function sets specified security information in the security descriptor of the IPsec DoS /// Protection database. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: SECURITY_INFORMATION /// The type of security information to set. /// /// /// Type: const SID* /// The owner's security identifier (SID) to be set in the security descriptor. /// /// /// Type: const SID* /// The group's SID to be set in the security descriptor. /// /// /// Type: const ACL* /// The discretionary access control list (DACL) to be set in the security descriptor. /// /// /// Type: const ACL* /// The system access control list (SACL) to be set in the security descriptor. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The security information was set successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described /// in the SetSecurityInfo reference topic. /// /// /// IPsecDospSetSecurityInfo0 is a specific implementation of IPsecDospSetSecurityInfo. 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-ipsecdospsetsecurityinfo0 DWORD IPsecDospSetSecurityInfo0( [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.IPsecDospSetSecurityInfo0")] public static extern Win32Error IPsecDospSetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// /// The IPsecDospStateCreateEnumHandle0 function creates a handle used to enumerate a set of IPsec DoS Protection objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const IPSEC_DOSP_STATE_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle for the newly created enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumeration 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 IPsec DoS Protection objects are returned. /// The caller must call IPsecDospStateDestroyEnumHandle0 to free the returned handle. /// The caller needs FWPM_ACTRL_READ_STATS access to the IPsec DoS Protection component. See Access Control for more information. /// /// IPsecDospStateCreateEnumHandle0 is a specific implementation of IPsecDospStateCreateEnumHandle. 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-ipsecdospstatecreateenumhandle0 DWORD // IPsecDospStateCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const IPSEC_DOSP_STATE_ENUM_TEMPLATE0 *enumTemplate, [out] // HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecDospStateCreateEnumHandle0")] public static extern Win32Error IPsecDospStateCreateEnumHandle0([In] HFWPENG engineHandle, in IPSEC_DOSP_STATE_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// /// The IPsecDospStateCreateEnumHandle0 function creates a handle used to enumerate a set of IPsec DoS Protection objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const IPSEC_DOSP_STATE_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle for the newly created enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumeration 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 IPsec DoS Protection objects are returned. /// The caller must call IPsecDospStateDestroyEnumHandle0 to free the returned handle. /// The caller needs FWPM_ACTRL_READ_STATS access to the IPsec DoS Protection component. See Access Control for more information. /// /// IPsecDospStateCreateEnumHandle0 is a specific implementation of IPsecDospStateCreateEnumHandle. 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-ipsecdospstatecreateenumhandle0 DWORD // IPsecDospStateCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const IPSEC_DOSP_STATE_ENUM_TEMPLATE0 *enumTemplate, [out] // HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecDospStateCreateEnumHandle0")] public static extern Win32Error IPsecDospStateCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// The IPsecDospStateDestroyEnumHandle0 function frees a handle returned by IPsecDospStateCreateEnumHandle0. /// /// 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 enumeration to destroy. Previously created by a call to IPsecDospStateCreateEnumHandle0. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumeration 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. /// /// /// /// /// IPsecDospStateDestroyEnumHandle0 is a specific implementation of IPsecDospStateDestroyEnumHandle. 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-ipsecdospstatedestroyenumhandle0 DWORD // IPsecDospStateDestroyEnumHandle0( [in] HFWPENG engineHandle, [in, out] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecDospStateDestroyEnumHandle0")] public static extern Win32Error IPsecDospStateDestroyEnumHandle0([In] HFWPENG engineHandle, [In, Out] HANDLE enumHandle); /// /// The IPsecDospStateEnum0 function returns the next page of results from the IPsec DoS Protection state enumerator. Each IPsec /// DoS Protection state entry corresponds to a flow that has successfully passed the IPsec DoS Protection authentication checks. /// /// /// 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 an IPsec DoS Protection enumeration. Call IPsecDospStateCreateEnumHandle0 to obtain an enumeration handle. /// /// /// Type: UINT32 /// The number of enumeration entries requested. /// /// /// Type: IPSEC_DOSP_STATE0*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The results 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 numEntries 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. /// /// IPsecDospStateEnum0 is a specific implementation of IPsecDospStateEnum. 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-ipsecdospstateenum0 DWORD IPsecDospStateEnum0( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_DOSP_STATE0 ***entries, [out] UINT32 *numEntries ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecDospStateEnum0")] public static extern Win32Error IPsecDospStateEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntries); /// /// The IPsecDospStateEnum0 function returns the next page of results from the IPsec DoS Protection state enumerator. Each IPsec /// DoS Protection state entry corresponds to a flow that has successfully passed the IPsec DoS Protection authentication checks. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_DOSP_STATE0*** /// Addresses of the enumeration entries. /// /// /// Type: const IPSEC_DOSP_STATE_ENUM_TEMPLATE0* /// Template for selectively restricting the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The results 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 IPsec DoS Protection objects are returned. /// /// IPsecDospStateEnum0 is a specific implementation of IPsecDospStateEnum. 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-ipsecdospstateenum0 DWORD IPsecDospStateEnum0( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_DOSP_STATE0 ***entries, [out] UINT32 *numEntries ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecDospStateEnum0")] public static Win32Error IPsecDospStateEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, IPSEC_DOSP_STATE_ENUM_TEMPLATE0? enumTemplate = null) => FwpmGenericEnum(IPsecDospStateCreateEnumHandle0, IPsecDospStateEnum0, IPsecDospStateDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The IPsecGetStatistics0 function retrieves Internet Protocol Security (IPsec) statistics. /// /// NoteIPsecGetStatistics0 is the specific implementation of IPsecGetStatistics used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecGetStatistics1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_STATISTICS0* /// Top-level object of IPsec statistics organization. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec statistics were 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. /// /// /// /// /// /// 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_READ_STATS access to the IPsec security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecgetstatistics0 DWORD IPsecGetStatistics0( [in] HFWPENG // engineHandle, [out] IPSEC_STATISTICS0 *ipsecStatistics ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecGetStatistics0")] public static extern Win32Error IPsecGetStatistics0([In] HFWPENG engineHandle, out IPSEC_STATISTICS0 ipsecStatistics); /// /// The IPsecGetStatistics1 function retrieves Internet Protocol Security (IPsec) statistics. /// /// NoteIPsecGetStatistics1 is the specific implementation of IPsecGetStatistics used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecGetStatistics0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_STATISTICS1* /// Top-level object of IPsec statistics organization. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec statistics were 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. /// /// /// /// /// /// 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_READ_STATS access to the IPsec security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecgetstatistics1 DWORD IPsecGetStatistics1( [in] HFWPENG // engineHandle, [out] IPSEC_STATISTICS1 *ipsecStatistics ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecGetStatistics1")] public static extern Win32Error IPsecGetStatistics1([In] HFWPENG engineHandle, out IPSEC_STATISTICS1 ipsecStatistics); /// The IPsecKeyManagerAddAndRegister0 function registers a Trusted Intermediary Agent (TIA) with IPsec. /// /// Type: HANDLE /// A handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const IPSEC_KEY_MANAGER0* /// The set of key management callbacks which IPsec will invoke. /// /// /// Type: const IPSEC_KEY_MANAGER_CALLBACKS0* /// The set of callbacks which should be invoked by IPsec at various stages of SA negotiation. /// /// /// Type: HANDLE* /// Address of the newly created registration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The TIA was successfully registered. /// /// /// 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. /// /// /// FWP_E_ALREADY_EXISTS 0x80320009L /// The TIA was not registered successfully because another TIA has already been registered to dictate keys. /// /// /// FWP_E_INVALID_INTERVAL 0x80320021L /// The TIA was not registered successfully because keyDictationTimeoutHint exceeded the maximum allowed value of 10 seconds. /// /// /// SEC_E_CANNOT_INSTALL 0x80090307L /// /// The TIA was not registered successfully because the binary image has not set the IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY property. /// /// /// /// /// /// /// If the IPSEC_KEY_MANAGER_FLAG_DICTATE_KEY flag is set for keyManager, all three callback members of /// keyManagerCallbacks must be specified; otherwise, only the keyNotify callback should be specified /// /// /// 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-ipseckeymanageraddandregister0 DWORD IPsecKeyManagerAddAndRegister0( // [in] HFWPENG engineHandle, [in] const IPSEC_KEY_MANAGER0 *keyManager, [in] const IPSEC_KEY_MANAGER_CALLBACKS0 *keyManagerCallbacks, // [out] HANDLE *keyMgmtHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecKeyManagerAddAndRegister0")] public static extern Win32Error IPsecKeyManagerAddAndRegister0([In] HFWPENG engineHandle, in IPSEC_KEY_MANAGER0 keyManager, in IPSEC_KEY_MANAGER_CALLBACKS0 keyManagerCallbacks, out HIPSECKEYMGRREG keyMgmtHandle); /// /// The IPsecKeyManagerGetSecurityInfoByKey0 function retrieves a copy of the security descriptor that controls access to the key manager. /// /// /// Type: HANDLE /// A handle to an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const void* /// Reserved. Must be set to NULL. /// /// /// 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. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipseckeymanagergetsecurityinfobykey0 DWORD // IPsecKeyManagerGetSecurityInfoByKey0( [in] HFWPENG engineHandle, const void *reserved, [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.IPsecKeyManagerGetSecurityInfoByKey0")] public static extern Win32Error IPsecKeyManagerGetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr reserved, SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// /// The IPsecKeyManagerSetSecurityInfoByKey0 function sets specified security information in the security descriptor that controls /// access to the key manager. /// /// /// Type: HANDLE /// A handle to an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const void* /// Reserved. Should be specified as NULL. /// /// /// 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. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipseckeymanagersetsecurityinfobykey0 DWORD // IPsecKeyManagerSetSecurityInfoByKey0( [in] HFWPENG engineHandle, const void *reserved, [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.IPsecKeyManagerSetSecurityInfoByKey0")] public static extern Win32Error IPsecKeyManagerSetSecurityInfoByKey0([In] HFWPENG engineHandle, [In, Optional] IntPtr reserved, SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// The IPsecKeyManagersGet0 function returns a list of current Trusted Intermediary Agents (TIAs). /// /// Type: HANDLE /// A handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_KEY_MANAGER0*** /// All of the current TIAs. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The list of current TIAs was successfully returned. /// /// /// 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 of entries (but not the individual entries themselves) must be freed by a call to FwpmFreeMemory0. // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipseckeymanagersget0 DWORD IPsecKeyManagersGet0( [in] HFWPENG // engineHandle, [out] IPSEC_KEY_MANAGER0 ***entries, [out] UINT32 *numEntries ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecKeyManagersGet0")] public static Win32Error IPsecKeyManagersGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) => FwpmGenericGetSubs(IPsecKeyManagersGet0, engineHandle, out entries); /// /// The IPsecKeyManagerUnregisterAndDelete0 function unregisters a Trusted Intermediary Agent (TIA) which had previously been /// registered with IPsec. /// /// /// Type: HANDLE /// A handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: HANDLE /// Address of the previously created registration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The TIA was successfully unregistered. /// /// /// 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-ipseckeymanagerunregisteranddelete0 DWORD // IPsecKeyManagerUnregisterAndDelete0( [in] HFWPENG engineHandle, [in] HANDLE keyMgmtHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecKeyManagerUnregisterAndDelete0")] public static extern Win32Error IPsecKeyManagerUnregisterAndDelete0([In] HFWPENG engineHandle, [In] HIPSECKEYMGRREG keyMgmtHandle); /// /// The IPsecSaContextAddInbound0 function adds an inbound IPsec security association (SA) bundle to an existing SA context. /// /// NoteIPsecSaContextAddInbound0 is the specific implementation of IPsecSaContextAddInbound used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecSaContextAddInbound1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// Identifier for the existing IPsec SA context. This is the value returned in the id parameter by the call to IPsecSaContextCreate0. /// /// /// Type: IPSEC_SA_BUNDLE0* /// The inbound IPsec SA bundle to be added to the SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA bundle was successfully added to the SA context. /// /// /// 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-ipsecsacontextaddinbound0 DWORD IPsecSaContextAddInbound0( [in] // HFWPENG engineHandle, [in] UINT64 id, [in] const IPSEC_SA_BUNDLE0 *inboundBundle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextAddInbound0")] public static extern Win32Error IPsecSaContextAddInbound0([In] HFWPENG engineHandle, ulong id, in IPSEC_SA_BUNDLE0 inboundBundle); /// /// The IPsecSaContextAddInbound1 function adds an inbound IPsec security association (SA) bundle to an existing SA context. /// /// NoteIPsecSaContextAddInbound1 is the specific implementation of IPsecSaContextAddInbound used in Windows 7 and later. /// See WFP Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, /// IPsecSaContextAddInbound0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// Identifier for the existing IPsec SA context. This is the value returned in the id parameter by the call to IPsecSaContextCreate1. /// /// /// Type: IPSEC_SA_BUNDLE1* /// The inbound IPsec SA bundle to be added to the SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA bundle was successfully added to the SA context. /// /// /// 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-ipsecsacontextaddinbound1 DWORD IPsecSaContextAddInbound1( [in] // HFWPENG engineHandle, [in] UINT64 id, [in] const IPSEC_SA_BUNDLE1 *inboundBundle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextAddInbound1")] public static extern Win32Error IPsecSaContextAddInbound1([In] HFWPENG engineHandle, ulong id, in IPSEC_SA_BUNDLE1 inboundBundle); /// /// The IPsecSaContextAddOutbound0 function adds an outbound IPsec security association (SA) bundle to an existing SA context. /// /// NoteIPsecSaContextAddOutbound0 is the specific implementation of IPsecSaContextAddOutbound used in Windows Vista. See /// WFP Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecSaContextAddOutbound1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// Identifier for the existing IPsec SA context. This is the value returned in the id parameter by the call to IPsecSaContextCreate0. /// /// /// Type: IPSEC_SA_BUNDLE0* /// The outbound IPsec SA bundle to be added to the SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA bundle was successfully added to the SA context. /// /// /// 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-ipsecsacontextaddoutbound0 DWORD IPsecSaContextAddOutbound0( [in] // HFWPENG engineHandle, [in] UINT64 id, [in] const IPSEC_SA_BUNDLE0 *outboundBundle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextAddOutbound0")] public static extern Win32Error IPsecSaContextAddOutbound0([In] HFWPENG engineHandle, ulong id, in IPSEC_SA_BUNDLE0 outboundBundle); /// /// The IPsecSaContextAddOutbound1 function adds an outbound IPsec security association (SA) bundle to an existing SA context. /// /// NoteIPsecSaContextAddOutbound1 is the specific implementation of IPsecSaContextAddOutbound used in Windows 7 and later. /// See WFP Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, /// IPsecSaContextAddOutbound0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// Identifier for the existing IPsec SA context. This is the value returned in the id parameter by the call to IPsecSaContextCreate1. /// /// /// Type: IPSEC_SA_BUNDLE1* /// The outbound IPsec SA bundle to be added to the SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA bundle was successfully added to the SA context. /// /// /// 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-ipsecsacontextaddoutbound1 DWORD IPsecSaContextAddOutbound1( [in] // HFWPENG engineHandle, [in] UINT64 id, [in] const IPSEC_SA_BUNDLE1 *outboundBundle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextAddOutbound1")] public static extern Win32Error IPsecSaContextAddOutbound1([In] HFWPENG engineHandle, ulong id, in IPSEC_SA_BUNDLE1 outboundBundle); /// /// The IPsecSaContextCreate0 function creates an IPsec security association (SA) context. /// /// NoteIPsecSaContextCreate0 is the specific implementation of IPsecSaContextCreate used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecSaContextCreate1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_TRAFFIC0* /// The outbound traffic of the SA. /// /// /// Type: UINT64* /// /// Optional filter identifier of the cached inbound filter corresponding to the outboundTraffic parameter specified by the /// caller. Base filtering engine (BFE) may cache the inbound filter identifier and return the cached value, if available. Caller must /// handle the case when BFE does not have a cached value, in which case this parameter will be set to 0. /// /// /// /// Type: UINT64* /// The identifier of the IPsec SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context 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. /// /// /// This function cannot be called from within a dynamic session. The call will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS. See /// Object Management for more information about dynamic sessions. /// /// The caller needs FWPM_ACTRL_ADD access to the IPsec security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextcreate0 DWORD IPsecSaContextCreate0( [in] HFWPENG // engineHandle, [in] const IPSEC_TRAFFIC0 *outboundTraffic, [out, optional] UINT64 *inboundFilterId, [out] UINT64 *id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextCreate0")] public static extern Win32Error IPsecSaContextCreate0([In] HFWPENG engineHandle, in IPSEC_TRAFFIC0 outboundTraffic, out ulong inboundFilterId, out ulong id); /// /// The IPsecSaContextCreate1 function creates an IPsec security association (SA) context. /// /// NoteIPsecSaContextCreate1 is the specific implementation of IPsecSaContextCreate used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaContextCreate0 /// is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_TRAFFIC1* /// The outbound traffic of the SA. /// /// /// Type: IPSEC_VIRTUAL_IF_TUNNEL_INFO0* /// Details related to virtual interface tunneling. /// /// /// Type: UINT64* /// /// Optional filter identifier of the cached inbound filter corresponding to the outboundTraffic parameter specified by the /// caller. Base filtering engine (BFE) may cache the inbound filter identifier and return the cached value, if available. Caller must /// handle the case when BFE does not have a cached value, in which case this parameter will be set to 0. /// /// /// /// Type: UINT64* /// The identifier of the IPsec SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context 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. /// /// /// This function cannot be called from within a dynamic session. The call will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS. See /// Object Management for more information about dynamic sessions. /// /// The caller needs FWPM_ACTRL_ADD access to the IPsec security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextcreate1 DWORD IPsecSaContextCreate1( [in] HFWPENG // engineHandle, [in] const IPSEC_TRAFFIC1 *outboundTraffic, [in, optional] const IPSEC_VIRTUAL_IF_TUNNEL_INFO0 *virtualIfTunnelInfo, // [out, optional] UINT64 *inboundFilterId, [out] UINT64 *id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextCreate1")] public static extern Win32Error IPsecSaContextCreate1([In] HFWPENG engineHandle, in IPSEC_TRAFFIC1 outboundTraffic, in IPSEC_VIRTUAL_IF_TUNNEL_INFO0 virtualIfTunnelInfo, out ulong inboundFilterId, out ulong id); /// /// The IPsecSaContextCreate1 function creates an IPsec security association (SA) context. /// /// NoteIPsecSaContextCreate1 is the specific implementation of IPsecSaContextCreate used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaContextCreate0 /// is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_TRAFFIC1* /// The outbound traffic of the SA. /// /// /// Type: IPSEC_VIRTUAL_IF_TUNNEL_INFO0* /// Details related to virtual interface tunneling. /// /// /// Type: UINT64* /// /// Optional filter identifier of the cached inbound filter corresponding to the outboundTraffic parameter specified by the /// caller. Base filtering engine (BFE) may cache the inbound filter identifier and return the cached value, if available. Caller must /// handle the case when BFE does not have a cached value, in which case this parameter will be set to 0. /// /// /// /// Type: UINT64* /// The identifier of the IPsec SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context 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. /// /// /// This function cannot be called from within a dynamic session. The call will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS. See /// Object Management for more information about dynamic sessions. /// /// The caller needs FWPM_ACTRL_ADD access to the IPsec security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextcreate1 DWORD IPsecSaContextCreate1( [in] HFWPENG // engineHandle, [in] const IPSEC_TRAFFIC1 *outboundTraffic, [in, optional] const IPSEC_VIRTUAL_IF_TUNNEL_INFO0 *virtualIfTunnelInfo, // [out, optional] UINT64 *inboundFilterId, [out] UINT64 *id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextCreate1")] public static extern Win32Error IPsecSaContextCreate1([In] HFWPENG engineHandle, in IPSEC_TRAFFIC1 outboundTraffic, [In, Optional] IntPtr virtualIfTunnelInfo, out ulong inboundFilterId, out ulong id); /// /// The IPsecSaContextCreateEnumHandle0 function creates a handle used to enumerate a set of IPsec security association (SA) /// context objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle for SA context enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumerator was created successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// If enumTemplate is NULL, all IPsec SA objects are returned. /// The caller must call IPsecSaContextDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_ENUM and FWPM_ACTRL_READ access to the IPsec security associations database. See Access Control /// for more information. /// /// /// IPsecSaContextCreateEnumHandle0 is a specific implementation of IPsecSaContextCreateEnumHandle. 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-ipsecsacontextcreateenumhandle0 DWORD // IPsecSaContextCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0 *enumTemplate, [out] // HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextCreateEnumHandle0")] public static extern Win32Error IPsecSaContextCreateEnumHandle0([In] HFWPENG engineHandle, in IPSEC_SA_CONTEXT_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// /// The IPsecSaContextCreateEnumHandle0 function creates a handle used to enumerate a set of IPsec security association (SA) /// context objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: HANDLE* /// Address of a HANDLE variable. On function return, it contains the handle for SA context enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumerator was created successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// If enumTemplate is NULL, all IPsec SA objects are returned. /// The caller must call IPsecSaContextDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_ENUM and FWPM_ACTRL_READ access to the IPsec security associations database. See Access Control /// for more information. /// /// /// IPsecSaContextCreateEnumHandle0 is a specific implementation of IPsecSaContextCreateEnumHandle. 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-ipsecsacontextcreateenumhandle0 DWORD // IPsecSaContextCreateEnumHandle0( [in] HFWPENG engineHandle, [in, optional] const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0 *enumTemplate, [out] // HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextCreateEnumHandle0")] public static extern Win32Error IPsecSaContextCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// The IPsecSaContextDeleteById0 function deletes an IPsec security association (SA) context. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// /// A runtime identifier for the object being removed from the system. This identifier was received from the system when the application /// called IPsecSaContextCreate0. /// /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context was successfully deleted. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// This function cannot be called from within a 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. The call will fail with FWP_E_DYNAMIC_SESSION_IN_PROGRESS. See /// Object Management for more information about dynamic sessions. /// /// The caller needs DELETE access to the IPsec security associations database. See Access Control for more information. /// /// IPsecSaContextDeleteById0 is a specific implementation of IPsecSaContextDeleteById. 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-ipsecsacontextdeletebyid0 DWORD IPsecSaContextDeleteById0( [in] // HFWPENG engineHandle, [in] UINT64 id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextDeleteById0")] public static extern Win32Error IPsecSaContextDeleteById0([In] HFWPENG engineHandle, ulong id); /// The IPsecSaContextDestroyEnumHandle0 function frees a handle returned by IPsecSaContextCreateEnumHandle0. /// /// 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 an IPsec security association (SA) context enumeration returned by IPsecSaContextCreateEnumHandle0. /// /// /// 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. /// /// /// /// /// IPsecSaContextDestroyEnumHandle0 is a specific implementation of IPsecSaContextDestroyEnumHandle. 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-ipsecsacontextdestroyenumhandle0 DWORD // IPsecSaContextDestroyEnumHandle0( [in] HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextDestroyEnumHandle0")] public static extern Win32Error IPsecSaContextDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// /// The IPsecSaContextEnum0 function returns the next page of results from the IPsec security association (SA) context enumerator. /// /// NoteIPsecSaContextEnum0 is the specific implementation of IPsecSaContextEnum used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecSaContextEnum1 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 an SA context enumeration returned by IPsecSaContextCreateEnumHandle0. /// /// /// Type: UINT32 /// Number of SA contexts requested. /// /// /// Type: IPSEC_SA_CONTEXT0*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of SA contexts returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA contexts were enumerated successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// If the numEntriesReturned is less than the numEntriesRequested, the enumeration is exhausted. /// The returned array of entries (but not the individual entries themselves) must be freed by a call to FwpmFreeMemory0. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextenum0 DWORD IPsecSaContextEnum0( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_CONTEXT0 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextEnum0")] public static extern Win32Error IPsecSaContextEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The IPsecSaContextEnum0 function returns the next page of results from the IPsec security association (SA) context enumerator. /// /// NoteIPsecSaContextEnum0 is the specific implementation of IPsecSaContextEnum used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecSaContextEnum1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_SA_CONTEXT0*** /// Addresses of the enumeration entries. /// /// /// Type: const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA contexts were enumerated successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// If enumTemplate is NULL, all IPsec SA objects are returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextenum0 DWORD IPsecSaContextEnum0( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_CONTEXT0 ***entries, [out] UINT32 // *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextEnum0")] public static Win32Error IPsecSaContextEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, IPSEC_SA_CONTEXT_ENUM_TEMPLATE0? enumTemplate) => FwpmGenericEnum(IPsecSaContextCreateEnumHandle0, IPsecSaContextEnum0, IPsecSaContextDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The IPsecSaContextEnum1 function returns the next page of results from the IPsec security association (SA) context enumerator. /// /// NoteIPsecSaContextEnum1 is the specific implementation of IPsecSaContextEnum used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaContextEnum0 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 an SA context enumeration returned by IPsecSaContextCreateEnumHandle0. /// /// /// Type: UINT32 /// Number of SA contexts requested. /// /// /// Type: IPSEC_SA_CONTEXT1*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of SA contexts returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA contexts were enumerated successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// If the numEntriesReturned is less than the numEntriesRequested, the enumeration is exhausted. /// The returned array of entries (but not the individual entries themselves) must be freed by a call to FwpmFreeMemory0. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextenum1 DWORD IPsecSaContextEnum1( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_CONTEXT1 ***entries, [out] UINT32 // *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextEnum1")] public static extern Win32Error IPsecSaContextEnum1([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The IPsecSaContextEnum1 function returns the next page of results from the IPsec security association (SA) context enumerator. /// /// NoteIPsecSaContextEnum1 is the specific implementation of IPsecSaContextEnum used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaContextEnum0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_SA_CONTEXT1*** /// Addresses of the enumeration entries. /// /// /// Type: const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA contexts were enumerated successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// If enumTemplate is NULL, all IPsec SA objects are returned. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextenum1 DWORD IPsecSaContextEnum1( [in] HFWPENG // engineHandle, [in] HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_CONTEXT1 ***entries, [out] UINT32 // *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextEnum1")] public static Win32Error IPsecSaContextEnum1([In] HFWPENG engineHandle, out SafeFwpmArray entries, IPSEC_SA_CONTEXT_ENUM_TEMPLATE0? enumTemplate) => FwpmGenericEnum(IPsecSaContextCreateEnumHandle0, IPsecSaContextEnum1, IPsecSaContextDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// The IPsecSaContextExpire0 function indicates that an IPsec security association (SA) context should be expired. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// A runtime identifier for SA context. This identifier was received from the system when the application called IPsecSaContextCreate0. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context was successfully expired. /// /// /// 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. /// /// /// /// /// /// When an SA context is expired, the corresponding outbound SA gets deleted immediately, whereas the inbound SA deletion is postponed /// for a minute. This allows the processing of any inbound IPsec protected traffic that may still be on the wire. /// /// The caller needs DELETE access to the IPsec security associations database. See Access Control for more information. /// /// IPsecSaContextExpire0 is a specific implementation of IPsecSaContextExpire. 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-ipsecsacontextexpire0 DWORD IPsecSaContextExpire0( [in] HFWPENG // engineHandle, [in] UINT64 id ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextExpire0")] public static extern Win32Error IPsecSaContextExpire0([In] HFWPENG engineHandle, ulong id); /// /// The IPsecSaContextGetById0 function retrieves an IPsec security association (SA) context. /// /// NoteIPsecSaContextGetById0 is the specific implementation of IPsecSaContextGetById used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecSaContextGetById1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// A runtime identifier for the SA context. This identifier was received from the system when the application called IPsecSaContextCreate0. /// /// /// Type: IPSEC_SA_CONTEXT0** /// Address of the IPsec SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context 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 caller must free the returned object, saContext, by a call to FwpmFreeMemory0. /// The caller needs FWPM_ACTRL_READ access to the IPsec security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextgetbyid0 DWORD IPsecSaContextGetById0( [in] HFWPENG // engineHandle, [in] UINT64 id, [out] IPSEC_SA_CONTEXT0 **saContext ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextGetById0")] public static Win32Error IPsecSaContextGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmStruct saContext) => FwpmGenericGetById(IPsecSaContextGetById0, engineHandle, id, out saContext); /// /// The IPsecSaContextGetById1 function retrieves an IPsec security association (SA) context. /// /// NoteIPsecSaContextGetById1 is the specific implementation of IPsecSaContextGetById used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaContextGetById0 /// is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// A runtime identifier for the SA context. This identifier was received from the system when the application called IPsecSaContextCreate0. /// /// /// Type: IPSEC_SA_CONTEXT1** /// Address of the IPsec SA context. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context 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 caller must free the returned object, saContext, by a call to FwpmFreeMemory0. /// The caller needs FWPM_ACTRL_READ access to the IPsec security associations database. See Access Control for more information. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextgetbyid1 DWORD IPsecSaContextGetById1( [in] HFWPENG // engineHandle, [in] UINT64 id, [out] IPSEC_SA_CONTEXT1 **saContext ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextGetById1")] public static Win32Error IPsecSaContextGetById1([In] HFWPENG engineHandle, ulong id, out SafeFwpmStruct saContext) => FwpmGenericGetById(IPsecSaContextGetById1, engineHandle, id, out saContext); /// /// The IPsecSaContextGetSpi0 function retrieves the security parameters index (SPI) for a security association (SA) context. /// /// NoteIPsecSaContextGetSpi0 is the specific implementation of IPsecSaContextGetSpi used in Windows Vista. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows 7 and later, /// IPsecSaContextGetSpi1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// A runtime identifier for the SA context. This identifier was received from the system when the application called IPsecSaContextCreate0. /// /// /// Type: IPSEC_GETSPI0* /// The inbound IPsec traffic. /// /// /// Type: IPSEC_SA_SPI* /// The inbound SA SPI. The IPSEC_SA_SPI data type maps to the UINT32 data type. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SPI for the IPsec SA context was retrieved successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// The caller needs FWPM_ACTRL_ADD access to the IPsec security associations database. See Access Control for more information. // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextgetspi0 DWORD IPsecSaContextGetSpi0( [in] HFWPENG // engineHandle, [in] UINT64 id, [in] const IPSEC_GETSPI0 *getSpi, [out] IPSEC_SA_SPI *inboundSpi ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextGetSpi0")] public static extern Win32Error IPsecSaContextGetSpi0([In] HFWPENG engineHandle, ulong id, in IPSEC_GETSPI0 getSpi, out uint inboundSpi); /// /// The IPsecSaContextGetSpi1 function retrieves the security parameters index (SPI) for a security association (SA) context. /// /// NoteIPsecSaContextGetSpi1 is the specific implementation of IPsecSaContextGetSpi used in Windows 7 and later. See WFP /// Version-Independent Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaContextGetSpi0 /// is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// A runtime identifier for the SA context. This identifier was received from the system when the application called IPsecSaContextCreate1. /// /// /// Type: IPSEC_GETSPI1* /// The inbound IPsec traffic. /// /// /// Type: IPSEC_SA_SPI* /// The inbound SA SPI. The IPSEC_SA_SPI data type maps to the UINT32 data type. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SPI for the IPsec SA context was retrieved successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// The caller needs FWPM_ACTRL_ADD access to the IPsec security associations database. See Access Control for more information. // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextgetspi1 DWORD IPsecSaContextGetSpi1( [in] HFWPENG // engineHandle, [in] UINT64 id, [in] const IPSEC_GETSPI1 *getSpi, [out] IPSEC_SA_SPI *inboundSpi ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextGetSpi1")] public static extern Win32Error IPsecSaContextGetSpi1([In] HFWPENG engineHandle, ulong id, in IPSEC_GETSPI1 getSpi, out uint inboundSpi); /// The IPsecSaContextSetSpi0 function sets the security parameters index (SPI) for a security association (SA) context. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT64 /// A runtime identifier for the SA context. This identifier was received from the system when the application called IPsecSaContextCreate1. /// /// /// Type: IPSEC_GETSPI1* /// The inbound IPsec traffic. /// /// /// Type: IPSEC_SA_SPI /// The inbound SA SPI. The IPSEC_SA_SPI data type maps to the UINT32 data type. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SPI for the IPsec SA context 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. /// /// /// /// /// The caller needs FWPM_ACTRL_ADD access to the IPsec security associations database. See Access Control for more information. /// /// IPsecSaContextSetSpi0 is a specific implementation of IPsecSaContextSetSpi. 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-ipsecsacontextsetspi0 DWORD IPsecSaContextSetSpi0( [in] HFWPENG // engineHandle, [in] UINT64 id, [in] const IPSEC_GETSPI1 *getSpi, [in] IPSEC_SA_SPI inboundSpi ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextSetSpi0")] public static extern Win32Error IPsecSaContextSetSpi0([In] HFWPENG engineHandle, ulong id, in IPSEC_GETSPI1 getSpi, uint inboundSpi); /// /// The IPsecSaContextSubscribe0 function is used to request the delivery of notifications regarding a particular IPsec security /// association (SA) context. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: const IPSEC_SA_CONTEXT_SUBSCRIPTION0* /// The notifications which will be delivered. /// /// /// Type: IPSEC_SA_CONTEXT_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 IPsec SA context's container. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextsubscribe0 DWORD IPsecSaContextSubscribe0( [in] // HFWPENG engineHandle, [in] const IPSEC_SA_CONTEXT_SUBSCRIPTION0 *subscription, [in] IPSEC_SA_CONTEXT_CALLBACK0 callback, [in, // optional] void *context, [out] HANDLE *eventsHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextSubscribe0")] public static extern Win32Error IPsecSaContextSubscribe0([In] HFWPENG engineHandle, in IPSEC_SA_CONTEXT_SUBSCRIPTION0 subscription, [In] IPSEC_SA_CONTEXT_CALLBACK0 callback, [In, Optional] IntPtr context, out HIPSECSACTXSUB eventsHandle); /// /// The IPsecSaContextSubscriptionsGet0 function retrieves an array of all the current IPsec security association (SA) 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: IPSEC_SA_CONTEXT_SUBSCRIPTION0*** /// The current IPsec SA 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. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsacontextsubscriptionsget0 DWORD // IPsecSaContextSubscriptionsGet0( [in] HFWPENG engineHandle, [out] IPSEC_SA_CONTEXT_SUBSCRIPTION0 ***entries, [out] UINT32 *numEntries ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextSubscriptionsGet0")] public static Win32Error IPsecSaContextSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmArray entries) => FwpmGenericGetSubs(IPsecSaContextSubscriptionsGet0, engineHandle, out entries); /// /// The IPsecSaContextUnsubscribe0 function is used to cancel an IPsec security association (SA) 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 SA change notification. This is the returned handle from the call to IPsecSaContextSubscribe0. /// 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-ipsecsacontextunsubscribe0 DWORD IPsecSaContextUnsubscribe0( [in] // HFWPENG engineHandle, [in, out] HANDLE eventsHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextUnsubscribe0")] public static extern Win32Error IPsecSaContextUnsubscribe0([In] HFWPENG engineHandle, [In, Out] HIPSECSACTXSUB eventsHandle); /// The IPsecSaContextUpdate0 function updates an IPsec security association (SA) context. /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: UINT32 /// Flags indicating the specific field in the IPSEC_SA_CONTEXT1 structure that is being updated. /// Possible values: /// /// /// IPsec SA flag /// Meaning /// /// /// IPSEC_SA_DETAILS_UPDATE_TRAFFIC /// Updates the [IPSEC_SA_DETAILS1](/windows/desktop/api/ipsectypes/ns-ipsectypes-ipsec_sa_details1) structure. /// /// /// IPSEC_SA_DETAILS_UPDATE_UDP_ENCAPSULATION /// Updates the [IPSEC_SA_DETAILS1](/windows/desktop/api/ipsectypes/ns-ipsectypes-ipsec_sa_details1) structure. /// /// /// IPSEC_SA_BUNDLE_UPDATE_FLAGS /// Updates the [IPSEC_SA_BUNDLE1](/windows/desktop/api/ipsectypes/ns-ipsectypes-ipsec_sa_bundle1) structure. /// /// /// IPSEC_SA_BUNDLE_UPDATE_NAP_CONTEXT /// Updates the [IPSEC_SA_BUNDLE1](/windows/desktop/api/ipsectypes/ns-ipsectypes-ipsec_sa_bundle1) structure. /// /// /// IPSEC_SA_BUNDLE_UPDATE_KEY_MODULE_STATE /// Updates the [IPSEC_SA_BUNDLE1](/windows/desktop/api/ipsectypes/ns-ipsectypes-ipsec_sa_bundle1) structure. /// /// /// IPSEC_SA_BUNDLE_UPDATE_PEER_V4_PRIVATE_ADDRESS /// Updates the [IPSEC_SA_BUNDLE1](/windows/desktop/api/ipsectypes/ns-ipsectypes-ipsec_sa_bundle1) structure. /// /// /// IPSEC_SA_BUNDLE_UPDATE_MM_SA_ID /// Updates the [IPSEC_SA_BUNDLE1](/windows/desktop/api/ipsectypes/ns-ipsectypes-ipsec_sa_bundle1) structure. /// /// /// /// /// Type: IPSEC_SA_CONTEXT1* /// An inbound and outbound SA pair. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The IPsec SA context was updated 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. /// /// /// /// /// IPsecSaContextUpdate0 is a specific implementation of IPsecSaContextUpdate. 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-ipsecsacontextupdate0 DWORD IPsecSaContextUpdate0( [in] HFWPENG // engineHandle, [in] UINT64 flags, [in] const IPSEC_SA_CONTEXT1 *newValues ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaContextUpdate0")] public static extern Win32Error IPsecSaContextUpdate0([In] HFWPENG engineHandle, [In] IPSEC_SA_BUNDLE_UPDATE flags, in IPSEC_SA_CONTEXT1 newValues); /// /// The IPsecSaCreateEnumHandle0 function creates a handle used to enumerate a set of Internet Protocol Security (IPsec) security /// association (SA) objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_SA_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 enumeration 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 IPsec SA objects are returned. /// The caller must call IPsecSaDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_READ and FWPM_ACTRL_ENUM access to the IPsec security associations database. See Access Control /// for more information. /// /// /// IPsecSaCreateEnumHandle0 is a specific implementation of IPsecSaCreateEnumHandle. 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-ipsecsacreateenumhandle0 DWORD IPsecSaCreateEnumHandle0( [in] // HFWPENG engineHandle, [in, optional] const IPSEC_SA_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaCreateEnumHandle0")] public static extern Win32Error IPsecSaCreateEnumHandle0([In] HFWPENG engineHandle, in IPSEC_SA_ENUM_TEMPLATE0 enumTemplate, out HANDLE enumHandle); /// /// The IPsecSaCreateEnumHandle0 function creates a handle used to enumerate a set of Internet Protocol Security (IPsec) security /// association (SA) objects. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_SA_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 enumeration 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 IPsec SA objects are returned. /// The caller must call IPsecSaDestroyEnumHandle0 to free the returned handle. /// /// The caller needs FWPM_ACTRL_READ and FWPM_ACTRL_ENUM access to the IPsec security associations database. See Access Control /// for more information. /// /// /// IPsecSaCreateEnumHandle0 is a specific implementation of IPsecSaCreateEnumHandle. 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-ipsecsacreateenumhandle0 DWORD IPsecSaCreateEnumHandle0( [in] // HFWPENG engineHandle, [in, optional] const IPSEC_SA_ENUM_TEMPLATE0 *enumTemplate, [out] HANDLE *enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaCreateEnumHandle0")] public static extern Win32Error IPsecSaCreateEnumHandle0([In] HFWPENG engineHandle, [In, Optional] IntPtr enumTemplate, out HANDLE enumHandle); /// /// The IPsecSaDbGetSecurityInfo0 function retrieves a copy of the security descriptor for the IPsec security association (SA) database. /// /// /// 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 retrieved successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// The returned securityDescriptor parameter must be freed through a call to FwpmFreeMemory0. The other four (optional) returned /// parameters must not be freed, as they point to addresses within the securityDescriptor parameter. /// /// /// This function behaves like the standard Win32 GetSecurityInfo function. The caller needs the same standard access rights as described /// in the GetSecurityInfo reference topic. /// /// /// IPsecSaDbGetSecurityInfo0 is a specific implementation of IPsecSaDbGetSecurityInfo. 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-ipsecsadbgetsecurityinfo0 DWORD IPsecSaDbGetSecurityInfo0( [in] // HFWPENG engineHandle, [in] SECURITY_INFORMATION securityInfo, [out, optional] PSID *sidOwner, [out, optional] PSID *sidGroup, [out, // optional] PACL *dacl, [out, optional] PACL *sacl, [out] PSECURITY_DESCRIPTOR *securityDescriptor ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaDbGetSecurityInfo0")] public static extern Win32Error IPsecSaDbGetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, out PSID sidOwner, out PSID sidGroup, out PACL dacl, out PACL sacl, out SafeFwpmMem securityDescriptor); /// /// The IPsecSaDbSetSecurityInfo0 function sets specified security information in the security descriptor of the IPsec security /// association database. /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: SECURITY_INFORMATION /// The type of security information to set. /// /// /// Type: const SID* /// The owner's security identifier (SID) to be set in the security descriptor. /// /// /// Type: const SID* /// The group's SID to be set in the security descriptor. /// /// /// Type: const ACL* /// The discretionary access control list (DACL) to be set in the security descriptor. /// /// /// Type: const ACL* /// The system access control list (SACL) to be set in the security descriptor. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The security information was set successfully. /// /// /// FWP_E_* error code 0x80320001—0x80320039 /// A Windows Filtering Platform (WFP) specific error. See WFP Error Codes for details. /// /// /// RPC_* error code 0x80010001—0x80010122 /// Failure to communicate with the remote or local firewall engine. /// /// /// /// /// /// This function behaves like the standard Win32 SetSecurityInfo function. The caller needs the same standard access rights as described /// in the SetSecurityInfo reference topic. /// /// /// IPsecSaDbSetSecurityInfo0 is a specific implementation of IPsecSaDbSetSecurityInfo. 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-ipsecsadbsetsecurityinfo0 DWORD IPsecSaDbSetSecurityInfo0( [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.IPsecSaDbSetSecurityInfo0")] public static extern Win32Error IPsecSaDbSetSecurityInfo0([In] HFWPENG engineHandle, SECURITY_INFORMATION securityInfo, [In, Optional] PSID sidOwner, [In, Optional] PSID sidGroup, [In, Optional] PACL dacl, [In, Optional] PACL sacl); /// The IPsecSaDestroyEnumHandle0 function frees a handle returned by IPsecSaCreateEnumHandle0. /// /// 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 enumeration to destroy. Previously created by a call to IPsecSaCreateEnumHandle0. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The enumeration 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. /// /// /// /// /// IPsecSaDestroyEnumHandle0 is a specific implementation of IPsecSaDestroyEnumHandle. 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-ipsecsadestroyenumhandle0 DWORD IPsecSaDestroyEnumHandle0( [in] // HFWPENG engineHandle, [in] HANDLE enumHandle ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaDestroyEnumHandle0")] public static extern Win32Error IPsecSaDestroyEnumHandle0([In] HFWPENG engineHandle, [In] HANDLE enumHandle); /// /// The IPsecSaEnum0 function returns the next page of results from the IPsec security association (SA) enumerator. /// /// NoteIPsecSaEnum0 is the specific implementation of IPsecSaEnum used in Windows Vista. See WFP Version-Independent Names /// and Targeting Specific Versions of Windows for more information. For Windows 7 and later, IPsecSaEnum1 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 an IPsec SA enumeration. Call IPsecSaCreateEnumHandle0 to obtain an enumeration handle. /// /// /// Type: UINT32 /// The number of enumeration entries requested. /// /// /// Type: IPSEC_SA_DETAILS0*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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. /// IPsecSaEnum0 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsaenum0 DWORD IPsecSaEnum0( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_DETAILS0 ***entries, [out] UINT32 *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaEnum0")] public static extern Win32Error IPsecSaEnum0([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The IPsecSaEnum0 function returns the next page of results from the IPsec security association (SA) enumerator. /// /// NoteIPsecSaEnum0 is the specific implementation of IPsecSaEnum used in Windows Vista. See WFP Version-Independent Names /// and Targeting Specific Versions of Windows for more information. For Windows 7 and later, IPsecSaEnum1 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_SA_DETAILS0*** /// Addresses of the enumeration entries. /// /// /// Type: IPSEC_SA_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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 IPsec SA objects are returned. /// IPsecSaEnum0 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsaenum0 DWORD IPsecSaEnum0( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_DETAILS0 ***entries, [out] UINT32 *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaEnum0")] public static Win32Error IPsecSaEnum0([In] HFWPENG engineHandle, out SafeFwpmArray entries, IPSEC_SA_ENUM_TEMPLATE0? enumTemplate) => FwpmGenericEnum(IPsecSaCreateEnumHandle0, IPsecSaEnum0, IPsecSaDestroyEnumHandle0, engineHandle, out entries, enumTemplate); /// /// The IPsecSaEnum1 function returns the next page of results from the IPsec security association (SA) enumerator. /// /// NoteIPsecSaEnum1 is the specific implementation of IPsecSaEnum used in Windows 7 and later. See WFP Version-Independent /// Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaEnum0 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 an IPsec SA enumeration. Call IPsecSaCreateEnumHandle0 to obtain an enumeration handle. /// /// /// Type: UINT32 /// The number of enumeration entries requested. /// /// /// Type: IPSEC_SA_DETAILS1*** /// Addresses of the enumeration entries. /// /// /// Type: UINT32* /// The number of enumeration entries returned. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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. /// IPsecSaEnum1 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsaenum1 DWORD IPsecSaEnum1( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_DETAILS1 ***entries, [out] UINT32 *numEntriesReturned ); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaEnum1")] public static extern Win32Error IPsecSaEnum1([In] HFWPENG engineHandle, [In] HANDLE enumHandle, uint numEntriesRequested, out SafeFwpmMem entries, out uint numEntriesReturned); /// /// The IPsecSaEnum1 function returns the next page of results from the IPsec security association (SA) enumerator. /// /// NoteIPsecSaEnum1 is the specific implementation of IPsecSaEnum used in Windows 7 and later. See WFP Version-Independent /// Names and Targeting Specific Versions of Windows for more information. For Windows Vista, IPsecSaEnum0 is available. /// /// /// /// Type: HANDLE /// Handle for an open session to the filter engine. Call FwpmEngineOpen0 to open a session to the filter engine. /// /// /// Type: IPSEC_SA_DETAILS1*** /// Addresses of the enumeration entries. /// /// /// Type: IPSEC_SA_ENUM_TEMPLATE0* /// Template to selectively restrict the enumeration. /// /// /// Type: DWORD /// /// /// Return code/value /// Description /// /// /// ERROR_SUCCESS 0 /// The SAs 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 IPsec SA objects are returned. /// IPsecSaEnum1 works on a snapshot of the SAs taken at the time the enumeration handle was created. /// // https://docs.microsoft.com/en-us/windows/win32/api/fwpmu/nf-fwpmu-ipsecsaenum1 DWORD IPsecSaEnum1( [in] HFWPENG engineHandle, [in] // HANDLE enumHandle, [in] UINT32 numEntriesRequested, [out] IPSEC_SA_DETAILS1 ***entries, [out] UINT32 *numEntriesReturned ); [PInvokeData("fwpmu.h", MSDNShortId = "NF:fwpmu.IPsecSaEnum1")] public static Win32Error IPsecSaEnum1([In] HFWPENG engineHandle, out SafeFwpmArray entries, IPSEC_SA_ENUM_TEMPLATE0? enumTemplate) => FwpmGenericEnum(IPsecSaCreateEnumHandle0, IPsecSaEnum1, IPsecSaDestroyEnumHandle0, engineHandle, out entries, enumTemplate); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error FwpmSubLayerGetByKey0([In] HFWPENG engineHandle, in Guid key, out SafeFwpmMem subLayer); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error FwpmSystemPortsGet0([In, Optional] HFWPENG engineHandle, out SafeFwpmMem sysPorts); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error IkeextSaGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmMem sa); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error IkeextSaGetById1([In] HFWPENG engineHandle, ulong id, [In, Optional] IntPtr saLookupContext, out SafeFwpmMem sa); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error IkeextSaGetById2([In] HFWPENG engineHandle, ulong id, [In, Optional] IntPtr saLookupContext, out SafeFwpmMem sa); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error IPsecKeyManagersGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error IPsecSaContextGetById0([In] HFWPENG engineHandle, ulong id, out SafeFwpmMem saContext); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error IPsecSaContextGetById1([In] HFWPENG engineHandle, ulong id, out SafeFwpmMem saContext); [DllImport(Lib_Fwpuclnt, SetLastError = false, ExactSpelling = true)] private static extern Win32Error IPsecSaContextSubscriptionsGet0([In] HFWPENG engineHandle, out SafeFwpmMem entries, out uint numEntries); }