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.

110 lines
3.1 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. //function declarations for LKP portion of the LKPLite
  57. DWORD LKPLiteGenLKP (
  58. LPTSTR lpszPID, //used for encrypting the LKPLite structure
  59. LPTSTR lpszProductCode, //Product Code
  60. DWORD dwQuantity, //quantity
  61. DWORD dwSerialNum, //serail number of SPK
  62. DWORD dwExpirationMos, //expiration in number of months from today
  63. DWORD dwVersion, //version number can be upto 99
  64. DWORD dwUpgrade, //upgrade or full license
  65. DWORD dwProgramType, //SELECT,MOLP or RETAIL
  66. LPTSTR * ppszLKPLite
  67. );
  68. DWORD LKPLiteVerifyLKP (
  69. LPTSTR lpszPID, //PID for verifying the LKP lite blob
  70. LPTSTR pszLKPLite, //B24 encoded LKP
  71. DWORD * pdwVerifyResult
  72. );
  73. DWORD LKPLiteCrackLKP (
  74. LPTSTR lpszPID,
  75. LPTSTR pszLKPLite,
  76. LPTSTR lpszProductCode,
  77. DWORD * pdwQuantity,
  78. DWORD * pdwSerialNum,
  79. DWORD * pdwExpitaitonMos,
  80. DWORD * pdwVersion,
  81. DWORD * pdwUpgrade,
  82. DWORD * pdwProgramType
  83. );
  84. DWORD LKPLiteEncryptUsingPID(LPTSTR lpszPID,
  85. BYTE * pbBufferToEncrypt,
  86. DWORD dwLength);
  87. DWORD LKPLiteDecryptUsingPID(LPTSTR lpszPID,
  88. BYTE * pbBufferToEncrypt,
  89. DWORD dwLength);
  90. DWORD LKPLiteValConfNumber(LPTSTR lpszLSID,
  91. LPTSTR lpszPID,
  92. LPTSTR lpszConfirmation);
  93. #endif //__LKPLITE__H__