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.

88 lines
2.1 KiB

  1. //-------------------------------------------------------------------
  2. //
  3. // FILE: CLicReg.Hpp
  4. //
  5. // Summary;
  6. // Class definition for handling the licensing api registration
  7. //
  8. // Notes;
  9. //
  10. // History
  11. // 11/15/94 MikeMi Created
  12. // Apr-26-95 MikeMi Added Computer name and remoting
  13. //
  14. //-------------------------------------------------------------------
  15. #ifndef __CLicReg_HPP__
  16. #define __CLicReg_HPP__
  17. const WCHAR FILEPRINT_SERVICE_REG_KEY[] = L"FilePrint";
  18. const WCHAR FILEPRINT_SERVICE_DISPLAY_NAME[] = L"Windows Server";
  19. const WCHAR FILEPRINT_SERVICE_FAMILY_DISPLAY_NAME[] = L"Windows Server";
  20. // license modes to pass to SetMode
  21. //
  22. enum LICENSE_MODE
  23. {
  24. LICMODE_PERSEAT,
  25. LICMODE_PERSERVER,
  26. LICMODE_UNDEFINED
  27. };
  28. //-------------------------------------------------------------------
  29. // Root class of all registry classes
  30. //
  31. class CLicReg
  32. {
  33. public:
  34. CLicReg();
  35. ~CLicReg();
  36. LONG CommitNow();
  37. LONG Close();
  38. protected:
  39. HKEY _hkey;
  40. };
  41. //-------------------------------------------------------------------
  42. // License Registry Key, for initialization and enumeration
  43. //
  44. class CLicRegLicense : public CLicReg
  45. {
  46. public:
  47. LONG Open( BOOL& fNew, LPCWSTR pszComputer = NULL );
  48. LONG EnumService( DWORD iService, LPWSTR pszBuffer, DWORD& cBuffer );
  49. };
  50. //-------------------------------------------------------------------
  51. // Services under the License Registry Key
  52. //
  53. class CLicRegLicenseService : public CLicReg
  54. {
  55. public:
  56. CLicRegLicenseService( LPCWSTR pszService = NULL );
  57. LONG Open( LPCWSTR pszComputer = NULL, BOOL fCreate = TRUE );
  58. void SetService( LPCWSTR pszService );
  59. BOOL CanChangeMode();
  60. LONG SetChangeFlag( BOOL fHasChanged );
  61. LONG SetMode( LICENSE_MODE lm );
  62. LONG SetUserLimit( DWORD dwLimit );
  63. LONG GetMode( LICENSE_MODE& lm );
  64. LONG GetUserLimit( DWORD& dwLimit );
  65. LONG GetDisplayName( LPWSTR pszName, DWORD& cchName );
  66. LONG SetDisplayName( LPCWSTR pszName );
  67. LONG GetFamilyDisplayName( LPWSTR pszName, DWORD& cchName );
  68. LONG SetFamilyDisplayName( LPCWSTR pszName );
  69. private:
  70. PWCHAR _pszService;
  71. };
  72. #endif