Source code of Windows XP (NT5)
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.

58 lines
2.4 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: LogonMutex.h
  3. //
  4. // Copyright (c) 2001, Microsoft Corporation
  5. //
  6. // File that implements a class that manages a single global logon mutex.
  7. //
  8. // History: 2001-04-06 vtan created
  9. // --------------------------------------------------------------------------
  10. #ifndef _LogonMutex_
  11. #define _LogonMutex_
  12. // --------------------------------------------------------------------------
  13. // CLogonMutex
  14. //
  15. // Purpose: This class encapsulates a logon mutex for exclusion to the
  16. // interactive logon interface offered by the friendly UI.
  17. //
  18. // History: 2001-04-06 vtan created
  19. // --------------------------------------------------------------------------
  20. class CLogonMutex
  21. {
  22. private:
  23. CLogonMutex (void);
  24. ~CLogonMutex (void);
  25. public:
  26. static void Acquire (void);
  27. static void Release (void);
  28. static void SignalReply (void);
  29. static void SignalShutdown (void);
  30. static void StaticInitialize (void);
  31. static void StaticTerminate (void);
  32. private:
  33. static HANDLE CreateShutdownEvent (void);
  34. static HANDLE CreateLogonMutex (void);
  35. static HANDLE CreateLogonRequestMutex (void);
  36. static HANDLE OpenShutdownEvent (void);
  37. static HANDLE OpenLogonMutex (void);
  38. private:
  39. static DWORD s_dwThreadID;
  40. static LONG s_lAcquireCount;
  41. static HANDLE s_hMutex;
  42. static HANDLE s_hMutexRequest;
  43. static HANDLE s_hEvent;
  44. static const TCHAR s_szLogonMutexName[];
  45. static const TCHAR s_szLogonRequestMutexName[];
  46. static const TCHAR s_szLogonReplyEventName[];
  47. static const TCHAR s_szShutdownEventName[];
  48. static SID_IDENTIFIER_AUTHORITY s_SecurityNTAuthority;
  49. static SID_IDENTIFIER_AUTHORITY s_SecurityWorldSID;
  50. };
  51. #endif /* _LogonMutex_ */