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.

214 lines
9.7 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996-1998
  5. //
  6. // File: tlsdef.h
  7. //
  8. // Contents:
  9. //
  10. // History: 12-09-97 HueiWang Created
  11. //
  12. //---------------------------------------------------------------------------
  13. #ifndef __TLSDEF_H__
  14. #define __TLSDEF_H__
  15. //---------------------------------------------------------------------------
  16. // Xenroll specific
  17. //#define CERTIFICATE_CA_TYPE 1
  18. //#define CERTITICATE_MF_TYPE 2
  19. //#define CERTIFICATE_CH_TYPE 3
  20. //#define CERTIFICATE_LEVEL_ROOT 0
  21. //---------------------------------------------------------------------------
  22. // KeyPack related code
  23. //
  24. #define LSKEYPACKTYPE_UNKNOWN 0x0
  25. #define LSKEYPACKTYPE_RETAIL 0x1
  26. #define LSKEYPACKTYPE_SELECT 0x2
  27. #define LSKEYPACKTYPE_CONCURRENT 0x3
  28. #define LSKEYPACKTYPE_TEMPORARY 0x4
  29. #define LSKEYPACKTYPE_OPEN 0x5
  30. #define LSKEYPACKTYPE_FREE 0x6
  31. #define LSKEYPACKTYPE_FIRST LSKEYPACKTYPE_UNKNOWN
  32. #define LSKEYPACKTYPE_LAST LSKEYPACKTYPE_FREE
  33. #define LSKEYPACKSTATUS_UNKNOWN 0x0
  34. #define LSKEYPACKSTATUS_ACTIVE 0x1
  35. #define LSKEYPACKSTATUS_PENDING 0x2
  36. #define LSKEYPACKSTATUS_RETURNED 0x3
  37. #define LSKEYPACKSTATUS_REVOKED 0x4
  38. #define LSKEYPACKSTATUS_TEMPORARY 0x5
  39. #define LSKEYPACKSTATUS_OTHERS 0x6
  40. #define LSKEYPACKSTATUS_ADD_LICENSE 0x7
  41. #define LSKEYPACKSTATUS_REMOVE_LICENSE 0x8
  42. #define LSKEYPACKSTATUS_ADD_DESC 0x9
  43. #define LSKEYPACKSTATUS_REMOVE_DESC 0x10
  44. #define LSKEYPACKSTATUS_FIRST LSKEYPACKSTATUS_UNKNOWN
  45. #define LSKEYPACKSTATUS_LAST LSKEYPACKSTATUS_REMOVE_DESC
  46. #define LSKEYPACKLICENSETYPE_UNKNOWN 0x0
  47. #define LSKEYPACKLICENSETYPE_NEW 0x1
  48. #define LSKEYPACKLICENSETYPE_UPGRADE 0x2
  49. #define LSKEYPACKLICENSETYPE_COMPETITIVE 0x3
  50. #define LSKEYPACKLICENSETYPE_TEMPORARY 0x4
  51. #define LSKEYPACKLICENSETYPE_FIRST LSKEYPACKLICENSETYPE_UNKNOWN
  52. #define LSKEYPACKLICENSETYPE_LAST LSKEYPACKLICENSETYPE_TEMPORARY
  53. #define LSKEYPACKCHANNELOFPURCHASE_UNKNOWN 0x0
  54. #define LSKEYPACKCHANNELOFPURCHASE_OEM 0x1
  55. #define LSKEYPACKCHANNELOFPURCHASE_RETAIL 0x2
  56. #define LSKEYPACKCHANNELOFPURCHASE_FIRST LSKEYPACKCHANNELOFPURCHASE_UNKNOWN
  57. #define LSKEYPACKCHANNELOFPURCHASE_LAST LSKEYPACKCHANNELOFPURCHASE_RETAIL
  58. #define LSKEYPACKPRODUCTFLAG_UNKNOWN 0x0000
  59. #define LSKEYPACKPLATFORMTYPE_UNKNOWN 0x0000
  60. #define LSKEYPACKPLATFORMTYPE_FREE 0x0002
  61. #define LSKEYPACKPLATFORMTYPE_OTHERS 0x00FF
  62. #define LSLICENSE_STATUS_UNKNOWN 0x0
  63. #define LSLICENSE_STATUS_TEMPORARY 0x1
  64. #define LSLICENSE_STATUS_ACTIVE 0x2
  65. #define LSLICENSE_STATUS_UPGRADED 0x3
  66. #define LSLICENSE_STATUS_REVOKE 0x4
  67. #define LSLICENSE_STATUS_PENDING 0x5
  68. #define LSLICENSE_STATUS_CONCURRENT 0x6
  69. #define LSLICENSE_STATUS_FIRST LSLICENSE_STATUS_UNKNOWN
  70. #define LSLICENSE_STATUS_LAST LSLICENSE_STATUS_CONCURRENT
  71. //---------------------------------------------------------------------------
  72. /// Key Pack Search Parameters
  73. // Basic KeyPack Search Parameter
  74. #define LSKEYPACK_SEARCH_INFO_ALL 0x0000FFFF
  75. #define LSKEYPACK_SEARCH_KEYPACKID 0x00000001
  76. #define LSKEYPACK_SEARCH_KEYPACKTYPE 0x00000002
  77. #define LSKEYPACK_SEARCH_PRODUCTID 0x00000004
  78. #define LSKEYPACK_SEARCH_MAJORVERSION 0x00000008
  79. #define LSKEYPACK_SEARCH_MINORVERSION 0x00000010
  80. #define LSKEYPACK_SEARCH_PLATFORMTYPE 0x00000020
  81. #define LSKEYPACK_SEARCH_LICENSETYPE 0x00000040
  82. #define LSKEYPACK_SEARCH_LANGID 0x00000080
  83. #define LSKEYPACK_SEARCH_COP 0x00000100
  84. #define LSKEYPACK_SEARCH_BSERIALNUMBER 0x00000200
  85. #define LSKEYPACK_SEARCH_TOTALLICENSES 0x00000400
  86. #define LSKEYPACK_SEARCH_PRODUCTFLAGS 0x00000800
  87. #define LSKEYPACK_SEARCH_COMPANYNAME 0x00001000
  88. #define LSKEYPACK_SEARCH_PRODUCTNAME 0x00002000
  89. #define LSKEYPACK_SEARCH_PRODUCTDESC 0x00004000
  90. #define LSKEYPACK_SEARCH_DUPLICATE \
  91. (LSKEYPACK_SEARCH_KEYPACKID | LSKEYPACK_SEARCH_COMPANYNAME | \
  92. LSKEYPACK_SEARCH_PRODUCTID | LSKEYPACK_SEARCH_MAJORVERSION | \
  93. LSKEYPACK_SEARCH_MINORVERSION | LSKEYPACK_SEARCH_PLATFORMTYPE)
  94. // Extended KeyPack Search Parameters
  95. #define LSKEYPACK_EXSEARCH_ALL 0xFFFF0000
  96. #define LSKEYPACK_EXSEARCH_DWINTERNAL 0x00010000
  97. #define LSKEYPACK_EXSEARCH_KEYPACKSTATUS 0x00020000
  98. #define LSKEYPACK_EXSEARCH_ACTIVATEDATE 0x00040000
  99. #define LSKEYPACK_EXSEARCH_EXPIREDATE 0x00080000
  100. #define LSKEYPACK_EXSEARCH_AVAILABLE 0x00100000
  101. #define LSKEYPACK_EXSEARCH_ALLVERSION 0x10000000
  102. #define LSKEYPACK_SEARCH_ALL (LSKEYPACK_SEARCH_INFO_ALL | LSKEYPACK_EXSEARCH_ALL)
  103. #define LSKEYPACK_SEARCH_NONE 0x00000000
  104. #define LSKEYPACK_SET_KEYPACKSTATUS LSKEYPACK_EXSEARCH_KEYPACKSTATUS
  105. #define LSKEYPACK_SET_ACTIVATEDATE LSKEYPACK_EXSEARCH_ACTIVATEDATE
  106. #define LSKEYPACK_SET_EXPIREDATE LSKEYPACK_EXSEARCH_EXPIREDATE
  107. #define LSKEYPACK_SET_AVAILABLE LSKEYPACK_EXSEARCH_AVAILABLE
  108. #define LSKEYPACK_SET_ALLSTATUS (LSKEYPACK_SET_KEYPACKSTATUS | LSKEYPACK_SET_ACTIVATEDATE | LSKEYPACK_SET_EXPIREDATE)
  109. //-----------------------------------------------------------------------------
  110. // License Search parameters
  111. //
  112. #define LSLICENSE_SEARCH_LICENSEID 0x00000001
  113. #define LSLICENSE_SEARCH_KEYPACKID 0x00000002
  114. #define LSLICENSE_SEARCH_MACHINENAME 0x00000008
  115. #define LSLICENSE_SEARCH_USERNAME 0x00000010
  116. #define LSLICENSE_SEARCH_ISSUEDATE 0x00000080
  117. #define LSLICENSE_SEARCH_EXPIREDATE 0x00000100
  118. #define LSLICENSE_SEARCH_NUMLICENSES 0x00000200
  119. #define LSLICENSE_SEARCH_ENTRY_STATUS 0x20000000
  120. #define LSLICENSE_SEARCH_MARK_FLAGS LSLICENSE_SEARCH_ENTRY_STATUS
  121. #define LSLICENSE_EXSEARCH_LICENSESTATUS 0x00100000
  122. #define LSLICENSE_SEARCH_ALL \
  123. (LSLICENSE_SEARCH_LICENSEID | LSLICENSE_SEARCH_KEYPACKID | \
  124. LSLICENSE_SEARCH_MACHINENAME | \
  125. LSLICENSE_SEARCH_USERNAME | \
  126. LSLICENSE_SEARCH_ISSUEDATE | LSLICENSE_SEARCH_NUMLICENSES | \
  127. LSLICENSE_SEARCH_EXPIREDATE | LSLICENSE_EXSEARCH_LICENSESTATUS | \
  128. LSLICENSE_SEARCH_ENTRY_STATUS)
  129. #define LSLICENSE_SEARCH_NONE 0x00000000
  130. //-----------------------------------------------------------------------------
  131. // General Define
  132. #define LSERVER_MAX_STRING_SIZE 255
  133. #define GUID_MAX_SIZE 37
  134. #define MAXCOMPUTERNAMELENGTH 32 // from MAX_COMPUTERNAME_LENGTH in winbase.h
  135. #define MAXUSERNAMELENGTH 256 // UNLEN in lmcons.h
  136. // HueiWang - temporary, need to define this
  137. #define HLS_MAX_SCOPE_NAME_LENGTH MAX_COMPUTERNAME_LENGTH
  138. //-------------------------------------------------------------
  139. // Hydra License Server Return Code
  140. #define LSERVER_S_SUCCESS ERROR_SUCCESS
  141. #define LSERVER_SUCCESS_BASE 4000
  142. #define LSERVER_ERROR_BASE 5000
  143. #define LSERVER_I_NO_MORE_DATA (LSERVER_SUCCESS_BASE + 1)
  144. #define LSERVER_I_PROXIMATE_LICENSE (LSERVER_SUCCESS_BASE + 2)
  145. #define LSERVER_I_TEMPORARY_LICENSE (LSERVER_SUCCESS_BASE + 3)
  146. #define LSERVER_I_LICENSE_UPGRADED (LSERVER_SUCCESS_BASE + 4)
  147. #define LSERVER_I_CERTIFICATE_OVERWRITE (LSERVER_SUCCESS_BASE + 5)
  148. #define LSERVER_I_REMOVE_TOOMANY (LSERVER_SUCCESS_BASE + 6)
  149. #define LSERVER_I_SELFSIGN_CERTIFICATE (LSERVER_SUCCESS_BASE + 7)
  150. #define LSERVER_I_NOT_LSERVER_CERTIFICATE (LSERVER_SUCCESS_BASE + 8)
  151. #define LSERVER_I_TEMP_SELFSIGN_CERT (LSERVER_SUCCESS_BASE + 9)
  152. #define LSERVER_I_SERVICE_SHUTDOWN (LSERVER_SUCCESS_BASE + 10)
  153. #define LSERVER_E_INTERNAL_ERROR (LSERVER_ERROR_BASE + 1)
  154. #define LSERVER_E_ERROR_GENERAL (LSERVER_ERROR_BASE + 2)
  155. #define LSERVER_E_ACCESS_DENIED (LSERVER_ERROR_BASE + 3)
  156. #define LSERVER_E_DUPLICATE (LSERVER_ERROR_BASE + 4)
  157. #define LSERVER_E_INVALID_HANDLE (LSERVER_ERROR_BASE + 5)
  158. #define LSERVER_E_INVALID_SEQUENCE (LSERVER_ERROR_BASE + 6)
  159. #define LSERVER_E_SERVER_BUSY (LSERVER_ERROR_BASE + 7)
  160. #define LSERVER_E_OUTOFMEMORY (LSERVER_ERROR_BASE + 8)
  161. #define LSERVER_E_INVALID_DATA (LSERVER_ERROR_BASE + 9)
  162. #define LSERVER_E_DATANOTFOUND (LSERVER_ERROR_BASE + 10)
  163. #define LSERVER_E_NO_LICENSE (LSERVER_ERROR_BASE + 11)
  164. #define LSERVER_E_NO_PRODUCT (LSERVER_ERROR_BASE + 12)
  165. #define LSERVER_E_LICENSE_REJECTED (LSERVER_ERROR_BASE + 13)
  166. #define LSERVER_E_LICENSE_REVOKED (LSERVER_ERROR_BASE + 14)
  167. #define LSERVER_E_LICENSE_EXPIRED (LSERVER_ERROR_BASE + 15)
  168. #define LSERVER_E_CORRUPT_DATABASE (LSERVER_ERROR_BASE + 16)
  169. #define LSERVER_E_NOTSUPPORTED (LSERVER_ERROR_BASE + 17)
  170. #define LSERVER_E_INVALID_NT_VERSION (LSERVER_ERROR_BASE + 18)
  171. #define LSERVER_E_NOT_NTSERVER (LSERVER_ERROR_BASE + 19)
  172. #define LSERVER_E_LS_NOTPRESENT (LSERVER_ERROR_BASE + 20)
  173. #define LSERVER_E_LS_NOTRUNNING (LSERVER_ERROR_BASE + 21)
  174. #define LSERVER_E_NO_CERTIFICATE (LSERVER_ERROR_BASE + 22)
  175. #define LSERVER_E_NOT_LSCERTIFICATE (LSERVER_ERROR_BASE + 23)
  176. #define LSERVER_E_POLICYMODULEERROR (LSERVER_ERROR_BASE + 24) // error in policy module return data
  177. #define LSERVER_E_INVALID_RETURN (LSERVER_ERROR_BASE + 25)
  178. #define LSERVER_E_INCOMPATIBLE (LSERVER_ERROR_BASE + 26)
  179. #define LSERVER_E_INVALID_SPK (LSERVER_ERROR_BASE + 27)
  180. #define LSERVER_E_INVALID_LKP (LSERVER_ERROR_BASE + 28)
  181. #define LSERVER_E_INVALID_SIGN (LSERVER_ERROR_BASE + 29)
  182. #define LSERVER_E_POLICYDENYREQUEST (LSERVER_ERROR_BASE + 30)
  183. #define LSERVER_E_NOPOLICYMODULE (LSERVER_ERROR_BASE + 31)
  184. #define ISPOLICYMODULECODE(x) (0x08000000 & x)
  185. #define LSERVER_E_LASTERROR LSERVER_E_NOPOLICYMODULE
  186. #endif