Skip to content

Commit c9b5e4f

Browse files
fix anti-virus posture report (#907)
1 parent 809d0f1 commit c9b5e4f

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src-tauri/src/enterprise/inspector/windows.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,9 @@ pub(super) fn disk_encryption_status() -> Result<bool, UnavailableReason> {
109109
pub(super) fn anti_virus_status() -> Result<bool, UnavailableReason> {
110110
let conn = WMIConnection::with_namespace_path("root\\SecurityCenter2")?;
111111
let products: Vec<AntiVirusProduct> = conn.query()?;
112-
for product in products {
113-
let enabled = (product.product_state & 0x0001_0000) != 0;
114-
let realtime = (product.product_state & 0x0002_0000) != 0;
115-
// let up_to_date = (product.product_state & 0x0004_0000) != 0;
116-
if enabled || realtime {
117-
return Ok(true);
118-
}
119-
}
120-
121-
Ok(false)
112+
Ok(products
113+
.iter()
114+
.any(|product| (product.product_state & 0x0000_F000) == 0x0000_1000))
122115
}
123116

124117
/// Check if this machine is part of an Active Directory domain.

0 commit comments

Comments
 (0)