WMI and Windows API

Are there any advantages or disadvantages of using WMI instead of the Windows API to access system information? like speed, extra permissions, memory usage.

or depends on the WMI class and how WMI implements access to information?

+7
winapi wmi
source share
5 answers

The main disadvantage of WMI is the speed, slowness of the data request, and if you try to use it at startup, it may delay you, because the WMI service takes a lot of time.

However, WMI information is richer because you sometimes need to make several API calls to get the same amount, some information is much easier to get, and filtering syntax can significantly reduce the amount code you have to write.

If speed is not a serious issue, I will always lean towards WMI.

+6
source share

Disadvantage: Speed
Advantage:. It wraps around its own API, as the API causes changes, if WMI has not changed, you can also take advantage. It will also save you some encoding.

0
source share

And richer data. Because programmers can write their own WMI providers, you can receive data from third-party software. This is what Microsoft does in its security center interface - receiving data from third-party antivirus and firewall programs.

0
source share

The advantage of WMI: You can get information about remote machines as easily as the current machine

0
source share

And the personification!
Your program may be running with an unprotected user, but access to the remote computer is determined by credentials.

0
source share

All Articles