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.

140 lines
6.1 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM bindsys.cmd
  5. REM Binds the NT system 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. $ENV{SCRIPT_NAME} [-l <language]
  21. Binds the NT binaries. Run during postbuild.
  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. if defined ia64 goto :EOF
  32. if defined amd64 goto :EOF
  33. REM Don't bind on checked build machines:
  34. rem if /i "%ntdebug%" == "" goto OK
  35. rem if /i NOT "%ntdebug%" == "ntsdnodbg" goto :EOF
  36. REM BUGBUG Don't bind on incremental for now
  37. REM if NOT defined SafePass (
  38. REM if exist %_NTPostBld%\build_logs\bindiff.txt (
  39. REM call logmsg.cmd "Don't bind on incremental for now."
  40. REM goto :EOF
  41. REM )
  42. REM )
  43. :OK
  44. REM ---------------------------------------------------------------------------
  45. REM BINDSYS.CMD - bind the NT binaries
  46. REM
  47. REM ---------------------------------------------------------------------------
  48. if "%bindrive%" == "" goto UseNTPOSTBLD
  49. if "%binroot%" == "" goto UseNTPOSTBLD
  50. goto UseBinDriveRoot
  51. :UseNTPOSTBLD
  52. if "%_NTPostBld%" == "" echo _NTPostBld not defined && goto :EOF
  53. set binplacedir=%_NTPostBld%
  54. goto GotBinplaceDir
  55. :UseBinDriveRoot
  56. set binplacedir=%bindrive%%binroot%
  57. :GotBinplaceDir
  58. set bindlog=%binplacedir%\build_logs\bind.log
  59. REM
  60. REM To work around imagehlp::BindImageEx/ImageLoad's assumption of . being in the path,
  61. REM we must not be sitting in the binaries directory, so that asms\...\comctl32.dll can
  62. REM beat retail\comctl32.dll. We must list %binplacedir%; explicitly in many paths
  63. REM where before we did not.
  64. REM
  65. REM As well, we don't want to be in some random directory that contains .dlls, like
  66. REM %windir%\system32 or %sdxroot%\tools\x86
  67. REM
  68. REM presumably no .dlls in %binplacedir%\build_logs
  69. REM other good choices might be \ or %windir%\config or %binplacedir%\symbols or %binplacedir%\asms
  70. REM
  71. pushd %binplacedir%\build_logs
  72. REM ------------------------------------------------
  73. REM Exclude these crypto binaries:
  74. REM ------------------------------------------------
  75. set Excludeexe=
  76. for %%i in (ntoskrnl ntkrnlmp ntkrnlpa ntkrpamp) do set Excludeexe=!Excludeexe! -x ..\%%i.exe
  77. set Excludedll=
  78. for %%i in (gpkcsp rsaenh dssenh ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  79. for %%i in (slbcsp sccbase ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  80. for %%i in (disdnci disdnsu ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  81. for %%i in (scrdaxp scrdenrl scrdsign scrdx86) do set Excludedll=!Excludedll! -x ..\%%i.dll
  82. for %%i in (xenraxp xenroll xenrsign xenrx86 ) do set Excludedll=!Excludedll! -x ..\%%i.dll
  83. REM
  84. REM Bind TO asms, even in non usa builds..
  85. REM
  86. set asmspath=
  87. set asmspath=%asmspath%;%binplacedir%\asms\6000\msft\windows\common\controls
  88. set asmspath=%asmspath%;%binplacedir%\asms\1000\msft\windows\gdiplus
  89. REM
  90. REM There was some wierdness with these, so we use the unabstracted ..\ instead.
  91. REM
  92. REM set System32=%binplacedir%\System32
  93. REM set MSTools=%binplacedir%\MSTools
  94. REM set IDW=%binplacedir%\IDW
  95. REM set Symbols=%binplacedir%\Symbols
  96. if exist ..\System32\*.dll Bind %Excludedll% -u -s ..\Symbols\system32 -p %asmspath%;..;..\System32 ..\System32\*.dll >>%bindlog% 2>&1
  97. if exist ..\System32\*.exe Bind %Excludeexe% -u -s ..\Symbols\system32 -p %asmspath%;..;..\System32 ..\System32\*.exe >>%bindlog% 2>&1
  98. if exist ..\System32\*.com Bind % -u -s ..\Symbols\system32 -p %asmspath%;..;..\System32 ..\System32\*.com >>%bindlog% 2>&1
  99. if exist ..\*.dll Bind %Excludedll% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.dll >>%bindlog% 2>&1
  100. if exist ..\*.exe Bind %Excludeexe% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.exe >>%bindlog% 2>&1
  101. if exist ..\*.cpl Bind %Excludedll% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.cpl >>%bindlog% 2>&1
  102. if exist ..\*.com Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.com >>%bindlog% 2>&1
  103. if exist ..\.ocx Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.ocx >>%bindlog% 2>&1
  104. if exist ..\*.ax Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.ax >>%bindlog% 2>&1
  105. if exist ..\*.scr Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.scr >>%bindlog% 2>&1
  106. if exist ..\*.tsp Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.tsp >>%bindlog% 2>&1
  107. if exist ..\*.drv Bind -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 ..\*.drv >>%bindlog% 2>&1
  108. if exist ..\MSTools\*.dll Bind %Excludedll% -u -s ..\Symbols\mstools -p %asmspath%;..;..\MSTools;..\System32 ..\MSTools\*.dll >>%bindlog% 2>&1
  109. if exist ..\MSTools\*.exe Bind %Excludeexe% -u -s ..\Symbols\mstools -p %asmspath%;..;..\MSTools;..\System32 ..\MSTools\*.exe >>%bindlog% 2>&1
  110. if exist ..\MSTools\*.com Bind -u -s ..\Symbols\mstools -p %asmspath%;..;..\MSTools;..\System32 ..\MSTools\*.com >>%bindlog% 2>&1
  111. if exist ..\IDW\*.dll Bind %Excludedll% -u -s ..\Symbols\idw -p %asmspath%;..;..\IDW;..\MSTools;..\System32 ..\IDW\*.dll >>%bindlog% 2>&1
  112. if exist ..\IDW\*.exe Bind %Excludeexe% -u -s ..\Symbols\idw -p %asmspath%;..;IDW;..\MSTools;..\System32 ..\IDW\*.exe >>%bindlog% 2>&1
  113. if exist ..\IDW\*.com Bind -u -s ..\Symbols\idw -p %asmspath%;..;..\IDW;..\MSTools;..\System32 ..\IDW\*.com >>%bindlog% 2>&1
  114. REM
  115. REM ..but only bind FROM asms for usa builds.
  116. REM
  117. if /i "%LANG%" equ "usa" for /f %%i in ('dir /s/b/ad ..\asms') do Bind %Excludedll% -u -s ..\Symbols\retail -p %asmspath%;..;..\System32 %%i\*.dll >>%bindlog% 2>&1
  118. popd