{"record":{"id":"42b10a7e15ddce67","repo":"openai/codex","slug":"helperfirewallcominitfailed","errorCode":"HelperFirewallComInitFailed","errorMessage":"CoInitializeEx failed: {hr:?}","messagePattern":"CoInitializeEx failed: (.+?)","errorType":"error_code","errorClass":"SetupFailure","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/setup_main/win/firewall.rs","lineNumber":65,"sourceCode":"    friendly_desc: &'a str,\n    protocol: i32,\n    local_user_spec: &'a str,\n    offline_sid: &'a str,\n    remote_addresses: Option<&'a str>,\n    remote_ports: Option<&'a str>,\n}\n\npub fn ensure_offline_proxy_allowlist(\n    offline_sid: &str,\n    proxy_ports: &[u16],\n    allow_local_binding: bool,\n    log: &mut dyn Write,\n) -> Result<()> {\n    let local_user_spec = format!(\"O:LSD:(A;;CC;;;{offline_sid})\");\n\n    let hr = unsafe { CoInitializeEx(None, COINIT_APARTMENTTHREADED) };\n    if hr.is_err() {\n        return Err(anyhow::Error::new(SetupFailure::new(\n            SetupErrorCode::HelperFirewallComInitFailed,\n            format!(\"CoInitializeEx failed: {hr:?}\"),\n        )));\n    }\n\n    let result = unsafe {\n        (|| -> Result<()> {\n            let policy: INetFwPolicy2 = CoCreateInstance(&NetFwPolicy2, None, CLSCTX_INPROC_SERVER)\n                .map_err(|err| {\n                    anyhow::Error::new(SetupFailure::new(\n                        SetupErrorCode::HelperFirewallPolicyAccessFailed,\n                        format!(\"CoCreateInstance NetFwPolicy2 failed: {err:?}\"),\n                    ))\n                })?;\n            ensure_local_policy_rules_take_effect(&policy)?;\n            let rules = policy.Rules().map_err(|err| {\n                anyhow::Error::new(SetupFailure::new(\n                    SetupErrorCode::HelperFirewallPolicyAccessFailed,","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/setup_main/win/firewall.rs#L47-L83","documentation":"Error \"CoInitializeEx failed: {hr:?}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/firewall.rs:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}