Hey Jack,
You’re correct that GetGPOList() isn’t the right path for firewall rules. That API only enumerates which GPOs apply to a user or machine, not the actual policy data. The error you’re hitting (0x80092004 / 2148074274) is a cryptographic error usually tied to certificate chain validation, not AD replication, so it’s likely failing because the process token you’re using doesn’t have the right domain context or the machine can’t validate the DC’s certs.
If your goal is to programmatically read the firewall rules enforced by Group Policy, you need to query the effective policy after it’s processed by the local system. The supported way is through the Windows Firewall with Advanced Security APIs, specifically INetFwPolicy2 via COM, which exposes the active rules regardless of whether they came from local configuration or GPO. If you want to see the raw GPO data itself, you’d have to parse the registry under HKLM\Software\Policies\Microsoft\WindowsFirewall and its subkeys for Domain, Private, and Public profiles, since that’s where Group Policy writes firewall settings.
In practice, most enterprise tools rely on INetFwPolicy2 because it gives you the merged effective policy. If you need to track which GPO delivered which setting, you’d have to combine GetAppliedGPOList() with parsing the policy files in SYSVOL (Machine\Registry.pol) for each GPO, but that’s far more complex and not exposed by Win32 directly. For your use case, stick with INetFwPolicy2 to enumerate rules and profiles, and only drop down to registry parsing if you need the raw GPO source.
If the above response helps answer your question, please hit "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
Domic V.