Ignore:
Timestamp:
11/28/07 20:33:21 (5 years ago)
Author:
Michael Medin <michael@…>
Children:
42edcda
Parents:
5ee4e31
Message:

2007-11-28 MickeM

  • Fixed some UNICODE issues with process-listings + Added an error message if the "detected" process enumeration method is not available. + Fixed some more unicode issues Password encrypt/decrypt: #107
  • Fixed unicode issues with "external programs" #109
  • Fixed so default string for check_nt:s FILEAGE command is "delta" is 5 minutes ago (and not absolute ie. 1970...), Issue #39 + added support for <date strings> to check_nt:s FILEAGE command, Issue #39

append: .<date string> if you want to use a "custom date" like so: ... -v FILEAGE -l c:
windows,Date: %Y-%m-%d %H:%M:%S" -w 5 -c 6 ...
Only the above listed %<char> works, and default to 0 so might not be to pretty but works...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/CheckSystem/CheckSystem.cpp

    raeadfda r3527e99  
    7070    if (systemInfo::isBelowNT4(osVer)) { 
    7171      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      } 
    7378    } else if (systemInfo::isAboveW2K(osVer)) { 
    7479      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      } 
    7685    } else { 
    7786      NSC_DEBUG_MSG_STD(_T("Autodetected failed, using PSAPI process enumeration.")); 
    7887      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      } 
    7994    } 
    8095  } else if (wantedMethod == C_SYSTEM_ENUMPROC_METHOD_PSAPI) { 
     
    721736  } 
    722737  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  } 
    724742  CEnumProcess::CProcessEntry entry; 
    725743  for (BOOL OK = enumeration.GetProcessFirst(&entry); OK; OK = enumeration.GetProcessNext(&entry) ) { 
     
    797815  for (std::list<StateConatiner>::iterator it = list.begin(); it != list.end(); ++it) { 
    798816    NSPROCLST::iterator proc = runningProcs.find((*it).data); 
    799     bool bFound = proc != runningProcs.end(); 
     817    bool bFound = (proc != runningProcs.end()); 
    800818    std::wstring tmp; 
    801819    TNtServiceInfo info; 
     
    904922      pdh.close(); 
    905923      double value = cDouble.getValue(); 
    906       //std::wcout << "Collected double data: " << value << std::endl; 
    907924      if (bNSClient) { 
    908925        msg += strEx::itos(static_cast<float>(value)); 
Note: See TracChangeset for help on using the changeset viewer.