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.

196 lines
2.3 KiB

  1. /*
  2. * Policy.h
  3. *
  4. * Author: BreenH
  5. *
  6. * The policy base class definition.
  7. */
  8. #ifndef __LC_POLICY_H__
  9. #define __LC_POLICY_H__
  10. /*
  11. * Defines
  12. */
  13. #define LC_VERSION_V1 0x1
  14. #define LC_VERSION_CURRENT LC_VERSION_V1
  15. #define LC_FLAG_INTERNAL_POLICY 0x1
  16. #define LC_FLAG_LIMITED_INIT_ONLY 0x2
  17. #define LC_FLAG_REQUIRE_APP_COMPAT 0x4
  18. #define LC_LLS_PRODUCT_NAME L"TermService"
  19. /*
  20. * Typedefs
  21. */
  22. class CPolicy;
  23. /*
  24. * Class Definition
  25. */
  26. class CPolicy
  27. {
  28. public:
  29. /*
  30. * Creation Functions
  31. */
  32. CPolicy(
  33. );
  34. virtual
  35. ~CPolicy(
  36. );
  37. /*
  38. * Core Loading and Activation Functions
  39. */
  40. NTSTATUS
  41. CoreActivate(
  42. BOOL fStartup,
  43. ULONG *pulAlternatePolicy
  44. );
  45. NTSTATUS
  46. CoreDeactivate(
  47. BOOL fShutdown
  48. );
  49. NTSTATUS
  50. CoreLoad(
  51. ULONG ulCoreVersion
  52. );
  53. NTSTATUS
  54. CoreUnload(
  55. );
  56. /*
  57. * Subclass Loading and Activation Functions
  58. */
  59. protected:
  60. virtual NTSTATUS
  61. Activate(
  62. BOOL fStartup,
  63. ULONG *pulAlternatePolicy
  64. );
  65. virtual NTSTATUS
  66. Deactivate(
  67. BOOL fShutdown
  68. );
  69. virtual NTSTATUS
  70. Load(
  71. );
  72. virtual NTSTATUS
  73. Unload(
  74. );
  75. /*
  76. * Reference Functions
  77. */
  78. public:
  79. LONG
  80. IncrementReference(
  81. );
  82. LONG
  83. DecrementReference(
  84. );
  85. /*
  86. * Administrative Functions
  87. */
  88. virtual NTSTATUS
  89. DestroyPrivateContext(
  90. LPLCCONTEXT lpContext
  91. );
  92. virtual ULONG
  93. GetFlags(
  94. ) = 0;
  95. virtual ULONG
  96. GetId(
  97. ) = 0;
  98. virtual NTSTATUS
  99. GetInformation(
  100. LPLCPOLICYINFOGENERIC lpPolicyInfo
  101. ) = 0;
  102. /*
  103. * Licensing Functions
  104. */
  105. virtual NTSTATUS
  106. Connect(
  107. CSession& Session,
  108. UINT &dwClientError
  109. );
  110. virtual NTSTATUS
  111. AutoLogon(
  112. CSession& Session,
  113. LPBOOL lpfUseCredentials,
  114. LPLCCREDENTIALS lpCredentials
  115. );
  116. virtual NTSTATUS
  117. Logon(
  118. CSession& Session
  119. );
  120. virtual NTSTATUS
  121. Disconnect(
  122. CSession& Session
  123. );
  124. virtual NTSTATUS
  125. Reconnect(
  126. CSession& Session,
  127. CSession& TemporarySession
  128. );
  129. virtual NTSTATUS
  130. Logoff(
  131. CSession& Session
  132. );
  133. /*
  134. * Common Helper Functions
  135. */
  136. protected:
  137. NTSTATUS
  138. CPolicy::GetLlsLicense(
  139. CSession& Session
  140. );
  141. /*
  142. * Private Variables
  143. */
  144. private:
  145. BOOL m_fActivated;
  146. LONG m_RefCount;
  147. };
  148. #endif