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.

115 lines
2.6 KiB

  1. #---------------------------------------------------------------------
  2. #package inftest;
  3. #
  4. # Copyright (c) Microsoft Corporation. All rights reserved.
  5. #
  6. # Version:
  7. # 1.00 01/21/2002 DMiura: initial version
  8. #
  9. #---------------------------------------------------------------------
  10. use strict;
  11. #use warnings;
  12. # my %exceptions = { <file> => {<lang1>=>1, <lang2>=>1, ...},
  13. my %bad_langs = (
  14. cs=>1,
  15. el=>1,
  16. hu=>1,
  17. jpn=>1,
  18. pl=>1,
  19. ru=>1,
  20. tr=>1
  21. );
  22. my %exceptions = (
  23. "c_737.nls" => {el=>1},
  24. "c_852.nls" => {cs=>1, hu=>1, pl=>1},
  25. "c_857.nls" => {tr=>1},
  26. "c_866.nls" => {ru=>1},
  27. "imjpch.dic" => {jpn=>1},
  28. "imjpgn.grm" => {jpn=>1},
  29. "imjpln.dic" => {jpn=>1},
  30. "imjpmig.exe" => {jpn=>1},
  31. "imjpnm.dic" => {jpn=>1},
  32. "imjpsb.dic" => {jpn=>1},
  33. "imjpst.dic" => {jpn=>1},
  34. "imjptk.dic" => {jpn=>1},
  35. "imjpzp.dic" => {jpn=>1},
  36. "kbdcz.dll" => {cs=>1},
  37. "kbdcz1.dll" => {cs=>1},
  38. "kbdcz2.dll" => {cs=>1},
  39. "kbdgkl.dll" => {el=>1},
  40. "kbdhe.dll" => {el=>1},
  41. "kbdhe220.dll" => {el=>1},
  42. "kbdhe319.dll" => {el=>1},
  43. "kbdhela2.dll" => {el=>1},
  44. "kbdhela3.dll" => {el=>1},
  45. "kbdhept.dll" => {el=>1},
  46. "kbdhu.dll" => {hu=>1},
  47. "kbdhu1.dll" => {hu=>1},
  48. "kbdpl.dll" => {pl=>1},
  49. "kbdpl1.dll" => {pl=>1},
  50. "kbdru.dll" => {ru=>1},
  51. "kbdru1.dll" => {ru=>1},
  52. "kbdtuf.dll" => {tr=>1},
  53. "kbdtuq.dll" => {tr=>1},
  54. "vga737.fon" => {el=>1},
  55. "vga852.fon" => {cs=>1, hu=>1, pl=>1},
  56. "vga857.fon" => {tr=>1},
  57. "vga866.fon" => {ru=>1}
  58. "wkbdcz1.dll" =>{cs=>1}
  59. "wkbdcz2.dll" =>{cs=>1}
  60. "wc_852.nls" =>{cs=>1,hu=>1}
  61. "wkbdcz.dll" =>{cs=>1}
  62. "wkbdgkl.dll" =>{el=>1}
  63. "wkbdhe220.dll" =>{el=>1}
  64. "wkbdhe319.dll" =>{el=>1}
  65. "wkbdhept.dll" =>{el=>1}
  66. "wkbdhela2.dll" =>{el=>1}
  67. "wc_737.nls" =>{el=>1}
  68. "wkbdhe.dll" =>{el=>1}
  69. "wkbdhu.dll"=>{hu=>1}
  70. "wc_852.nls"=>{hu=>1,pl=>1}
  71. "wkbdpl1.dll"=>{pl=>1}
  72. "wkbdpl.dll"=>{pl=>1}
  73. "wkbdru1.dll"=>{ru=>1}
  74. "wc_866.nls"=>{ru=>1}
  75. "wkbdru.dll"=>{ru=>1}
  76. "wkbdtuf.dll" =>{tr=>1}
  77. "wc_857.nls" =>{tr=>1}
  78. );
  79. # First parameter should be the language, pull it out
  80. my $lang = shift @ARGV;
  81. if ( exists $bad_langs{lc$lang} ) {
  82. # Call inftest with passed parameters
  83. my @results = `inftest.exe @ARGV` ;
  84. exit $! if $!;
  85. my $exitVal = $?>>8;
  86. # Test for language and exception list. Print results to std out.
  87. foreach my $result (@results) {
  88. if ( $result =~ /: error \S+ :.*?(\S+)$/i ) {
  89. my $langs = $exceptions{lc$1};
  90. if ( exists $langs->{lc$lang} ) {
  91. $result =~ s/: error \S+ :/: WARNING :/i;
  92. }
  93. }
  94. print $result;
  95. }
  96. exit $exitVal;
  97. }
  98. # Default behavior is to pass through to EXE
  99. system( "inftest.exe @ARGV" );
  100. if ( $! ) { exit $! }
  101. else { exit $?>>8 }