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.

1195 lines
34 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADUB.INF
  4. ;
  5. ; UB network card and driver SETUP INF file.
  6. ;
  7. ; History:
  8. ; davidhov 00-Feb-1992 Created
  9. ; terryk 27-Feb-1992 Reorganize section location
  10. ; added comment
  11. ; terryk 03-Mar-1992 Changed to ub setup
  12. ; terryk 02-Apr-1992 Code review changed
  13. ; davidhov 03-Apr-1992 Enhanced to use new INF section
  14. ; structure from SunilP, et al.
  15. ;
  16. ;***********************************************************************
  17. ;-----------------------------------------------------------------------
  18. ; OPTION TYPE
  19. ; -----------
  20. ; This identifies the Option type we are dealing with. The different
  21. ; possible types are:
  22. ;
  23. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  24. ;
  25. ; Types specific to networking:
  26. ;
  27. ; NetAdapter, a netcard / adapter combination or just a netcard
  28. ; NetDriver, just a netcard driver
  29. ; NetTransport, a complete NDIS-compliant TDI transport stack
  30. ; NetService, an NT networking service
  31. ; NetWork, a complete network ensemble.
  32. ; NetProvider a complete network which supports NT MPR protocol
  33. ;-----------------------------------------------------------------------
  34. [Identification]
  35. OptionType = NetAdapter
  36. ;-----------------------------------------------------------------------
  37. ; PlatformsSupported
  38. ; ------------------
  39. ; This identifies the platforms supported by the adapter card.
  40. ; Possible types are:
  41. ;
  42. ; ISA, EISA and MCA
  43. ;-----------------------------------------------------------------------
  44. [PlatformsSupported]
  45. ISA
  46. EISA
  47. "Jazz-Internal Bus"
  48. ;-----------------------------------------------------------------------
  49. ; OPTION LIST
  50. ; -----------
  51. ; This section lists the OEM Option key names. These keys are locale
  52. ; independent and used to represent the option in a locale independent
  53. ; manner.
  54. ;
  55. ;-----------------------------------------------------------------------
  56. [Options]
  57. UBPC
  58. UBPCEOTP
  59. ;***********************************************************************
  60. ; CONSTANTS FOR USING DIALOGS
  61. ;***********************************************************************
  62. [IRQChoicesUBPC]
  63. IRQ_0 = "2",2
  64. IRQ_1 = "3",3
  65. IRQ_2 = "4",4
  66. IRQ_3 = "5",5
  67. [IRQChoicesUBPCEOTP]
  68. IRQ_0 = "2",2
  69. IRQ_1 = "3",3
  70. IRQ_2 = "4",4
  71. IRQ_3 = "5",5
  72. IRQ_4 = "7",7
  73. IRQ_5 = "12",12
  74. [IRQChoicesUBPS]
  75. IRQ_0 = "2",2
  76. IRQ_1 = "3",3
  77. IRQ_2 = "4",4
  78. IRQ_3 = "5",5
  79. IRQ_4 = "7",7
  80. IRQ_5 = "12",12
  81. [IOBaseAddrChoices]
  82. IOBase_1 = "0x350",848
  83. IOBase_2 = "0x358",856
  84. IOBase_3 = "0x360",864
  85. IOBase_4 = "0x368",872
  86. [MemMappedWndBaseAddrChoicesUBPC]
  87. Add_1 = "0xC0000",786432
  88. Add_2 = "0xC8000",819200
  89. Add_3 = "0xD0000",851968
  90. Add_4 = "0xD8000",884736
  91. [MemMappedWndBaseAddrChoicesUBPCEOTP]
  92. Add_1 = "0x80000",524288
  93. Add_2 = "0x88000",557056
  94. Add_3 = "0x90000",589824
  95. Add_4 = "0x98000",622592
  96. Add_5 = "0xA0000",655360
  97. Add_6 = "0xA8000",688128
  98. Add_7 = "0xB0000",720896
  99. Add_8 = "0xB8000",753664
  100. Add_9 = "0xC0000",786432
  101. Add_10 = "0xC8000",819200
  102. Add_11 = "0xD0000",851968
  103. Add_12 = "0xD8000",884736
  104. Add_13 = "0xE0000",917504
  105. Add_14 = "0xE8000",950272
  106. [MemMappedWndBaseAddrChoicesUBPS]
  107. Add_2 = "0xC8000",819200
  108. Add_4 = "0xD8000",884736
  109. [FileConstants]
  110. ;
  111. ; File names, etc.
  112. ;
  113. UtilityInf = "UTILITY.INF"
  114. subroutineinf = "SUBROUTN.INF"
  115. SoftwareType = "driver"
  116. Exit_Code = 0
  117. ;ShellCode = 0
  118. ;
  119. ; EventLog Message File
  120. ;
  121. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  122. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  123. ;
  124. ; Product Info
  125. ;
  126. Manufacturer = "Microsoft"
  127. ProductMajorVersion = "4"
  128. ProductMinorVersion = "0"
  129. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  130. ;
  131. ; Software
  132. ;
  133. ProductSoftwareName = "UB"
  134. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\ubnei.sys"
  135. NetRuleSoftwareType = "ubneiSys ndisDriver ubDriver"
  136. NetRuleSoftwareUse = $(SoftwareType)
  137. NetRuleSoftwareBindForm = """UbneiSys"" yes no container"
  138. NetRuleSoftwareClass = {"ubDriver basic"}
  139. NetRuleSoftwareBindable = {"ubDriver ubAdapter non exclusive 100"} ;
  140. ; Hardware
  141. ;
  142. ProductHardwareName = "UB"
  143. NetRuleHardwareType = "ub ubAdapter"
  144. NetRuleHardwareBindForm = " yes yes container"
  145. NetRuleHardwareClass = {"ubAdapter basic"}
  146. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  147. ;
  148. ; Registry Key
  149. ;
  150. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  151. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  152. [GeneralConstants]
  153. ;
  154. ; Program flow control variables.
  155. ;
  156. from = ""
  157. to = ""
  158. ;
  159. ; Return codes; Exit_Code is set to one of these
  160. ;
  161. ExitCodeOk = 0
  162. ExitCodeCancel = 1
  163. ExitCodeFatal = 2
  164. KeyNull = ""
  165. MAXIMUM_ALLOWED = 33554432
  166. RegistryErrorIndex = NO_ERROR
  167. KeyProduct = ""
  168. KeyParameters = ""
  169. TRUE = 1
  170. FALSE = 0
  171. NoTitle = 0
  172. ExitState = "Active"
  173. OldVersionExisted = $(FALSE)
  174. DriverPath = $(!STF_NTPATH)\drivers
  175. [date]
  176. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  177. ; Minute, Second }
  178. Now = {} ? $(!LIBHANDLE) GetSystemDate
  179. ;---------------------------------------------------------------------------
  180. ; 1. Identify
  181. ;
  182. ; DESCRIPTION: To verify that this INF deals with the same type of options
  183. ; as we are choosing currently.
  184. ;
  185. ; INPUT: None
  186. ;
  187. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  188. ; $($R1): Option Type (COMPUTER ...)
  189. ; $($R2): Diskette description
  190. ;---------------------------------------------------------------------------
  191. [Identify]
  192. ;
  193. ;
  194. read-syms Identification
  195. set Status = STATUS_SUCCESSFUL
  196. set Identifier = $(OptionType)
  197. set Media = #("Source Media Descriptions", 1, 1)
  198. Return $(Status) $(Identifier) $(Media)
  199. ;------------------------------------------------------------------------
  200. ; 2. ReturnOptions:
  201. ;
  202. ; DESCRIPTION: To return the option list supported by this INF and the
  203. ; localised text list representing the options.
  204. ;
  205. ;
  206. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  207. ;
  208. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  209. ; STATUS_NOLANGUAGE
  210. ; STATUS_FAILED
  211. ; STATUS_NOTSUPPORTED
  212. ;
  213. ; $($R1): Option List
  214. ; $($R2): Option Text List
  215. ;------------------------------------------------------------------------
  216. [ReturnOptions]
  217. ;
  218. ;
  219. set Status = STATUS_FAILED
  220. set OptionList = {}
  221. set OptionTextList = {}
  222. ;
  223. ; Check if the language requested is supported
  224. ;
  225. set LanguageList = ^(LanguagesSupported, 1)
  226. Ifcontains(i) $($0) in $(LanguageList)
  227. ;
  228. ; Check if the platforms requested is supported
  229. ;
  230. ifstr(i) $($1) == ""
  231. goto returnoptions
  232. endif
  233. set PlatformList = ^(PlatformsSupported, 1)
  234. Ifcontains(i) $($1) in $(PlatformList)
  235. goto returnoptions
  236. else
  237. set Status = STATUS_NOTSUPPORTED
  238. goto finish_ReturnOptions
  239. endif
  240. else
  241. set Status = STATUS_NOLANGUAGE
  242. goto finish_ReturnOptions
  243. endif
  244. ;
  245. ; form a list of all the options and another of the text representing
  246. ;
  247. returnoptions = +
  248. set OptionList = ^(Options, 1)
  249. set OptionTextList = ^(OptionsText$($0), 1)
  250. set Status = STATUS_SUCCESSFUL
  251. finish_ReturnOptions = +
  252. Return $(Status) $(OptionList) $(OptionTextList)
  253. ;----------InstallOption-------------------------------------------------
  254. ;
  255. ; InstallOption:
  256. ;
  257. ; This section is shelled to by main installation processing
  258. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  259. ;
  260. ;
  261. ; FUNCTION: To copy files representing Options
  262. ; To configure the installed option
  263. ; To update the registry for the installed option
  264. ;
  265. ; INPUT: $($0): Language to use
  266. ; $($1): OptionID to install
  267. ; $($2): SourceDirectory
  268. ; $($3): AddCopy (YES | NO)
  269. ; $($4): DoCopy (YES | NO)
  270. ; $($5): DoConfig (YES | NO)
  271. ;
  272. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  273. ; STATUS_NOLANGUAGE |
  274. ; STATUS_USERCANCEL |
  275. ; STATUS_FAILED
  276. ;
  277. ;------------------------------------------------------------------------
  278. [InstallOption]
  279. ;
  280. ; extract parameters
  281. ;
  282. set Option = $($1)
  283. set SrcDir = $($2)
  284. set AddCopy = $($3)
  285. set DoCopy = $($4)
  286. set DoConfig = $($5)
  287. ;
  288. ; Check if the language requested is supported
  289. ;
  290. set LanguageList = ^(LanguagesSupported, 1)
  291. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  292. Return STATUS_NOLANGUAGE
  293. endif
  294. Debug-Output "OEMNADUB.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  295. Debug-Output "OEMNADUB.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  296. ; define all the constants
  297. set-subst LF = "\n"
  298. read-syms GeneralConstants
  299. read-syms FileConstants
  300. read-syms DialogConstants$(!STF_LANGUAGE)
  301. ifstr(i) $(!NTN_Origination) == "NCPA"
  302. set Continue = $(OK)
  303. endif
  304. read-syms FileConstants$(!STF_LANGUAGE)
  305. detect date
  306. set-title $(FunctionTitle)
  307. set to = Begin
  308. set from = Begin
  309. ;
  310. ; Assume all is well.
  311. ;
  312. set CommonStatus = STATUS_SUCCESSFUL
  313. EndWait
  314. ;
  315. ; Set up the operation-mode-based variables and gaily welcome
  316. ; the user. If the "install mode" variable is improperly set,
  317. ; assume this is a new installation.
  318. ;
  319. Begin = +
  320. Ifstr(i) $(!NTN_InstallMode) == deinstall
  321. set StartLabel = removeadapter
  322. else-Ifstr(i) $(!NTN_InstallMode) == Update
  323. set StartLabel = UpgradeSoftware
  324. else-Ifstr(i) $(!NTN_InstallMode) == bind
  325. set StartLabel = bindingadapter
  326. else-Ifstr(i) $(!NTN_InstallMode) == configure
  327. set CommonStatus = STATUS_REBOOT
  328. set StartLabel = configureadapter
  329. ;
  330. ; You cannot config the software component
  331. ;
  332. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  333. Debug-Output "OEMNADUB.INF: Cannot configure the driver software."
  334. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  335. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  336. Debug-Output "OEMNADUB.INF: ShellCode error: cannot get an error string."
  337. goto ShellCodeError
  338. endif
  339. set Error = $($R0)
  340. set from = end
  341. set to = end
  342. goto nonfatalinfo
  343. endif
  344. else
  345. set StartLabel = installadapter
  346. set OEM_ABANDON_OPTIONS = {}
  347. set OEM_ABANDON_SOFTWARE = FALSE
  348. set OEM_ABANDON_ON = TRUE
  349. endif
  350. ; set the default values
  351. ; IRQ level = 5
  352. set IRQValue = *($(IRQList), 4)
  353. ; IoBaseAddress = 0x368
  354. set IOBaseAddrValue = *($(IOBaseAddrList), 4)
  355. ; default mamory mapped window address is 884736 (0xd800)
  356. set MemMappedWndAddrValue = *($(MemMappedWndAddrList),~($(MemMappedWndAddrValues),884736))
  357. set EditTextIn = "1"
  358. set from = $(fatal)
  359. set to = $(fatal)
  360. goto $(StartLabel)
  361. ;-----------------------------------------------
  362. ; Installation Section
  363. ;-----------------------------------------------
  364. installadapter = +
  365. ;
  366. ; First, check whether the same version of the software exists
  367. ;
  368. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  369. Ifstr $(KeyProduct) != $(KeyNull)
  370. ;
  371. ; Same version already existed in the local machine
  372. ; Popup the dialog and ask the user whether he wants to continue
  373. ;
  374. CloseRegKey $(KeyProduct)
  375. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  376. ;
  377. ; Cannot Install the same software again
  378. ;
  379. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  380. $(ProductVersion)
  381. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  382. Debug-Output "OEMNADUB.INF: ShellCode error: cannot get an error string."
  383. goto ShellCodeError
  384. endif
  385. goto end
  386. else
  387. ;
  388. ; Add a new adapter card?
  389. ;
  390. Shell $(UtilityInf), CardExistedDlg
  391. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  392. Debug-Output "OEMNADUB.INF: ShellCode error: cannot get an error string."
  393. goto ShellCodeError
  394. endif
  395. ifstr(i) $($R1) != "OK"
  396. set CommonStatus = STATUS_USERCANCEL
  397. goto end
  398. endif
  399. set OldVersionExisted = $(TRUE)
  400. endif
  401. Endif
  402. Goto adapteroptions
  403. ;-----------------------------------------------
  404. ; Configuration Section
  405. ;-----------------------------------------------
  406. ;
  407. ; Get the current values of all the parameters
  408. ;
  409. configureadapter = +
  410. Ifstr(i) $(KeyProduct) == $(KeyNull)
  411. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  412. Ifstr $(KeyProduct) == $(KeyNull)
  413. Set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  414. Debug-Output "OEMNADUB.INF: Cannot find component product key"
  415. Goto fatalregistry
  416. Endif
  417. Endif
  418. ;
  419. ; Get the other parameters; they're attached to the service parameters key
  420. ;
  421. Debug-Output "OEMNADUB.INF: INF: Shelling to FindService"
  422. Shell $(UtilityInf) FindService, $(KeyProduct)
  423. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  424. Debug-Output "OEMNADUB.INF: INF: FindService shell failure"
  425. Goto ShellCodeError
  426. Endif
  427. Ifstr(i) $($R0) != NO_ERROR
  428. Debug-Output "OEMNADUB.INF: INF: FindService Shell error: "$($R0)
  429. Goto fatalregistry
  430. endif
  431. set KeyParameters = $($R2)
  432. ;
  433. ; We don't need the services key, so close it.
  434. ;
  435. CloseRegKey $($R1)
  436. Ifstr $(KeyParameters) == $(KeyNull)
  437. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  438. Debug-Output "OEMNADUB.INF: Cannot find component service"
  439. goto fatalregistry
  440. endif
  441. set OldVersionExisted = $(TRUE )
  442. set ValueName = ""
  443. set ValueData = ""
  444. set ValueStr = ""
  445. set ValueList = {}
  446. ;
  447. ; Get the old values
  448. ;
  449. EnumRegValue $(KeyParameters) ValueList
  450. ForListDo $(ValueList)
  451. set ValueItem = $($)
  452. set ValueName = *($(ValueItem),1)
  453. set ValueData = *($(ValueItem),4)
  454. Ifstr(i) $(ValueName) == "InterruptNumber"
  455. set IRQValueIndex = $(ValueData)
  456. else-ifstr(i) $(ValueName) == "IoBaseAddress"
  457. set IOBaseAddrIndex = $(ValueData)
  458. else-ifstr(i) $(ValueName) == "MemoryMappedBaseAddress"
  459. set MemMappedWndAddrIndex = $(ValueData)
  460. else-ifstr(i) $(ValueName) == "BusType"
  461. set BusInterfaceType = $(ValueData)
  462. else-ifstr(i) $(ValueName) == "BusNumber"
  463. set BusNumber = $(ValueData)
  464. endif
  465. EndForListDo
  466. set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValueIndex)))
  467. ifstr(i) $(IRQValue) == ""
  468. set IRQValue = *($(IRQList), 4)
  469. endif
  470. set IOBaseAddrValue = *($(IOBaseAddrList), +
  471. ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  472. ifstr(i) $(IOBaseAddrValue) == ""
  473. set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  474. endif
  475. set MemMappedWndAddrValue = *($(MemMappedWndAddrList), +
  476. ~($(MemMappedWndAddrValues),$(MemMappedWndAddrIndex)))
  477. ifstr(i) $(MemMappedWndAddrValue) == ""
  478. set MemMappedWndAddrValue = *($(MemMappedWndAddrList),~($(MemMappedWndAddrValue),884736))
  479. endif
  480. ;
  481. ; Let the user bang on the options until satisfied.
  482. ;
  483. adapteroptions = +
  484. set from = adapteroptions
  485. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  486. ifstr(i) $(!AutoNetInterfaceType) != ""
  487. set BusInterfaceType = $(!AutoNetInterfaceType)
  488. else
  489. set BusInterfaceType = 1 ;ISA
  490. endif
  491. ifstr(i) $(!AutoNetBusNumber) != ""
  492. set BusNumber = $(!AutoNetBusNumber)
  493. else
  494. set BusNumber = 0
  495. endif
  496. goto nextstep
  497. endif
  498. read-syms FileDependentDlg$(!STF_LANGUAGE)
  499. ui start "InputDlg"
  500. ifstr(i) $(DLGEVENT) == "CONTINUE"
  501. set IRQValueIndex = $(Combo1Out)
  502. set IOBaseAddrIndex = $(Combo2Out)
  503. set MemMappedWndAddrIndex = $(Combo3Out)
  504. ui pop 1
  505. else-ifstr(i) $(DLGEVENT) == "BACK"
  506. set CommonStatus = STATUS_USERCANCEL
  507. Debug-Output "OEMNADUB.INF: Action: exit. Bye."
  508. ui pop 1
  509. goto end
  510. else
  511. ;
  512. ; Unknown command
  513. ;
  514. ui pop 1
  515. Debug-Output "OEMNADUB.INF: Action: unknown. Bye."
  516. goto end
  517. endif
  518. ;
  519. ; If installing, go create the necessary keys;
  520. ; if configuring, they're already open.
  521. ;
  522. ifstr(i) $(!STF_NCDETINFO) == {}
  523. ; not detect. popup dialog.
  524. Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
  525. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  526. Debug-Output "ShellCode error."
  527. goto ShellCodeError
  528. endif
  529. set BusInterfaceType = $($R1)
  530. set BusNumber = $($R2)
  531. else
  532. ; use the STF_NCDETINFO information
  533. set BusInterfaceType = *($(!STF_NCDETINFO),5)
  534. set BusNumber = *($(!STF_NCDETINFO),6)
  535. endif
  536. nextstep = +
  537. ifint $(OldVersionExisted) == $(TRUE)
  538. ifstr(i) $(!NTN_InstallMode) == configure
  539. goto writeparameters
  540. endif
  541. endif
  542. StartWait
  543. ; *****************************************************************
  544. ; New Product Installation
  545. ; *****************************************************************
  546. ;
  547. ; Add Software Component
  548. ;
  549. Ifint $(OldVersionExisted) != $(FALSE)
  550. Goto installhardware
  551. Endif
  552. ifstr(i) $(!NTN_InstallMode) == "install"
  553. Ifstr(i) $(DoCopy) == "YES"
  554. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  555. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  556. Goto ShellCodeError
  557. Else-Ifstr(i) $($R0) == STATUS_FAILED
  558. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  559. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  560. goto ShellCodeError
  561. endif
  562. set Error = $($R0)
  563. Goto fatal
  564. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  565. Goto successful
  566. Endif
  567. Set SrcDir = $($R1)
  568. Endif
  569. install "Install-Option"
  570. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  571. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  572. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  573. goto ShellCodeError
  574. endif
  575. set Error = $($R0)
  576. goto fatal
  577. endif
  578. endif
  579. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  580. $(ProductSoftwareName), +
  581. $(ProductSoftwareName), +
  582. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  583. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  584. $(NetEventDLL), ""
  585. Set OEM_ABANDON_SOFTWARE = TRUE
  586. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  587. Debug-Output "OEMNADUB.INF: ShellCode error"
  588. goto ShellCodeError
  589. endif
  590. set RegistryErrorIndex = $($R0)
  591. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  592. EndWait
  593. Debug-Output "OEMNADUB.INF: Registry error: add software components"
  594. CloseRegKey $($R1)
  595. CloseRegKey $($R2)
  596. CloseRegKey $($R3)
  597. CloseRegKey $($R4)
  598. CloseRegKey $($R5)
  599. goto fatalregistry
  600. endif
  601. ;
  602. ; At this point:
  603. ; $R1 contains the product version key handle;
  604. ; $R2 contains the NetRules subkey handle;
  605. ; $R3 contains the new Services key handle; and
  606. ; $R4 contains the Parameters key
  607. ; $R5 contains the Linkage Key
  608. ;
  609. Set SoftProductKey = $($R1)
  610. Set SoftNetRuleKey = $($R2)
  611. Set SoftServiceKey = $($R3)
  612. Set SoftParameterKey = $($R4)
  613. Set SoftLinkageKey = $($R5)
  614. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  615. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  616. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  617. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  618. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  619. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  620. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  621. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  622. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  623. Debug-Output "OEMNADUB.INF: ShellCode error."
  624. goto ShellCodeError
  625. endif
  626. set RegistryErrorIndex = $($R0)
  627. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  628. EndWait
  629. Debug-Output "OEMNADUB.INF: Registry error: add value list for software product."
  630. CloseRegKey $(SoftProductKey)
  631. CloseRegKey $(SoftNetRuleKey)
  632. CloseRegKey $(SoftServiceKey)
  633. CloseRegKey $(SoftParameterKey)
  634. CloseRegKey $(SoftLinkageKey)
  635. goto fatalregistry
  636. endif
  637. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  638. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  639. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  640. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  641. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  642. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  643. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  644. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  645. Debug-Output "OEMNADUB.INF: ShellCode error."
  646. goto ShellCodeError
  647. endif
  648. Set RegistryErrorIndex = $($R0)
  649. CloseRegKey $(SoftProductKey)
  650. CloseRegKey $(SoftNetRuleKey)
  651. CloseRegKey $(SoftServiceKey)
  652. CloseRegKey $(SoftParameterKey)
  653. CloseRegKey $(SoftLinkageKey)
  654. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  655. EndWait
  656. Debug-Output "OEMNADUB.INF: Registry error: add value list."
  657. goto fatalregistry
  658. endif
  659. ;
  660. ; Create the HARDWARE\Netcard region and its corresponding service
  661. ;
  662. installhardware =+
  663. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  664. ifint $($R4) != -1
  665. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  666. endif
  667. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  668. Debug-Output "OEMNADUB.INF: Cannot add hardware component"
  669. goto ShellCodeError
  670. endif
  671. set RegistryErrorIndex = $($R0)
  672. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  673. EndWait
  674. Debug-Output "OEMNADUB.INF: Registry error: add hardware component"
  675. CloseRegKey $($R1)
  676. CloseRegKey $($R2)
  677. CloseRegKey $($R3)
  678. goto fatalregistry
  679. endif
  680. ;
  681. ; At this point:
  682. ; $R1 Registry key variable for HARDWARE\Netcard\(n)
  683. ; $R2 Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  684. ; $R3 Registry key handle for <service>\Parameters key
  685. ; $R4 Adapter number assigned to adapter
  686. ; $R5 Service name generated by combining svc name with adapter number
  687. ;
  688. set KeyProduct = $($R1)
  689. set KeyAdapterRules = $($R2)
  690. set KeyParameters = $($R3)
  691. set AdapterNumber = $($R4)
  692. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  693. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  694. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  695. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  696. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  697. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  698. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  699. Shell $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  700. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  701. Debug-Output "OEMNADUB.INF: ShellCode error"
  702. goto ShellCodeError
  703. endif
  704. CloseRegKey $(KeyProduct)
  705. Set KeyProduct = ""
  706. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  707. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  708. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  709. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  710. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  711. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  712. Shell $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  713. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  714. Debug-Output "OEMNADUB.INF: ShellCode error."
  715. goto ShellCodeError
  716. endif
  717. CloseRegKey $(KeyAdapterRules)
  718. Set RegistryErrorIndex = $($R0)
  719. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  720. EndWait
  721. Debug-Output "OEMNADUB.INF: Registry error: add value list."
  722. CloseRegKey $(KeyParameters)
  723. goto fatalregistry
  724. Endif
  725. ;
  726. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  727. ;
  728. writeparameters = +
  729. ;
  730. ; Add the rest of the parameters to the Services area
  731. ;
  732. Ifstr(i) $(KeyParameters) == $(KeyNull)
  733. Debug-Output "OEMNADUB.INF: *** KeyParameters is NULL at writeparameters"
  734. Endif
  735. set IRQValue = *($(IRQValues), ~($(IRQList),$(IRQValueIndex)))
  736. set IOBaseAddrValue = *($(IOBaseAddrValues), +
  737. ~($(IOBaseAddrList),$(IOBaseAddrIndex)))
  738. set MemMappedWndAddrValue = *($(MemMappedWndAddrValues), +
  739. ~($(MemMappedWndAddrList),$(MemMappedWndAddrIndex)))
  740. ifstr(i) $(Option) == "UBPC"
  741. set CardType = "2"
  742. else-ifstr(i) $(Option) == "UBPCEOTP"
  743. set CardType = "4"
  744. else
  745. set CardType = "3"
  746. endif
  747. set NewValueList = {+
  748. {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  749. {CardType,$(NoTitle),$(!REG_VT_DWORD),$(CardType)},+
  750. {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
  751. {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  752. {InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  753. {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  754. {MemoryMappedBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(MemMappedWndAddrValue)}}
  755. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  756. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  757. Shell $(UtilityInf),AddDefaultNetCardParameters,$(KeyParameters)
  758. endif
  759. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  760. Debug-Output "OEMNADUB.INF: ShellCode error."
  761. goto ShellCodeError
  762. endif
  763. Set RegistryErrorIndex = $($R0)
  764. CloseRegKey $(KeyParameters)
  765. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  766. Debug-Output "OEMNADUB.INF: Registry error: Add value list"
  767. goto fatalregistry
  768. Endif
  769. EndWait
  770. goto successful
  771. ;-----------------------------------------------
  772. ; Binding section
  773. ;-----------------------------------------------
  774. bindingadapter =+
  775. set Error = "Binding: Sorry, not yet implemented."
  776. goto fatal
  777. ;-----------------------------------------------
  778. ; Removeadapter section
  779. ;-----------------------------------------------
  780. removeadapter = +
  781. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  782. ; Remove Software Component
  783. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  784. $(ProductSoftwareName)
  785. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  786. Debug-Output "OEMNADUB.INF: ShellCode error"
  787. goto ShellCodeError
  788. endif
  789. set RegistryErrorIndex = $($R0)
  790. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  791. goto fatalregistry
  792. endif
  793. else
  794. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  795. $(ProductSoftwareName), $(!NTN_RegBase)
  796. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  797. Debug-Output "OEMNADUB.INF: ShellCode error"
  798. goto ShellCodeError
  799. endif
  800. set RegistryErrorIndex = $($R0)
  801. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  802. goto fatalregistry
  803. endif
  804. endif
  805. goto end
  806. ;-----------------------------------------------
  807. ; Upgrade Software section
  808. ;-----------------------------------------------
  809. UpgradeSoftware = +
  810. ; Upgrade software component
  811. ;
  812. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  813. Ifstr $(KeyProduct) != $(KeyNull)
  814. install "Install-Update"
  815. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  816. goto fatal
  817. endif
  818. ; Upgrade the version number
  819. ;
  820. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  821. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  822. ;
  823. ; do nothing for update
  824. ;
  825. CloseRegKey $(KeyProduct)
  826. else
  827. ;
  828. ; Cannot Open software key, goto ERROR
  829. ;
  830. goto fatalregistry
  831. endif
  832. ;
  833. ; Enumerate all netcards installed of this type and update them
  834. ;
  835. set iSearch = 1
  836. nextnetcard = +
  837. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  838. set KeyNetcard = $($R0)
  839. set iSearch = $($R1)
  840. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  841. Ifstr $(KeyNetcard) != $(KeyNull)
  842. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  843. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  844. CloseRegKey $(KeyNetcard)
  845. goto nextnetcard
  846. Endif
  847. goto end
  848. ;
  849. ; End of Upgrade Software
  850. ;
  851. ;
  852. ; Escape hatches
  853. ;
  854. successful = +
  855. goto end
  856. abandon = +
  857. ForListDo $(OEM_ABANDON_OPTIONS)
  858. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  859. $(ProductSoftwareName), $($)
  860. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  861. Debug-Output "OEMNADUB.INF: ShellCode error"
  862. goto ShellCodeError
  863. endif
  864. set RegistryErrorIndex = $($R0)
  865. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  866. goto fatalregistry
  867. endif
  868. EndForListDo
  869. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  870. ; Remove Software Component
  871. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  872. $(ProductSoftwareName), FALSE
  873. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  874. Debug-Output "OEMNADUB.INF: ShellCode error"
  875. goto ShellCodeError
  876. endif
  877. set RegistryErrorIndex = $($R0)
  878. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  879. goto fatalregistry
  880. endif
  881. endif
  882. goto end
  883. ;
  884. ; warning display
  885. ;
  886. warning = +
  887. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  888. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  889. goto ShellCodeError
  890. endif
  891. ifstr(i) $($R1) == "OK"
  892. goto $(to)
  893. else-ifstr(i) $($R1) == "CANCEL"
  894. goto $(from)
  895. else
  896. ; Debug-Msg "Error Error Bad DLGEVENT"
  897. goto "end"
  898. endif
  899. ;
  900. ; non fatal error display
  901. ;
  902. nonfatalinfo = +
  903. Set CommonStatus = STATUS_USERCANCEL
  904. Set Severity = STATUS
  905. goto nonfatalmsg
  906. nonfatal = +
  907. Set Severity = NONFATAL
  908. goto nonfatalmsg
  909. nonfatalmsg = +
  910. ifstr(i) $(Error) == ""
  911. Set Severity = NONFATAL
  912. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  913. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  914. goto ShellCodeError
  915. endif
  916. set Error = $($R0)
  917. endif
  918. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  919. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  920. goto ShellCodeError
  921. endif
  922. ifstr(i) $($R1) == "OK"
  923. goto $(from)
  924. else
  925. goto "end"
  926. endif
  927. ;
  928. ; Registry is broken
  929. ;
  930. fatalregistry = +
  931. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  932. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  933. goto ShellCodeError
  934. endif
  935. set Error = $($R0)
  936. goto fatal
  937. ;
  938. ; fatal error display
  939. ;
  940. fatal = +
  941. ifstr(i) $(Error) == ""
  942. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  943. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  944. goto ShellCodeError
  945. endif
  946. set Error = $($R0)
  947. endif
  948. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  949. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  950. goto ShellCodeError
  951. endif
  952. goto setfailed
  953. ;
  954. ; Shelling error
  955. ;
  956. ShellCodeError = +
  957. set DlgType = "MessageBox"
  958. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  959. set STF_MB_TEXT = $(ShellCodeErrorText)
  960. set STF_MB_TYPE = 1
  961. set STF_MB_ICON = 3
  962. set STF_MB_DEF = 1
  963. ui start "Error Message"
  964. goto setfailed
  965. setfailed = +
  966. set CommonStatus = STATUS_FAILED
  967. ;
  968. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  969. ;
  970. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  971. set OEM_ABANDON_ON = FALSE
  972. goto abandon
  973. endif
  974. goto end
  975. end = +
  976. goto term
  977. term = +
  978. Return $(CommonStatus)
  979. ;***************************************************************
  980. ; INSTALL SECTIONS
  981. ;***************************************************************
  982. [Install-Option]
  983. set STF_VITAL = ""
  984. ifstr(i) $(AddCopy) == "YES"
  985. ;
  986. ; Add the files to the copy list
  987. ;
  988. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  989. ; the other INF files
  990. ;
  991. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  992. endif
  993. Debug-Output "OEMNADUB.INF: [Install-Option] DoCopy = "$(DoCopy)
  994. ifstr(i) $(DoCopy) == "YES"
  995. ;
  996. ; Copy files in the copy list
  997. ;
  998. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  999. CopyFilesInCopyList
  1000. endif
  1001. ifstr(i) $(DoConfig) == "YES"
  1002. ;
  1003. ; Add product to registry
  1004. ;
  1005. ;
  1006. ; Finish up
  1007. endif
  1008. Exit
  1009. [Install-Update]
  1010. set STF_VITAL = ""
  1011. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  1012. ;set STF_VERSION = "YES"
  1013. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1014. exit
  1015.