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.

60 lines
1.0 KiB

  1. //*************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation 1998
  4. // All rights reserved
  5. //
  6. // events.hxx
  7. //
  8. //*************************************************************
  9. #define DIAGNOSTICS_KEY L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Diagnostics"
  10. #define DIAGNOSTICS_POLICY_VALUE L"RunDiagnosticLoggingFileDeployment"
  11. #define FDEPLOY_EVENT_SOURCE L"Folder Redirection"
  12. class CEvents;
  13. extern CEvents * gpEvents;
  14. class CEvents
  15. {
  16. public:
  17. CEvents();
  18. ~CEvents();
  19. DWORD
  20. Init();
  21. inline void Reference()
  22. {
  23. _Refs++;
  24. }
  25. inline void Release()
  26. {
  27. if ( 0 == --_Refs )
  28. {
  29. gpEvents = 0;
  30. delete this;
  31. }
  32. }
  33. void
  34. Report(
  35. DWORD EventID,
  36. WORD Strings,
  37. ...
  38. );
  39. PSID
  40. UserSid();
  41. private:
  42. void
  43. GetUserSid();
  44. HANDLE _hEventLog;
  45. PSID _pUserSid;
  46. DWORD _Refs;
  47. };