Changeset 1d53fe0 in nscp for modules/CheckEventLog
- Timestamp:
- 02/12/09 20:28:56 (4 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- b1ac2fa
- Parents:
- 04f2743
- Location:
- modules/CheckEventLog
- Files:
-
- 1 added
- 1 edited
-
CheckEventLog.cpp (modified) (2 diffs)
-
Jamfile (added)
Legend:
- Unmodified
- Added
- Removed
-
modules/CheckEventLog/CheckEventLog.cpp
r04f2743 r1d53fe0 622 622 //GetOldestEventLogRecord(hLog, &dwThisRecord); 623 623 624 while (ReadEventLog(hLog, EVENTLOG_FORWARDS_READ|EVENTLOG_SEQUENTIAL_READ, 625 0, buffer.getBufferUnsafe(), buffer.getBufferSize(), &dwRead, &dwNeeded)) 626 { 624 while (true) { 625 BOOL bStatus = ReadEventLog(hLog, EVENTLOG_FORWARDS_READ|EVENTLOG_SEQUENTIAL_READ, 626 0, buffer.getBufferUnsafe(), buffer.getBufferSize(), &dwRead, &dwNeeded); 627 if (bStatus == FALSE) { 628 DWORD err = GetLastError(); 629 if (err == ERROR_INSUFFICIENT_BUFFER) { 630 NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small change the value of ") + EVENTLOG_BUFFER + _T("=") + strEx::itos(dwNeeded+1) + _T(" under [EventLog] in nsc.ini : ") + error::lookup::last_error(err)); 631 } else if (err == ERROR_HANDLE_EOF) { 632 break; 633 } else { 634 NSC_LOG_ERROR_STD(_T("Failed to read from eventlog: ") + error::lookup::last_error(err)); 635 message = _T("Failed to read from eventlog: ") + error::lookup::last_error(err); 636 CloseEventLog(hLog); 637 return NSCAPI::returnUNKNOWN; 638 } 639 } 627 640 EVENTLOGRECORD *pevlr = buffer.getBufferUnsafe(); 628 641 while (dwRead > 0) { … … 719 732 } 720 733 } 721 DWORD err = GetLastError();722 if (err == ERROR_INSUFFICIENT_BUFFER) {723 NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small (set the value of ") + EVENTLOG_BUFFER + _T("): ") + error::lookup::last_error(err));724 message = std::wstring(_T("EvenlogBuffer is too small (set the value of ")) + EVENTLOG_BUFFER + _T("): ") + error::lookup::last_error(err);725 return NSCAPI::returnUNKNOWN;726 } else if (err != ERROR_HANDLE_EOF) {727 NSC_LOG_ERROR_STD(_T("Failed to read from eventlog: ") + error::lookup::last_error(err));728 message = _T("Failed to read from eventlog: ") + error::lookup::last_error(err);729 return NSCAPI::returnUNKNOWN;730 }731 734 CloseEventLog(hLog); 732 735 for (uniq_eventlog_map::const_iterator cit = uniq_records.begin(); cit != uniq_records.end(); ++cit) {
Note: See TracChangeset
for help on using the changeset viewer.








