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.

134 lines
4.2 KiB

  1. //=============================================================================
  2. // PageBootIni.h : Declaration of the CPageBootIni
  3. //
  4. // TESTING NOTE:
  5. //
  6. // If the registry value "HKLM\SOFTWARE\Microsoft\Shared Tools\MSConfig:boot.ini"
  7. // is set, that string will indicate what file this tab edits (otherwise it will
  8. // be editing the c:\boot.ini file). For testing without interfering with your
  9. // real boot.ini file, make a copy of boot.ini, set it to the same attributes
  10. // and set this key appropriately.
  11. //=============================================================================
  12. #if !defined(AFX_PAGEBOOTINI_H__30CE1B24_CA43_4AFF_870C_7D49CCCF86BF__INCLUDED_)
  13. #define AFX_PAGEBOOTINI_H__30CE1B24_CA43_4AFF_870C_7D49CCCF86BF__INCLUDED_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif // _MSC_VER > 1000
  17. #include "PageBase.h"
  18. #include "MSConfigState.h"
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CPageBootIni dialog
  21. #define BOOT_INI _T("c:\\boot.ini")
  22. class CPageBootIni : public CPropertyPage, public CPageBase
  23. {
  24. DECLARE_DYNCREATE(CPageBootIni)
  25. friend LRESULT BootIniEditSubclassProc(HWND hwnd, UINT wm, WPARAM wp, LPARAM lp);
  26. // Construction
  27. public:
  28. CPageBootIni();
  29. ~CPageBootIni();
  30. void InitializePage();
  31. BOOL LoadBootIni(CString strFileName = _T(""));
  32. void SyncControlsToIni(BOOL fSyncEditField = TRUE);
  33. void SelectLine(int index);
  34. void SetDefaultOS(int iIndex);
  35. BOOL SetBootIniContents(const CString & strNewContents, const CString & strAddedExtension = _T(""));
  36. void ChangeCurrentOSFlag(BOOL fAdd, LPCTSTR szFlag);
  37. LPCTSTR GetName() { return _T("bootini"); };
  38. TabState GetCurrentTabState();
  39. BOOL OnApply();
  40. void CommitChanges();
  41. void SetNormal();
  42. void SetDiagnostic();
  43. // Dialog Data
  44. //{{AFX_DATA(CPageBootIni)
  45. enum { IDD = IDD_PAGEBOOTINI };
  46. // NOTE - ClassWizard will add data members here.
  47. // DO NOT EDIT what you see in these blocks of generated code !
  48. //}}AFX_DATA
  49. // Overrides
  50. // ClassWizard generate virtual function overrides
  51. //{{AFX_VIRTUAL(CPageBootIni)
  52. protected:
  53. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  54. //}}AFX_VIRTUAL
  55. // Implementation
  56. protected:
  57. // Generated message map functions
  58. //{{AFX_MSG(CPageBootIni)
  59. virtual BOOL OnInitDialog();
  60. afx_msg void OnBootMoveDown();
  61. afx_msg void OnBootMoveUp();
  62. afx_msg void OnSelChangeList();
  63. afx_msg void OnClickedBase();
  64. afx_msg void OnClickedBootLog();
  65. afx_msg void OnClickedNoGUIBoot();
  66. afx_msg void OnClickedSOS();
  67. afx_msg void OnClickedSafeBoot();
  68. afx_msg void OnClickedSBDSRepair();
  69. afx_msg void OnClickedSBMinimal();
  70. afx_msg void OnClickedSBMinimalAlt();
  71. afx_msg void OnClickedSBNetwork();
  72. afx_msg void OnChangeEditTimeOut();
  73. afx_msg void OnKillFocusEditTimeOut();
  74. afx_msg void OnClickedBootAdvanced();
  75. afx_msg void OnClickedSetAsDefault();
  76. afx_msg void OnClickedCheckBootPaths();
  77. afx_msg void OnDestroy();
  78. //}}AFX_MSG
  79. DECLARE_MESSAGE_MAP()
  80. private:
  81. CStringArray m_arrayIniLines; // array of lines in the ini file
  82. int m_nTimeoutIndex; // list index of the "timeout=" line
  83. int m_nDefaultIndex; // list index of the "default=" line
  84. int m_nMinOSIndex; // first list index of an OS line
  85. int m_nMaxOSIndex; // last list index of an OS line
  86. CString m_strSafeBoot; // the current string for the safeboot flag
  87. BOOL m_fIgnoreEdit; // used to avoid a recursion problem
  88. CString m_strOriginalContents; // contents of the BOOT.INI as read
  89. CString m_strFileName; // name (with path) of the boot.ini file
  90. TabState m_stateCurrent; // USER or NORMAL state
  91. HWND GetDlgItemHWND(UINT nID)
  92. {
  93. HWND hwnd = NULL;
  94. CWnd * pWnd = GetDlgItem(nID);
  95. if (pWnd)
  96. hwnd = pWnd->m_hWnd;
  97. ASSERT(hwnd);
  98. return hwnd;
  99. }
  100. void UserMadeChange()
  101. {
  102. m_stateCurrent = USER;
  103. SetModified(TRUE);
  104. }
  105. private:
  106. BOOL m_fModified;
  107. void SetModified(BOOL bChanged = TRUE)
  108. {
  109. m_fModified = bChanged;
  110. CPropertyPage::SetModified(bChanged);
  111. }
  112. };
  113. //{{AFX_INSERT_LOCATION}}
  114. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  115. #endif // !defined(AFX_PAGEBOOTINI_H__30CE1B24_CA43_4AFF_870C_7D49CCCF86BF__INCLUDED_)