私は WMI を使用して OS にアンチウイルスが存在することを検出しました。それは正常に動作し、Win XP および Window7 の名前やインスタンス ID などのアンチウイルスの情報を Namespace:\root\SecurityCenter および \root\SecurityCenter, \root\Security を使用して表示します。 .
if(isHLOSVersion( ))
hres = pLoc->ConnectServer( _bstr_t(L"root\\SecurityCenter2"),
// Object path of SecurityCenter
NULL, // User name. NULL = current user
NULL, // User password. NULL = current
0, // Locale. NULL indicates current
NULL, // Security flags.
0, // Authority (e.g. Kerberos)
0, // Context object
&pSvc // pointer to IWbemServices proxy
);
else
hres = pLoc->ConnectServer( _bstr_t(L"root\\SecurityCenter"),
// Object path of SecurityCenter
NULL, // User name. NULL = current user
NULL, // User password. NULL = current
0, // Locale. NULL indicates current
NULL, // Security flags.
0, // Authority (e.g. Kerberos)
0, // Context object
&pSvc // pointer to IWbemServices proxy
);
ただし、Windows 2003 サーバーおよび 2008 サーバー 2003 サーバー R2 および 2008 サーバー R2 の場合、上記の名前空間が存在しないため、そこでは機能しません。
Windows 2003 サーバーおよび 2008 サーバー 2003 サーバー R2 および 2008 サーバー R2 オペレーティング システムにウイルス対策が存在するかどうかを検出する方法を教えてください。