INetFwProducts::Register method (netfw.h)
The Register method registers a third-party firewall product.
Syntax
HRESULT Register(
[in] INetFwProduct *product,
[out, retval] IUnknown **registration
);
Parameters
[in] product
The INetFwProduct object that defines the product to be registered.
[out, retval] registration
The registration handle. The registration will be removed when this object is released.
Return value
If the method succeeds the return value is S_OK.
If the method fails, the return value is one of the following error codes.
Return code | Description |
---|---|
|
The product binary has not been signed. |
|
The operation was aborted due to permissions issues. |
|
The method failed due to an invalid parameter. |
|
The method was unable to allocate required memory. |
|
The method failed due to an invalid pointer. |
Remarks
Registrations only last for the lifetime of the Windows Firewall service. Third-party firewalls calling this API should also have a service dependency on the Windows Firewall service (mpssvc) to make sure that the service is not unexpectedly stopped, causing all registrations to be lost.
Registrations are removed when a returned registration object is released by the third-party firewall or when the third-party firewall process exits.
A user mode code module using this API should be linked with the /integritycheck linker flag. This flag sets IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY in the image PE header OptionalHeader.DllCharacteristics field, which enforces a signature check at load time. The code module should be digitally signed, consistent with the Authenticode signing procedure.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | netfw.h |
DLL | FirewallAPI.dll |