GetFirewallState
Will determine the firewall is currently providing protection.
If Windows SecurityCenter is enabled and the product reports to SecurityCenter then this method is implemented even if the product does not explicitly state that it is implemented.
Syntax
Method ID
#define WAAPI_MID_GET_FIREWALL_STATE 1007
JSON Input Structure
{
"input": {
"method": 1007,
"signature": number,
"show_profile_details": boolean
}
}
Input Properties
| Parameter | Type | Description |
|---|---|---|
show_profile_details | boolean | (optional) (Windows Firewall only) If true, will show some more details about the active profiles. Default value is 'false'. |
JSON Output Structure
{
"result": {
"method": 1007,
"code": number,
"timing": number,
"timestamp": string,
"enabled": boolean,
"profile_details": {
"(public or private or domain)": {
"enabled": boolean,
"block_inbound_connections": boolean,
"has_allow_all_outbound_rule": boolean,
"block_all_inbound_connections": boolean,
"block_outbound_connections": boolean,
"has_allow_all_inbound_rule": boolean,
"has_block_inbound_rule": boolean,
"has_block_outbound_rule": boolean
}
},
"managed_by_3rd_party_products": [
{
"displayName": string,
"pathToSignedProductExe": string,
"signature": number
},
...
]
}
}
Output Properties
| Property | Type | Description |
|---|---|---|
result.method | number | The method ID that generated this result. |
result.code | number | The result code. See Result Codes. |
result.timing | number | The measured time for the method call in milliseconds. |
result.timestamp | string | The timestamp in seconds of when the call was made. |
result.enabled | boolean | True if firewall protection is enabled. |
result.profile_details | object | (optional) (Windows Firewall only) The object of information about the profile. |
result.profile_details.(public or private or domain) | object | (optional) (Windows Firewall only) The object of information about the (public or private or domain) profile. |
result.profile_details.(public or private or domain).enabled | boolean | (optional) (Windows Firewall only) True if the FW is enaled for this profile. If false, other properties will not be shown. |
result.profile_details.(public or private or domain).block_inbound_connections | boolean | (optional) (Windows Firewall only) True if the block inbound connections is enabled. |
result.profile_details.(public or private or domain).has_allow_all_outbound_rule | boolean | (optional) (Windows Firewall only) True if there is at least one outbound rule which will allow all traffic for the current profile. |
result.profile_details.(public or private or domain).block_all_inbound_connections | boolean | (optional) (Windows Firewall only) True if the block all inbound connections is enabled. |
result.profile_details.(public or private or domain).block_outbound_connections | boolean | (optional) (Windows Firewall only) True if the block outbound connections is enabled. |
result.profile_details.(public or private or domain).has_allow_all_inbound_rule | boolean | (optional) (Windows Firewall only) True if there is at least one inbound rule which will allow all traffic for the current profile. |
result.profile_details.(public or private or domain).has_block_inbound_rule | boolean | (optional) (Windows Firewall only) True if there is at least one inbound rule which will block traffic for the current profile. |
result.profile_details.(public or private or domain).has_block_outbound_rule | boolean | (optional) (Windows Firewall only) True if there is at least one outbound rule which will block traffic for the current profile. |
result.managed_by_3rd_party_products | array<object> | (optional) (Windows Firewall only) An array of information about third party products manage Windows Firewall. |
result.managed_by_3rd_party_products.displayName | string | (optional) (Windows Firewall only) The name of third party products manage Windows Firewall. |
result.managed_by_3rd_party_products.pathToSignedProductExe | string | (optional) (Windows Firewall only) The path of third party products manage Windows Firewall. |
result.managed_by_3rd_party_products.signature | number | (optional) (Windows Firewall only) The signature of third party products manage Windows Firewall. |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The operation completed successfully. |
note
Other codes may be returned. See the full Result Codes reference for the complete list.
Remarks
Error Handling
The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.
Examples
Examples will be added here demonstrating the usage of this method.
See Also
Last updated: 2026-10-01