在我的项目中,我想监控我系统中的软件安装和卸载,所以我使用了WMI事件机制,但是现在我遇到了一个问题并且有一个问题。
问题:
我想监控 HKLM'SOFTWARE\Microsoft\Windows\currentversion\unistall',但代码 [1] 工作错误(ExecNotificationQueryAnsync 失败,=0x80041058)。而代码 [2] 工作正常,有什么问题?
[1]
hres = pSvc->ExecNotificationQueryAsync(
_bstr_t("WQL"),
_bstr_t("SELECT * FROM RegistryTreeChangeEvent WITHIN 1 " "WHERE Hive='HKEY_LOCAL_MACHINE'" "AND RootPath='software\\Microsoft\\Windows\\currentversion\\unistall'"
),
WBEM_FLAG_SEND_STATUS,
NULL,
pStubSink);
[2]
hres = pSvc->ExecNotificationQueryAsync(
_bstr_t("WQL"),
_bstr_t("SELECT * FROM RegistryTreeChangeEvent WITHIN 1 " "WHERE Hive='HKEY_LOCAL_MACHINE'" "AND RootPath='software'"
),
WBEM_FLAG_SEND_STATUS,
NULL,
pStubSink);
问题:在我的事件消费者中,我想获取软件的名称,我该怎么做?
谢谢!!