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.

175 lines
3.7 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. VOID
  102. ReceivedPermanentLicense();
  103. LICENSE_STATUS
  104. SetInternetConnectorStatus(
  105. BOOL * pfStatus );
  106. LICENSE_STATUS
  107. GetInternetConnectorStatus(
  108. BOOL * pfStatus );
  109. VOID
  110. CheckLicensingTimeBombExpiration();
  111. VOID
  112. LogLicensingEvent(
  113. HANDLE hLicense,
  114. DWORD dwEventId );
  115. LICENSE_STATUS
  116. QueryLicenseInfo(
  117. HANDLE hLicense,
  118. PTS_LICENSE_INFO pTsLicenseInfo );
  119. VOID
  120. FreeLicenseInfo(
  121. PTS_LICENSE_INFO pTsLicenseInfo );
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125. #endif