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.

179 lines
3.9 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996-1998
  5. //
  6. // File: hslice.h
  7. //
  8. // Contents: Hydra Server License Protocol API
  9. //
  10. // History: 01-07-98 FredCh Created
  11. //
  12. //-----------------------------------------------------------------------------
  13. #ifndef _HSLICENSE_H_
  14. #define _HSLICENSE_H_
  15. #include <license.h>
  16. ///////////////////////////////////////////////////////////////////////////////
  17. // Context flags
  18. //
  19. #define LICENSE_CONTEXT_PER_SEAT 0x00000001
  20. #define LICENSE_CONTEXT_CONCURRENT 0x00000002
  21. #define LICENSE_CONTEXT_INTERNET 0x00000003
  22. #define LICENSE_CONTEXT_REMOTE_ADMIN 0x00000004
  23. #define LICENSE_CONTEXT_CON_QUEUE 0x00000005
  24. ///////////////////////////////////////////////////////////////////////////////
  25. // These are the different responses that can be constructed by the
  26. // ConstructLicenseResponse API
  27. //
  28. #define LICENSE_RESPONSE_VALID_CLIENT 0x00000001
  29. #define LICENSE_RESPONSE_INVALID_CLIENT 0x00000002
  30. //-----------------------------------------------------------------------------
  31. //
  32. // Terminal server's license server discovery mechanism may log these
  33. // events:
  34. //
  35. // LICENSING_EVENT_NO_LICENSE_SERVER - it cannot find any license server.
  36. //
  37. // LICENSING_EVENT_TEMP_LICENSE_EXPIRED - A client has been disconnected
  38. // because its temporary license has expired.
  39. //
  40. // LICENSING_EVENT_NO_LICENSE_GRANTED - No license could be granted, and
  41. // we're past the grace period
  42. //
  43. // LICENSING_EVENT_NO_CONCURRENT_LICENSE - No more remote admin or internet
  44. // connector logons allowed.
  45. //
  46. //-----------------------------------------------------------------------------
  47. #define LICENSING_EVENT_NO_LICENSE_SERVER 0x00000001
  48. #define LICENSING_EVENT_TEMP_LICENSE_EXPIRED 0x00000002
  49. #define LICENSING_EVENT_NO_LICENSE_GRANTED 0x00000003
  50. #define LICENSING_EVENT_NO_CONCURRENT_LICENSE 0x00000004
  51. ///////////////////////////////////////////////////////////////////////////////
  52. // Hydra server licensing API
  53. //
  54. #ifdef __cplusplus
  55. extern "C" {
  56. #endif
  57. LICENSE_STATUS
  58. InitializeLicenseLib(
  59. BOOL fUseLicenseServer );
  60. LICENSE_STATUS
  61. ShutdownLicenseLib();
  62. LICENSE_STATUS
  63. CreateLicenseContext(
  64. HANDLE * phContext,
  65. DWORD dwFlag );
  66. LICENSE_STATUS
  67. InitializeLicenseContext(
  68. HANDLE hContext,
  69. DWORD dwFlags,
  70. LPLICENSE_CAPABILITIES pLicenseCap );
  71. LICENSE_STATUS
  72. AcceptLicenseContext(
  73. HANDLE hContext,
  74. DWORD cbInBuf,
  75. PBYTE pInBuf,
  76. DWORD * pcbOutBuf,
  77. PBYTE * ppOutBuf );
  78. LICENSE_STATUS
  79. DeleteLicenseContext(
  80. HANDLE hContext );
  81. LICENSE_STATUS
  82. GetConcurrentLicense(
  83. HANDLE hContext,
  84. PLONG pLicenseCount );
  85. LICENSE_STATUS
  86. ReturnConcurrentLicense(
  87. HANDLE hContext,
  88. LONG LicenseCount );
  89. LICENSE_STATUS
  90. GetConcurrentLicenseCount(
  91. HANDLE hContext,
  92. PLONG pLicenseCount );
  93. LICENSE_STATUS
  94. ConstructLicenseResponse(
  95. HANDLE hLicense,
  96. DWORD dwResponse,
  97. PDWORD pcbOutBuf,
  98. PBYTE * ppOutBuf );
  99. LICENSE_STATUS
  100. InitializeLicensingTimeBomb();
  101. BOOL
  102. RegisteredWithLicenseServer();
  103. VOID
  104. ReceivedPermanentLicense();
  105. LICENSE_STATUS
  106. SetInternetConnectorStatus(
  107. BOOL * pfStatus );
  108. LICENSE_STATUS
  109. GetInternetConnectorStatus(
  110. BOOL * pfStatus );
  111. VOID
  112. CheckLicensingTimeBombExpiration();
  113. BOOL
  114. IsLicensingTimeBombExpired();
  115. VOID
  116. LogLicensingEvent(
  117. HANDLE hLicense,
  118. DWORD dwEventId );
  119. LICENSE_STATUS
  120. QueryLicenseInfo(
  121. HANDLE hLicense,
  122. PTS_LICENSE_INFO pTsLicenseInfo );
  123. VOID
  124. FreeLicenseInfo(
  125. PTS_LICENSE_INFO pTsLicenseInfo );
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129. #endif