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.

93 lines
2.0 KiB

  1. //
  2. // Copyright (c) 2002 Microsoft Corporation, All Rights Reserved
  3. //
  4. #pragma once
  5. #include <ntsecapi.h>
  6. /******************************************************************************
  7. * #includes to Register this class with the CResourceManager.
  8. *****************************************************************************/
  9. #include "DllWrapperBase.h"
  10. extern const GUID g_guidSecur32Api ;
  11. extern const WCHAR g_tstrSecur32[] ;
  12. typedef NTSTATUS (*PFN_LSA_ENUMERATE_LOGON_SESSIONS)
  13. (
  14. OUT PULONG LogonSessionCount,
  15. OUT PLUID* LogonSessionList
  16. );
  17. typedef NTSTATUS (*PFN_LSA_GET_LOGON_SESSION_DATA)
  18. (
  19. IN PLUID LogonId,
  20. OUT PSECURITY_LOGON_SESSION_DATA* ppLogonSessionData
  21. );
  22. typedef NTSTATUS (*PFN_LSA_FREE_RETURN_BUFFER)
  23. (
  24. IN PVOID Buffer
  25. );
  26. class CSecur32Api : public CDllWrapperBase
  27. {
  28. PFN_LSA_ENUMERATE_LOGON_SESSIONS m_pfncLsaEnumerateLogonSessions ;
  29. PFN_LSA_GET_LOGON_SESSION_DATA m_pfncLsaGetLogonSessionData ;
  30. PFN_LSA_FREE_RETURN_BUFFER m_pfncLsaFreeReturnBuffer ;
  31. public:
  32. NTSTATUS LsaEnumerateLogonSessions (
  33. PULONG LogonSessionCount,
  34. PLUID* LogonSessionList
  35. ) ;
  36. NTSTATUS LsaGetLogonSessionData (
  37. PLUID LogonId,
  38. PSECURITY_LOGON_SESSION_DATA* ppLogonSessionData
  39. ) ;
  40. NTSTATUS LsaFreeReturnBuffer ( PVOID Buffer ) ;
  41. // Inherrited initialization function.
  42. virtual bool Init();
  43. CSecur32Api ( LPCTSTR a_tstrWrappedDllName ) ;
  44. ~CSecur32Api () ;
  45. } ;
  46. class CLuidHelper
  47. {
  48. class Resource
  49. {
  50. CSecur32Api * m_pSecur32 ;
  51. public:
  52. Resource () ;
  53. ~Resource () ;
  54. CSecur32Api * operator () () const
  55. {
  56. return m_pSecur32 ;
  57. }
  58. operator CSecur32Api () const
  59. {
  60. return *m_pSecur32 ;
  61. }
  62. BOOL operator ! () const
  63. {
  64. return ( NULL == m_pSecur32 ) ;
  65. }
  66. } ;
  67. public:
  68. BOOL IsInteractiveSession ( PLUID ) ;
  69. NTSTATUS GetLUIDFromProcess ( HANDLE , PLUID ) ;
  70. } ;