This is a story about a class named
Win32_Service and the types. Types we all like (or hate, doesn’t matter in this case :)). And the WMI.
Look at, for example,
ErrorControl. These are of type
uint8. Sounds good. Just get the values from the list in documentation and you’re done. Then you try to load
Win32_Service in other part of your code and you want to check these values. Boom. The casting fails. Checking the
Win32_Service again you’ll find that these parameters there are plain
Yup. Pretty confusing. I was not expecting that. I’d really like to know the reason for that…