Description
get_propval returns several codes from S_OK to WBEM_E_FAILED;
The following line seems to not be doing what is expected:
if ((hr = get_propval( view, co->index, property, pVal, pType, plFlavor ) != S_OK))
Here it assigns to hr 0 or 1, instead the returned code due to priority (!= over =).