Hans Leidekker (@hans) commented about dlls/pdh/tests/pdh.c:
- status = PdhAddCounterA( query, "\System\System Up Time", 0, &counter );
- ok(status == ERROR_SUCCESS, "PdhAddCounterA failed 0x%08lx\n", status);
- status = PdhCollectQueryData(query);
- ok(status == ERROR_SUCCESS, "PdhCollectQueryData failed 0x%08lx\n", status);
- status = PdhGetFormattedCounterValue( counter, PDH_FMT_DOUBLE, NULL, &value );
- ok(status == ERROR_SUCCESS, "PdhGetFormattedCounterValue failed 0x%08lx\n", status);
- ret = pPdhVbGetDoubleCounterValue( NULL, NULL );
- ok(ret == 0.0, "Unexpected value %f\n", ret);
- ret = pPdhVbGetDoubleCounterValue( NULL, &status );
- ok(status == PDH_INVALID_HANDLE, "PdhVbGetDoubleCounterValue failed 0x%08lx\n", status);
- ok(ret == 0.0, "Unexpected value %f\n", ret);
You should set 'status' to a known value before calling PdhVbGetDoubleCounterValue(). Same below.