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.

1292 lines
38 KiB

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