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.

158 lines
3.0 KiB

  1. //
  2. // Driver Verifier UI
  3. // Copyright (c) Microsoft Corporation, 1999
  4. //
  5. //
  6. //
  7. // module: verifier.cpp
  8. // author: DMihai
  9. // created: 11/1/00
  10. //
  11. // Description
  12. //
  13. // Defines the class behaviors for the application.
  14. //
  15. #include "stdafx.h"
  16. #include "verifier.h"
  17. #include "vsheet.h"
  18. #include "vrfutil.h"
  19. #include "vglobal.h"
  20. #include "CmdLine.h"
  21. #ifdef _DEBUG
  22. #define new DEBUG_NEW
  23. #undef THIS_FILE
  24. static char THIS_FILE[] = __FILE__;
  25. #endif
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CVerifierApp
  28. BEGIN_MESSAGE_MAP(CVerifierApp, CWinApp)
  29. //{{AFX_MSG_MAP(CVerifierApp)
  30. // NOTE - the ClassWizard will add and remove mapping macros here.
  31. // DO NOT EDIT what you see in these blocks of generated code!
  32. //}}AFX_MSG
  33. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CVerifierApp construction
  37. CVerifierApp::CVerifierApp()
  38. {
  39. // TODO: add construction code here,
  40. // Place all significant initialization in InitInstance
  41. CString strAppName;
  42. if( VrfLoadString( IDS_APPTITLE, strAppName ) )
  43. {
  44. m_pszAppName = _tcsdup( (LPCTSTR)strAppName );
  45. }
  46. }
  47. /////////////////////////////////////////////////////////////////////////////
  48. // The one and only CVerifierApp object
  49. CVerifierApp theApp;
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CVerifierApp initialization
  52. BOOL CVerifierApp::InitInstance()
  53. {
  54. DWORD dwExitCode;
  55. BOOL bGlobalDataInitialized;
  56. static CVerifierPropSheet MainDlg;
  57. //
  58. // Assume program will run fine and will not change any settings
  59. //
  60. dwExitCode = EXIT_CODE_SUCCESS;
  61. bGlobalDataInitialized = VerifInitalizeGlobalData();
  62. if( TRUE != bGlobalDataInitialized )
  63. {
  64. //
  65. // Cannot run the app
  66. //
  67. dwExitCode = EXIT_CODE_ERROR;
  68. goto ExitApp;
  69. }
  70. //
  71. // Check for command line arguments
  72. //
  73. if( __argc > 1 )
  74. {
  75. //
  76. // Run just in command line mode
  77. //
  78. _tsetlocale( LC_ALL, _T( ".OCP" ) );
  79. g_bCommandLineMode = TRUE;
  80. dwExitCode = CmdLineExecute( __argc, __targv );
  81. goto ExitApp;
  82. }
  83. else
  84. {
  85. FreeConsole();
  86. }
  87. //
  88. // Standard MFC initialization
  89. //
  90. AfxEnableControlContainer();
  91. //
  92. // Create our brush used to fill out the background of our steps lists
  93. //
  94. g_hDialogColorBrush = GetSysColorBrush( COLOR_3DFACE );
  95. //
  96. // There is only one property sheet in this program so we declared it static
  97. //
  98. m_pMainWnd = &MainDlg;
  99. MainDlg.DoModal();
  100. if( g_bSettingsSaved )
  101. {
  102. dwExitCode = EXIT_CODE_REBOOT_NEEDED;
  103. }
  104. else
  105. {
  106. dwExitCode = EXIT_CODE_SUCCESS;
  107. }
  108. goto ExitApp;
  109. ExitApp:
  110. //
  111. // All done, exit the app
  112. //
  113. exit( dwExitCode );
  114. //
  115. // not reached
  116. //
  117. return FALSE;
  118. }