Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.2 KiB

  1. //
  2. // Event log entry
  3. //
  4. typedef struct tagEVENTLOGENTRY {
  5. DWORD dwEventID;
  6. FILETIME ftEventTime;
  7. LPTSTR lpEventLogName;
  8. LPTSTR lpEventSourceName;
  9. LPTSTR lpText;
  10. struct tagEVENTLOGENTRY * pNext;
  11. } EVENTLOGENTRY, *LPEVENTLOGENTRY;
  12. //
  13. // Source name entry
  14. //
  15. typedef struct tagSOURCEENTRY {
  16. LPTSTR lpEventLogName;
  17. LPTSTR lpEventSourceName;
  18. struct tagSOURCEENTRY * pNext;
  19. } SOURCEENTRY, *LPSOURCEENTRY;
  20. //
  21. // CEvents class
  22. //
  23. class CEvents
  24. {
  25. private:
  26. LPEVENTLOGENTRY m_pEventEntries;
  27. public:
  28. CEvents();
  29. ~CEvents();
  30. BOOL AddEntry(LPTSTR lpEventLogName, LPTSTR lpEventSourceName, LPTSTR lpText,
  31. DWORD dwEventID, FILETIME *ftTime);
  32. VOID FreeData();
  33. STDMETHODIMP SecondsSince1970ToFileTime(DWORD dwSecondsSince1970,
  34. FILETIME *pftTime);
  35. LPTSTR BuildMessage(LPTSTR lpMsg, LPTSTR *lpStrings, DWORD dwStringCount,
  36. HMODULE hParamFile);
  37. STDMETHODIMP SaveEventLogEntry (PEVENTLOGRECORD pEntry,
  38. LPTSTR lpEventLogName,
  39. LPTSTR lpEventSourceName,
  40. FILETIME *ftEntry);
  41. LPTSTR * BuildStringArray(LPTSTR lpStrings, DWORD dwStringCount);
  42. STDMETHODIMP ParseEventLogRecords (PEVENTLOGRECORD lpEntries,
  43. DWORD dwEntriesSize,
  44. LPTSTR lpEventLogName,
  45. LPTSTR lpEventSourceName,
  46. DWORD dwEventID,
  47. FILETIME * pBeginTime,
  48. FILETIME * pEndTime);
  49. STDMETHODIMP QueryForEventLogEntries (LPTSTR lpComputerName,
  50. LPTSTR lpEventLogName,
  51. LPTSTR lpEventSourceName,
  52. DWORD dwEventID,
  53. SYSTEMTIME * pBeginTime,
  54. SYSTEMTIME * pEndTime);
  55. STDMETHODIMP GetEventLogEntryText(LPOLESTR pszEventSource, LPOLESTR pszEventLogName,
  56. LPOLESTR pszEventTime, DWORD dwEventID, LPOLESTR *ppszText);
  57. BOOL IsEntryInEventSourceList (LPEVENTLOGENTRY lpEntry, LPSOURCEENTRY lpEventSources);
  58. BOOL IsEntryInExceptionList (LPEVENTLOGENTRY lpEntry);
  59. STDMETHODIMP GetCSEEntries(SYSTEMTIME * pBeginTime, SYSTEMTIME * pEndTime,
  60. LPSOURCEENTRY lpEventSources, LPOLESTR *ppszText, BOOL bGpCore);
  61. STDMETHODIMP DumpDebugInfo (void);
  62. LPTSTR ConvertTimeToDisplayTime (SYSTEMTIME *pSysTime, FILETIME *pFileTime, LPTSTR szBuffer, ULONG ulNoChars);
  63. STDMETHODIMP AddSourceEntry (LPTSTR lpEventLogName,
  64. LPTSTR lpEventSourceName,
  65. LPSOURCEENTRY *lpList);
  66. static VOID FreeSourceData(LPSOURCEENTRY lpList);
  67. STDMETHODIMP SaveEntriesToStream (IStream *pStm);
  68. STDMETHODIMP LoadEntriesFromStream (IStream *pStm);
  69. };
  70. #define ISDIGIT(c) ((c) >= TEXT('0') && (c) <= TEXT('9'))