machine_deal_win.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef RLZ_LIB_MACHINE_DEAL_WIN_H_
  5. #define RLZ_LIB_MACHINE_DEAL_WIN_H_
  6. #include <stddef.h>
  7. #include "rlz/lib/rlz_api.h"
  8. // OEM Deal confirmation storage functions.
  9. namespace rlz_lib {
  10. // The maximum length of an access points RLZ in bytes.
  11. const size_t kMaxDccLength = 128;
  12. // Makes the OEM Deal Confirmation code writable by all users on the machine.
  13. // This should be called before calling SetMachineDealCode from a non-admin
  14. // account.
  15. // Access: HKLM write.
  16. bool RLZ_LIB_API CreateMachineState(void);
  17. // Set the OEM Deal Confirmation Code (DCC). This information is used for RLZ
  18. // initialization.
  19. // Access: HKLM write, or
  20. // HKCU read if rlz_lib::CreateMachineState() has been successfully called.
  21. bool RLZ_LIB_API SetMachineDealCode(const char* dcc);
  22. // Get the DCC cgi argument string to append to a daily ping.
  23. // Should be used only by OEM deal trackers. Applications should use the
  24. // GetMachineDealCode method which has an AccessPoint parameter.
  25. // Access: HKLM read.
  26. bool RLZ_LIB_API GetMachineDealCodeAsCgi(char* cgi, size_t cgi_size);
  27. // Get the DCC value stored in registry.
  28. // Should be used only by OEM deal trackers. Applications should use the
  29. // GetMachineDealCode method which has an AccessPoint parameter.
  30. // Access: HKLM read.
  31. bool RLZ_LIB_API GetMachineDealCode(char* dcc, size_t dcc_size);
  32. // Parses a ping response, checks if it is valid and sets the machine DCC
  33. // from the response. The ping must also contain the current DCC value in
  34. // order to be considered valid.
  35. // Access: HKLM write;
  36. // HKCU write if CreateMachineState() has been successfully called.
  37. bool RLZ_LIB_API SetMachineDealCodeFromPingResponse(const char* response);
  38. } // namespace rlz_lib
  39. #endif // RLZ_LIB_MACHINE_DEAL_WIN_H_