I'm quite new to WMI, I'm following this guide here.
So I pasted that code in the guide and ran it without any issues using the provided query. But when I changed the query to
SELECT State FROM Win32_Service I get no data, just the error code 0xC0000005, which I believe is a permissions error?
That same query above works just fine in the PowerShell using the following command:
Get-WmiObject -Query "select State from Win32_Service"
What I've tried
So what gives? Why am I having trouble querying the WMI from my C++ code?
EDIT: I found the line that's causing the crash. I'm not sure why it's crashing though.
wcout << vtProp.bstrVal << endl;
User contributions licensed under CC BY-SA 3.0