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.

57 lines
2.6 KiB

  1. // ValidateDigPid is given a Digital PID that contains a binary
  2. // representation of the ProductKey. It needs to validate that key
  3. // against the static Public Key table
  4. typedef enum {
  5. pkstatOk = 0,
  6. pkstatInvalidCrc,
  7. pkstatSecurityFailure,
  8. pkstatUnknownGroupID,
  9. pkstatInvalidProdKey,
  10. pkstatInvalidKeyLen,
  11. pkstatOutOfMemory,
  12. } ProdKeyStatus;
  13. // return value is a ProdKeyStatus (see above)
  14. extern "C" int STDAPICALLTYPE ValidateDigitalPid(
  15. PDIGITALPID pDigPid, // [IN] DigitalPid to validate
  16. PDWORD pdwSequence, // [OUT] Sequence
  17. PBOOL pfCCP); // [OUT] upgrade flag
  18. // return value is a PidGenError (see PidGen.h)
  19. extern "C" DWORD STDAPICALLTYPE PIDGenStaticA(
  20. LPSTR lpstrSecureCdKey, // [IN] 25-character Secure CD-Key (gets U-Cased)
  21. LPCSTR lpstrRpc, // [IN] 5-character Release Product Code
  22. LPCSTR lpstrSku, // [IN] Stock Keeping Unit (formatted like 123-12345)
  23. LPCSTR lpstrOemId, // [IN] 4-character OEM ID or NULL
  24. BOOL fOem, // [IN] is this an OEM install?
  25. LPSTR lpstrPid2, // [OUT] PID 2.0, pass in ptr to 24 character array
  26. LPBYTE lpbPid3, // [OUT] pointer to binary PID3 buffer. First DWORD is the length
  27. LPDWORD lpdwSeq, // [OUT] optional ptr to sequence number (can be NULL)
  28. LPBOOL pfCCP); // [OUT] optional ptr to Compliance Checking flag (can be NULL)
  29. // return value is a PidGenError (see PidGen.h)
  30. extern "C" DWORD STDAPICALLTYPE PIDGenStaticW(
  31. LPWSTR lpstrSecureCdKey, // [IN] 25-character Secure CD-Key (gets U-Cased)
  32. LPCWSTR lpstrRpc, // [IN] 5-character Release Product Code
  33. LPCWSTR lpstrSku, // [IN] Stock Keeping Unit (formatted like 123-12345)
  34. LPCWSTR lpstrOemId, // [IN] 4-character OEM ID or NULL
  35. LPBYTE lpbPublicKey, // [IN] pointer to optional public key or NULL
  36. DWORD dwcbPublicKey, // [IN] byte length of optional public key
  37. DWORD dwKeyIdx, // [IN] key pair index optional public key
  38. BOOL fOem, // [IN] is this an OEM install?
  39. LPWSTR lpstrPid2, // [OUT] PID 2.0, pass in ptr to 24 character array
  40. LPBYTE lpbPid3, // [OUT] pointer to binary PID3 buffer. First DWORD is the length
  41. LPDWORD lpdwSeq, // [OUT] optional ptr to sequence number (can be NULL)
  42. LPBOOL pfCCP); // [OUT] optional ptr to Compliance Checking flag (can be NULL)
  43. #ifdef UNICODE
  44. #define PIDGenStatic PIDGenStaticW
  45. #else
  46. #define PIDGenStatic PIDGenStaticA
  47. #endif // UNICODE