Changeset 3527e99 in nscp for trunk/modules/CheckSystem/CheckSystem.cpp
- Timestamp:
- 11/28/07 20:33:21 (5 years ago)
- Children:
- 42edcda
- Parents:
- 5ee4e31
- File:
-
- 1 edited
-
trunk/modules/CheckSystem/CheckSystem.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/CheckSystem/CheckSystem.cpp
raeadfda r3527e99 70 70 if (systemInfo::isBelowNT4(osVer)) { 71 71 NSC_DEBUG_MSG_STD(_T("Autodetected NT4<, using PSAPI process enumeration.")); 72 processMethod_ = ENUM_METHOD::PSAPI; 72 if (method == (method|ENUM_METHOD::PSAPI)) { 73 processMethod_ = ENUM_METHOD::PSAPI; 74 } else { 75 NSC_LOG_ERROR_STD(_T("PSAPI method not available, since you are on NT4 you need to install \"Platform SDK Redistributable: PSAPI for Windows NT\" from Microsoft.")); 76 NSC_LOG_ERROR_STD(_T("Try this URL: http://www.microsoft.com/downloads/details.aspx?FamilyID=3d1fbaed-d122-45cf-9d46-1cae384097ac")); 77 } 73 78 } else if (systemInfo::isAboveW2K(osVer)) { 74 79 NSC_DEBUG_MSG_STD(_T("Autodetected W2K>, using TOOLHELP process enumeration.")); 75 processMethod_ = ENUM_METHOD::TOOLHELP; 80 if (method == (method|ENUM_METHOD::TOOLHELP)) { 81 processMethod_ = ENUM_METHOD::TOOLHELP; 82 } else { 83 NSC_LOG_ERROR_STD(_T("TOOLHELP was not available, since you are on > W2K you need top manually override the ") C_SYSTEM_ENUMPROC_METHOD _T("option in NSC:ini.")); 84 } 76 85 } else { 77 86 NSC_DEBUG_MSG_STD(_T("Autodetected failed, using PSAPI process enumeration.")); 78 87 processMethod_ = ENUM_METHOD::PSAPI; 88 if (method == (method|ENUM_METHOD::PSAPI)) { 89 processMethod_ = ENUM_METHOD::PSAPI; 90 } else { 91 NSC_LOG_ERROR_STD(_T("PSAPI method not availabletry installing \"Platform SDK Redistributable: PSAPI for Windows NT\" from Microsoft.")); 92 NSC_LOG_ERROR_STD(_T("Try this URL: http://www.microsoft.com/downloads/details.aspx?FamilyID=3d1fbaed-d122-45cf-9d46-1cae384097ac")); 93 } 79 94 } 80 95 } else if (wantedMethod == C_SYSTEM_ENUMPROC_METHOD_PSAPI) { … … 721 736 } 722 737 CEnumProcess enumeration; 723 enumeration.SetMethod(processMethod); 738 if (enumeration.SetMethod(processMethod) != processMethod) { 739 NSC_LOG_ERROR_STD(_T("Failed to set process enumeration method")); 740 return ret; 741 } 724 742 CEnumProcess::CProcessEntry entry; 725 743 for (BOOL OK = enumeration.GetProcessFirst(&entry); OK; OK = enumeration.GetProcessNext(&entry) ) { … … 797 815 for (std::list<StateConatiner>::iterator it = list.begin(); it != list.end(); ++it) { 798 816 NSPROCLST::iterator proc = runningProcs.find((*it).data); 799 bool bFound = proc != runningProcs.end();817 bool bFound = (proc != runningProcs.end()); 800 818 std::wstring tmp; 801 819 TNtServiceInfo info; … … 904 922 pdh.close(); 905 923 double value = cDouble.getValue(); 906 //std::wcout << "Collected double data: " << value << std::endl;907 924 if (bNSClient) { 908 925 msg += strEx::itos(static_cast<float>(value));
Note: See TracChangeset
for help on using the changeset viewer.








