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.

101 lines
2.5 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM smashem.cmd
  5. REM Smash locks on certain binaries
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. if defined _CPCMAGIC goto CPCBegin
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. #!perl
  14. use strict;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use PbuildEnv;
  18. use ParseArgs;
  19. sub Usage { print<<USAGE; exit(1) }
  20. smashem [-l <language>]
  21. Smash locks on certain binaries
  22. USAGE
  23. parseargs('?' => \&Usage);
  24. # *** NEXT FEW LINES ARE TEMPLATE ***
  25. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  26. __END__
  27. :CPCBegin
  28. set _CPCMAGIC=
  29. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  30. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  31. REM Incremental check
  32. REM First off, clear out error level as somebody is doing weird things with it
  33. set ErrorLevel=
  34. set Bindiff=%_NTPostBld%\build_logs\bindiff.txt
  35. set Inputs=win32k.sys kernel32.dll ntdll.dll winsrv.dll
  36. if exist %Bindiff% (
  37. set ChangedInputs=0
  38. for %%a in (%Inputs%) do (
  39. findstr /ilc:"%_NTPostBld%\uniproc\%%a" %BinDiff%
  40. if /i "!ErrorLevel!" == "0" set /a ChangedInputs=!ChangedInputs! + 1
  41. )
  42. echo !ChangedInputs!
  43. if !ChangedInputs! EQU 0 (
  44. @echo Skipping - No inputs changed
  45. goto :EOF
  46. )
  47. )
  48. REM
  49. REM We do 3 steps here:
  50. REM 1. Make the %_NTPostBld%\uniproc directory
  51. REM 2. Copy some specified files into that directory from %_NTPostBld%
  52. REM 3. run smashlck.exe on those files
  53. REM
  54. REM
  55. REM 1. Make the %_NTPostBld%\uniproc directory
  56. REM
  57. if not exist %_NTPostBld%\uniproc (
  58. call ExecuteCmd.cmd "md %_NTPostBld%\uniproc"
  59. if errorlevel 1 goto :EOF
  60. )
  61. REM
  62. REM 2. Copy some specified files into that directory from the root of binaries.
  63. REM
  64. REM Only do this on x86 machines
  65. if /i NOT "%PROCESSOR_ARCHITECTURE%" == "x86" goto :EOF
  66. if /i "%AMD64%" == "1" goto :EOF
  67. if /i "%IA64%" == "1" goto :EOF
  68. set UNIPROC_FILES=kernel32.dll ntdll.dll win32k.sys winsrv.dll
  69. for %%i in (%UNIPROC_FILES%) do (
  70. call ExecuteCmd.cmd "xcopy /YFR %_NTPostBld%\%%i %_NTPostBld%\uniproc\"
  71. if errorlevel 1 goto :EOF
  72. )
  73. REM
  74. REM 3. run smashlck on those files
  75. REM
  76. REM
  77. REM if we're on a checked build machine, then don't smash locks.
  78. REM checked builds are always MP.
  79. REM
  80. if /i NOT "%_BuildType%" == "fre" goto :EOF
  81. for %%i in (%UNIPROC_FILES%) do (
  82. call ExecuteCmd.cmd "smashlck.exe -u %_NTPostBld%\uniproc\%%i"
  83. if errorlevel 1 goto :EOF
  84. )