Leaked source code of windows server 2003
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.

112 lines
2.5 KiB

  1. // chap.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "nfaa.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CMSCHAPSetting dialog
  12. CMSCHAPSetting::CMSCHAPSetting(CWnd* pParent /*=NULL*/)
  13. : CDialog(CMSCHAPSetting::IDD, pParent)
  14. {
  15. //{{AFX_DATA_INIT(CMSCHAPSetting)
  16. //m_dwValidateServerCertificate = FALSE;
  17. //}}AFX_DATA_INIT
  18. m_bReadOnly = FALSE;
  19. }
  20. void CMSCHAPSetting::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(CMSCHAPSetting)
  24. DDX_Check(pDX, IDC_CHAP_AUTO_WINLOGIN, m_dwAutoWinLogin);
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(CMSCHAPSetting, CDialog)
  28. //{{AFX_MSG_MAP(CMSCHAPSetting)
  29. ON_WM_HELPINFO()
  30. ON_BN_CLICKED(IDC_CHAP_AUTO_WINLOGIN, OnCheckCHAPAutoLogin)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CMSCHAPSetting message handlers
  35. BOOL CMSCHAPSetting::OnInitDialog()
  36. {
  37. CDialog::OnInitDialog();
  38. m_dwAutoWinLogin =
  39. *pdwAutoWinLogin ? TRUE : FALSE;
  40. if (m_bReadOnly) {
  41. SAFE_ENABLEWINDOW(IDC_CHAP_AUTO_WINLOGIN, FALSE);
  42. }
  43. UpdateData(FALSE);
  44. return TRUE; // return TRUE unless you set the focus to a control
  45. // EXCEPTION: OCX Property Pages should return FALSE
  46. }
  47. void CMSCHAPSetting::ControlsValuesToSM(
  48. DWORD *pdwAutoWinLogin
  49. )
  50. {
  51. DWORD dwAutoWinLogin = 0;
  52. // pull all our data from the controls
  53. UpdateData(TRUE);
  54. dwAutoWinLogin =
  55. m_dwAutoWinLogin ? 1 : 0;
  56. *pdwAutoWinLogin = dwAutoWinLogin;
  57. return;
  58. }
  59. void CMSCHAPSetting::OnOK()
  60. {
  61. UpdateData (TRUE);
  62. ControlsValuesToSM(pdwAutoWinLogin);
  63. CDialog::OnOK();
  64. }
  65. BOOL CMSCHAPSetting::OnHelpInfo(HELPINFO* pHelpInfo)
  66. {
  67. if (pHelpInfo->iContextType == HELPINFO_WINDOW)
  68. {
  69. DWORD* pdwHelp = (DWORD*) &g_aHelpIDs_IDD_CHAP_SETTINGS[0];
  70. ::WinHelp ((HWND)pHelpInfo->hItemHandle,
  71. c_szWlsnpHelpFile,
  72. HELP_WM_HELP,
  73. (DWORD_PTR)(LPVOID)pdwHelp);
  74. }
  75. return TRUE;
  76. }
  77. void CMSCHAPSetting::OnCheckCHAPAutoLogin()
  78. {
  79. UpdateData(TRUE);
  80. }
  81. BOOL CMSCHAPSetting::Initialize(
  82. DWORD *padwAutoWinLogin,
  83. BOOL bReadOnly
  84. )
  85. {
  86. m_bReadOnly = bReadOnly;
  87. pdwAutoWinLogin = padwAutoWinLogin;
  88. return(TRUE);
  89. }