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.

115 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1994-95 Microsoft Corporation
  3. Module Name:
  4. srvobj.h
  5. Abstract:
  6. Server object implementation.
  7. Author:
  8. Don Ryan (donryan) 04-Jan-1995
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. Jeff Parham (jeffparh) 30-Jan-1996
  13. o Modified to use LlsProductLicensesGet() to avoid race conditions in
  14. getting the correct number of concurrent licenses with secure products.
  15. o Ported to LlsLocalService API to remove dependencies on configuration
  16. information being in the registry.
  17. --*/
  18. #ifndef _SRVOBJ_H_
  19. #define _SRVOBJ_H_
  20. class CServer : public CCmdTarget
  21. {
  22. DECLARE_DYNCREATE(CServer)
  23. private:
  24. enum Win2000State { uninitialized = 0, win2000, notwin2000 };
  25. Win2000State m_IsWin2000;
  26. CCmdTarget* m_pParent;
  27. CString m_strController;
  28. CObArray m_serviceArray;
  29. BOOL m_bServicesRefreshed;
  30. protected:
  31. HKEY m_hkeyRoot;
  32. HKEY m_hkeyLicense;
  33. HKEY m_hkeyReplication;
  34. LLS_HANDLE m_hLls;
  35. public:
  36. CString m_strName;
  37. CServices* m_pServices;
  38. public:
  39. CServer(CCmdTarget* pParent = NULL, LPCTSTR pName = NULL);
  40. #ifdef CONFIG_THROUGH_REGISTRY
  41. inline HKEY GetReplRegHandle()
  42. { return m_hkeyReplication; }
  43. #else
  44. inline LLS_HANDLE GetLlsHandle()
  45. { return m_hLls; }
  46. #endif
  47. virtual ~CServer();
  48. BOOL InitializeIfNecessary();
  49. BOOL RefreshServices();
  50. void ResetServices();
  51. BOOL ConnectLls();
  52. void DisconnectLls();
  53. BOOL HaveAdminAuthority();
  54. BOOL IsWin2000();
  55. // ClassWizard generated virtual function overrides
  56. //{{AFX_VIRTUAL(CServer)
  57. public:
  58. virtual void OnFinalRelease();
  59. //}}AFX_VIRTUAL
  60. // Generated OLE dispatch map functions
  61. //{{AFX_DISPATCH(CServer)
  62. afx_msg LPDISPATCH GetApplication();
  63. afx_msg BSTR GetName();
  64. afx_msg LPDISPATCH GetParent();
  65. afx_msg BSTR GetController();
  66. afx_msg BOOL IsLogging();
  67. afx_msg BOOL IsReplicatingToDC();
  68. afx_msg BOOL IsReplicatingDaily();
  69. afx_msg long GetReplicationTime();
  70. afx_msg LPDISPATCH GetServices(const VARIANT FAR& index);
  71. //}}AFX_DISPATCH
  72. DECLARE_DISPATCH_MAP()
  73. protected:
  74. // Generated message map functions
  75. //{{AFX_MSG(CServer)
  76. // NOTE - the ClassWizard will add and remove member functions here.
  77. //}}AFX_MSG
  78. DECLARE_MESSAGE_MAP()
  79. friend class CService; // accesses m_hkeyLicense;
  80. };
  81. #define REG_KEY_SERVER_PARAMETERS _T("SYSTEM\\CurrentControlSet\\Services\\LicenseService\\Parameters")
  82. #define REG_VALUE_USE_ENTERPRISE _T("UseEnterprise")
  83. #define REG_VALUE_ENTERPRISE_SERVER _T("EnterpriseServer")
  84. #define REG_VALUE_REPLICATION_TYPE _T("ReplicationType")
  85. #define REG_VALUE_REPLICATION_TIME _T("ReplicationTime")
  86. #endif // _SRVOBJ_H_