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.

120 lines
3.3 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // File:
  6. //
  7. // Contents:
  8. //
  9. // History:
  10. //
  11. //---------------------------------------------------------------------------
  12. #ifndef __LKPLITE__H__
  13. #define __LKPLITE__H__
  14. //SPK Stuff
  15. #define LKPLITE_SPK_SELECT 1
  16. #define LKPLITE_SPK_BASIC 0
  17. #define LKPLITE_SPK_UNKNOWN 2
  18. #define LKPLITE_SPK_LEN 25
  19. //SPK Masks
  20. #define LKPLITE_SPK_SELECT_MASK 0x0000200000000000
  21. #define LKPLITE_SPK_BASIC_MASK 0x0000000000000000
  22. #define LKPLITE_SPK_PID_MASK 0x00001FFFFFFFFF00
  23. #define LKPLITE_SPK_UNIQUEID_MASK 0xFFFFC00000000000
  24. #define LKPLITE_SPK_INVALID 1
  25. #define LKPLITE_SPK_VALID 2
  26. #define LKPLITE_SPK_INVALID_SIGN 3
  27. #define LKPLITE_INVALID_CONFNUM 4
  28. //LKP Stuff
  29. #define LKPLITE_PROGRAM_SELECT 0x0
  30. #define LKPLITE_PROGRAM_MOLP 0x1
  31. #define LKPLITE_PROGRAM_RETAIL 0x2
  32. #define LKPLITE_LKP_LEN 25
  33. #define LKPLITE_LKP_INVALID 1
  34. #define LKPLITE_LKP_VALID 2
  35. #define LKPLITE_LKP_INVALID_SIGN 3
  36. //LKP Masks
  37. #define LKPLITE_LKP_PRODUCT_MASK 0xFFC0000000000000
  38. #define LKPLITE_LKP_QUANTITY_MASK 0x003FFF0000000000
  39. #define LKPLITE_LKP_SERAIL_NO_MASK 0x000000FFF0000000
  40. #define LKPLITE_LKP_PROGRAM_MASK 0x000000000C000000
  41. #define LKPLITE_LKP_EXP_DATE_MASK 0x0000000003FC0000
  42. #define LKPLITE_LKP_VERSION_MASK 0x000000000003F800
  43. #define LKPLITE_LKP_UPG_FULL_MASK 0x0000000000000700
  44. //function declarations for SPK portion of the LKPLite
  45. DWORD LKPLiteGenSPK (
  46. LPTSTR pszPID, //PID for the product. Should include the installation number
  47. DWORD dwUniqueId, //unique Id to be put in the SPK
  48. short nSPKType, //Can be 1 for select or 0 for BASIC
  49. LPTSTR * ppszSPK
  50. );
  51. DWORD LKPLiteVerifySPK (
  52. LPTSTR pszPID, //PID to validate against
  53. LPTSTR pszSPK,
  54. DWORD * pdwVerifyResult
  55. );
  56. DWORD LKPLiteCrackSPK (
  57. LPTSTR pszPID,
  58. LPTSTR pszSPK, //Pointer to SPK
  59. LPTSTR pszPIDPart, //PID Part of SPK
  60. DWORD * pdwUniqueId, //uniqueId part of SPK
  61. short * pnSPKType //Type of SPK - Select/Basic
  62. );
  63. //function declarations for LKP portion of the LKPLite
  64. DWORD LKPLiteGenLKP (
  65. LPTSTR lpszPID, //used for encrypting the LKPLite structure
  66. LPTSTR lpszProductCode, //Product Code
  67. DWORD dwQuantity, //quantity
  68. DWORD dwSerialNum, //serail number of SPK
  69. DWORD dwExpirationMos, //expiration in number of months from today
  70. DWORD dwVersion, //version number can be upto 99
  71. DWORD dwUpgrade, //upgrade or full license
  72. DWORD dwProgramType, //SELECT,MOLP or RETAIL
  73. LPTSTR * ppszLKPLite
  74. );
  75. DWORD LKPLiteVerifyLKP (
  76. LPTSTR lpszPID, //PID for verifying the LKP lite blob
  77. LPTSTR pszLKPLite, //B24 encoded LKP
  78. DWORD * pdwVerifyResult
  79. );
  80. DWORD LKPLiteCrackLKP (
  81. LPTSTR lpszPID,
  82. LPTSTR pszLKPLite,
  83. LPTSTR lpszProductCode,
  84. DWORD * pdwQuantity,
  85. DWORD * pdwSerialNum,
  86. DWORD * pdwExpitaitonMos,
  87. DWORD * pdwVersion,
  88. DWORD * pdwUpgrade,
  89. DWORD * pdwProgramType
  90. );
  91. DWORD LKPLiteEncryptUsingPID(LPTSTR lpszPID,
  92. BYTE * pbBufferToEncrypt,
  93. DWORD dwLength);
  94. DWORD LKPLiteDecryptUsingPID(LPTSTR lpszPID,
  95. BYTE * pbBufferToEncrypt,
  96. DWORD dwLength);
  97. DWORD LKPLiteGenConfNumber(LPTSTR lpszLSID,
  98. LPTSTR lpszPID,
  99. LPTSTR *lpszConfirmation);
  100. DWORD LKPLiteValConfNumber(LPTSTR lpszLSID,
  101. LPTSTR lpszPID,
  102. LPTSTR lpszConfirmation);
  103. #endif //__LKPLITE__H__