Windows API equivalent to “WMIC QFE Get”

2019-07-21 20:17发布

问题:

I am a newbie in C++ and currently working to get Windows Hotfix/Patch information in C++ DLL.

I have evaluated the following ways:

  1. By executing a sub process in C++ code and running wmic qfe get and read all the data.
  2. By using the C++ APIs to initialize COM, Connect to Wbem and execute select * from win32_quickfixengineering query.

Apart from above two methods,

Is there any direct Windows API that does all the job for me and gives the list of KB Info currently installed on the machine?

回答1:

You can use the Windows Update Agent API and the IUpdateSearcher interface.