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.

127 lines
4.9 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996-1998
  5. //
  6. // File: verify.h
  7. //
  8. // Contents: Header file for license Verification API
  9. //
  10. // History: 01-21-98 FredCh Created
  11. //
  12. //-----------------------------------------------------------------------------
  13. #ifndef _VERIFY_H_
  14. #define _VERIFY_H_
  15. ///////////////////////////////////////////////////////////////////////////////
  16. //
  17. // These is the license upgrade logic
  18. //
  19. // Action | Temp License | Expired | Version < HS
  20. // | | |
  21. // ---------------------------------------------------------------------------
  22. // Should Upgrade | 1 | 0 | 0
  23. // ---------------------------------------------------------------------------
  24. // Must Upgrade | 1 | 1 | 0
  25. // ---------------------------------------------------------------------------
  26. // Must Upgrade | 1 | 0 | 1
  27. // ---------------------------------------------------------------------------
  28. // Must Upgrade | 1 | 1 | 1
  29. // ---------------------------------------------------------------------------
  30. // Must Upgrade | 0 | 1 | 1
  31. // ---------------------------------------------------------------------------
  32. // Must Upgrade | 0 | 1 | 0
  33. // ---------------------------------------------------------------------------
  34. // Must Upgrade | 0 | 0 | 1
  35. // ---------------------------------------------------------------------------
  36. // Should Upgrade | 0 | 0 (past leeway) | 0
  37. // ---------------------------------------------------------------------------
  38. // OK | 0 | 0 | 0
  39. // ---------------------------------------------------------------------------
  40. //
  41. ///////////////////////////////////////////////////////////////////////////////
  42. #define LICENSE_STATE_TEMPORARY 0x00000001
  43. #define LICENSE_STATE_EXPIRED 0x00000002
  44. #define LICENSE_STATE_OLD_VERSION 0x00000004
  45. #define LICENSE_STATE_INVALID_PRODUCT 0x00000008 // TS5 RC1 license server
  46. // bug - must upgrade
  47. #define LICENSE_STATE_LEEWAY 0x00000010
  48. #define VERIFY_RESULT_TEMP_0_0 LICENSE_STATE_TEMPORARY
  49. #define VERIFY_RESULT_TEMP_EXPIRED_0 LICENSE_STATE_TEMPORARY | LICENSE_STATE_EXPIRED
  50. #define VERIFY_RESULT_TEMP_0_OLD LICENSE_STATE_TEMPORARY | LICENSE_STATE_OLD_VERSION
  51. #define VERIFY_RESULT_TEMP_EXPIRED_OLD LICENSE_STATE_TEMPORARY | LICENSE_STATE_EXPIRED | LICENSE_STATE_OLD_VERSION
  52. #define VERIFY_RESULT_0_EXPIRED_0 LICENSE_STATE_EXPIRED
  53. #define VERIFY_RESULT_0_EXPIRED_OLD LICENSE_STATE_EXPIRED | LICENSE_STATE_OLD_VERSION
  54. #define VERIFY_RESULT_0_LEEWAY_0 LICENSE_STATE_LEEWAY
  55. #define VERIFY_RESULT_0_LEEWAY_OLD LICENSE_STATE_LEEWAY | LICENSE_STATE_OLD_VERSION
  56. #define VERIFY_RESULT_0_0_OLD LICENSE_STATE_OLD_VERSION
  57. #define VERIFY_RESULT_0_0_0 0x00000000
  58. #define VERIFY_RESULT_INVALID_PRODUCT LICENSE_STATE_INVALID_PRODUCT
  59. #define VERIFY_RESULT_BETA_LICENSE VERIFY_RESULT_TEMP_EXPIRED_0
  60. #define LicenseInitState( _CurrentState ) \
  61. _CurrentState = 0
  62. #define LicenseSetState( _CurrentState, _State ) \
  63. _CurrentState |= _State
  64. ///////////////////////////////////////////////////////////////////////////////
  65. LICENSE_STATUS
  66. VerifyHwid(
  67. PHS_Protocol_Context pContext,
  68. PValidation_Info pValidationInfo,
  69. PLicense_Verification_Data pDecodedData );
  70. LICENSE_STATUS
  71. VerifyLicenseSignature(
  72. PHS_Protocol_Context pContext,
  73. PValidation_Info pValidationInfo,
  74. PLicense_Verification_Data pDecodedData );
  75. LICENSE_STATUS
  76. VerifyProductInfo(
  77. PHS_Protocol_Context pLmContext,
  78. PValidation_Info pValidationInfo,
  79. PLicense_Verification_Data pDecodedData,
  80. PDWORD pdwLicenseState );
  81. LICENSE_STATUS
  82. VerifyDateAndTime(
  83. PLicense_Verification_Data pDecodedData,
  84. PDWORD pdwLicenseState );
  85. LICENSE_STATUS
  86. GetVerifyResult(
  87. DWORD dwLicenseState );
  88. LICENSE_STATUS
  89. VerifyClientHwid(
  90. PHS_Protocol_Context pContext,
  91. PValidation_Info pValidationInfo,
  92. PLICENSEDPRODUCT pLicenseInfo );
  93. LICENSE_STATUS
  94. VerifyLicenseProductInfo(
  95. PHS_Protocol_Context pLmContext,
  96. PValidation_Info pValidationInfo,
  97. PLICENSEDPRODUCT pLicenseInfo,
  98. PDWORD pdwLicenseState );
  99. LICENSE_STATUS
  100. VerifyLicenseDateAndTime(
  101. PLICENSEDPRODUCT pLicenseInfo,
  102. PDWORD pdwLicenseState );
  103. #endif