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.

1535 lines
43 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADAM.INF
  4. ;
  5. ; PCNET Family network card and driver SETUP INF file.
  6. ;
  7. ; History:
  8. ;***********************************************************************
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with. The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ; Types specific to networking:
  18. ;
  19. ; NetAdapter, a netcard / adapter combination or just a netcard
  20. ; NetDriver, just a netcard driver
  21. ; NetTransport, a complete NDIS-compliant TDI transport stack
  22. ; NetService, an NT networking service
  23. ; NetWork, a complete network ensemble.
  24. ; NetProvider a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26. [Identification]
  27. OptionType = NetAdapter
  28. ;-----------------------------------------------------------------------
  29. ; PlatformsSupported
  30. ; ------------------
  31. ; This identifies the platforms supported by the adapter card.
  32. ; Possible types are:
  33. ;
  34. ; ISA and EISA
  35. ;-----------------------------------------------------------------------
  36. [PlatformsSupported]
  37. ISA
  38. EISA
  39. PCI
  40. ;-----------------------------------------------------------------------
  41. ; OPTION LIST
  42. ; -----------
  43. ; This section lists the OEM Option key names. These keys are locale
  44. ; independent and used to represent the option in a locale independent
  45. ; manner.
  46. ;
  47. ;-----------------------------------------------------------------------
  48. [Options]
  49. AMDPCI
  50. ;***********************************************************************
  51. ; CONSTANTS FOR USING DIALOGS
  52. ;***********************************************************************
  53. [FileConstants]
  54. GenericInfVersion = " v3.11"
  55. GenericSysName = "amdpcn.sys"
  56. GenericName = "AMDPCN"
  57. ;
  58. ; File names, etc.
  59. ;
  60. UtilityInf = "UTILITY.INF"
  61. ParamInf = "NCPARAM.INF"
  62. subroutineinf = "SUBROUTN.INF"
  63. SoftwareType = "driver"
  64. Exit_Code = 0
  65. ;
  66. ; EventLog Message File
  67. ;
  68. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  69. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  70. ; Product Info
  71. ;
  72. Manufacturer = "Microsoft"
  73. ProductMajorVersion = "4"
  74. ProductMinorVersion = "0"
  75. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  76. ;
  77. ; Software
  78. ;
  79. ProductSoftwareName = "AMDPCN"
  80. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\"$(GenericSysName)
  81. NetRuleSoftwareType = "pcntn3Sys ndisDriver pcntn3Driver"
  82. NetRuleSoftwareUse = $(SoftwareType)
  83. NetRuleSoftwareBindForm = """pcntn3Sys"" yes no container"
  84. NetRuleSoftwareClass = {"pcntn3Driver basic"}
  85. NetRuleSoftwareBindable = {"pcntn3Driver pcntn3Adapter non exclusive 100"}
  86. ;
  87. ; Hardware
  88. ;
  89. ProductHardwareName = "AMDPCN"
  90. NetRuleHardwareType = "pcntn3 pcntn3Adapter"
  91. NetRuleHardwareBindForm = " yes yes container"
  92. NetRuleHardwareClass = {"pcntn3Adapter basic"}
  93. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  94. ;
  95. ; Registry Key
  96. ;
  97. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  98. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  99. [GeneralConstants]
  100. ;
  101. ; Program flow control variables.
  102. ;
  103. from = ""
  104. to = ""
  105. ;
  106. ; Return codes; Exit_Code is set to one of these
  107. ;
  108. ExitCodeOk = 0
  109. ExitCodeCancel = 1
  110. ExitCodeFatal = 2
  111. KeyNull = ""
  112. MAXIMUM_ALLOWED = 33554432
  113. RegistryErrorIndex = NO_ERROR
  114. KeyProduct = ""
  115. KeyParameters = ""
  116. TRUE = 1
  117. FALSE = 0
  118. NoTitle = 0
  119. ExitState = "Active"
  120. OldVersionExisted = $(FALSE)
  121. DriverPath = $(!STF_NTPATH)\drivers
  122. [date]
  123. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  124. ; Minute, Second }
  125. Now = {} ? $(!LIBHANDLE) GetSystemDate
  126. ;---------------------------------------------------------------------------
  127. ; 1. Identify
  128. ;
  129. ; DESCRIPTION: To verify that this INF deals with the same type of options
  130. ; as we are choosing currently.
  131. ;
  132. ; INPUT: None
  133. ;
  134. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  135. ; $($R1): Option Type (COMPUTER ...)
  136. ; $($R2): Diskette description
  137. ;---------------------------------------------------------------------------
  138. [Identify]
  139. ;
  140. ;
  141. read-syms Identification
  142. set Status = STATUS_SUCCESSFUL
  143. set Identifier = $(OptionType)
  144. set Media = #("Source Media Descriptions", 1, 1)
  145. Return $(Status) $(Identifier) $(Media)
  146. ;------------------------------------------------------------------------
  147. ; 2. ReturnOptions:
  148. ;
  149. ; DESCRIPTION: To return the option list supported by this INF and the
  150. ; localised text list representing the options.
  151. ;
  152. ;
  153. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  154. ;
  155. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  156. ; STATUS_NOLANGUAGE
  157. ; STATUS_FAILED
  158. ; STATUS_NOTSUPPORTED
  159. ;
  160. ; $($R1): Option List
  161. ; $($R2): Option Text List
  162. ;------------------------------------------------------------------------
  163. [ReturnOptions]
  164. ;
  165. ;
  166. set Status = STATUS_FAILED
  167. set OptionList = {}
  168. set OptionTextList = {}
  169. ;
  170. ; Check if the language requested is supported
  171. ;
  172. set LanguageList = ^(LanguagesSupported, 1)
  173. Ifcontains(i) $($0) in $(LanguageList)
  174. ;
  175. ; Check if the platforms requested is supported
  176. ;
  177. ifstr(i) $($1) == ""
  178. goto returnoptions
  179. endif
  180. set PlatformList = ^(PlatformsSupported, 1)
  181. Ifcontains(i) $($1) in $(PlatformList)
  182. goto returnoptions
  183. else
  184. set Status = STATUS_NOTSUPPORTED
  185. goto finish_ReturnOptions
  186. endif
  187. else
  188. set Status = STATUS_NOLANGUAGE
  189. goto finish_ReturnOptions
  190. endif
  191. ;
  192. ; form a list of all the options and another of the text representing
  193. ;
  194. returnoptions = +
  195. set OptionList = ^(Options, 1)
  196. set OptionTextList = ^(OptionsText$($0), 1)
  197. set Status = STATUS_SUCCESSFUL
  198. finish_ReturnOptions = +
  199. Return $(Status) $(OptionList) $(OptionTextList)
  200. ;------------------------------------------------------------------------
  201. ;
  202. ; InstallOption:
  203. ;
  204. ; This section is shelled to by main installation processing
  205. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  206. ;
  207. ;
  208. ; FUNCTION: To copy files representing Options
  209. ; To configure the installed option
  210. ; To update the registry for the installed option
  211. ;
  212. ; INPUT: $($0): Language to use
  213. ; $($1): OptionID to install
  214. ; $($2): SourceDirectory
  215. ; $($3): AddCopy (YES | NO)
  216. ; $($4): DoCopy (YES | NO)
  217. ; $($5): DoConfig (YES | NO)
  218. ;
  219. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  220. ; STATUS_NOLANGUAGE |
  221. ; STATUS_USERCANCEL |
  222. ; STATUS_FAILED
  223. ;
  224. ;------------------------------------------------------------------------
  225. [InstallOption]
  226. ;
  227. ; Set default values for
  228. ;
  229. set Status = STATUS_FAILED
  230. ;
  231. ; extract parameters
  232. ;
  233. set Option = $($1)
  234. set SrcDir = $($2)
  235. set AddCopy = $($3)
  236. set DoCopy = $($4)
  237. set DoConfig = $($5)
  238. ;
  239. ; Check if the language requested is supported
  240. ;
  241. set LanguageList = ^(LanguagesSupported, 1)
  242. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  243. Return STATUS_NOLANGUAGE
  244. endif
  245. set-subst LF = "\n"
  246. read-syms GeneralConstants
  247. read-syms FileConstants
  248. read-syms FileConstants$(!STF_LANGUAGE)
  249. read-syms DialogConstants$(!STF_LANGUAGE)
  250. ifstr(i) $(!NTN_Origination) == "NCPA"
  251. set Continue = $(OK)
  252. endif
  253. detect date
  254. set-title $(FunctionTitle)
  255. set to = Begin
  256. set from = Begin
  257. ;
  258. ; Assume all is well.
  259. ;
  260. set CommonStatus = STATUS_SUCCESSFUL
  261. EndWait
  262. ;
  263. ; Set up the operation-mode-based variables and gaily welcome
  264. ; the user. If the "install mode" variable is improperly set,
  265. ; assume this is a new installation.
  266. ;
  267. Begin = +
  268. Set ActivateDetection = FALSE
  269. Ifstr(i) $(!NTN_InstallMode) == deinstall
  270. set StartLabel = removeadapter
  271. else-Ifstr(i) $(!NTN_InstallMode) == Update
  272. set StartLabel = UpgradeSoftware
  273. else-Ifstr(i) $(!NTN_InstallMode) == bind
  274. set StartLabel = bindingadapter
  275. else-Ifstr(i) $(!NTN_InstallMode) == configure
  276. ; set ActivateDetection = TRUE
  277. set StartLabel = configureadapter
  278. ;
  279. ; You cannot config the software component
  280. ;
  281. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  282. Debug-Output "Cannot configure the PCNet family driver software."
  283. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  284. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  285. Debug-Output "ShellCode error: cannot get an error string."
  286. goto ShellCodeError
  287. endif
  288. set Error = $($R0)
  289. set from = end
  290. set to = end
  291. goto nonfatalinfo
  292. endif
  293. else
  294. ; set ActivateDetection = TRUE
  295. set StartLabel = installadapter
  296. set OEM_ABANDON_OPTIONS = {}
  297. set OEM_ABANDON_SOFTWARE = FALSE
  298. set OEM_ABANDON_ON = TRUE
  299. endif
  300. ; set the default values
  301. ; IRQ Level = 3
  302. ; IRQ Level = Auto_Scan
  303. set IRQValue = *($(IRQList), 9)
  304. ; IOBase Address = 0x300
  305. ; IOBase Address = Auto_Scan
  306. set IOBaseAddrValue = *($(IOBaseAddrList), 17)
  307. ; DMAChannel = 5
  308. ; DMAChannel = Auto_Scan
  309. set DMAChannelValue = *($(DMAChannelList), 5)
  310. set RadioIn = {4}
  311. set BusScanValue = "ALL"
  312. set LED0Value = *($(LEDList), 1)
  313. set LED1Value = *($(LEDList), 1)
  314. set LED2Value = *($(LEDList), 1)
  315. set LED3Value = *($(LEDList), 1)
  316. set TPValue = 1
  317. set FullDuplexValue = *($(FullDuplexList), 4)
  318. set BusTimerValue = *($(BusTimerList), 10)
  319. Set from = $(fatal)
  320. Set to = $(fatal)
  321. Goto $(StartLabel)
  322. ;-----------------------------------------------
  323. ; Installation Section
  324. ;-----------------------------------------------
  325. installadapter = +
  326. set IsISA = 0
  327. set Vendor = 4130
  328. set CardID = 8192
  329. Shell $(UtilityInf), GetPCIInformation, $(Vendor) $(CardID)
  330. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  331. goto ShellCodeError
  332. endif
  333. set AdapterList = $($R0)
  334. set NewAdapterList = {}
  335. set NumNew = 0
  336. ForListDo $(AdapterList)
  337. ; make sure that all the adapters are new
  338. set BusNumber = *($($),1)
  339. set SlotNum = *($($),2)
  340. Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNumber), +
  341. $(SlotNum), $(GenericPCIAdapterName), $(ProductHardwareName)
  342. ifstr(i) $($R1) != "YES"
  343. set-add NumNew = $(NumNew),1
  344. ifstr(i) $(NewAdapterList) == {}
  345. set NewAdapterList = {$($)}
  346. else
  347. set NewAdapterList = >($(NewAdapterList),$($))
  348. endif
  349. endif
  350. EndForListDo
  351. set AdapterList = $(NewAdapterList)
  352. ifint $(NumNew) == 0
  353. set AdapterList = {{0,0,0}}
  354. set IsISA = 1
  355. endif
  356. debug-output $(AdapterList)
  357. ;
  358. ; First, check whether the same version of the software exists
  359. ;
  360. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  361. Ifstr $(KeyProduct) != $(KeyNull)
  362. ;
  363. ; Same version already existed in the local machine
  364. ; Popup the dialog and ask the user whether he wants to continue
  365. ;
  366. CloseRegKey $(KeyProduct)
  367. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  368. ;
  369. ; Cannot Install the same software again
  370. ;
  371. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  372. $(ProductVersion)
  373. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  374. Debug-Output "ShellCode error: cannot get an error string."
  375. goto ShellCodeError
  376. endif
  377. goto end
  378. else
  379. ;
  380. ; Add a new adapter card?
  381. ;
  382. Shell $(UtilityInf), CardExistedDlg
  383. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  384. Debug-Output "ShellCode error: cannot get an error string."
  385. goto ShellCodeError
  386. endif
  387. ifstr(i) $($R1) != "OK"
  388. goto end
  389. endif
  390. set OldVersionExisted = $(TRUE)
  391. endif
  392. endif
  393. ; If we're installing a second time, don't re-copy the help file
  394. ; !!!
  395. ifint $(OldVersionExisted) == $(FALSE)
  396. ifstr(i) $(!NTN_InstallMode) == "install"
  397. Ifstr(i) $(DoCopy) == "YES"
  398. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  399. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  400. Goto ShellCodeError
  401. Else-Ifstr(i) $($R0) == STATUS_FAILED
  402. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  403. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  404. goto ShellCodeError
  405. endif
  406. set Error = $($R0)
  407. Goto fatal
  408. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  409. Goto successful
  410. Endif
  411. Set SrcDir = $($R1)
  412. endif
  413. install "Install-Helpfile"
  414. endif
  415. endif
  416. SetHelpFile "pcnet.hlp" 1 11
  417. ;
  418. ; dll load addition
  419. ;
  420. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  421. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  422. Goto ShellCodeError
  423. Else-Ifstr(i) $($R0) == STATUS_FAILED
  424. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  425. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  426. goto ShellCodeError
  427. endif
  428. set Error = $($R0)
  429. Goto fatal
  430. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  431. Goto successful
  432. Endif
  433. Set SrcDir = $($R1)
  434. install "Install-Dll"
  435. goto adaptersetup
  436. ;-----------------------------------------------
  437. ; Configuration Section
  438. ;-----------------------------------------------
  439. ;
  440. ; Get the current values of all the parameters
  441. ;
  442. configureadapter = +
  443. SetHelpFile "pcnet.hlp" 1 11
  444. Ifstr $(KeyProduct) == $(KeyNull)
  445. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  446. Ifstr $(KeyProduct) == $(KeyNull)
  447. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  448. Debug-Output "Cannot find component product key"
  449. goto fatalregistry
  450. Endif
  451. Endif
  452. ;
  453. ; Get the other parameters; they're attached to the service parameters key
  454. ;
  455. Debug-Output "INF: Shelling to FindService"
  456. Shell $(UtilityInf) FindService, $(KeyProduct)
  457. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  458. Debug-Output "INF: FindService shell failure"
  459. Goto ShellCodeError
  460. Endif
  461. Ifstr(i) $($R0) != NO_ERROR
  462. Debug-Output "INF: FindService Shell error: "$($R0)
  463. Goto fatalregistry
  464. endif
  465. Set KeyParameters = $($R2)
  466. ;
  467. ; We don't need the services key, so close it.
  468. ;
  469. CloseRegKey $($R1)
  470. Ifstr $(KeyParameters) == $(KeyNull)
  471. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  472. Debug-Output "Cannot find component service"
  473. goto fatalregistry
  474. endif
  475. set OldVersionExisted = $(TRUE)
  476. set ValueName = ""
  477. set ValueData = ""
  478. set ValueStr = ""
  479. set ValueList = {}
  480. ;
  481. ; Get the old values
  482. ;
  483. EnumRegValue $(KeyParameters) ValueList
  484. ForListDo $(ValueList)
  485. set ValueItem = $($)
  486. set ValueName = *($(ValueItem),1)
  487. set ValueData = *($(ValueItem),4)
  488. ifstr(i) $(ValueName) == "BUS_TO_SCAN"
  489. set BusScanValue = $(ValueData)
  490. else-ifstr(i) $(ValueName) == "TP"
  491. set TPValue = $(ValueData)
  492. else-ifstr(i) $(ValueName) == "LED0"
  493. set LED0Value = $(ValueData)
  494. else-ifstr(i) $(ValueName) == "LED1"
  495. set LED1Value = $(ValueData)
  496. else-ifstr(i) $(ValueName) == "LED2"
  497. set LED2Value = $(ValueData)
  498. else-ifstr(i) $(ValueName) == "LED3"
  499. set LED3Value = $(ValueData)
  500. else-ifstr(i) $(ValueName) == "IOBaseAddress"
  501. set IOBaseAddrValue = $(ValueData)
  502. else-ifstr(i) $(ValueName) == "InterruptNumber"
  503. set IRQValue = $(ValueData)
  504. else-ifstr(i) $(ValueName) == "DMAChannel"
  505. set DMAChannelValue = $(ValueData)
  506. else-ifstr(i) $(ValueName) == "FDUP"
  507. set FullDuplexValue = $(ValueData)
  508. else-ifstr(i) $(ValueName) == "BUSTIMER"
  509. set BusTimerValue = $(ValueData)
  510. else-ifstr(i) $(ValueName) == "BusType"
  511. set BusInterfaceType = $(ValueData)
  512. ifint $(BusInterfaceType) == 5
  513. set IsISA = 0
  514. else
  515. set IsISA = 1
  516. endif
  517. else-ifstr(i) $(ValueName) == "BusNumber"
  518. set BusNumber = $(ValueData)
  519. endif
  520. EndForListDo
  521. Ifint $(TPValue) == 0
  522. Set CheckItemsIn = {"OFF"}
  523. Else
  524. Set CheckItemsIn = {"ON"}
  525. Endif
  526. ; set the Radio Buttons depending on the bustype in the reg.
  527. Ifstr $(BusScanValue) == "PNP"
  528. Set RadioIn = {1}
  529. Else-Ifstr $(BusScanValue) == "VESA"
  530. Set RadioIn = {2}
  531. Else-Ifstr $(BusScanValue) == "ISA"
  532. Set RadioIn = {3}
  533. Else-Ifstr $(BusScanValue) == "ALL"
  534. Set RadioIn = {4}
  535. Else-Ifstr $(BusScanValue) == ""
  536. Set RadioIn = {4}
  537. Endif
  538. Debug-Output $(InfName)" TP is "$(TPValue)
  539. ;;;;;;;;; Not needed for PCI Adapters!!
  540. ifint $(IsISA) == 1
  541. ; Isa
  542. set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValue)))
  543. ifstr(i) $(IRQValue) == ""
  544. set IRQValue = *($(IRQList), 2)
  545. endif
  546. Debug-Output $(InfName)" IRQ_Level is "$(IRQValue)
  547. set DMAChannelValue = *($(DMAChannelList), ~($(DMAChannelValues),$(DMAChannelValue)))
  548. ifstr(i) $(DMAChannelValue) == ""
  549. set DMAChannelValue = *($(DMAChannelList), 2)
  550. endif
  551. Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  552. set IOBaseAddrValue = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrValue)))
  553. ifstr(i) $(IOBaseAddrValue) == ""
  554. set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  555. endif
  556. Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  557. endif
  558. ;;;;;;;;; End of Change!!
  559. set LED0Value = *($(LEDList), ~($(LEDValues),$(LED0Value)))
  560. ifstr(i) $(LED0Value) == ""
  561. set LED0Value = *($(LEDList), 1)
  562. endif
  563. Debug-Output $(InfName)" LED0 is "$(LED0Value)
  564. set LED1Value = *($(LEDList), ~($(LEDValues),$(LED1Value)))
  565. ifstr(i) $(LED1Value) == ""
  566. set LED1Value = *($(LEDList), 1)
  567. endif
  568. Debug-Output $(InfName)" LED1 is "$(LED1Value)
  569. set LED2Value = *($(LEDList), ~($(LEDValues),$(LED2Value)))
  570. ifstr(i) $(LED2Value) == ""
  571. set LED2Value = *($(LEDList), 1)
  572. endif
  573. Debug-Output $(InfName)" LED2 is "$(LED0Value)
  574. set LED3Value = *($(LEDList), ~($(LEDValues),$(LED3Value)))
  575. ifstr(i) $(LED3Value) == ""
  576. set LED3Value = *($(LEDList), 1)
  577. endif
  578. Debug-Output $(InfName)" LED3 is "$(LED3Value)
  579. set FullDuplexValue = *($(FullDuplexList), ~($(FullDuplexValues),$(FullDuplexValue)))
  580. ifstr(i) $(FullDuplexValue) == ""
  581. set FullDuplexValue = *($(FullDuplexList), 1)
  582. endif
  583. Debug-Output $(InfName)" Full Duplex is "$(FullDuplexValue)
  584. set BusTimerValue = *($(BusTimerList), ~($(BusTimerValues),$(BusTimerValue)))
  585. ifstr(i) $(BusTimerValue) == ""
  586. set BusTimerValue = *($(BusTimerList), 1)
  587. endif
  588. Debug-Output $(InfName)" Bus Timer is "$(BusTimerValue)
  589. ; Shell $(ParamInf) Param_SaveValues
  590. ; Set CurrParamSettings = $($R0)
  591. ;
  592. ; Put up the adapter configuration dialog if necessary.
  593. ;
  594. ; Note that $(CurrParamSettings) has the old known parameter values.
  595. ;
  596. adaptersetup = +
  597. ; Shell "" DebugConfiguration "before displaying dialog"
  598. Set from = adapteroptions
  599. adapteroptions = +
  600. LoadLibrary "x" $(!STF_CWDDIR)\$(DialogDllName) hLib
  601. ifint $(IsISA) == 0
  602. ; pci
  603. read-syms FileDependentDlgPCI$(!STF_LANGUAGE)
  604. Debug-Output $(InfName)" TP is "$(TPValue)
  605. Debug-Output $(InfName)" LED0 is "$(LED0Value)
  606. Debug-Output $(InfName)" LED1 is "$(LED1Value)
  607. Debug-Output $(InfName)" LED2 is "$(LED2Value)
  608. Debug-Output $(InfName)" LED3 is "$(LED3Value)
  609. Debug-Output $(InfName)" Full Duplex is "$(FullDuplexValue)
  610. Debug-Output $(InfName)" Bus Timer is "$(BusTimerValue)
  611. ui start "Inputdlg" $(hLib)
  612. else
  613. ; isa
  614. debug-output "read the isa dialog"
  615. read-syms FileDependentDlg$(!STF_LANGUAGE)
  616. Debug-Output $(InfName)" Bus is "$(BusScanValue)
  617. Debug-Output $(InfName)" TP is "$(TPValue)
  618. Debug-Output $(InfName)" LED0 is "$(LED0Value)
  619. Debug-Output $(InfName)" LED1 is "$(LED1Value)
  620. Debug-Output $(InfName)" LED2 is "$(LED2Value)
  621. Debug-Output $(InfName)" LED3 is "$(LED3Value)
  622. Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  623. Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  624. Debug-Output $(InfName)" Full Duplex is "$(FullDuplexValue)
  625. Debug-Output $(InfName)" Bus Timer is "$(BusTimerValue)
  626. ui start "InputDlg" $(hLib)
  627. endif
  628. set ExitButton = $(ButtonPressed)
  629. Debug-Output " ButtonPressed "$(ButtonPressed)
  630. debug-output $(DLGEVENT)
  631. FreeLibrary $(hLib)
  632. ifstr(i) $(DLGEVENT) == "CONTINUE"
  633. ifint $(IsISA) == 1
  634. set IOBaseAddrValue = $(Combo1Out)
  635. set IRQValueValue = $(Combo2Out)
  636. set DMAChannelValue = $(Combo3Out)
  637. set FullDuplexValue = $(Combo4Out)
  638. set BusTimerValue = $(Combo5Out)
  639. set ExitButton = $(ButtonPressed)
  640. set BusIndex = *($(RadioOut),1)
  641. else
  642. set FullDuplexValue = $(Combo1Out)
  643. set BusTimerValue = $(Combo2Out)
  644. set ExitButton = $(ButtonPressed)
  645. set BusIndex = *($(RadioOut),1)
  646. endif
  647. Ifint $(BusIndex) == 1
  648. Set BusScanValue = "PNP"
  649. else-Ifint $(BusIndex) == 2
  650. Set BusScanValue = "VESA"
  651. else-Ifint $(BusIndex) == 3
  652. Set BusScanValue = "ISA"
  653. else-Ifint $(BusIndex) == 4
  654. Set BusScanValue = "ALL"
  655. Endif
  656. Set Chk = *($(CheckItemsOut), 1)
  657. Ifstr(i) $(Chk) == "ON"
  658. Set TPValue = 1
  659. Else
  660. Set TPValue = 0
  661. Endif
  662. ui pop 1
  663. ; goto nextstep
  664. else-ifstr(i) $(DLGEVENT) == "EXIT"
  665. set CommonStatus = STATUS_USERCANCEL
  666. Debug-Output "Action: exit. Bye."
  667. ui pop 1
  668. goto end
  669. else
  670. ;
  671. ; Unknow command
  672. ;
  673. ui pop 1
  674. Debug-Output "Action: unknown. Bye."
  675. goto end
  676. endif
  677. Debug-Output " Combo list out "$(ComboListItemsOut)
  678. ;
  679. ; If installing, go create the necessary keys;
  680. ; if configuring, they're already open.
  681. ;
  682. skipoptions =+
  683. ifint $(OldVersionExisted) == $(TRUE)
  684. ifstr(i) $(!NTN_InstallMode) == configure
  685. Shell $(UtilityInf), GetBusTypeNum
  686. set BusTypeNum = $($R1)
  687. set BusNumberValue = 0
  688. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  689. Debug-Output "ShellCode error."
  690. goto ShellCodeError
  691. endif
  692. debug-output "before write registry"
  693. set DMAChannelValue = *($(DMAChannelValues), ~($(DMAChannelList),$(DMAChannelValue)))
  694. set IRQValue = *($(IRQValues), ~($(IRQList),$(IRQValueValue)))
  695. set IOBaseAddrValue = *($(IOBaseAddrValues), ~($(IOBaseAddrList),$(IOBaseAddrValue)))
  696. set LED0Value = *($(LEDValues), ~($(LEDList),$(LED0Value)))
  697. set LED1Value = *($(LEDValues), ~($(LEDList),$(LED1Value)))
  698. set LED2Value = *($(LEDValues), ~($(LEDList),$(LED2Value)))
  699. set LED3Value = *($(LEDValues), ~($(LEDList),$(LED3Value)))
  700. set FullDuplexValue = *($(FullDuplexValues), ~($(FullDuplexList),$(FullDuplexValue)))
  701. set BusTimerValue = *($(BusTimerValues), ~($(BusTimerList),$(BusTimerValue)))
  702. ; Ifint $(TPValue) != 0
  703. ifint $(IsISA) == 0
  704. ; PCI version
  705. set NewValueList = {{FDUP, $(NoTitle),$(!REG_VT_DWORD),$(FullDuplexValue)},+
  706. {BUSTIMER, $(NoTitle),$(!REG_VT_DWORD),$(BusTimerValue)},+
  707. {TP, $(NoTitle),$(!REG_VT_DWORD),$(TPValue)}}
  708. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  709. else
  710. ; ISA version
  711. set NewValueList = {{BUS_TO_SCAN,$(NoTitle),$(!REG_VT_SZ),$(BusScanValue)},+
  712. {FDUP, $(NoTitle),$(!REG_VT_DWORD),$(FullDuplexValue)},+
  713. {BUSTIMER, $(NoTitle),$(!REG_VT_DWORD),$(BusTimerValue)},+
  714. {TP, $(NoTitle),$(!REG_VT_DWORD),$(TPValue)},+
  715. {IOBaseAddress, $(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  716. {InterruptNumber, $(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  717. {DMAChannel, $(NoTitle),$(!REG_VT_DWORD),$(DMAChannelValue)}}
  718. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  719. endif
  720. CloseRegKey $(KeyParameters)
  721. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  722. Debug-Output "ShellCode error."
  723. goto ShellCodeError
  724. endif
  725. set RegistryErrorIndex = $($R0)
  726. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  727. Debug-Output "Registry error: Add value list"
  728. goto fatalregistry
  729. endif
  730. EndWait
  731. goto successful
  732. endif
  733. endif
  734. StartWait
  735. ;
  736. ; Add Software Component
  737. ;
  738. ifint $(OldVersionExisted) == $(FALSE)
  739. ifstr(i) $(!NTN_InstallMode) == "install"
  740. Ifstr(i) $(DoCopy) == "YES"
  741. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  742. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  743. Goto ShellCodeError
  744. Else-Ifstr(i) $($R0) == STATUS_FAILED
  745. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  746. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  747. goto ShellCodeError
  748. endif
  749. set Error = $($R0)
  750. Goto fatal
  751. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  752. Goto successful
  753. Endif
  754. Set SrcDir = $($R1)
  755. Endif
  756. install "Install-Option"
  757. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  758. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  759. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  760. goto ShellCodeError
  761. endif
  762. set Error = $($R0)
  763. goto fatal
  764. endif
  765. endif
  766. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  767. $(ProductSoftwareName), +
  768. $(ProductSoftwareName), +
  769. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  770. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  771. $(NetEventDLL)
  772. Set OEM_ABANDON_SOFTWARE = TRUE
  773. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  774. Debug-Output "ShellCode error"
  775. goto ShellCodeError
  776. endif
  777. ;
  778. ; At this point:
  779. ; $R1 contains the product version key handle;
  780. ; $R2 contains the NetRules subkey handle;
  781. ; $R3 contains the new Services key handle; and
  782. ; $R4 contains the Parameters key
  783. ; $R5 contains the Linkage Key
  784. ;
  785. set RegistryErrorIndex = $($R0)
  786. set KeyProduct = $($R1)
  787. Set SoftNetRulesKey = $($R2)
  788. CloseRegKey $($R3)
  789. CloseRegKey $($R4)
  790. CloseRegKey $($R5)
  791. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  792. EndWait
  793. Debug-Output "Registry error: add software components"
  794. CloseRegKey $(KeyProduct)
  795. CloseRegKey $(SoftNetRulesKey)
  796. goto fatalregistry
  797. endif
  798. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  799. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  800. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  801. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  802. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  803. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  804. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  805. Shell $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  806. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  807. Debug-Output "ShellCode error."
  808. goto ShellCodeError
  809. endif
  810. set RegistryErrorIndex = $($R0)
  811. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  812. EndWait
  813. Debug-Output "Registry error: add value list."
  814. CloseRegKey $(KeyProduct)
  815. CloseRegKey $(SoftNetRulesKey)
  816. goto fatalregistry
  817. endif
  818. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  819. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  820. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  821. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  822. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  823. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  824. Shell $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  825. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  826. Debug-Output "ShellCode error."
  827. goto ShellCodeError
  828. endif
  829. set RegistryErrorIndex = $($R0)
  830. CloseRegKey $(KeyProduct)
  831. CloseRegKey $(SoftNetRulesKey)
  832. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  833. EndWait
  834. Debug-Output "Resgitry error: add value list."
  835. goto fatalregistry
  836. endif
  837. endif
  838. debug-output $(AdapterList)
  839. ForListDo $(AdapterList)
  840. set BusNumber = *($($),1)
  841. set DeviceNum = *($($),2)
  842. set FunctionNum = *($($),3)
  843. ;
  844. ; Create the HARDWARE\Netcard region and its corresponding service
  845. ;
  846. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  847. ifint $($R4) != -1
  848. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  849. endif
  850. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  851. Debug-Output "Cannot add hardware component"
  852. goto ShellCodeError
  853. endif
  854. set RegistryErrorIndex = $($R0)
  855. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  856. EndWait
  857. Debug-Output "Registry error: add hardware component"
  858. CloseRegKey $($R1)
  859. CloseRegKey $($R2)
  860. CloseRegKey $($R3)
  861. goto fatalregistry
  862. endif
  863. ;
  864. ; At this point:
  865. ; $R1 Registry key variable for HARDWARE\Netcard\(n)
  866. ; $R2 Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  867. ; $R3 Registry key handle for <service>\Parameters key
  868. ; $R4 Adapter number assigned to adapter
  869. ; $R5 Service name generated by combining svc name with adapter number
  870. ;
  871. set KeyParameters = $($R3)
  872. set KeyAdapterRules = $($R2)
  873. set AdapterNumber = $($R4)
  874. ifint $(IsISA) == 1
  875. set HardwareDescription = $(GenericAdapterName)
  876. set HardwareTitle = $(GenericAdapterName)
  877. else
  878. set HardwareDescription = $(GenericPCIAdapterName)
  879. set HardwareTitle = $(GenericPCIAdapterName)
  880. endif
  881. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  882. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(HardwareTitle)},+
  883. {Description,$(NoTitle),$(!REG_VT_SZ),$(HardwareDescription)},+
  884. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  885. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  886. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  887. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  888. Shell $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  889. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  890. Debug-Output "ShellCode error"
  891. goto ShellCodeError
  892. endif
  893. CloseRegKey $($R1)
  894. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  895. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  896. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  897. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  898. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  899. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  900. Shell $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  901. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  902. Debug-Output "ShellCode error."
  903. goto ShellCodeError
  904. endif
  905. set RegistryErrorIndex = $($R0)
  906. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  907. EndWait
  908. Debug-Output "Resgitry error: add value list."
  909. CloseRegKey $(KeyParameters)
  910. CloseRegKey $(KeyAdapterRules)
  911. goto fatalregistry
  912. endif
  913. CloseRegKey $(KeyAdapterRules)
  914. goto writeparameters
  915. ;
  916. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  917. ;
  918. writeparameters = +
  919. Shell $(UtilityInf), GetBusTypeNum
  920. set BusTypeNum = $($R1)
  921. set BusNumberValue = 0
  922. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  923. Debug-Output "ShellCode error."
  924. goto ShellCodeError
  925. endif
  926. debug-output "before write registry"
  927. set DMAChannelValue = *($(DMAChannelValues), ~($(DMAChannelList),$(DMAChannelValue)))
  928. set IRQValue = *($(IRQValues), ~($(IRQList),$(IRQValueValue)))
  929. set IOBaseAddrValue = *($(IOBaseAddrValues), ~($(IOBaseAddrList),$(IOBaseAddrValue)))
  930. set LED0Value = *($(LEDValues), ~($(LEDList),$(LED0Value)))
  931. set LED1Value = *($(LEDValues), ~($(LEDList),$(LED1Value)))
  932. set LED2Value = *($(LEDValues), ~($(LEDList),$(LED2Value)))
  933. set LED3Value = *($(LEDValues), ~($(LEDList),$(LED3Value)))
  934. set FullDuplexValue = *($(FullDuplexValues), ~($(FullDuplexList),$(FullDuplexValue)))
  935. set BusTimerValue = *($(BusTimerValues), ~($(BusTimerList),$(BusTimerValue)))
  936. ; Ifint $(TPValue) != 0
  937. ifint $(IsISA) == 0
  938. ; PCI version
  939. set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),5},+
  940. {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  941. {LED0, $(NoTitle),$(!REG_VT_DWORD),$(LED0Value)},+
  942. {LED1, $(NoTitle),$(!REG_VT_DWORD),$(LED1Value)},+
  943. {LED2, $(NoTitle),$(!REG_VT_DWORD),$(LED2Value)},+
  944. {LED3, $(NoTitle),$(!REG_VT_DWORD),$(LED3Value)},+
  945. {FDUP, $(NoTitle),$(!REG_VT_DWORD),$(FullDuplexValue)},+
  946. {BUSTIMER, $(NoTitle),$(!REG_VT_DWORD),$(BusTimerValue)},+
  947. {TP, $(NoTitle),$(!REG_VT_DWORD),$(TPValue)},+
  948. {AdapterCFID,$(NoTitle),$(!REG_VT_DWORD),536875042},+
  949. {SlotNumber, $(NoTitle),$(!REG_VT_DWORD),$(DeviceNum)},+
  950. {BusNumber, $(NoTitle),$(!REG_VT_DWORD),$(BusNumber)}}
  951. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  952. else
  953. ; ISA version
  954. set NewValueList = {{BUS_TO_SCAN,$(NoTitle),$(!REG_VT_SZ),$(BusScanValue)},+
  955. {BusType,$(NoTitle),$(!REG_VT_DWORD),1},+
  956. {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  957. {LED0, $(NoTitle),$(!REG_VT_DWORD),$(LED0Value)},+
  958. {LED1, $(NoTitle),$(!REG_VT_DWORD),$(LED1Value)},+
  959. {LED2, $(NoTitle),$(!REG_VT_DWORD),$(LED2Value)},+
  960. {LED3, $(NoTitle),$(!REG_VT_DWORD),$(LED3Value)},+
  961. {FDUP, $(NoTitle),$(!REG_VT_DWORD),$(FullDuplexValue)},+
  962. {BUSTIMER, $(NoTitle),$(!REG_VT_DWORD),$(BusTimerValue)},+
  963. {TP, $(NoTitle),$(!REG_VT_DWORD),$(TPValue)},+
  964. {IOBaseAddress, $(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  965. {InterruptNumber, $(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  966. {DMAChannel, $(NoTitle),$(!REG_VT_DWORD),$(DMAChannelValue)},+
  967. {BusNumber, $(NoTitle),$(!REG_VT_DWORD),$(BusNumber)}}
  968. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  969. endif
  970. CloseRegKey $(KeyParameters)
  971. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  972. Debug-Output "ShellCode error."
  973. goto ShellCodeError
  974. endif
  975. set RegistryErrorIndex = $($R0)
  976. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  977. Debug-Output "Registry error: Add value list"
  978. goto fatalregistry
  979. endif
  980. EndForListDo
  981. EndWait
  982. goto successful
  983. ;-----------------------------------------------
  984. ; Binding section
  985. ;-----------------------------------------------
  986. bindingadapter =+
  987. set Error = "Binding: Sorry, not yet implemented."
  988. goto fatal
  989. ;-----------------------------------------------
  990. ; Removeadapter section
  991. ;-----------------------------------------------
  992. removeadapter = +
  993. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  994. ; Remove Software Component
  995. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  996. $(ProductSoftwareName)
  997. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  998. Debug-Output "ShellCode error"
  999. goto ShellCodeError
  1000. endif
  1001. set RegistryErrorIndex = $($R0)
  1002. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1003. goto fatalregistry
  1004. endif
  1005. else
  1006. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1007. $(ProductSoftwareName), $(!NTN_RegBase)
  1008. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1009. Debug-Output "ShellCode error"
  1010. goto ShellCodeError
  1011. endif
  1012. set RegistryErrorIndex = $($R0)
  1013. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1014. goto fatalregistry
  1015. endif
  1016. endif
  1017. goto end
  1018. ;-----------------------------------------------
  1019. ; Upgrade Software section
  1020. ;-----------------------------------------------
  1021. UpgradeSoftware = +
  1022. LoadLibrary "x" $(!STF_CWDDIR)\ncpa.cpl NCPA_HANDLE
  1023. ;set !NTN_ScUseRegistry = "YES"
  1024. OpenRegKey $(!REG_H_LOCAL) "" "Software\Microsoft\PCNTN3" $(MAXIMUM_ALLOWED) KeyProduct
  1025. Ifstr $(KeyProduct) != $(KeyNull)
  1026. ;
  1027. ; remove the old one
  1028. ;
  1029. ; First remove software
  1030. DeleteRegTree $(KeyProduct) ""
  1031. ;
  1032. ; remove the driver
  1033. ;
  1034. LibraryProcedure NCPA_RESULT $(NCPA_HANDLE), CPlSetup $(!STF_HWND), DELETESVC, "PCNTN3"
  1035. ;
  1036. ; Remove network card
  1037. ;
  1038. set NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  1039. OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) IE_KeyNetcards
  1040. ifstr(i) $(IE_KeyNetcards) != ""
  1041. EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  1042. ForListDo $(IE_KeyNameList)
  1043. OpenRegKey $(IE_KeyNetcards) "" *($($),1) +
  1044. $(MAXIMUM_ALLOWED) NetworkCardKey
  1045. Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1046. GetRegValue $(NetworkCardKey),"ProductName", ProductNameInfo
  1047. set ProductName = *($(ProductNameInfo), 4)
  1048. Debug-Output " ProductName = "$(ProductName)
  1049. ifstr(i) $(ProductName) != "PCNTN3"
  1050. goto nextnetcard
  1051. endif
  1052. GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1053. set ServiceName = *($(ServiceNameInfo), 4)
  1054. Debug-Output " ServiceName = "$(ServiceName)
  1055. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\"$(ServiceName) +
  1056. $(MAXIMUM_ALLOWED) ServiceKey
  1057. DeleteRegTree $(ServiceKey) ""
  1058. DeleteRegTree $(NetworkCardKey) ""
  1059. endif
  1060. nextnetcard = +
  1061. EndForListDo
  1062. endif
  1063. ;
  1064. ; make sure amdpci does not exit
  1065. ;
  1066. OpenRegKey $(!REG_H_LOCAL) "" "Software\Microsoft\AMDPCI" $(MAXIMUM_ALLOWED) KeyProduct2
  1067. ifstr $(KeyProduct2) == $(KeyNull)
  1068. LibraryProcedure NCPA_RESULT $(NCPA_HANDLE), CPlSetup $(!STF_HWND), STARTSVC, NetDetect
  1069. set !NTN_InstallMode = Install
  1070. Shell "" InstallOption $(!STF_LANGUAGE) "AMDPCI" $(SrcDir) "YES" "YES" "NO"
  1071. set !NTN_InstallMode = Update
  1072. else
  1073. ;
  1074. ; something wrong
  1075. ;
  1076. endif
  1077. else
  1078. endif
  1079. FreeLibrary $(NCPA_HANDLE)
  1080. goto end
  1081. ;
  1082. ; End of Upgrade Software
  1083. ;
  1084. ;
  1085. ; Escape hatches
  1086. ;
  1087. successful = +
  1088. goto end
  1089. abandon = +
  1090. ForListDo $(OEM_ABANDON_OPTIONS)
  1091. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1092. $(ProductSoftwareName), $($)
  1093. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1094. Debug-Output "ShellCode error"
  1095. goto ShellCodeError
  1096. endif
  1097. set RegistryErrorIndex = $($R0)
  1098. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1099. goto fatalregistry
  1100. endif
  1101. EndForListDo
  1102. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1103. ; Remove Software Component
  1104. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1105. $(ProductSoftwareName), FALSE
  1106. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1107. Debug-Output "ShellCode error"
  1108. goto ShellCodeError
  1109. endif
  1110. set RegistryErrorIndex = $($R0)
  1111. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1112. goto fatalregistry
  1113. endif
  1114. endif
  1115. goto end
  1116. ;
  1117. ; warning display
  1118. ;
  1119. warning = +
  1120. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1121. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1122. goto ShellCodeError
  1123. endif
  1124. ifstr(i) $($R1) == "OK"
  1125. goto $(to)
  1126. else-ifstr(i) $($R1) == "CANCEL"
  1127. goto $(from)
  1128. else
  1129. goto "end"
  1130. endif
  1131. ;
  1132. ; non fatal error display
  1133. ;
  1134. nonfatalinfo = +
  1135. Set Severity = STATUS
  1136. Set CommonStatus = STATUS_USERCANCEL
  1137. goto nonfatalmsg
  1138. nonfatal = +
  1139. Set Severity = NONFATAL
  1140. goto nonfatalmsg
  1141. nonfatalmsg = +
  1142. ifstr(i) $(Error) == ""
  1143. Set Severity = NONFATAL
  1144. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1145. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1146. goto ShellCodeError
  1147. endif
  1148. set Error = $($R0)
  1149. endif
  1150. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1151. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1152. goto ShellCodeError
  1153. endif
  1154. ifstr(i) $($R1) == "OK"
  1155. goto $(from)
  1156. else
  1157. goto "end"
  1158. endif
  1159. ;
  1160. ; Registry is broken
  1161. ;
  1162. fatalregistry = +
  1163. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1164. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1165. goto ShellCodeError
  1166. endif
  1167. set Error = $($R0)
  1168. goto fatal
  1169. ;
  1170. ; Netcard detection failure
  1171. ;
  1172. fataldetect = +
  1173. Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1174. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1175. Debug-Output "ShellCode error: cannot get an error string."
  1176. goto ShellCodeError
  1177. endif
  1178. set Error = $($R0)
  1179. Goto fatal
  1180. ;
  1181. ; fatal error display
  1182. ;
  1183. fatal = +
  1184. ifstr(i) $(Error) == ""
  1185. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1186. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1187. goto ShellCodeError
  1188. endif
  1189. set Error = $($R0)
  1190. endif
  1191. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1192. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1193. goto ShellCodeError
  1194. endif
  1195. goto setfailed
  1196. ;
  1197. ; Shelling error
  1198. ;
  1199. ShellCodeError = +
  1200. set DlgType = "MessageBox"
  1201. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1202. set STF_MB_TEXT = $(ShellCodeErrorText)
  1203. set STF_MB_TYPE = 1
  1204. set STF_MB_ICON = 3
  1205. set STF_MB_DEF = 1
  1206. ui start "Error Message"
  1207. goto setfailed
  1208. setfailed = +
  1209. set CommonStatus = STATUS_FAILED
  1210. ;
  1211. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1212. ;
  1213. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1214. set OEM_ABANDON_ON = FALSE
  1215. goto abandon
  1216. endif
  1217. goto end
  1218. end = +
  1219. goto term
  1220. term = +
  1221. Return $(CommonStatus)
  1222. [DebugConfiguration]
  1223. Set InfName = "OEMNADAM.INF"
  1224. Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1225. Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1226. Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1227. return
  1228. ;***************************************************************
  1229. ; INSTALL SECTIONS
  1230. ;***************************************************************
  1231. [Install-Option]
  1232. set STF_VITAL = ""
  1233. ifstr(i) $(AddCopy) == "YES"
  1234. ;
  1235. ; Add the files to the copy list
  1236. ;
  1237. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1238. ; the other INF files
  1239. ;
  1240. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1241. endif
  1242. ifstr(i) $(DoCopy) == "YES"
  1243. ;
  1244. ; Copy files in the copy list
  1245. ;
  1246. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1247. CopyFilesInCopyList
  1248. endif
  1249. Exit
  1250. [Install-Update]
  1251. set STF_VITAL = ""
  1252. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  1253. ;set STF_VERSION = "YES"
  1254. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1255. AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1256. AddSectionFilesToCopyList Files-hlp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1257. exit
  1258. [Install-Helpfile]
  1259. Debug-Output "At Install-Helpfile"
  1260. set STF_VITAL = ""
  1261. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  1262. ;set STF_VERSION = "YES"
  1263. ifstr(i) $(AddCopy) == "YES"
  1264. AddSectionFilesToCopyList Files-hlp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1265. endif
  1266. ifstr(i) $(DoCopy) == "YES"
  1267. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1268. CopyFilesInCopyList
  1269. endif
  1270. exit
  1271. [Install-Dll]
  1272. set STF_VITAL = ""
  1273. ifstr(i) $(AddCopy) == "YES"
  1274. AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1275. endif
  1276. ifstr(i) $(DoCopy) == "YES"
  1277. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1278. CopyFilesInCopyList
  1279. endif
  1280. exit