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.

248 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. machine.h
  5. Abstract:
  6. IIS Machine Property Page Class Definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef __MACHINE_H__
  14. #define __MACHINE_H__
  15. //
  16. // Help ID
  17. //
  18. #define HIDD_IIS_MACHINE (0x20081)
  19. class CMasterDll : public CObject
  20. /*++
  21. Class Description:
  22. Master Dll object
  23. Public Interface:
  24. CMasterDll : Constructor
  25. ~CMasterDll : Destructor
  26. Config : Bring up config sheets
  27. --*/
  28. {
  29. public:
  30. CMasterDll(
  31. IN UINT nID,
  32. IN LPCTSTR lpszDllName,
  33. IN LPCTSTR lpszMachineName
  34. );
  35. ~CMasterDll();
  36. public:
  37. //
  38. // Config Master Instance
  39. //
  40. DWORD Config(HWND hWnd, LPCTSTR lpServers);
  41. BOOL IsLoaded() const;
  42. operator LPCTSTR();
  43. operator HINSTANCE();
  44. private:
  45. HINSTANCE m_hDll;
  46. CString m_strText;
  47. pfnConfigure m_pfnConfig;
  48. };
  49. typedef CList<CMasterDll *, CMasterDll *> CMasterDllList;
  50. class COMDLL CIISMachinePage : public CPropertyPage
  51. {
  52. /*++
  53. Class Description:
  54. IIS Machine Property Page
  55. Public Interface:
  56. CIISMachinePage : Constructor
  57. ~CIISMachinePage : Destructor
  58. QueryResult : Get the result code
  59. --*/
  60. DECLARE_DYNCREATE(CIISMachinePage)
  61. //
  62. // Construction/Destruction
  63. //
  64. public:
  65. CIISMachinePage(
  66. IN LPCTSTR lpstrMachineName = NULL,
  67. IN HINSTANCE hInstance = NULL
  68. );
  69. ~CIISMachinePage();
  70. //
  71. // Access
  72. //
  73. public:
  74. HRESULT QueryResult() const;
  75. //
  76. // Dialog Data
  77. //
  78. protected:
  79. //{{AFX_DATA(CIISMachinePage)
  80. enum { IDD = IDD_IIS_MACHINE };
  81. int m_nMasterType;
  82. BOOL m_fLimitNetworkUse;
  83. CEdit m_edit_MaxNetworkUse;
  84. CStatic m_static_ThrottlePrompt;
  85. CStatic m_static_MaxNetworkUse;
  86. CStatic m_static_KBS;
  87. CButton m_button_EditDefault;
  88. CButton m_check_LimitNetworkUse;
  89. CComboBox m_combo_MasterType;
  90. //}}AFX_DATA
  91. //
  92. // Overrides
  93. //
  94. protected:
  95. // ClassWizard generate virtual function overrides
  96. //{{AFX_VIRTUAL(CIISMachinePage)
  97. public:
  98. virtual BOOL OnApply();
  99. protected:
  100. virtual void DoDataExchange(CDataExchange * pDX);
  101. virtual void PostNcDestroy();
  102. //}}AFX_VIRTUAL
  103. CILong m_nMaxNetworkUse;
  104. //
  105. // Implementation
  106. //
  107. protected:
  108. HRESULT LoadDelayedValues();
  109. BOOL SetControlStates();
  110. // Generated message map functions
  111. //{{AFX_MSG(CIISMachinePage)
  112. afx_msg void OnCheckLimitNetworkUse();
  113. afx_msg void OnButtonEditDefault();
  114. afx_msg void OnButtonFileTypes();
  115. afx_msg void OnHelp();
  116. afx_msg BOOL OnHelpInfo(HELPINFO * pHelpInfo);
  117. afx_msg void OnDestroy();
  118. virtual BOOL OnInitDialog();
  119. //}}AFX_MSG
  120. afx_msg void OnItemChanged();
  121. DECLARE_MESSAGE_MAP()
  122. protected:
  123. CMasterDllList m_lstMasterDlls;
  124. protected:
  125. static void ParseMaxNetworkUse(
  126. IN OUT CILong & nMaxNetworkUse,
  127. OUT BOOL & fLimitNetworkUse
  128. );
  129. static void BuildMaxNetworkUse(
  130. IN OUT CILong & nMaxNetworkUse,
  131. IN OUT BOOL & fLimitNetworkUse
  132. );
  133. private:
  134. BOOL m_fLocal;
  135. HRESULT m_hr;
  136. HINSTANCE m_hInstance;
  137. CString m_strMachineName;
  138. CString m_strHelpFile;
  139. CStringListEx m_strlMimeTypes;
  140. CMimeTypes * m_ppropMimeTypes;
  141. CMachineProps * m_ppropMachine;
  142. };
  143. //
  144. // Inline Expansion
  145. //
  146. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  147. inline DWORD CMasterDll::Config(
  148. IN HWND hWnd,
  149. IN LPCTSTR lpServers
  150. )
  151. {
  152. ASSERT(m_pfnConfig != NULL);
  153. return (*m_pfnConfig)(hWnd, MASTER_INSTANCE, lpServers);
  154. }
  155. inline BOOL CMasterDll::IsLoaded() const
  156. {
  157. return m_hDll != NULL;
  158. }
  159. inline CMasterDll::operator LPCTSTR()
  160. {
  161. return (LPCTSTR)m_strText;
  162. }
  163. inline CMasterDll::operator HINSTANCE()
  164. {
  165. return m_hDll;
  166. }
  167. inline /* static */ void CIISMachinePage::BuildMaxNetworkUse(
  168. IN OUT CILong & nMaxNetworkUse,
  169. IN OUT BOOL & fLimitNetworkUse
  170. )
  171. {
  172. nMaxNetworkUse = fLimitNetworkUse
  173. ? nMaxNetworkUse * KILOBYTE
  174. : INFINITE_BANDWIDTH;
  175. }
  176. #if 0
  177. //
  178. // COMPILER ISSUE::: Inlining this function doesn't
  179. // work on x86 using NT 5!
  180. //
  181. inline HRESULT CIISMachinePage::QueryResult() const
  182. {
  183. return m_hr;
  184. }
  185. #endif // 0
  186. #endif // __MACHINE_H__