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.

1053 lines
20 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. w3servic.cpp
  5. Abstract:
  6. WWW Service Property Page
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. //
  14. // Include Files
  15. //
  16. #include "stdafx.h"
  17. #include "w3scfg.h"
  18. #include "mmmdlg.h"
  19. #include "w3servic.h"
  20. #ifdef _DEBUG
  21. #undef THIS_FILE
  22. static char BASED_CODE THIS_FILE[] = __FILE__;
  23. #endif
  24. //
  25. // Values for PWS
  26. //
  27. #define LIMITED_CONNECTIONS_MIN (10)
  28. #define LIMITED_CONNECTIONS_MAX (40)
  29. //
  30. // Default SSL port
  31. //
  32. #define DEFAULT_SSL_PORT (441)
  33. IMPLEMENT_DYNCREATE(CW3ServicePage, CInetPropertyPage)
  34. CW3ServicePage::CW3ServicePage(
  35. IN CInetPropertySheet * pSheet
  36. )
  37. /*++
  38. Routine Description:
  39. Constructor for WWW service page
  40. Arguments:
  41. CInetPropertySheet * pSheet : Property sheet object
  42. Return Value:
  43. N/A
  44. --*/
  45. : CInetPropertyPage(CW3ServicePage::IDD, pSheet),
  46. m_nSSLPort(DEFAULT_SSL_PORT),
  47. m_nTCPPort(80),
  48. m_iSSL(-1),
  49. m_iaIpAddress(NULL_IP_ADDRESS),
  50. m_strDomainName()
  51. {
  52. #ifdef _DEBUG
  53. afxMemDF |= checkAlwaysMemDF;
  54. #endif // _DEBUG
  55. #if 0 // Keep Class Wizard Happy
  56. //{{AFX_DATA_INIT(CW3ServicePage)
  57. m_nUnlimited = RADIO_LIMITED;
  58. m_nIpAddressSel = -1;
  59. m_nTCPPort = 80;
  60. m_fEnableLogging = FALSE;
  61. m_fUseKeepAlives = FALSE;
  62. m_strComment = _T("");
  63. m_strDomainName = _T("");
  64. m_nSSLPort = DEFAULT_SSL_PORT;
  65. //}}AFX_DATA_INIT
  66. m_iaIpAddress = (LONG)0L;
  67. m_nMaxConnections = 50;
  68. m_nVisibleMaxConnections = 50;
  69. m_nConnectionTimeOut = 600;
  70. m_nSSLPort = DEFAULT_SSL_PORT;
  71. m_fUnlimitedConnections = FALSE;
  72. #endif // 0
  73. }
  74. CW3ServicePage::~CW3ServicePage()
  75. /*++
  76. Routine Description:
  77. Destructor
  78. Arguments:
  79. N/A
  80. Return Value:
  81. N/A
  82. --*/
  83. {
  84. }
  85. void
  86. CW3ServicePage::GetTopBinding()
  87. /*++
  88. Routine Description:
  89. Get the first binding information in the list
  90. Arguments:
  91. None
  92. Return Value:
  93. None
  94. --*/
  95. {
  96. //
  97. // Show primary values;
  98. //
  99. ASSERT(m_strlBindings.GetCount() > 0
  100. || IS_MASTER_INSTANCE(QueryInstance()));
  101. if (m_strlBindings.GetCount() > 0)
  102. {
  103. CString & strBinding = m_strlBindings.GetHead();
  104. CInstanceProps::CrackBinding(
  105. strBinding,
  106. m_iaIpAddress,
  107. m_nTCPPort,
  108. m_strDomainName
  109. );
  110. //
  111. // Find SSL port that is bound to this IP address
  112. //
  113. m_iSSL = CInstanceProps::FindMatchingSecurePort(
  114. m_strlSecureBindings,
  115. m_iaIpAddress,
  116. m_nSSLPort
  117. );
  118. }
  119. }
  120. BOOL
  121. CW3ServicePage::StoreTopBinding()
  122. /*++
  123. Routine Description:
  124. Take values from the dialog, and put them into the top level
  125. binding string.
  126. Arguments:
  127. None
  128. Return Value:
  129. TRUE if the values are correct, FALSE otherwise.
  130. --*/
  131. {
  132. if (!FetchIpAddressFromCombo(
  133. m_combo_IpAddresses,
  134. m_oblIpAddresses,
  135. m_iaIpAddress
  136. ))
  137. {
  138. //
  139. // Because UpdateData() is called before this, this should NEVER fail
  140. //
  141. ASSERT(FALSE);
  142. return FALSE;
  143. }
  144. CString strBinding;
  145. ASSERT(m_nTCPPort > 0);
  146. if (m_nTCPPort == m_nSSLPort)
  147. {
  148. //
  149. // TCP port and SSL port cannot be the same
  150. //
  151. ::AfxMessageBox(IDS_TCP_SSL_PART);
  152. return FALSE;
  153. }
  154. CInstanceProps::BuildBinding(
  155. strBinding,
  156. m_iaIpAddress,
  157. m_nTCPPort,
  158. m_strDomainName
  159. );
  160. //
  161. // Check binding ok
  162. //
  163. if (m_strlBindings.GetCount() > 0)
  164. {
  165. if (!IsBindingUnique(strBinding, m_strlBindings, 0))
  166. {
  167. ::AfxMessageBox(IDS_ERR_BINDING);
  168. return FALSE;
  169. }
  170. m_strlBindings.SetAt(m_strlBindings.GetHeadPosition(), strBinding);
  171. }
  172. else
  173. {
  174. m_strlBindings.AddTail(strBinding);
  175. }
  176. //
  177. // Now do the same for the SSL binding
  178. //
  179. if (m_fCertInstalled)
  180. {
  181. if (m_nSSLPort > 0)
  182. {
  183. CInstanceProps::BuildSecureBinding(
  184. strBinding,
  185. m_iaIpAddress,
  186. m_nSSLPort
  187. );
  188. if (m_strlSecureBindings.GetCount() > 0)
  189. {
  190. if (IsBindingUnique(strBinding, m_strlSecureBindings, m_iSSL))
  191. {
  192. //
  193. // Find its place
  194. //
  195. if (m_iSSL != -1)
  196. {
  197. //
  198. // Replace selected entry
  199. //
  200. m_strlSecureBindings.SetAt(
  201. m_strlSecureBindings.FindIndex(m_iSSL),
  202. strBinding
  203. );
  204. }
  205. else
  206. {
  207. //
  208. // Add to end of list
  209. //
  210. ASSERT(!m_strlSecureBindings.IsEmpty());
  211. m_strlSecureBindings.AddTail(strBinding);
  212. m_iSSL = (int)m_strlSecureBindings.GetCount() - 1;
  213. }
  214. }
  215. else
  216. {
  217. //
  218. // Entry already existed in the list. This is OK, just
  219. // delete the current entry rather than bothering
  220. // to change it.
  221. //
  222. ASSERT(m_iSSL != -1);
  223. if (m_iSSL != -1)
  224. {
  225. m_strlSecureBindings.RemoveAt(
  226. m_strlSecureBindings.FindIndex(m_iSSL)
  227. );
  228. m_iSSL = CInstanceProps::FindMatchingSecurePort(
  229. m_strlSecureBindings,
  230. m_iaIpAddress,
  231. m_nSSLPort
  232. );
  233. ASSERT(m_iSSL != -1);
  234. }
  235. }
  236. }
  237. else
  238. {
  239. //
  240. // List of secure bindings was empty, add new entry
  241. //
  242. m_strlSecureBindings.AddTail(strBinding);
  243. m_iSSL = 0;
  244. }
  245. }
  246. else
  247. {
  248. //
  249. // Delete the secure binding if it did exist
  250. //
  251. if (m_iSSL != -1)
  252. {
  253. m_strlSecureBindings.RemoveAt(
  254. m_strlSecureBindings.FindIndex(m_iSSL)
  255. );
  256. m_iSSL = -1;
  257. }
  258. }
  259. }
  260. return TRUE;
  261. }
  262. void
  263. CW3ServicePage::DoDataExchange(
  264. IN CDataExchange * pDX
  265. )
  266. /*++
  267. Routine Description:
  268. Initialise/Store Control Data
  269. Arguments:
  270. CDataExchange * pDX : Data exchange object
  271. Return Value:
  272. None
  273. --*/
  274. {
  275. CInetPropertyPage::DoDataExchange(pDX);
  276. if (!pDX->m_bSaveAndValidate)
  277. {
  278. m_fEnableLogging = LoggingEnabled(m_dwLogType);
  279. }
  280. //{{AFX_DATA_MAP(CW3ServicePage)
  281. DDX_Control(pDX, IDC_RADIO_UNLIMITED, m_radio_Unlimited);
  282. DDX_Control(pDX, IDC_BUTTON_PROPERTIES, m_button_LogProperties);
  283. DDX_Control(pDX, IDC_STATIC_CONNECTIONS, m_static_Connections);
  284. DDX_Control(pDX, IDC_STATIC_LOG_PROMPT, m_static_LogPrompt);
  285. DDX_Control(pDX, IDC_EDIT_SSL_PORT, m_edit_SSLPort);
  286. DDX_Control(pDX, IDC_EDIT_TCP_PORT, m_edit_TCPPort);
  287. DDX_Control(pDX, IDC_EDIT_MAX_CONNECTIONS, m_edit_MaxConnections);
  288. DDX_Control(pDX, IDC_COMBO_LOG_FORMATS, m_combo_LogFormats);
  289. DDX_Control(pDX, IDC_COMBO_IP_ADDRESS, m_combo_IpAddresses);
  290. DDX_Radio(pDX, IDC_RADIO_UNLIMITED, m_nUnlimited);
  291. DDX_Check(pDX, IDC_CHECK_USE_KEEPALIVE, m_fUseKeepAlives);
  292. DDX_Check(pDX, IDC_CHECK_ENABLE_LOGGING, m_fEnableLogging);
  293. DDX_Text(pDX, IDC_EDIT_COMMENT, m_strComment);
  294. DDV_MinMaxChars(pDX, m_strComment, 0, MAX_PATH);
  295. //}}AFX_DATA_MAP
  296. if (pDX->m_bSaveAndValidate && !FetchIpAddressFromCombo(
  297. m_combo_IpAddresses,
  298. m_oblIpAddresses,
  299. m_iaIpAddress
  300. ))
  301. {
  302. pDX->Fail();
  303. }
  304. if (!pDX->m_bSaveAndValidate || !m_fUnlimitedConnections )
  305. {
  306. DDX_Text(pDX, IDC_EDIT_MAX_CONNECTIONS, m_nVisibleMaxConnections);
  307. }
  308. if (Has10ConnectionLimit())
  309. {
  310. //
  311. // Special validation for unlimited connections. We use a bogus
  312. // numeric check for data validation. Number adjustment happens
  313. // later.
  314. //
  315. if (pDX->m_bSaveAndValidate &&
  316. (m_nVisibleMaxConnections < 0
  317. || m_nVisibleMaxConnections > UNLIMITED_CONNECTIONS))
  318. {
  319. TCHAR szMin[32];
  320. TCHAR szMax[32];
  321. wsprintf(szMin, _T("%ld"), 0);
  322. wsprintf(szMax, _T("%ld"), 40);
  323. CString prompt;
  324. ::AfxFormatString2(prompt, AFX_IDP_PARSE_INT_RANGE, szMin, szMax);
  325. ::AfxMessageBox(prompt, MB_ICONEXCLAMATION);
  326. prompt.Empty();
  327. pDX->Fail();
  328. }
  329. }
  330. else
  331. {
  332. DDV_MinMaxLong(pDX, m_nVisibleMaxConnections, 0, UNLIMITED_CONNECTIONS);
  333. }
  334. DDX_Text(pDX, IDC_EDIT_CONNECTION_TIMEOUT, m_nConnectionTimeOut);
  335. DDV_MinMaxLong(pDX, m_nConnectionTimeOut, 0, MAX_TIMEOUT);
  336. //
  337. // Port DDXV must be done just prior to storetopbinding,
  338. // so as to activate the right control in case of
  339. // failure
  340. //
  341. if (m_fCertInstalled && !IS_MASTER_INSTANCE(QueryInstance()))
  342. {
  343. DDXV_UINT(pDX, IDC_EDIT_SSL_PORT, m_nSSLPort, 0, 65535);
  344. }
  345. DDX_Text(pDX, IDC_EDIT_TCP_PORT, m_nTCPPort);
  346. if (!IS_MASTER_INSTANCE(QueryInstance()))
  347. {
  348. DDV_MinMaxUInt(pDX, m_nTCPPort, 1, 65535);
  349. }
  350. if (pDX->m_bSaveAndValidate)
  351. {
  352. if (!IS_MASTER_INSTANCE(QueryInstance()))
  353. {
  354. if (!StoreTopBinding())
  355. {
  356. pDX->Fail();
  357. }
  358. }
  359. EnableLogging(m_dwLogType, m_fEnableLogging);
  360. }
  361. }
  362. //
  363. // Message Map
  364. //
  365. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  366. BEGIN_MESSAGE_MAP(CW3ServicePage, CInetPropertyPage)
  367. //{{AFX_MSG_MAP(CW3ServicePage)
  368. ON_BN_CLICKED(IDC_RADIO_LIMITED, OnRadioLimited)
  369. ON_BN_CLICKED(IDC_RADIO_UNLIMITED, OnRadioUnlimited)
  370. ON_BN_CLICKED(IDC_CHECK_ENABLE_LOGGING, OnCheckEnableLogging)
  371. ON_BN_CLICKED(IDC_BUTTON_ADVANCED, OnButtonAdvanced)
  372. ON_BN_CLICKED(IDC_BUTTON_PROPERTIES, OnButtonProperties)
  373. ON_WM_DESTROY()
  374. //}}AFX_MSG_MAP
  375. ON_BN_CLICKED(IDC_CHECK_USE_KEEPALIVE, OnItemChanged)
  376. ON_EN_CHANGE(IDC_EDIT_TCP_PORT, OnItemChanged)
  377. ON_EN_CHANGE(IDC_EDIT_COMMENT, OnItemChanged)
  378. ON_EN_CHANGE(IDC_EDIT_CONNECTION_TIMEOUT, OnItemChanged)
  379. ON_EN_CHANGE(IDC_EDIT_MAX_CONNECTIONS, OnItemChanged)
  380. ON_EN_CHANGE(IDC_EDIT_IP_ADDRESS, OnItemChanged)
  381. ON_EN_CHANGE(IDC_EDIT_SSL_PORT, OnItemChanged)
  382. ON_EN_CHANGE(IDC_EDIT_DOMAIN_NAME, OnItemChanged)
  383. ON_CBN_EDITCHANGE(IDC_COMBO_IP_ADDRESS, OnItemChanged)
  384. ON_CBN_SELCHANGE(IDC_COMBO_IP_ADDRESS, OnItemChanged)
  385. ON_CBN_SELCHANGE(IDC_COMBO_LOG_FORMATS, OnItemChanged)
  386. END_MESSAGE_MAP()
  387. void
  388. CW3ServicePage::SetControlStates()
  389. /*++
  390. Routine Description:
  391. Set control states depending on the currently selected items
  392. Arguments:
  393. None
  394. Return Value:
  395. None.
  396. --*/
  397. {
  398. if (m_edit_MaxConnections.m_hWnd)
  399. {
  400. m_edit_MaxConnections.EnableWindow(!m_fUnlimitedConnections);
  401. m_static_Connections.EnableWindow(!m_fUnlimitedConnections);
  402. }
  403. }
  404. void
  405. CW3ServicePage::SetLogState()
  406. /*++
  407. Routine Description:
  408. Enable/disable logging controls depending on whether logging
  409. is enabled or not.
  410. Arguments:
  411. None
  412. Return Value:
  413. None
  414. --*/
  415. {
  416. m_static_LogPrompt.EnableWindow(m_fEnableLogging);
  417. m_combo_LogFormats.EnableWindow(m_fEnableLogging);
  418. m_button_LogProperties.EnableWindow(m_fEnableLogging);
  419. }
  420. //
  421. // Message Handlers
  422. //
  423. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  424. BOOL
  425. CW3ServicePage::OnSetActive()
  426. /*++
  427. Routine Description:
  428. Property page is getting activation notification
  429. Arguments:
  430. None
  431. Return Value:
  432. TRUE to activate the page, FALSE otherwise.
  433. --*/
  434. {
  435. //
  436. // No certificates, no SSL
  437. //
  438. BeginWaitCursor();
  439. m_fCertInstalled = IsCertInstalledOnServer(GetServerName(), QueryInstance());
  440. EndWaitCursor();
  441. GetDlgItem(IDC_STATIC_SSL_PORT)->EnableWindow(
  442. m_fCertInstalled
  443. && !IS_MASTER_INSTANCE(QueryInstance())
  444. && HasAdminAccess()
  445. );
  446. GetDlgItem(IDC_EDIT_SSL_PORT)->EnableWindow(
  447. m_fCertInstalled
  448. && !IS_MASTER_INSTANCE(QueryInstance())
  449. && HasAdminAccess()
  450. );
  451. return CInetPropertyPage::OnSetActive();
  452. }
  453. BOOL
  454. CW3ServicePage::OnInitDialog()
  455. /*++
  456. Routine Description:
  457. WM_INITDIALOG handler. Initialize the dialog.
  458. Arguments:
  459. None.
  460. Return Value:
  461. TRUE if focus is to be set automatically, FALSE if the focus
  462. is already set.
  463. --*/
  464. {
  465. CInetPropertyPage::OnInitDialog();
  466. //
  467. // Take our direction from a phony button
  468. //
  469. CRect rc(0, 0, 0, 0);
  470. m_ocx_LogProperties.Create(
  471. _T("LogUI"),
  472. WS_BORDER,
  473. rc,
  474. this,
  475. IDC_LOGUICTRL
  476. );
  477. m_radio_Unlimited.EnableWindow(!Has10ConnectionLimit());
  478. //
  479. // Initialize the logging ocx
  480. //
  481. m_ocx_LogProperties.SetAdminTarget(GetServerName(), QueryMetaPath());
  482. m_ocx_LogProperties.SetComboBox(m_combo_LogFormats.m_hWnd);
  483. //
  484. // Disable non heritable properties for master instance
  485. // or operator
  486. //
  487. if (IS_MASTER_INSTANCE(QueryInstance()) || !HasAdminAccess())
  488. {
  489. GetDlgItem(IDC_STATIC_IP_ADDRESS)->EnableWindow(FALSE);
  490. GetDlgItem(IDC_COMBO_IP_ADDRESS)->EnableWindow(FALSE);
  491. GetDlgItem(IDC_STATIC_TCP_PORT)->EnableWindow(FALSE);
  492. GetDlgItem(IDC_EDIT_TCP_PORT)->EnableWindow(FALSE);
  493. GetDlgItem(IDC_STATIC_SSL_PORT)->EnableWindow(FALSE);
  494. GetDlgItem(IDC_EDIT_SSL_PORT)->EnableWindow(FALSE);
  495. GetDlgItem(IDC_BUTTON_ADVANCED)->EnableWindow(FALSE);
  496. }
  497. {
  498. CWaitCursor wait;
  499. PopulateComboWithKnownIpAddresses(
  500. QueryServerName(),
  501. m_combo_IpAddresses,
  502. m_iaIpAddress,
  503. m_oblIpAddresses,
  504. m_nIpAddressSel
  505. );
  506. }
  507. SetControlStates();
  508. SetLogState();
  509. return TRUE;
  510. }
  511. /* virtual */
  512. HRESULT
  513. CW3ServicePage::FetchLoadedValues()
  514. /*++
  515. Routine Description:
  516. Move configuration data from sheet to dialog controls
  517. Arguments:
  518. None
  519. Return Value:
  520. HRESULT
  521. --*/
  522. {
  523. CError err;
  524. m_fCertInstalled = IsCertInstalledOnServer(GetServerName(), QueryInstance());
  525. BEGIN_META_INST_READ(CW3Sheet)
  526. FETCH_INST_DATA_FROM_SHEET(m_fUseKeepAlives);
  527. FETCH_INST_DATA_FROM_SHEET(m_nMaxConnections);
  528. FETCH_INST_DATA_FROM_SHEET(m_nConnectionTimeOut);
  529. FETCH_INST_DATA_FROM_SHEET(m_strComment);
  530. FETCH_INST_DATA_FROM_SHEET(m_dwLogType);
  531. FETCH_INST_DATA_FROM_SHEET(m_strlBindings);
  532. FETCH_INST_DATA_FROM_SHEET(m_strlSecureBindings);
  533. GetTopBinding();
  534. m_fUnlimitedConnections =
  535. ((ULONG)(LONG)m_nMaxConnections >= UNLIMITED_CONNECTIONS);
  536. if (Has10ConnectionLimit())
  537. {
  538. m_fUnlimitedConnections = FALSE;
  539. if ((LONG)m_nMaxConnections > LIMITED_CONNECTIONS_MAX)
  540. {
  541. m_nMaxConnections = LIMITED_CONNECTIONS_MAX;
  542. }
  543. }
  544. //
  545. // Set the visible max connections edit field, which
  546. // may start out with a default value
  547. //
  548. m_nVisibleMaxConnections = m_fUnlimitedConnections
  549. ? INITIAL_MAX_CONNECTIONS
  550. : m_nMaxConnections;
  551. //
  552. // Set radio value
  553. //
  554. m_nUnlimited = m_fUnlimitedConnections ? RADIO_UNLIMITED : RADIO_LIMITED;
  555. m_nOldTCPPort = m_nTCPPort;
  556. END_META_INST_READ(err)
  557. return err;
  558. }
  559. /* virtual */
  560. HRESULT
  561. CW3ServicePage::SaveInfo()
  562. /*++
  563. Routine Description:
  564. Save the information on this property page
  565. Arguments:
  566. BOOL fUpdateData : If TRUE, control data has not yet been stored. This
  567. is the case when "apply" is pressed.
  568. Return Value:
  569. Error return code
  570. --*/
  571. {
  572. ASSERT(IsDirty());
  573. TRACEEOLID("Saving W3 service page now...");
  574. CError err;
  575. m_nMaxConnections = m_fUnlimitedConnections
  576. ? UNLIMITED_CONNECTIONS
  577. : m_nVisibleMaxConnections;
  578. //
  579. // Check to make sure we're not violating the license
  580. // agreement
  581. //
  582. if (Has10ConnectionLimit())
  583. {
  584. if (m_nMaxConnections > LIMITED_CONNECTIONS_MAX)
  585. {
  586. ::AfxMessageBox(IDS_CONNECTION_LIMIT);
  587. m_nMaxConnections = LIMITED_CONNECTIONS_MIN;
  588. }
  589. else if (m_nMaxConnections > LIMITED_CONNECTIONS_MIN
  590. && m_nMaxConnections <= LIMITED_CONNECTIONS_MAX)
  591. {
  592. ::AfxMessageBox(IDS_WRN_CONNECTION_LIMIT);
  593. }
  594. }
  595. m_ocx_LogProperties.ApplyLogSelection();
  596. BeginWaitCursor();
  597. BEGIN_META_INST_WRITE(CW3Sheet)
  598. STORE_INST_DATA_ON_SHEET(m_fUseKeepAlives);
  599. STORE_INST_DATA_ON_SHEET(m_nMaxConnections);
  600. STORE_INST_DATA_ON_SHEET(m_nConnectionTimeOut);
  601. STORE_INST_DATA_ON_SHEET(m_strComment);
  602. STORE_INST_DATA_ON_SHEET(m_dwLogType);
  603. STORE_INST_DATA_ON_SHEET(m_strlBindings);
  604. STORE_INST_DATA_ON_SHEET(m_strlSecureBindings);
  605. END_META_INST_WRITE(err)
  606. EndWaitCursor();
  607. return err;
  608. }
  609. void
  610. CW3ServicePage::OnItemChanged()
  611. /*++
  612. Routine Description
  613. All EN_CHANGE and BN_CLICKED messages map to this function
  614. Arguments:
  615. None
  616. Return Value:
  617. None
  618. --*/
  619. {
  620. SetControlStates();
  621. SetModified(TRUE);
  622. }
  623. void
  624. CW3ServicePage::OnRadioLimited()
  625. /*++
  626. Routine Description:
  627. 'limited' radio button handler
  628. Arguments:
  629. None
  630. Return Value:
  631. None
  632. --*/
  633. {
  634. m_fUnlimitedConnections = FALSE;
  635. SetControlStates();
  636. m_edit_MaxConnections.SetSel(0,-1);
  637. m_edit_MaxConnections.SetFocus();
  638. OnItemChanged();
  639. }
  640. void
  641. CW3ServicePage::OnRadioUnlimited()
  642. /*++
  643. Routine Description:
  644. 'unlimited' radio button handler
  645. Arguments:
  646. None
  647. Return Value:
  648. None
  649. --*/
  650. {
  651. m_fUnlimitedConnections = TRUE;
  652. OnItemChanged();
  653. }
  654. void
  655. CW3ServicePage::ShowTopBinding()
  656. /*++
  657. Routine Description:
  658. Put information about the top level binding in the dialog controls
  659. Arguments:
  660. None
  661. Return Value:
  662. None
  663. --*/
  664. {
  665. BeginWaitCursor();
  666. GetTopBinding();
  667. PopulateComboWithKnownIpAddresses(
  668. QueryServerName(),
  669. m_combo_IpAddresses,
  670. m_iaIpAddress,
  671. m_oblIpAddresses,
  672. m_nIpAddressSel
  673. );
  674. EndWaitCursor();
  675. CString strTCPPort, strSSLPort;
  676. if (m_nTCPPort)
  677. {
  678. strTCPPort.Format(_T("%ld"), m_nTCPPort);
  679. }
  680. if (m_nSSLPort)
  681. {
  682. strSSLPort.Format(_T("%ld"), m_nSSLPort);
  683. }
  684. m_edit_TCPPort.SetWindowText(strTCPPort);
  685. m_edit_SSLPort.SetWindowText(strSSLPort);
  686. }
  687. void
  688. CW3ServicePage::OnButtonAdvanced()
  689. /*++
  690. Routine Description:
  691. 'advanced' button handler -- bring up the bindings dialog
  692. Arguments:
  693. None
  694. Return Value:
  695. None
  696. --*/
  697. {
  698. if (!UpdateData(TRUE))
  699. {
  700. return;
  701. }
  702. CMMMDlg dlg(
  703. QueryServerName(),
  704. QueryInstance(),
  705. m_strlBindings,
  706. m_strlSecureBindings,
  707. this
  708. );
  709. if (dlg.DoModal() == IDOK)
  710. {
  711. //
  712. // Get information about the top level binding
  713. //
  714. m_strlBindings.RemoveAll();
  715. m_strlSecureBindings.RemoveAll();
  716. m_strlBindings.AddTail(&(dlg.GetBindings()));
  717. m_strlSecureBindings.AddTail(&(dlg.GetSecureBindings()));
  718. ShowTopBinding();
  719. OnItemChanged();
  720. }
  721. }
  722. void
  723. CW3ServicePage::OnCheckEnableLogging()
  724. /*++
  725. Routine Description:
  726. 'enable logging' checkbox handler
  727. Arguments:
  728. None
  729. Return Value:
  730. None
  731. --*/
  732. {
  733. m_fEnableLogging = !m_fEnableLogging;
  734. SetLogState();
  735. OnItemChanged();
  736. }
  737. void
  738. CW3ServicePage::OnButtonProperties()
  739. /*++
  740. Routine Description:
  741. Pass on "log properties" button click to the ocx.
  742. Arguments:
  743. None
  744. Return Value:
  745. None
  746. --*/
  747. {
  748. m_ocx_LogProperties.DoClick();
  749. }
  750. void
  751. CW3ServicePage::OnDestroy()
  752. /*++
  753. Routine Description:
  754. WM_DESTROY handler. Clean up internal data
  755. Arguments:
  756. None
  757. Return Value:
  758. None
  759. --*/
  760. {
  761. CInetPropertyPage::OnDestroy();
  762. if (m_ocx_LogProperties.m_hWnd)
  763. {
  764. m_ocx_LogProperties.Terminate();
  765. }
  766. }