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.

184 lines
5.1 KiB

  1. [Identification]
  2. OptionType = NetAdapter
  3. [Identify]
  4. read-syms Identification
  5. set Status = STATUS_SUCCESSFUL
  6. set Identifier = $(OptionType)
  7. set Media = #("Source Media Descriptions", 1, 1)
  8. Return $(Status) $(Identifier) $(Media)
  9. [ReturnOptions]
  10. set Status = STATUS_FAILED
  11. set OptionList = {}
  12. set OptionTextList = {}
  13. set LanguageList = ^(LanguagesSupported, 1)
  14. Ifcontains(i) $($0) in $(LanguageList)
  15. ifstr(i) $($1) == ""
  16. goto returnoptions
  17. endif
  18. else
  19. set Status = STATUS_NOLANGUAGE
  20. goto finish_ReturnOptions
  21. endif
  22. returnoptions = +
  23. set OptionList = ^($($1)Options, 1)
  24. set OptionTextList = ^($($1)OptionsText$($0), 1)
  25. set Status = STATUS_SUCCESSFUL
  26. finish_ReturnOptions = +
  27. Return $(Status) $(OptionList) $(OptionTextList)
  28. [FileConstants]
  29. UtilityInf = "UTILITY.INF"
  30. ParamInf = "NCPARAM.INF"
  31. subroutineinf = "SUBROUTN.INF"
  32. SoftwareType = "driver"
  33. Exit_Code = 0
  34. [GeneralConstants]
  35. from = ""
  36. to = ""
  37. ExitCodeOk = 0
  38. ExitCodeCancel = 1
  39. ExitCodeFatal = 2
  40. KeyNull = ""
  41. MAXIMUM_ALLOWED = 33554432
  42. RegistryErrorIndex = NO_ERROR
  43. KeyProduct = ""
  44. KeyParameters = ""
  45. TRUE = 1
  46. FALSE = 0
  47. NoTitle = 0
  48. ExitState = "Active"
  49. OldVersionExisted = $(FALSE)
  50. DriverPath = $(!STF_NTPATH)\drivers
  51. [InstallOption]
  52. set Option = $($1)
  53. set SrcDir = $($2)
  54. set AddCopy = $($3)
  55. set DoCopy = $($4)
  56. set DoConfig = $($5)
  57. set LanguageList = ^(LanguagesSupported, 1)
  58. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  59. Return STATUS_NOLANGUAGE
  60. endif
  61. set-subst LF = "\n"
  62. read-syms GeneralConstants
  63. read-syms FileConstants
  64. ForListDo $(!STF_BUSTYPELIST)
  65. set OptionList = ^($($)Options,1)
  66. set FileNameList = ^($($)Filename,1)
  67. ifint ~($(OptionList),$(Option)) != 0
  68. goto FoundBus
  69. endif
  70. EndForListDo
  71. FoundBus = +
  72. debug-output *($(FileNameList), ~($(OptionList), $(Option)))
  73. ;
  74. ; Remove old inf file
  75. ;
  76. Shell "ntlanman.inf" RemoveOldInfFile $(Option), "NetAdapter", "oemnad", "oemnadzz.inf"
  77. ;
  78. ; Copy it over
  79. ;
  80. set Num = 0
  81. nextinf = +
  82. ifint $(Num) < 99
  83. set OemFileName = "oemnad"$(Num)".inf"
  84. set FileToCheck = $(!STF_WINDOWSSYSPATH)"\"$(OemFileName)
  85. install Install-SeeIfFileIsPresent
  86. ifstr(i) $(STATUS) == "YES"
  87. set-add Num = $(Num) 1
  88. goto nextinf
  89. else
  90. goto copyinf
  91. endif
  92. endif
  93. goto finish
  94. copyinf = +
  95. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  96. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  97. Goto ShellCodeError
  98. Else-Ifstr(i) $($R0) == STATUS_FAILED
  99. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  100. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  101. goto ShellCodeError
  102. endif
  103. set Error = $($R0)
  104. Goto fatal
  105. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  106. Goto finish
  107. Endif
  108. ;
  109. ; Just need the disk location
  110. ;
  111. Split-String $($R1), "\", DiskLocationInfo
  112. Set SrcDir = ""
  113. ifstr(i) *($(DiskLocationInfo),1) == "\"
  114. ifstr(i) *($(DiskLocationInfo),2) == "\"
  115. set SrcDir = "\\"*($(DiskLocationInfo),3)"\"*($(DiskLocationInfo),5)
  116. endif
  117. else
  118. Set SrcDir = *($(DiskLocationInfo),1)
  119. endif
  120. debug-output $(SrcDir)
  121. ; we need to do some checking for srcdir
  122. set OemSrc = $(SrcDir)*($(FileNameList), ~($(OptionList), $(Option)))
  123. set OemDst = $(!STF_WINDOWSSYSPATH)"\"$(OemFileName)
  124. install Install-OemINF
  125. ;
  126. ; Get location
  127. ;
  128. Split-String $(OemSrc), "\", OemSrcInfo
  129. QueryListSize ListSize $(OemSrcInfo)
  130. set-sub ListSize = $(ListSize) 2
  131. set Count = 0
  132. set SrcDir = ""
  133. SrcDirLoop = +
  134. set-add Count = $(Count) 1
  135. set SrcDir = $(SrcDir)*($(OemSrcInfo),$(Count))
  136. ifint $(Count) != $(ListSize)
  137. goto SrcDirLoop
  138. endif
  139. debug-output $(SrcDir)
  140. set !STF_SRCDIR_OVERRIDE = $(SrcDir)
  141. Shell $(OemDst) "InstallOption" +
  142. $(!STF_LANGUAGE) $(Option) +
  143. $(SrcDir) $(AddCopy) $(DoCopy) $(DoConfig)
  144. finish = +
  145. return STATUS_SUCCESSFUL
  146. ShellCodeError = +
  147. set DlgType = "MessageBox"
  148. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  149. set STF_MB_TEXT = $(ShellCodeErrorText)
  150. set STF_MB_TYPE = 1
  151. set STF_MB_ICON = 3
  152. set STF_MB_DEF = 1
  153. ui start "Error Message"
  154. setfailed = +
  155. set CommonStatus = STATUS_FAILED
  156. term = +
  157. Return $(CommonStatus)
  158. [Source Media Descriptions]
  159. 1 = "Windows NT Setup Disk #1" , TAGFILE = disk1
  160. 2 = "Windows NT Setup CD-ROM Disk" , TAGFILE = disk2
  161. [ProductType]
  162. STF_PRODUCT = WinNT
  163. STF_PLATFORM = Alpha
  164. [LanguagesSupported]
  165. ENG
  166. [Install-SeeIfFileIsPresent]
  167. LibraryProcedure STATUS,$(!LIBHANDLE), CheckFileExistance $(FileToCheck)
  168. exit
  169. [Install-OemINF]
  170. LibraryProcedure STATUS,$(!LIBHANDLE), CopySingleFile $(OemSrc) $(OemDst)
  171. exit