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.

812 lines
26 KiB

  1. [Identification]
  2. OptionType = NetAdapter
  3. [PlatformsSupported]
  4. EISA
  5. PCI
  6. "Jazz-Internal Bus"
  7. [Options]
  8. DEC300
  9. [FileConstants]
  10. UtilityInf = "UTILITY.INF"
  11. subroutineinf = "SUBROUTN.INF"
  12. SoftwareType = "driver"
  13. Exit_Code = 0
  14. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  15. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  16. DEC300_1BYTE = 3187472
  17. Manufacturer = "DigitalEquipment"
  18. ProductMajorVersion = "4"
  19. ProductMinorVersion = "0"
  20. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  21. ProductSoftwareName = "Defea"
  22. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\defea.sys"
  23. NetRuleSoftwareType = "defeaSys ndisDriver defeaDriver"
  24. NetRuleSoftwareUse = $(SoftwareType)
  25. NetRuleSoftwareBindForm = """DefeaSys"" yes no container"
  26. NetRuleSoftwareClass = {"defeaDriver basic"}
  27. ProductHardwareName = "Defea"
  28. NetRuleHardwareType = "dec300 dec300Adapter"
  29. NetRuleHardwareBindForm = " yes yes container"
  30. NetRuleHardwareClass = {"dec300Adapter basic"}
  31. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  32. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  33. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  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. Successful_Install = 0
  52. [date]
  53. Now = {} ? $(!LIBHANDLE) GetSystemDate
  54. [processor]
  55. PROC_TYPE = "" ? $(LIBHANDLE) GetProcessor
  56. [Identify]
  57. read-syms Identification
  58. set Status = STATUS_SUCCESSFUL
  59. set Identifier = $(OptionType)
  60. set Media = #("Source Media Descriptions", 1, 1)
  61. Return $(Status) $(Identifier) $(Media)
  62. [ReturnOptions]
  63. set Status = STATUS_FAILED
  64. set OptionList = {}
  65. set OptionTextList = {}
  66. set LanguageList = ^(LanguagesSupported, 1)
  67. Ifcontains(i) $($0) in $(LanguageList)
  68. ifstr(i) $($1) == ""
  69. goto returnoptions
  70. endif
  71. set PlatformList = ^(PlatformsSupported, 1)
  72. Ifcontains(i) $($1) in $(PlatformList)
  73. goto returnoptions
  74. else
  75. set Status = STATUS_NOTSUPPORTED
  76. goto finish_ReturnOptions
  77. endif
  78. else
  79. set Status = STATUS_NOLANGUAGE
  80. goto finish_ReturnOptions
  81. endif
  82. returnoptions = +
  83. set OptionList = ^(Options, 1)
  84. set OptionTextList = ^(OptionsText$($0), 1)
  85. set Status = STATUS_SUCCESSFUL
  86. finish_ReturnOptions = +
  87. Return $(Status) $(OptionList) $(OptionTextList)
  88. [InstallOption]
  89. ; set !DebugOutputControl = 1
  90. set Option = $($1)
  91. set SrcDir = $($2)
  92. set AddCopy = $($3)
  93. set DoCopy = $($4)
  94. set DoConfig = $($5)
  95. set LanguageList = ^(LanguagesSupported, 1)
  96. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  97. Return STATUS_NOLANGUAGE
  98. endif
  99. Debug-Output "OEMNADD4.INF: STF_CWDIR is: "$(!STF_CWDIR)
  100. Debug-Output "OEMNADD4.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  101. set-subst LF = "\n"
  102. SetHelpFile "defddi.hlp" 1 600
  103. read-syms GeneralConstants
  104. read-syms FileConstants
  105. Shell $(UtilityInf), GetBindingInfo, "DEC"
  106. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  107. Debug-Output "ShellCode error: cannot get an error string."
  108. goto ShellCodeError
  109. endif
  110. set NetRuleSoftwareBindable = $($R1)
  111. read-syms DialogConstants$(!STF_LANGUAGE)
  112. ifstr(i) $(!NTN_Origination) == "NCPA"
  113. set Continue = $(OK)
  114. endif
  115. read-syms FileConstants$(!STF_LANGUAGE)
  116. detect date
  117. set-title $(FunctionTitle)
  118. set to = Begin
  119. set from = Begin
  120. set CommonStatus = STATUS_SUCCESSFUL
  121. EndWait
  122. Begin = +
  123. ; set !DebugOutputControl = 1
  124. Ifstr(i) $(!NTN_InstallMode) == deinstall
  125. set StartLabel = removeadapter
  126. else-Ifstr(i) $(!NTN_InstallMode) == Update
  127. set StartLabel = UpgradeSoftware
  128. else-Ifstr(i) $(!NTN_InstallMode) == bind
  129. set StartLabel = bindingadapter
  130. else-Ifstr(i) $(!NTN_InstallMode) == configure
  131. set CommonStatus = STATUS_REBOOT
  132. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  133. Debug-Output "Cannot configure the dec 300 driver software."
  134. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  135. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  136. Debug-Output "ShellCode error: cannot get an error string."
  137. goto ShellCodeError
  138. endif
  139. set Error = $($R0)
  140. set from = end
  141. set to = end
  142. goto nonfatalinfo
  143. else
  144. set StartLabel = configureadapter
  145. endif
  146. else
  147. set StartLabel = installadapter
  148. set OEM_ABANDON_OPTIONS = {}
  149. set OEM_ABANDON_SOFTWARE = FALSE
  150. set OEM_ABANDON_ON = TRUE
  151. endif
  152. ;************ Detect Processor Type *****************
  153. ; LoadLibrary "" $(!STF_CWDDIR)setupdll.dll LIBHANDLE
  154. ; detect processor
  155. ; FreeLibrary $(LIBHANDLE)
  156. ; ifstr(i) $(PROC_TYPE) == Alpha_AXP
  157. ; set SourceDir = $(SrcDir)WINNT\ALPHA\
  158. ; set UpdateDir = $(SrcDir)WINNT\ALPHA\
  159. ; else-ifstr(i) $(PROC_TYPE) == R4000
  160. ; set SourceDir = $(SrcDir)WINNT\MIPS\
  161. ; set UpdateDir = $(SrcDir)WINNT\MIPS\
  162. ; else
  163. ; set SourceDir = $(SrcDir)WINNT\INTEL\
  164. ; set UpdateDir = $(SrcDir)WINNT\INTEL\
  165. ; endif
  166. ; endif
  167. Debug-Output "NTN_Origination"$(!NTN_Origination)
  168. set from = $(fatal)
  169. set to = $(fatal)
  170. goto $(StartLabel)
  171. installadapter = +
  172. goto nextstep
  173. configureadapter = +
  174. Ifstr $(KeyProduct) == $(KeyNull)
  175. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  176. Ifstr $(KeyProduct) == $(KeyNull)
  177. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  178. Debug-Output "Cannot find component product key"
  179. goto fatalregistry
  180. Endif
  181. Endif
  182. Debug-Output "INF: Shelling to FindService"
  183. Shell $(UtilityInf) FindService, $(KeyProduct)
  184. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  185. Debug-Output "INF: FindService shell failure"
  186. Goto ShellCodeError
  187. Endif
  188. Ifstr(i) $($R0) != NO_ERROR
  189. Debug-Output "INF: FindService Shell error: "$($R0)
  190. Goto fatalregistry
  191. endif
  192. Set KeyParameters = $($R2)
  193. CloseRegKey $($R1)
  194. Ifstr $(KeyParameters) == $(KeyNull)
  195. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  196. Debug-Output "Cannot find component service"
  197. goto fatalregistry
  198. endif
  199. set OldVersionExisted = $(TRUE)
  200. set ValueName = ""
  201. set ValueData = ""
  202. set ValueStr = ""
  203. set ValueList = {}
  204. EnumRegValue $(KeyParameters) ValueList
  205. ;***************** Read Registry Info for Defaults *****************
  206. ForListDo $(ValueList)
  207. set ValueItem = $($)
  208. set ValueName = *($(ValueItem),1)
  209. set ValueData = *($(ValueItem),4)
  210. ifstr(i) $(ValueName) == "BurstSize"
  211. set BurstSizeIndex = $(ValueData)
  212. else-ifstr(i) $(ValueName) == "FullDuplexEnable"
  213. set FullDuplexEnableIndex = $(ValueData)
  214. else-ifstr(i) $(ValueName) == "RcvBuffCnt"
  215. set RcvBuffCntIndex = $(ValueData)
  216. else-ifstr(i) $(ValueName) == "XmtBuffCnt"
  217. set XmtBuffCntIndex = $(ValueData)
  218. else-ifstr(i) $(ValueName) == "RequestedTTRT"
  219. set RequestedTTRTIndex = $(ValueData)
  220. else-ifstr(i) $(ValueName) == "SlotNumber"
  221. set SlotNumber = $(ValueData)
  222. endif
  223. EndForListDo
  224. Set Caption = $(FunctionTitle)
  225. Set Label1 = "Slot #"$(SlotNumber)
  226. ifstr(i) $(FullDuplexEnableIndex) == 1
  227. set RadioIn = {1}
  228. else
  229. set RadioIn = {2}
  230. endif
  231. ifstr(i) $(RequestedTTRTIndex) == ""
  232. set EditTextIn = {8}
  233. else
  234. set EditTextIn = {$(RequestedTTRTIndex)}
  235. endif
  236. set BurstSizeValue = *($(BurstSizeList), ~($(BurstSizeValues),$(BurstSizeIndex)))
  237. ifstr(i) $(BurstSizeValue) == ""
  238. set BurstSizeValue = 16
  239. endif
  240. set ReceiveBuffValue = *($(ReceiveBuffList), ~($(ReceiveBuffValues),$(RcvBuffCntIndex)))
  241. ifstr(i) $(ReceiveBuffValue) == ""
  242. set ReceiveBuffValue = 4
  243. endif
  244. set TransmitBuffValue = *($(TransmitBuffList), ~($(TransmitBuffValues),$(XmtBuffCntIndex)))
  245. ifstr(i) $(TransmitBuffValue) == ""
  246. set TransmitBuffValue = 32
  247. endif
  248. set RequestedTTRTValue = RequestedTTRTIndex
  249. ifstr(i) $(RequestedTTRTValue) == ""
  250. set RequestedTTRTValue = 8
  251. endif
  252. ;***************** Display the Dialog ******************************
  253. displaydialog = +
  254. set ExitButton = ""
  255. LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\$(DialogDllName) hLib
  256. read-syms FileDependentDlg$(!STF_LANGUAGE)
  257. restart = +
  258. set NotifyFields = {YES,NO,NO}
  259. ui start "InputDlg" $(hLib)
  260. set ExitButton = $(DLGEVENT)
  261. ifstr(i) $(DLGEVENT) == "CONTINUE"
  262. ifint *($(EditTextOut),1) < 4
  263. shell $(subroutineinf) SetupMessage ENG NONFATAL "Value of Requested TTRT must be between 4 and 165 ms"
  264. goto restart
  265. else-ifint *($(EditTextOut),1) > 165
  266. shell $(subroutineinf) SetupMessage ENG NONFATAL "Value of Requested TTRT must be between 4 and 165 ms"
  267. goto restart
  268. endif
  269. set BurstSizeIndex = *($(BurstSizeValues), ~($(BurstSizeList),$(Combo1Out)))
  270. set TransmitBuffIndex = *($(TransmitBuffValues), ~($(TransmitBuffList),$(Combo3Out)))
  271. set ReceiveBuffIndex = *($(ReceiveBuffValues), ~($(ReceiveBuffList),$(Combo2Out)))
  272. ifstr(i) *($(RadioOut),1) == 1
  273. Set FullDuplexEnableIndex = 1
  274. else
  275. Set FullDuplexEnableIndex = 2
  276. endif
  277. set RequestedTTRTIndex = *($(EditTextOut),1)
  278. FreeLibrary $(hLib)
  279. ui pop 1
  280. ifstr(i) $(StartLabel) == installadapter
  281. Set Successful_Install = 1
  282. goto returnpoint
  283. endif
  284. else-ifstr(i) $(DLGEVENT) == "NOTIFY"
  285. ; ifstr(i) $(Combo1Out) != 16
  286. ; shell $(subroutineinf) SetupMessage ENG NONFATAL "If supported by the adapter, a burst size of 16 longwords is recommended."
  287. ; endif
  288. goto restart
  289. else-ifstr(i) $(DLGEVENT) == "BACK"
  290. FreeLibrary $(hLib)
  291. ui pop 1
  292. ifstr(i) $(StartLabel) == installadapter
  293. goto returnpoint
  294. else
  295. CloseRegKey $(KeyParameters)
  296. set CommonStatus = STATUS_USERCANCEL
  297. goto end
  298. endif
  299. else
  300. FreeLibrary $(hLib)
  301. ui pop 1
  302. goto end
  303. endif
  304. set NewValueList = {{RcvBuffCnt,$(NoTitle),$(!REG_VT_DWORD),$(ReceiveBuffIndex)},+
  305. {BurstSize,$(NoTitle),$(!REG_VT_DWORD),$(BurstSizeIndex)},+
  306. {XmtBuffCnt,$(NoTitle),$(!REG_VT_DWORD),$(TransmitBuffIndex)},+
  307. {FullDuplexEnable,$(NoTitle),$(!REG_VT_DWORD),$(FullDuplexEnableIndex)},+
  308. {RequestedTTRT,$(NoTitle),$(!REG_VT_DWORD),$(RequestedTTRTIndex)}}
  309. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  310. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  311. goto ShellCodeError
  312. endif
  313. CloseRegKey $(KeyParameters)
  314. goto successful
  315. nextstep = +
  316. StartWait
  317. installproduct = +
  318. Shell $(UtilityInf), EISAFindBus, $(DEC300_1BYTE)
  319. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  320. goto ShellCodeError
  321. endif
  322. ifstr $($R0) != "NO_ERROR"
  323. set Error = $($R0)
  324. goto fatal
  325. endif
  326. ifstr(i) $($R1) == {}
  327. set Error = $(CANNOT_FIND_ANY_CARD)
  328. set CommonStatus = STATUS_USERCANCEL
  329. set from = end
  330. goto nonfatal
  331. endif
  332. set AdapterList = $($R1)
  333. ;**************** Install Hardware Component For Each***********************
  334. ;**************** Card and Store Params. In a List *************************
  335. Set AllAdaptersInstalled = $(TRUE)
  336. ForListDo $(AdapterList)
  337. set BusNum = *($($),1)
  338. set SlotNum = *($($),2)
  339. Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  340. $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  341. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  342. goto ShellCodeError
  343. endif
  344. ifstr $($R0) != "NO_ERROR"
  345. set Error = $($R0)
  346. goto fatal
  347. endif
  348. ifstr(i) $($R1) != "YES"
  349. Set AllAdaptersInstalled = $(FALSE)
  350. Set ReceiveBuffValue = 4
  351. Set TransmitBuffValue = 32
  352. Set BurstSizeValue = 16
  353. Set EditTextIn = {"8"}
  354. Set RadioIn = {2}
  355. Set Caption = $(FunctionTitle)
  356. Set Label1 = "Slot #"$(SlotNum)
  357. Set ExitButton = ""
  358. goto displaydialog
  359. else
  360. Set ExitButton = ""
  361. Set OldVersionExisted = $(TRUE)
  362. endif
  363. returnpoint = +
  364. ifstr(i) $(ExitButton) == "CONTINUE"
  365. Set List1 = >($(List1),$(BusNum))
  366. Set List2 = >($(List2),$(SlotNum))
  367. Set List3 = >($(List3),$(ReceiveBuffIndex))
  368. Set List4 = >($(List4),$(BurstSizeIndex))
  369. Set List5 = >($(List5),$(TransmitBuffIndex))
  370. Set List6 = >($(List6),$(FullDuplexEnableIndex))
  371. Set List7 = >($(List7),$(RequestedTTRTIndex))
  372. endif
  373. EndForListDo
  374. ifstr(i) $(AllAdaptersInstalled) == $(TRUE)
  375. shell $(subroutineinf) SetupMessage ENG NONFATAL "All DEC FDDIcontroller/EISA adapters already installed"
  376. endif
  377. ;*************** Install Software Component If Needed*******************
  378. ifstr(i) $(Successful_Install) == 1
  379. Debug-Output "Successful Install"
  380. ifint $(OldVersionExisted) == $(FALSE)
  381. Ifstr(i) $(DoCopy) == "YES"
  382. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  383. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  384. Goto ShellCodeError
  385. Else-Ifstr(i) $($R0) == STATUS_FAILED
  386. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  387. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  388. goto ShellCodeError
  389. endif
  390. set Error = $($R0)
  391. Goto fatal
  392. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  393. Goto successful
  394. Endif
  395. Set SrcDir = $($R1)
  396. Endif
  397. install "Install-Option"
  398. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  399. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  400. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  401. goto ShellCodeError
  402. endif
  403. set Error = $($R0)
  404. goto fatal
  405. endif
  406. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  407. $(ProductSoftwareName), +
  408. $(ProductSoftwareName), +
  409. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  410. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  411. $(NetEventDLL)
  412. Set OEM_ABANDON_SOFTWARE = TRUE
  413. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  414. goto ShellCodeError
  415. endif
  416. set RegistryErrorIndex = $($R0)
  417. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  418. EndWait
  419. CloseRegKey $($R1)
  420. CloseRegKey $($R2)
  421. CloseRegKey $($R3)
  422. CloseRegKey $($R4)
  423. CloseRegKey $($R5)
  424. goto fatalregistry
  425. endif
  426. Set SoftProductKey = $($R1)
  427. Set SoftNetRuleKey = $($R2)
  428. Set SoftServiceKey = $($R3)
  429. Set SoftParameterKey = $($R4)
  430. Set SoftLinkageKey = $($R5)
  431. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  432. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  433. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  434. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  435. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  436. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  437. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  438. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  439. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  440. goto ShellCodeError
  441. endif
  442. set RegistryErrorIndex = $($R0)
  443. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  444. EndWait
  445. CloseRegKey $(SoftProductKey)
  446. CloseRegKey $(SoftNetRuleKey)
  447. CloseRegKey $(SoftServiceKey)
  448. CloseRegKey $(SoftParameterKey)
  449. CloseRegKey $(SoftLinkageKey)
  450. goto fatalregistry
  451. endif
  452. set BindableTxt = {"defeaDriver dec300Adapter non exclusive 100"}
  453. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  454. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  455. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  456. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  457. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(BindableTxt)}, +
  458. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  459. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  460. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  461. goto ShellCodeError
  462. endif
  463. set RegistryErrorIndex = $($R0)
  464. CloseRegKey $(SoftProductKey)
  465. CloseRegKey $(SoftNetRuleKey)
  466. CloseRegKey $(SoftServiceKey)
  467. CloseRegKey $(SoftParameterKey)
  468. CloseRegKey $(SoftLinkageKey)
  469. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  470. EndWait
  471. goto fatalregistry
  472. endif
  473. endif
  474. else
  475. set CommonStatus = STATUS_USERCANCEL
  476. goto successful
  477. endif
  478. ;*********** Add Hardware Component For Each Card **********************
  479. ForListDo $(List1)
  480. ifstr(i) $($) != ""
  481. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  482. ifint $($R4) != -1
  483. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  484. endif
  485. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  486. goto ShellCodeError
  487. endif
  488. set RegistryErrorIndex = $($R0)
  489. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  490. EndWait
  491. CloseRegKey $($R1)
  492. CloseRegKey $($R2)
  493. CloseRegKey $($R3)
  494. goto fatalregistry
  495. endif
  496. Set HardNetCardKey = $($R1)
  497. Set HardNetRuleKey = $($R2)
  498. Set HardParameterKey = $($R3)
  499. set AdapterNumber = $($R4)
  500. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  501. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  502. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  503. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  504. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  505. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  506. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  507. Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  508. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  509. goto ShellCodeError
  510. endif
  511. set NewValueList = {{CardType,$(NoTitle),$(!REG_VT_DWORD),5},+
  512. {BusType,$(NoTitle),$(!REG_VT_DWORD),2},+
  513. {MediaType,$(NoTitle),$(!REG_VT_DWORD),3},+
  514. {EisaCompressedId,$(NoTitle),$(!REG_VT_DWORD),$(DEC300_1BYTE)},+
  515. {BusNumber,$(NoTitle),$(!REG_VT_DWORD),*($(List1),$(#))},+
  516. {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),*($(List2),$(#))},+
  517. {RcvBuffCnt,$(NoTitle),$(!REG_VT_DWORD),*($(List3),$(#))},+
  518. {BurstSize,$(NoTitle),$(!REG_VT_DWORD),*($(List4),$(#))},+
  519. {XmtBuffCnt,$(NoTitle),$(!REG_VT_DWORD),*($(List5),$(#))},+
  520. {FullDuplexEnable,$(NoTitle),$(!REG_VT_DWORD),*($(List6),$(#))},+
  521. {RequestedTTRT,$(NoTitle),$(!REG_VT_DWORD),*($(List7),$(#))}}
  522. Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  523. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  524. goto ShellCodeError
  525. endif
  526. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  527. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  528. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  529. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  530. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  531. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  532. Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  533. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  534. goto ShellCodeError
  535. endif
  536. CloseRegKey $(HardNetCardKey)
  537. CloseRegKey $(HardNetRuleKey)
  538. CloseRegKey $(HardParameterKey)
  539. endif
  540. EndForListDo
  541. goto writeparameters
  542. writeparameters = +
  543. EndWait
  544. goto successful
  545. bindingadapter =+
  546. set Error = "Binding: Sorry, not yet implemented."
  547. goto fatal
  548. removeadapter = +
  549. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  550. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  551. $(ProductSoftwareName)
  552. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  553. Debug-Output "ShellCode error"
  554. goto ShellCodeError
  555. endif
  556. set RegistryErrorIndex = $($R0)
  557. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  558. goto fatalregistry
  559. endif
  560. else
  561. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  562. $(ProductSoftwareName), $(!NTN_RegBase)
  563. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  564. Debug-Output "ShellCode error"
  565. goto ShellCodeError
  566. endif
  567. set RegistryErrorIndex = $($R0)
  568. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  569. goto fatalregistry
  570. endif
  571. endif
  572. goto end
  573. UpgradeSoftware = +
  574. ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  575. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  576. Ifstr $(KeyProduct) != $(KeyNull)
  577. GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  578. set Version = *($(VersionInfo), 4)
  579. Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  580. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  581. Debug-Output "ShellCode error"
  582. goto ShellCodeError
  583. endif
  584. set !UG_Filename = $($R0)
  585. ifstr(i) $(!UG_Filename) != ""
  586. install "Install-Update"
  587. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  588. goto fatal
  589. endif
  590. endif
  591. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  592. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  593. ifint $(Version) != $(ProductVersion)
  594. endif
  595. CloseRegKey $(KeyProduct)
  596. ;
  597. ; Upgrade MediaType to correct value (3 instead of 4).
  598. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Linkage" $(MAXIMUM_ALLOWED) LinkageKey
  599. ifstr(i) $(LinkageKey) != ""
  600. GetRegValue $(LinkageKey) Bind BindInfo
  601. ForListDo *($(BindInfo),4)
  602. Split-String $($) "\" CardInfo
  603. QueryListSize CardPos $(CardInfo)
  604. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"*($(CardInfo),$(CardPos))"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
  605. ifstr $(ParamKey) != ""
  606. SetRegValue $(ParamKey) {MediaType,$(NoTitle),$(!REG_VT_DWORD),3}
  607. CloseRegKey $(ParamKey)
  608. endif
  609. EndForListDo
  610. CloseRegKey $(LinkageKey)
  611. endif
  612. else
  613. goto fatalregistry
  614. endif
  615. else
  616. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  617. $(MAXIMUM_ALLOWED) NetworkCardKey
  618. Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  619. GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  620. set ServiceName = *($(ServiceNameInfo), 4)
  621. OpenRegKey $(NetworkCardKey) "" "NetRules" +
  622. $(MAXIMUM_ALLOWED) NetRuleKey
  623. Ifstr(i) $(NetRuleKey) != $(KeyNull)
  624. else
  625. goto fatalregistry
  626. endif
  627. CloseRegKey $(NetRules)
  628. CloseRegKey $(NetworkCardKey)
  629. else
  630. goto fatalregistry
  631. endif
  632. OpenRegKey $(!REG_H_LOCAL) "" +
  633. $(!NTN_ServiceBase)"\"$(ServiceName) +
  634. $(MAXIMUM_ALLOWED) ServiceKey
  635. Ifstr(i) $(ServiceKey) != $(KeyNull)
  636. CloseRegKey $(ServiceKey)
  637. else
  638. goto fatalregistry
  639. endif
  640. endif
  641. ;
  642. ; Enumerate all netcards installed of this type and update them
  643. ;
  644. set iSearch = 1
  645. nextnetcard = +
  646. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  647. set KeyNetcard = $($R0)
  648. set iSearch = $($R1)
  649. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  650. Ifstr $(KeyNetcard) != $(KeyNull)
  651. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  652. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  653. CloseRegKey $(KeyNetcard)
  654. goto nextnetcard
  655. Endif
  656. goto end
  657. successful = +
  658. goto end
  659. abandon = +
  660. ForListDo $(OEM_ABANDON_OPTIONS)
  661. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  662. $(ProductSoftwareName), $($)
  663. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  664. Debug-Output "ShellCode error"
  665. goto ShellCodeError
  666. endif
  667. set RegistryErrorIndex = $($R0)
  668. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  669. goto fatalregistry
  670. endif
  671. EndForListDo
  672. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  673. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  674. $(ProductSoftwareName), FALSE
  675. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  676. Debug-Output "ShellCode error"
  677. goto ShellCodeError
  678. endif
  679. set RegistryErrorIndex = $($R0)
  680. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  681. goto fatalregistry
  682. endif
  683. endif
  684. goto end
  685. warning = +
  686. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  687. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  688. goto ShellCodeError
  689. endif
  690. ifstr(i) $($R1) == "OK"
  691. goto $(to)
  692. else-ifstr(i) $($R1) == "CANCEL"
  693. goto $(from)
  694. else
  695. goto "end"
  696. endif
  697. nonfatalinfo = +
  698. Set CommonStatus = STATUS_USERCANCEL
  699. Set Severity = STATUS
  700. goto nonfatalmsg
  701. nonfatal = +
  702. Set Severity = NONFATAL
  703. goto nonfatalmsg
  704. nonfatalmsg = +
  705. ifstr(i) $(Error) == ""
  706. Set Severity = NONFATAL
  707. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  708. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  709. goto ShellCodeError
  710. endif
  711. set Error = $($R0)
  712. endif
  713. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  714. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  715. goto ShellCodeError
  716. endif
  717. ifstr(i) $($R1) == "OK"
  718. goto $(from)
  719. else
  720. goto "end"
  721. endif
  722. fatalregistry = +
  723. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  724. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  725. goto ShellCodeError
  726. endif
  727. set Error = $($R0)
  728. goto fatal
  729. fatal = +
  730. ifstr(i) $(Error) == ""
  731. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  732. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  733. goto ShellCodeError
  734. endif
  735. set Error = $($R0)
  736. endif
  737. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  738. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  739. goto ShellCodeError
  740. endif
  741. goto setfailed
  742. ShellCodeError = +
  743. set DlgType = "MessageBox"
  744. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  745. set STF_MB_TEXT = $(ShellCodeErrorText)
  746. set STF_MB_TYPE = 1
  747. set STF_MB_ICON = 3
  748. set STF_MB_DEF = 1
  749. ui start "Error Message"
  750. goto setfailed
  751. setfailed = +
  752. set CommonStatus = STATUS_FAILED
  753. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  754. set OEM_ABANDON_ON = FALSE
  755. goto abandon
  756. endif
  757. goto end
  758. end = +
  759. goto term
  760. term = +
  761. Return $(CommonStatus)
  762. [Install-Option]
  763. set STF_VITAL = ""
  764. ifstr(i) $(AddCopy) == "YES"
  765. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  766. endif
  767. ifstr(i) $(DoCopy) == "YES"
  768. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  769. CopyFilesInCopyList
  770. endif
  771. ifstr(i) $(DoConfig) == "YES"
  772. endif
  773. Exit
  774. [Install-Update]
  775. set STF_VITAL = ""
  776. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  777. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  778. AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  779. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  780. CopyFilesInCopyList
  781. exit