If you're going to work with this sort of stuff much you will find downloading the Win 10 SDK helps (it's fairly large though - 4Gb of disk space once installed). Have a look at:
https://developer.microsoft.com/en-us/w ... ws-10-sdk/
I'm not really sure how you are getting a result if you don't understand how the function works! Post your code so that we can see what you've done.
pulStatus and pulProblemNumber are _Out_ values. It's a method of returning multiple values from a single function call, otherwise things would get complicated.
This means that you supply a pointer to a variable as an argument to the function and the function sets the value of this variable before it returns. The target variable must be the size expected by the function. In this case 'pul' means 'pointer to unsigned long'.
As PB doesn't have specific unsigned variable types, use a long.
In this case three values are returned from one function call; the return value from the function is an error code if things go wrong and the values of pulStatus and pulProblemNumber.
The return value should be CR_SUCCESS, if it isn't the function call ran into trouble and the values of pulStatus and pulProblemNumber may be unreliable or invalid.
If it isn't CR_SUCCESS, the value describes the trouble. CR_ enumeration values are defined in 'cfgmgr32.h' in the 'Include' subfolder of the SDK.
pulStatus doesn't really make any sense as a single value, particularly in decimal format.
Its value is set at the bit level. This means that each individual bit in the value has its own meaning.
You need to examine all the bits to determine the full meaning (or at least all the bits that are relevant to your purpose anyway.)
Again the bit values are defined in 'cfg.h' in the SDK. You need to study this section carefully as the meaning of bits has changed in various versions of Windows.
If the bit DN_HAS_PROBLEM is set in pulStatus then pulProblemNumber will have been set by the function.
pulProblemNumber is a CM_PROB enumeration value as defined in 'cfg.h'
In this case 22 ($16 in hex) is CM_PROB_DISABLED.
The way to check for a device being disabled then is:
1) Check for CR_SUCCESS from CM_Get_DevNode_Status
2) Check if the bit DN_HAS_PROBLEM is set in pulStatus.
3) Check if the value of pulProblemNumber is CM_PROB_DISABLED.
If these three things are true then the device is disabled.
Checking if a device is enabled is more complex - just how 'enabled' will you require the result to be?
It's potentially more complicated than checking if DN_HAS_PROBLEM is not set and pulProblemNumber <> CM_PROB_DISABLED, depending on the specifics of the device in question. A device may not be fully operational even with these values, for example if a driver didn't load or a required service isn't running...