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.

75 lines
2.1 KiB

  1. /*****************************************************************************\
  2. * MODULE: lusrdata.hxx
  3. *
  4. * PURPOSE: This specialises the user data class to keep track of data
  5. * useful for the user port reference count.
  6. *
  7. * Copyright (C) 2000 Microsoft Corporation
  8. *
  9. * History:
  10. *
  11. * 1/11/2000 mlawrenc Implemented
  12. *
  13. \*****************************************************************************/
  14. #if (!defined (_LUSRDATA_HXX))
  15. #define _LUSRDATA_HXX
  16. #include "userdata.hxx"
  17. class CLogonUserData
  18. : public CUserData {
  19. public:
  20. CLogonUserData (); // Default contructor
  21. int Compare(const CLogonUserData *second) const;
  22. friend inline BOOL operator== (const CLogonUserData &lhs, const CLogonUserData &rhs);
  23. friend inline BOOL operator!= (const CLogonUserData &lhs, const CLogonUserData &rhs);
  24. CLogonUserData &operator=(const CLogonUserData &rhs);
  25. inline DWORD IncRefCount(void);
  26. inline DWORD DecRefCount(void);
  27. protected:
  28. ULONG m_ulSessionId;
  29. DWORD m_dwRefCount;
  30. private:
  31. BOOL _GetClientSessionId( VOID );
  32. };
  33. typedef CSingleList<CLogonUserData*> CLogonUserList;
  34. typedef CLogonUserData* PCLOGON_USERDATA;
  35. /////////////////////////////////////////////////////////////////////////////////////
  36. // INLINE METHODS
  37. ////////////////////////////////////////////////////////////////////////////////////
  38. inline DWORD CLogonUserData::IncRefCount(void) { // Should be protected when called
  39. return ++m_dwRefCount;
  40. }
  41. inline DWORD CLogonUserData::DecRefCount(void) { // Must be protected when called...
  42. if (m_dwRefCount > 0) --m_dwRefCount;
  43. return m_dwRefCount;
  44. }
  45. inline BOOL operator== (const CLogonUserData &lhs, const CLogonUserData &rhs) {
  46. return !lhs.Compare(&rhs);
  47. }
  48. inline BOOL operator!= (const CLogonUserData &lhs, const CLogonUserData &rhs) {
  49. return lhs.Compare(&rhs);
  50. }
  51. #endif // #if (!defined(_LUSRDATA_HXX))
  52. /****************************************************************
  53. ** End of File (lusrdata.hxx)
  54. ****************************************************************/