Changeset 371df23 in nscp


Ignore:
Timestamp:
09/18/08 07:30:15 (5 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
bb8b6d1
Parents:
08f0346
Message:
  • Added option [EventLog?] lookup_names=0 to disable the evetlog name lookup (default is on)
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • AutoBuild.h

    r4bf9740 r371df23  
    33// change the FALSE to TRUE for autoincrement of build number 
    44#define INCREMENT_VERSION TRUE 
    5 #define FILEVER        0,3,4,30 
    6 #define PRODUCTVER     0,3,4,30 
    7 #define STRFILEVER     _T("0.3.4.30") 
    8 #define STRPRODUCTVER  _T("0.3.4.30") 
    9 #define STRPRODUCTDATE  _T("2008-09-16") 
     5#define FILEVER        0,3,4,32 
     6#define PRODUCTVER     0,3,4,32 
     7#define STRFILEVER     _T("0.3.4.32") 
     8#define STRPRODUCTVER  _T("0.3.4.32") 
     9#define STRPRODUCTDATE  _T("2008-09-18") 
    1010#endif // AUTOBUILD_H 
  • changelog

    r08f0346 r371df23  
    66 
    772008-09-17 MickeM - 0.3.4 RC-6 
     8 * Added option [EventLog] lookup_names=0 to disable the evetlog name lookup (default is on) 
     9 
     102008-09-17 MickeM 
    811 * Fixed issue on all filters so == takes the "usual" 2 equalsigns (old still works). 
    912 * Added so tray icon can get "propper" name from core for "description". 
  • include/config.h

    rc37e58f r371df23  
    159159#define EVENTLOG_DEBUG _T("debug") 
    160160#define EVENTLOG_DEBUG_DEFAULT 0 
     161#define EVENTLOG_LOOKUP_NAMES _T("lookup_names") 
     162#define EVENTLOG_LOOKUP_NAMES_DEFAULT 1 
    161163#define EVENTLOG_SYNTAX _T("syntax") 
    162164#define EVENTLOG_SYNTAX_DEFAULT _T("") 
  • modules/CheckEventLog/CheckEventLog.cpp

    r08f0346 r371df23  
    4848    NSCModuleHelper::registerCommand(_T("CheckEventLog"), _T("Check for errors in the event logger!")); 
    4949    debug_ = NSCModuleHelper::getSettingsInt(EVENTLOG_SECTION_TITLE, EVENTLOG_DEBUG, EVENTLOG_DEBUG_DEFAULT)==1; 
     50    lookup_names_ = NSCModuleHelper::getSettingsInt(EVENTLOG_SECTION_TITLE, EVENTLOG_LOOKUP_NAMES, EVENTLOG_LOOKUP_NAMES_DEFAULT)==1; 
    5051    syntax_ = NSCModuleHelper::getSettingsString(EVENTLOG_SECTION_TITLE, EVENTLOG_SYNTAX, EVENTLOG_SYNTAX_DEFAULT); 
    5152    buffer_ = NSCModuleHelper::getSettingsInt(EVENTLOG_SECTION_TITLE, EVENTLOG_BUFFER, EVENTLOG_BUFFER_DEFAULT); 
     
    168169} 
    169170 
    170 std::wstring load_string(std::wstring module, UINT id, DWORD bufferSize = 2048) { 
    171   //HMODULE hModule = LoadLibrary(module.c_str()); 
    172   HMODULE hModule = LoadLibraryEx(module.c_str(), NULL, LOAD_LIBRARY_AS_DATAFILE); 
    173   //HMODULE hModule = GetModuleHandle(module.c_str()); 
    174   if (hModule == NULL) { 
    175     return _T("failed to load: ") + module + _T("( reson: ") + error::lookup::last_error(); 
    176   } 
    177  
    178   std::wstring rName = _T("1"); 
    179   std::wstring ret; 
    180   HRSRC rsSrc = FindResource(hModule, rName.c_str(), RT_MESSAGETABLE); 
    181   if (rsSrc == NULL) 
    182     ret = _T("Failed to load string ") + strEx::itos(id) + _T(" reason was: ") + error::lookup::last_error();  
    183   /* 
    184   TCHAR *buffer = new TCHAR[bufferSize+1]; 
    185   if (LoadString(hModule, id, buffer, bufferSize) != 0) { 
    186     ret = buffer; 
    187   } else { 
    188     ret = _T("Failed to load string ") + strEx::itos(id) + _T(" reason was: ") + error::lookup::last_error();  
    189   } 
    190   NSC_DEBUG_MSG_STD(buffer); 
    191   delete [] buffer; 
    192   */ 
    193   return ret; 
    194  
    195 } 
    196171std::wstring find_eventlog_name(std::wstring name) { 
    197172  try { 
     
    206181        strEx::replace(real_name, _T("\n"), _T("")); 
    207182        strEx::replace(real_name, _T("\r"), _T("")); 
    208         //strEx::replace(real_name, _T("\m"), _T("")); 
    209         //NSC_DEBUG_MSG_STD(_T("Found file: ") + real_name + _T(" for ") + *cit); 
    210183        if (real_name == name) 
    211184          return *cit; 
     
    608581 
    609582  for (std::list<std::wstring>::const_iterator cit2 = files.begin(); cit2 != files.end(); ++cit2) { 
    610     std::wstring name = find_eventlog_name(*cit2); 
    611     if ((*cit2) != name) { 
    612       NSC_DEBUG_MSG_STD(_T("Opening alternative log: ") + name); 
     583    std::wstring name = *cit2; 
     584    if (lookup_names_) { 
     585      name = find_eventlog_name(*cit2); 
     586      if ((*cit2) != name) { 
     587        NSC_DEBUG_MSG_STD(_T("Opening alternative log: ") + name); 
     588      } 
    613589    } 
    614590    HANDLE hLog = OpenEventLog(NULL, name.c_str()); 
  • modules/CheckEventLog/CheckEventLog.h

    ra34b229 r371df23  
    3232  std::wstring syntax_; 
    3333  DWORD buffer_; 
     34  bool lookup_names_; 
    3435 
    3536public: 
Note: See TracChangeset for help on using the changeset viewer.