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.

124 lines
2.6 KiB

  1. //
  2. // System level IO verification configuration utility
  3. // Copyright (c) Microsoft Corporation, 1999
  4. //
  5. //
  6. // module: main.cxx
  7. // author: DMihai
  8. // created: 04/19/99
  9. // description: command line parsing and help information
  10. //
  11. #include <windows.h>
  12. #include <tchar.h>
  13. #include <stdlib.h>
  14. #include <stdio.h>
  15. #include <common.ver>
  16. #include "resid.hxx"
  17. #include "resutil.hxx"
  18. #include "regutil.hxx"
  19. void
  20. DisplayHelpInformation();
  21. //////////////////////////////////////////////////////////
  22. extern "C" void _cdecl
  23. wmain( int argc, TCHAR *argv[] )
  24. {
  25. BOOL bResult;
  26. DWORD dwVerifierLevel;
  27. TCHAR strCmdLineOption[ 64 ];
  28. dwVerifierLevel = -1;
  29. //
  30. // look for /enable
  31. //
  32. bResult = GetStringFromResources(
  33. IDS_ENABLE_CMDLINE_OPTION,
  34. strCmdLineOption,
  35. ARRAY_LEN( strCmdLineOption ) );
  36. if( bResult && argc >= 2 && _tcsicmp( argv[ 1 ], strCmdLineOption ) == 0 )
  37. {
  38. //
  39. // level is hardcoded for now
  40. //
  41. dwVerifierLevel = 3;
  42. //
  43. // this will exit process
  44. //
  45. EnableSysIoVerifier(
  46. dwVerifierLevel );
  47. }
  48. //
  49. // look for /disable
  50. //
  51. bResult = GetStringFromResources(
  52. IDS_DISABLE_CMDLINE_OPTION,
  53. strCmdLineOption,
  54. ARRAY_LEN( strCmdLineOption ) );
  55. if( bResult && argc == 2 && _tcsicmp( argv[ 1 ], strCmdLineOption ) == 0 )
  56. {
  57. //
  58. // get the name of the kernel module
  59. //
  60. //
  61. // this will exit process
  62. //
  63. DisableSysIoVerifier();
  64. }
  65. //
  66. // look for /status
  67. //
  68. bResult = GetStringFromResources(
  69. IDS_STATUS_CMDLINE_OPTION,
  70. strCmdLineOption,
  71. ARRAY_LEN( strCmdLineOption ) );
  72. if( bResult && argc == 2 && _tcsicmp( argv[ 1 ], strCmdLineOption ) == 0 )
  73. {
  74. //
  75. // this will exit process
  76. //
  77. DumpSysIoVerifierStatus();
  78. }
  79. DisplayHelpInformation();
  80. }
  81. ///////////////////////////////////////////////////////////
  82. void
  83. DisplayHelpInformation()
  84. {
  85. PrintStringFromResources( IDS_HELP_LINE1 );
  86. puts( VER_LEGALCOPYRIGHT_STR );
  87. PrintStringFromResources( IDS_HELP_LINE3 );
  88. PrintStringFromResources( IDS_HELP_LINE4 );
  89. PrintStringFromResources( IDS_HELP_LINE5 );
  90. PrintStringFromResources( IDS_HELP_LINE6 );
  91. PrintStringFromResources( IDS_HELP_LINE7 );
  92. PrintStringFromResources( IDS_HELP_LINE8 );
  93. PrintStringFromResources( IDS_HELP_LINE9 );
  94. exit( EXIT_CODE_NOTHING_CHANGED );
  95. }