Merge branch 'sigar-1.6'
This commit is contained in:
commit
dec7508ed1
|
@ -115,6 +115,7 @@ JNIEXPORT jint SIGAR_JNI(win32_RegistryKey_RegLoadKey)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static DWORD RegOpenOpts[] = {
|
static DWORD RegOpenOpts[] = {
|
||||||
|
0,
|
||||||
KEY_WOW64_32KEY,
|
KEY_WOW64_32KEY,
|
||||||
KEY_WOW64_64KEY
|
KEY_WOW64_64KEY
|
||||||
};
|
};
|
||||||
|
|
|
@ -98,11 +98,11 @@ public class TestPdh extends SigarTestCase {
|
||||||
|
|
||||||
public void testValidate() {
|
public void testValidate() {
|
||||||
Object[][] tests = {
|
Object[][] tests = {
|
||||||
{ "\\Does Not\\Exist", new Integer(Pdh.NO_OBJECT) },
|
{ "\\Does Not\\Exist", new Integer(Pdh.NO_OBJECT), new Integer(Pdh.BAD_COUNTERNAME) },
|
||||||
{ "Does Not Exist", new Integer(Pdh.BAD_COUNTERNAME) },
|
{ "Does Not Exist", new Integer(Pdh.BAD_COUNTERNAME) },
|
||||||
{ "\\System\\DoesNotExist", new Integer(Pdh.NO_COUNTER) },
|
{ "\\System\\DoesNotExist", new Integer(Pdh.NO_COUNTER) },
|
||||||
{ "\\Processor(666)\\% User Time", new Integer(Pdh.NO_INSTANCE) },
|
{ "\\Processor(666)\\% User Time", new Integer(Pdh.NO_INSTANCE) },
|
||||||
{ "\\System\\Threads", new Integer(Pdh.VALID_DATA) },
|
{ "\\System\\Threads", new Integer(Pdh.VALID_DATA), new Integer(Pdh.BAD_COUNTERNAME) },
|
||||||
//slow
|
//slow
|
||||||
//{ "\\\\-\\System\\Threads", new Integer(Pdh.NO_MACHINE) },
|
//{ "\\\\-\\System\\Threads", new Integer(Pdh.NO_MACHINE) },
|
||||||
};
|
};
|
||||||
|
@ -113,6 +113,13 @@ public class TestPdh extends SigarTestCase {
|
||||||
int status = Pdh.validate(path);
|
int status = Pdh.validate(path);
|
||||||
boolean expectedResult = (status == expect);
|
boolean expectedResult = (status == expect);
|
||||||
|
|
||||||
|
if (!expectedResult) {
|
||||||
|
if (tests[i].length == 3) {
|
||||||
|
expect = ((Integer)tests[i][2]).intValue();
|
||||||
|
expectedResult = (status == expect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!expectedResult) {
|
if (!expectedResult) {
|
||||||
traceln("[validate] " + path + "-->" +
|
traceln("[validate] " + path + "-->" +
|
||||||
Integer.toHexString(status).toUpperCase() +
|
Integer.toHexString(status).toUpperCase() +
|
||||||
|
|
|
@ -3748,7 +3748,7 @@ int sigar_file_version_get(sigar_file_version_t *version,
|
||||||
data = malloc(len);
|
data = malloc(len);
|
||||||
|
|
||||||
if (GetFileVersionInfo(name, handle, len, data)) {
|
if (GetFileVersionInfo(name, handle, len, data)) {
|
||||||
if (VerQueryValue(data, "\\", &info, 0)) {
|
if (VerQueryValue(data, "\\", &info, &len)) {
|
||||||
version->product_major = HIWORD(info->dwProductVersionMS);
|
version->product_major = HIWORD(info->dwProductVersionMS);
|
||||||
version->product_minor = LOWORD(info->dwProductVersionMS);
|
version->product_minor = LOWORD(info->dwProductVersionMS);
|
||||||
version->product_build = HIWORD(info->dwProductVersionLS);
|
version->product_build = HIWORD(info->dwProductVersionLS);
|
||||||
|
|
Loading…
Reference in New Issue