Skip to main content

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​

ParameterTypeDescription
show_profile_detailsboolean(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​

PropertyTypeDescription
result.methodnumberThe method ID that generated this result.
result.codenumberThe result code. See Result Codes.
result.timingnumberThe measured time for the method call in milliseconds.
result.timestampstringThe timestamp in seconds of when the call was made.
result.enabledbooleanTrue if firewall protection is enabled.
result.profile_detailsobject(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).enabledboolean(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_connectionsboolean(optional) (Windows Firewall only) True if the block inbound connections is enabled.
result.profile_details.(public or private or domain).has_allow_all_outbound_ruleboolean(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_connectionsboolean(optional) (Windows Firewall only) True if the block all inbound connections is enabled.
result.profile_details.(public or private or domain).block_outbound_connectionsboolean(optional) (Windows Firewall only) True if the block outbound connections is enabled.
result.profile_details.(public or private or domain).has_allow_all_inbound_ruleboolean(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_ruleboolean(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_ruleboolean(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_productsarray<object>(optional) (Windows Firewall only) An array of information about third party products manage Windows Firewall.
result.managed_by_3rd_party_products.displayNamestring(optional) (Windows Firewall only) The name of third party products manage Windows Firewall.
result.managed_by_3rd_party_products.pathToSignedProductExestring(optional) (Windows Firewall only) The path of third party products manage Windows Firewall.
result.managed_by_3rd_party_products.signaturenumber(optional) (Windows Firewall only) The signature of third party products manage Windows Firewall.

Result Codes​

CodeNameDescription
0WAAPI_OKThe 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