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.

84 lines
1.9 KiB

  1. //--------------------------------------------------------------------
  2. // Copyright (c) 2002 Microsoft Corporation, All Rights Reserved
  3. //
  4. // eventlog.h
  5. //
  6. // Definitions and constants for writing event log events.
  7. //
  8. //--------------------------------------------------------------------
  9. //
  10. // This is the event source for BITS system events. If it changes, also change
  11. // the INF files to create a matching subdirectory in SYSTEM\CurrentControlSet\Services\EventLog\System\
  12. //
  13. #define WS_EVENT_SOURCE L"BITS"
  14. #define USER_NAME_LENGTH 200
  15. //
  16. // A simple log to write error and informational events to the
  17. // system event log.
  18. //
  19. class EVENT_LOG
  20. {
  21. public:
  22. EVENT_LOG() throw( ComError );
  23. ~EVENT_LOG();
  24. static HRESULT GetUnknownUserName(
  25. WCHAR Name[],
  26. size_t Length
  27. );
  28. static HRESULT SidToUser( PSID Sid, LPWSTR Name, size_t Length );
  29. HRESULT ReportStateFileCleared();
  30. HRESULT
  31. ReportFileDeletionFailure(
  32. GUID & Id,
  33. LPCWSTR Title,
  34. LPCWSTR FileList,
  35. bool fMoreFiles
  36. );
  37. HRESULT
  38. ReportGenericJobChange(
  39. GUID & Id,
  40. LPCWSTR Title,
  41. SidHandle Owner,
  42. SidHandle User,
  43. DWORD EventType
  44. );
  45. inline HRESULT ReportJobCancellation(
  46. GUID & Id,
  47. LPCWSTR Title,
  48. SidHandle Owner,
  49. SidHandle User
  50. )
  51. {
  52. return ReportGenericJobChange( Id, Title, Owner, User, MC_JOB_CANCELLED );
  53. }
  54. inline HRESULT ReportJobOwnershipChange(
  55. GUID & Id,
  56. LPCWSTR Title,
  57. SidHandle Owner,
  58. SidHandle User
  59. )
  60. {
  61. return ReportGenericJobChange( Id, Title, Owner, User, MC_JOB_TAKE_OWNERSHIP );
  62. }
  63. private:
  64. HANDLE m_hEventLog;
  65. WCHAR * m_OwnerString;
  66. WCHAR * m_UserString;
  67. };
  68. extern EVENT_LOG * g_EventLogger;