none
WMI calls while querying Win32_LogicalDisk and other classes returning wrong values on wndows 64 bit machines RRS feed

  • Question

  • Hi All,

    I am querying WMI classes for getting some system information. For e.g. here I am querying for the Size of Logical Partitions on the system.
    But I am getting some weird values on Windows 64 bit machines , can any one tell whats going wrong ? Am I using the WMI classes in proper way ?
    Your help will be appreciated.


      hr = pNameSpace->lpVtbl->ExecQuery(
             pNameSpace,
             L"WQL",
             L"SELECT * FROM Win32_LogicalDisk",
             WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
             NULL,
             &pEnumerator);


          hr = pEnumerator->lpVtbl->Next(pEnumerator, WBEM_INFINITE,
                                       1, &pclsObj, (unsigned long *)&uReturn);

          VariantInit(&vtProp);
          value = 0;
          pclsObj->lpVtbl->Get(pclsObj, L"Size", 0,&vtProp,&type, 0);
          value = vtProp.ullVal;
          VariantClear(&vtProp);

    I am getting some very huge values, for, which are obviousely not correct. e.g. 15199872084213809


    Regards
    Vasu


    Monday, March 1, 2010 11:00 AM

All replies

  • Hi,

    Were you able to resolve this by any ways ? I am also facing the same issue.

    Thanks in Advance !!

    Regards,

    Alka

    Thursday, July 14, 2016 6:47 AM