Question

i am trying to vendor specifc attribute from this WMI class MSStorageDriver_FailurePredictData(HDD SMART information). Here is the used code :

    IEnumWbemClassObject* pEnumerator = NULL;
    hres = pSvc->ExecQuery( L"WQL", L"SELECT * FROM MSStorageDriver_FailurePredictData",
    WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator);

    IWbemClassObject *pclsObj = NULL;
    ULONG uReturn = 0;
      while (pEnumerator)
   {
    HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn);
            //**I am getting an issue here the method Next() returns hr=-2147217405 **

    if(0 == uReturn || FAILED(hr))
      break;
         //do smoething
     }

i need to know why Next() is not working properly.

Was it helpful?

Solution

i think i figured out the solution.I should run visual studio as Administrator

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top