(SIGAR-168) always fallback to wmi when peb fails for proc_args

This commit is contained in:
Doug MacEachern committed 2009-09-01 14:09:46 -07:00
1 parent 0b335d9025
commit c88b49abe2
2 files changed
+16 -17

No files matched your search

+6 -5
View File
@@ -171,15 +171,16 @@ int sigar_proc_args_peb_get(sigar_t *sigar, HANDLE proc,
}
size = rtl_bufsize(buf, rtl.CommandLine);
if (size <= 0) {
return ERROR_DATATYPE_MISMATCH; /* fallback to wmi */
}
memset(buf, '\0', sizeof(buf));
if ((size > 0) &&
ReadProcessMemory(proc, rtl.CommandLine.Buffer, buf, size, NULL))
{
if (ReadProcessMemory(proc, rtl.CommandLine.Buffer, buf, size, NULL)) {
return sigar_parse_proc_args(sigar, buf, procargs);
}
else {
return SIGAR_OK;
return GetLastError();
}
}