Jump to content

cbutkus

Member
  • Posts

    1
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About cbutkus

cbutkus's Achievements

0

Reputation

  1. I've got a Java application that uses JNI. Part of the JNI code call the pdh methods to get the system uptime. The code is shown below. What's happening is that the call to PdhAddCounter is hanging (it doesn't return). I haven't found anything on this issue anywhere on the internet at this point. Any ideas? The application is a 32-bit app running on Windows Server 2003 Standard x64 Edition, Service Pack 2 int _bladmin_win_get_uptime () { PDH_STATUS status; HQUERY hQuery; HCOUNTER hCounter; PDH_FMT_COUNTERVALUE Value; int ret; ret = R_ERROR; if (PdhOpenQuery (NULL, 0, &hQuery) == ERROR_SUCCESS) { if ((status = PdhAddCounter(hQuery, "\\\\.\\System\\System Up Time", 0, &hCounter)) == ERROR_SUCCESS) { if ((status = PdhCollectQueryData (hQuery)) == ERROR_SUCCESS) { if ((status = PdhGetFormattedCounterValue (hCounter, PDH_FMT_LARGE , NULL, &Value)) == ERROR_SUCCESS) { ret = (DWORD)(Value.largeValue); } } PdhRemoveCounter (hCounter); } PdhCloseQuery (hQuery); } return ret; }
×
×
  • Create New...