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.

2254 lines
58 KiB

  1. ; **********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ; Copyright (c) Madge Networks Ltd. 1994
  6. ;
  7. ; MADGE Smart Ringnode Driver installer for MdgMPort.SYS
  8. ;
  9. ; VeRsIoN=OEMSETUP.INF 3.04.30 (for use with MdgMPort.SYS 2.04.30)
  10. ;
  11. ; **********************************************************************
  12. ; ----------------------------------------------------------------------
  13. ; Mandatory configuration information.
  14. ; ----------------------------------------------------------------------
  15. [Identification]
  16. OptionType = NetAdapter
  17. [PlatformsSupported]
  18. MCA
  19. ISA
  20. EISA
  21. PCI
  22. PCMCIA
  23. "Jazz-Internal Bus"
  24. [Options]
  25. ;MSMDGMPAUTO
  26. MSMDGMPISA
  27. MSMDGMPATP
  28. MSMDGMPISAC
  29. MSMDGMPISACP
  30. MSMDGMPPC
  31. MSMDGMPSM16
  32. MSMDGMPPNP
  33. MSMDGMPMCA
  34. MSMDGMPMC32
  35. MSMDGMPEISA
  36. MSMDGMPPCI
  37. MSMDGMPPCIBM
  38. MSMDGMPPCMCIA
  39. [OptionsISA]
  40. ;MSMDGMPAUTO
  41. MSMDGMPISA
  42. MSMDGMPATP
  43. MSMDGMPISAC
  44. MSMDGMPISACP
  45. MSMDGMPPC
  46. MSMDGMPSM16
  47. MSMDGMPPNP
  48. [OptionsMCA]
  49. ;MSMDGMPAUTO
  50. MSMDGMPMCA
  51. MSMDGMPMC32
  52. [OptionsEISA]
  53. ;MSMDGMPAUTO
  54. MSMDGMPEISA
  55. MSMDGMPISA
  56. MSMDGMPATP
  57. MSMDGMPISAC
  58. MSMDGMPISACP
  59. MSMDGMPPC
  60. MSMDGMPSM16
  61. MSMDGMPPNP
  62. [OptionsPCI]
  63. ;MSMDGMPAUTO
  64. MSMDGMPPCI
  65. MSMDGMPPCIBM
  66. [OptionsPCMCIA]
  67. ;MSMDGMPAUTO
  68. MSMDGMPPCMCIA
  69. ;-----------------------------------------------------------------------
  70. ; Adapter options that require a slot number and a transfer method.
  71. ; Others require an IO location a transfer method and an IRQ number.
  72. ;-----------------------------------------------------------------------
  73. [SlotNumberOnlyOptions]
  74. MSMDGMPEISA
  75. MSMDGMPMCA
  76. MSMDGMPMC32
  77. MSMDGMPPCI
  78. MSMDGMPPCIBM
  79. ;-----------------------------------------------------------------------
  80. ; Adapter options that support MMIO.
  81. ;-----------------------------------------------------------------------
  82. [MmioOptions]
  83. MSMDGMPPCI
  84. ; ----------------------------------------------------------------------
  85. ; Constants specific to the driver.
  86. ; ----------------------------------------------------------------------
  87. [FileConstants]
  88. ;
  89. ; File names, etc.
  90. ;
  91. DialogDllName = "MDGMPDLG.DLL"
  92. SoftwareType = "driver"
  93. Exit_Code = 0
  94. ;
  95. ; Product Information.
  96. ;
  97. Manufacturer = "Madge"
  98. ProductMajorVersion = "4"
  99. ProductMinorVersion = "0"
  100. ProductRevision = ".00"
  101. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)$(ProductRevision)
  102. ;
  103. ; Software information.
  104. ;
  105. ProductSoftwareName = "MadgeMPort"
  106. ProductSoftwareImagePath = "%SystemRoot%\system32\drivers\MdgMPort.sys"
  107. NetRuleSoftwareType = "mdgtrSys ndisDriver mdgtrDriver"
  108. NetRuleSoftwareUse = $(SoftwareType)
  109. NetRuleSoftwareBindForm = """mdgtrSys"" yes no container"
  110. NetRuleSoftwareClass = {"mdgtrDriver basic"}
  111. NetRuleSoftwareBindable = {"mdgtrDriver mdgtrAdapter non exclusive 100"}
  112. ;
  113. ; Hardware information.
  114. ;
  115. ProductHardwareName = "MadgeMPort"
  116. NetRuleHardwareType = "mdgtr mdgtrAdapter"
  117. NetRuleHardwareBindForm = " yes yes container"
  118. NetRuleHardwareClass = {"mdgtrAdapter basic"}
  119. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  120. ;
  121. ; Registry Key.
  122. ;
  123. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  124. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  125. ;
  126. ; EventLog Message File.
  127. ;
  128. MadgeEventLogFile = $(ProductSoftwareImagePath)
  129. ; ---------------------------------------------------------------------
  130. ; General constants.
  131. ; ---------------------------------------------------------------------
  132. [GeneralConstants]
  133. ;
  134. ; File names, etc.
  135. ;
  136. UtilityInf = "UTILITY.INF"
  137. SubroutineInf = "SUBROUTN.INF"
  138. ParamInf = "NCPARAM.INF"
  139. ;
  140. ; Program flow control variables.
  141. ;
  142. From = ""
  143. To = ""
  144. ;
  145. ; Return codes; Exit_Code is set to one of these
  146. ;
  147. ExitCodeOk = 0
  148. ExitCodeCancel = 1
  149. ExitCodeFatal = 2
  150. ;
  151. ; Miscellaneous.
  152. ;
  153. MAXIMUM_ALLOWED = 33554432
  154. RegistryErrorIndex = NO_ERROR
  155. KeyNull = ""
  156. KeyProduct = ""
  157. KeyParameters = ""
  158. TRUE = 1
  159. FALSE = 0
  160. NoTitle = 0
  161. ExitState = "Active"
  162. OldVersionExisted = $(FALSE)
  163. DriverPath = $(!STF_NTPATH)\drivers
  164. ;
  165. ; Resource values returned by the detection DLL, so do not change them.
  166. ;
  167. VALUE_UNKNOWN = 65535
  168. GENERAL_PIO = 0
  169. GENERAL_DMA = 500
  170. GENERAL_MMIO = 501
  171. ;
  172. ; Transfer types on the registry.
  173. ;
  174. TRANSFER_UNKNOWN = 65535
  175. TRANSFER_PIO = 0
  176. TRANSFER_DMA = 1
  177. TRANSFER_MMIO = 2
  178. ;
  179. ; Lists used to the raw internal form of parameters to and from
  180. ; the form shown to users.
  181. ;
  182. IoUserList = ^(IoLocationChoices, 1)
  183. IoRawList = ^(IoLocationChoices, 2)
  184. SlotUserList = ^(SlotNumberChoices, 1)
  185. SlotRawList = ^(SlotNumberChoices, 2)
  186. DmaUserList = ^(DmaChannelChoices, 1)
  187. DmaRawList = ^(DmaChannelChoices, 2)
  188. IrqUserList = ^(IrqNumberChoices, 1)
  189. IrqRawList = ^(IrqNumberChoices, 2)
  190. RxTxUserList = ^(RxTxSlotsChoices,1)
  191. RxTxRawList = ^(RxTxSlotsChoices,2)
  192. StatsUserList = ^(StatsChoices,1)
  193. StatsRawList = ^(StatsChoices,2)
  194. MpUserList = ^(MpChoices,1)
  195. MpRawList = ^(MpChoices,2)
  196. ;
  197. ; Adapter classification lists.
  198. ;
  199. MadgeAdapterOptions = ^(Options,1)
  200. SlotNumberAdapters = ^(SlotNumberOnlyOptions,1)
  201. MmioAdapters = ^(MmioOptions,1)
  202. ;
  203. ; Help identifiers.
  204. ;
  205. MadgeHelpIdMin = 6000
  206. MadgeHelpIdMax = 6003
  207. MadgeHelpIdMDGMPISA = 6001
  208. MadgeHelpIdMDGMPATP = 6001
  209. MadgeHelpIdMDGMPISAC = 6001
  210. MadgeHelpIdMDGMPISACP = 6001
  211. MadgeHelpIdMDGMPPC = 6001
  212. MadgeHelpIdMDGMPSM16 = 6001
  213. MadgeHelpIdMDGMPPNP = 6001
  214. MadgeHelpIdMDGMPPCMCIA = 6001
  215. MadgeHelpIdMDGMPEISA = 6002
  216. MadgeHelpIdMDGMPMCA = 6002
  217. MadgeHelpIdMDGMPMC32 = 6002
  218. MadgeHelpIdMDGMPPCI = 6003
  219. MadgeHelpIdMDGMPPCIBM = 6003
  220. ;
  221. ; card ids
  222. ;
  223. IDMSMDGMPPCI = 135350; 210B6
  224. IDVMSMDGMPPCI = AdapterCFID
  225. IDMSMDGMPPCIBM = 266422 ; 410B6
  226. IDVMSMDGMPPCIBM = AdapterCFID
  227. IDMSMDGMPEISA = 34612
  228. IDVMSMDGMPEISA = EisaCompressedId
  229. IDMSMDGMPMCA = 45
  230. IDVMSMDGMPMCA = McaPosId
  231. IDMSMDGMPMC32 = 116
  232. IDVMSMDGMPMC32 = McaPosId
  233. [date]
  234. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  235. ; Minute, Second }
  236. Now = {} ? $(!LIBHANDLE) GetSystemDate
  237. ;---------------------------------------------------------------------------
  238. ; Identify the INF file to NT.
  239. ;
  240. ; DESCRIPTION: To verify that this INF deals with the same type of options
  241. ; as we are choosing currently.
  242. ;
  243. ; INPUT: None
  244. ;
  245. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  246. ; $($R1): Option Type (COMPUTER ...)
  247. ; $($R2): Diskette description
  248. ;---------------------------------------------------------------------------
  249. [Identify]
  250. read-syms Identification
  251. set Status = STATUS_SUCCESSFUL
  252. set Identifier = $(OptionType)
  253. set Media = #("Source Media Descriptions", 1, 1)
  254. return $(Status) $(Identifier) $(Media)
  255. ;------------------------------------------------------------------------
  256. ; Return the options supported by this INF file.
  257. ;
  258. ; DESCRIPTION: To return the option list supported by this INF and the
  259. ; localised text list representing the options.
  260. ;
  261. ;
  262. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  263. ;
  264. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  265. ; STATUS_NOLANGUAGE
  266. ; STATUS_FAILED
  267. ; STATUS_NOTSUPPORTED
  268. ;
  269. ; $($R1): Option List
  270. ; $($R2): Option Text List
  271. ;------------------------------------------------------------------------
  272. [ReturnOptions]
  273. set Status = STATUS_FAILED
  274. set OptionList = {}
  275. set OptionTextList = {}
  276. ;
  277. ; Check if the language requested is supported.
  278. ;
  279. set LanguageList = ^(LanguagesSupported, 1)
  280. ifcontains(i) $($0) in $(LanguageList)
  281. ;
  282. ;
  283. ; Check if the platforms requested is supported
  284. ;
  285. ifstr(i) $($1) == ""
  286. ;
  287. goto Return_Options
  288. ;
  289. endif
  290. set PlatformList = ^(PlatformsSupported, 1)
  291. ifcontains(i) $($1) in $(PlatformList)
  292. ;
  293. goto Return_Options
  294. ;
  295. else
  296. ;
  297. set Status = STATUS_NOTSUPPORTED
  298. goto Finish_ReturnOptions
  299. ;
  300. endif
  301. ;
  302. else
  303. ;
  304. set Status = STATUS_NOLANGUAGE
  305. goto Finish_ReturnOptions
  306. ;
  307. endif
  308. ;
  309. ; form a list of all the options and another of the text representing
  310. ;
  311. Return_Options = +
  312. set OptionList = ^(Options$($1), 1)
  313. set OptionTextList = ^(OptionsText$($1)$($0), 1)
  314. set Status = STATUS_SUCCESSFUL
  315. Finish_ReturnOptions = +
  316. return $(Status) $(OptionList) $(OptionTextList)
  317. ;------------------------------------------------------------------------
  318. ; InstallOption:
  319. ;
  320. ; This section is shelled to by main installation processing
  321. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  322. ;
  323. ;
  324. ; FUNCTION: To copy files representing Options
  325. ; To configure the installed option
  326. ; To update the registry for the installed option
  327. ;
  328. ; INPUT: $($0): Language to use
  329. ; $($1): OptionID to install
  330. ; $($2): SourceDirectory
  331. ; $($3): AddCopy (YES | NO)
  332. ; $($4): DoCopy (YES | NO)
  333. ; $($5): DoConfig (YES | NO)
  334. ;
  335. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  336. ; STATUS_NOLANGUAGE |
  337. ; STATUS_USERCANCEL |
  338. ; STATUS_FAILED
  339. ;------------------------------------------------------------------------
  340. [InstallOption]
  341. StartWait
  342. ;
  343. ; Un-comment for debugging.
  344. ;
  345. ; set !DebugOutputControl = 1
  346. ;
  347. ; Set default values.
  348. ;
  349. set Status = STATUS_FAILED
  350. ;
  351. ; extract parameters
  352. ;
  353. set Option = $($1)
  354. set SrcDir = $($2)
  355. set AddCopy = $($3)
  356. set DoCopy = $($4)
  357. set DoConfig = $($5)
  358. Debug-Output "MADGE: STF_CWDIR = "$(!STF_CWDIR)
  359. Debug-Output "MADGE: STF_LANGUAGE = "$(!STF_LANGUAGE)
  360. Debug-Output "MADGE: Option = "$(Option)
  361. Debug-Output "MADGE: SrcDir = "$(SrcDir)
  362. Debug-Output "MADGE: AddCopy = "$(AddCopy)
  363. Debug-Output "MADGE: DoCopy = "$(DoCopy)
  364. Debug-Output "MADGE: DoConfig = "$(DoConfig)
  365. ;
  366. ; Check if the language requested is supported
  367. ;
  368. set LanguageList = ^(LanguagesSupported, 1)
  369. ifcontains(i) $($0) NOT-IN $(LanguageList)
  370. ;
  371. return STATUS_NOLANGUAGE
  372. ;
  373. endif
  374. ;
  375. ; Define all the constants
  376. ;
  377. set-subst LF = "\n"
  378. read-syms GeneralConstants
  379. read-syms FileConstants
  380. read-syms DialogConstants$(!STF_LANGUAGE)
  381. ifstr(i) $(!NTN_Origination) == "NCPA"
  382. ;
  383. set Continue = $(OK)
  384. ;
  385. endif
  386. read-syms FileConstants$(!STF_LANGUAGE)
  387. SetHelpFile "mdgmpdlg.hlp" $(MadgeHelpIdMin) $(MadgeHelpIdMax)
  388. detect date
  389. set-title $(FunctionTitle)
  390. set To = Begin
  391. set From = Begin
  392. ;
  393. ; Assume all is well.
  394. ;
  395. set CommonStatus = STATUS_SUCCESSFUL
  396. EndWait
  397. ; -----------------------------------------------------------------------
  398. ; Set up the operation-mode-based variables and gaily welcome
  399. ; the user. If the "install mode" variable is improperly set,
  400. ; assume this is a new installation.
  401. ; -----------------------------------------------------------------------
  402. Begin = +
  403. ;
  404. ; Until proven otherwise we assume that the adapter has not been
  405. ; detected by our NetDetect DLL and we have not done any raw->user
  406. ; mapping of parameter lists.
  407. ;
  408. set AdapterDetected = FALSE
  409. set MappedRawParameters = FALSE
  410. ifstr(i) $(!NTN_InstallMode) == deinstall
  411. ;
  412. set StartLabel = Remove_Adapter
  413. ;
  414. else-ifstr(i) $(!NTN_InstallMode) == Update
  415. ;
  416. set StartLabel = Upgrade_Software
  417. ;
  418. else-ifstr(i) $(!NTN_InstallMode) == bind
  419. ;
  420. set StartLabel = Binding_Adapter
  421. ;
  422. else-ifstr(i) $(!NTN_InstallMode) == configure
  423. set CommonStatus = STATUS_REBOOT
  424. set StartLabel = Configure_Adapter
  425. ;
  426. ; You cannot config the software component
  427. ;
  428. ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  429. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  430. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  431. goto Shell_Code_Error
  432. endif
  433. set Error = $($R0)
  434. set From = End
  435. set To = End
  436. goto Non_Fatal_Info
  437. endif
  438. else
  439. set StartLabel = Install_Adapter
  440. set OEM_ABANDON_OPTIONS = {}
  441. set OEM_ABANDON_SOFTWARE = FALSE
  442. set OEM_ABANDON_ON = TRUE
  443. endif
  444. set From = Fatal
  445. set To = Fatal
  446. goto $(StartLabel)
  447. ; ----------------------------------------------------------------------
  448. ; Installation Section
  449. ; ----------------------------------------------------------------------
  450. Install_Adapter = +
  451. ;
  452. ; First, check whether the same version of the software exists
  453. ;
  454. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  455. Ifstr $(KeyProduct) != $(KeyNull)
  456. ;
  457. ;
  458. ; Same version already existed in the local machine
  459. ; Popup the dialog and ask the user whether he wants to continue
  460. ;
  461. CloseRegKey $(KeyProduct)
  462. ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
  463. ;
  464. ; Cannot Install the same software again
  465. ;
  466. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  467. $(ProductVersion)
  468. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  469. goto Shell_Code_Error
  470. endif
  471. goto End
  472. else
  473. ;
  474. ; Make sure the user really wants to add a new adapter.
  475. ; Don't bother for automatic installation.
  476. ;
  477. ifstr(i) $(Option) != "MSMDGMPAUTO"
  478. ;
  479. ; Add a new adapter card?
  480. ;
  481. Shell $(UtilityInf), CardExistedDlg
  482. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  483. goto Shell_Code_Error
  484. endif
  485. ifstr(i) $($R1) != "OK"
  486. goto End
  487. endif
  488. endif
  489. set OldVersionExisted = $(TRUE)
  490. endif
  491. endif
  492. ; -----------------------------------------------------------------------
  493. ; Copy the driver and helper files from the distribution disk.
  494. ; -----------------------------------------------------------------------
  495. Install_Files = +
  496. Debug-Output "OEMNADMA.INF: Install Files"
  497. ifint $(OldVersionExisted) == $(FALSE)
  498. ifstr(i) $(!NTN_InstallMode) == "install"
  499. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR), "YES"
  500. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  501. goto Shell_Code_Error
  502. else-ifstr(i) $($R0) == STATUS_FAILED
  503. shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  504. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  505. goto Shell_Code_Error
  506. endif
  507. set Error = $($R0)
  508. goto Fatal
  509. else-ifstr(i) $($R0) == STATUS_USERCANCEL
  510. goto Successful
  511. endif
  512. set SrcDir = $($R1) ; Referenced in install sections.
  513. install "Install-Option"
  514. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  515. shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  516. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  517. goto Shell_Code_Error
  518. endif
  519. set Error = $($R0)
  520. goto Fatal
  521. endif
  522. endif
  523. endif
  524. ; -----------------------------------------------------------------------
  525. ; If the adapter option is MSMDGMPAUTO then we need to perform some adapter
  526. ; detection. In addition, we may not have been asked to detect the
  527. ; adapter but NCPA may have already done it for use. If it has then set
  528. ; up the detection variables from the values passed by NCPA.
  529. ; -----------------------------------------------------------------------
  530. ifstr(i) $(!STF_NCDETECT) == YES
  531. ifstr(i) $(!STF_NCOPTION) == $(Option)
  532. set AdapterDetected = TRUE
  533. set DetectOption = $(!STF_NCOPTION)
  534. set DetectIndex = $(!STF_NCDETCARD)
  535. goto Set_Installation_Defaults
  536. endif
  537. endif
  538. ; -----------------------------------------------------------------------
  539. ; Set some defaults that apply to all card types
  540. ; -----------------------------------------------------------------------
  541. Set_Installation_Defaults = +
  542. Debug-Output "OEMNADMA.INF: Set Install Defaults"
  543. StartWait
  544. ;
  545. ; Set up some defaults that are not affected by automatic detection.
  546. ;
  547. set MaxFrameSize = 4096
  548. set LAA = ""
  549. set RxTxSlots = *($(RxTxRawList),3)
  550. set StatsFlag = *($(StatsRawList),1)
  551. set SpeedFlag = 0
  552. set OldIrqNumber = $(VALUE_UNKNOWN)
  553. set OldDmaChannel = $(VALUE_UNKNOWN)
  554. set OldIoLocation = $(VALUE_UNKNOWN)
  555. set OldSlotNumber = $(VALUE_UNKNOWN)
  556. set OldMpFlag = $(VALUE_UNKNOWN)
  557. ;
  558. ; Now set up the options for adapter options.
  559. ;
  560. ifcontains(i) $(Option) in $(SlotNumberAdapters)
  561. set TypeList = {{SLOTNUMBER,SlotList,SlotNumber},+
  562. {DMACHANNEL,DmaList,DmaChannel},+
  563. {MULTIPROCESSOR,MpList,MpFlag}}
  564. else
  565. set TypeList = {{IOLOCATION,IoList,IoLocation},+
  566. {DMACHANNEL,DmaList,DmaChannel},+
  567. {INTERRUPTNUMBER,IrqList,IrqNumber},+
  568. {MULTIPROCESSOR,MpList,MpFlag}}
  569. endif
  570. Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  571. set Status = $($R0)
  572. ifstr(i) $(Status) != STATUS_SUCCESSFUL
  573. Debug-Output "OEMNADMA.INF: Param_BuildTypeLists returned "$(Status)
  574. goto Fatal
  575. endif
  576. ;
  577. ; If the adapter was automatically detected then call the
  578. ; DLL to find out what the parameters are.
  579. ;
  580. ifstr(i) $(AdapterDetected) == TRUE
  581. Debug-Output "OEMNADMA.INF: Calling Param_QueryCard"
  582. Shell $(ParamInf) Param_QueryCard $(DetectIndex)
  583. set Status = $($R0)
  584. set ParamList = $($R1)
  585. ifstr(i) $(Status) != STATUS_SUCCESSFUL
  586. goto Fatal
  587. endif
  588. endif
  589. ;
  590. ; And set the defaults. This will be the automatically detected
  591. ; value if the adapter was detected or the first allowable choice
  592. ; otherwise.
  593. ;
  594. Debug-Output "OEMNADMA.INF: Calling Param_SetDefaults"
  595. Shell $(ParamInf) Param_SetDefaults $(ParamList)
  596. Debug-Output "MADGE: SlotNumber = "$(SlotNumber)
  597. Debug-Output "MADGE: IoLocation = "$(IoLocation)
  598. Debug-Output "MADGE: IrqNumber = "$(IrqNumber)
  599. Debug-Output "MADGE: DmaChannel = "$(DmaChannel)
  600. Debug-Output "MADGE: MpFlag = "$(MpFlag)
  601. Debug-Output "MADGE: SlotList = "$(SlotList)
  602. Debug-Output "MADGE: IoList = "$(IoList)
  603. Debug-Output "MADGE: IrqList = "$(IrqList)
  604. Debug-Output "MADGE: DmaList = "$(DmaList)
  605. Debug-Output "MADGE: MpList = "$(MpList)
  606. ;
  607. ; Note what the hardware detectable values are for later.
  608. ;
  609. ifstr(i) $(AdapterDetected) == TRUE
  610. set OldSlotNumber = $(SlotNumber)
  611. set OldIoLocation = $(IoLocation)
  612. set OldIrqNumber = $(IrqNumber)
  613. set OldDmaChannel = $(DmaChannel)
  614. set OldMpFlag = $(MpFlag)
  615. endif
  616. set OldValueTitle = $(OldValueTitleInstall)
  617. EndWait
  618. goto Get_Adapter_Options
  619. ; -----------------------------------------------------------------------
  620. ; Configuration Section
  621. ; -----------------------------------------------------------------------
  622. Configure_Adapter = +
  623. StartWait
  624. ;
  625. ; Now set up the options for adapter options.
  626. ;
  627. ifcontains(i) $(Option) in $(SlotNumberAdapters)
  628. set TypeList = {{SLOTNUMBER,SlotList,SlotNumber},+
  629. {DMACHANNEL,DmaList,DmaChannel},+
  630. {MULTIPROCESSOR,MpList,MpFlag}}
  631. else
  632. set TypeList = {{IOLOCATION,IoList,IoLocation},+
  633. {DMACHANNEL,DmaList,DmaChannel},+
  634. {INTERRUPTNUMBER,IrqList,IrqNumber},+
  635. {MULTIPROCESSOR,MpList,MpFlag}}
  636. endif
  637. Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  638. set Status = $($R0)
  639. ifstr(i) $(Status) != STATUS_SUCCESSFUL
  640. goto fataldetect
  641. endif
  642. ;
  643. ; And set the defaults.
  644. ;
  645. Shell $(ParamInf) Param_SetDefaults $(ParamList)
  646. ;
  647. ; Set up the defaults not done by the help interface the
  648. ; detection DLL above.
  649. ;
  650. set MaxFrameSize = 4096
  651. set LAA = ""
  652. set RxTxSlots = *($(RxTxRawList),3)
  653. set StatsFlag = *($(StatsRawList),1)
  654. set NoMmioFlag = 0
  655. set SpeedFlag = 0
  656. set TransferType = $(TRANSFER_UNKNOWN)
  657. ;
  658. ; NB !NTN_RegBase, for hardware components, is :
  659. ; \SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\0x
  660. ;
  661. ;
  662. ; This next IF is redundant - it will always be NULL
  663. ;
  664. ifstr $(KeyProduct) == $(KeyNull)
  665. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  666. ifstr $(KeyProduct) == $(KeyNull)
  667. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  668. goto Fatal_Registry
  669. endif
  670. endif
  671. ;
  672. ; Get the other parameters; they're attached to the service
  673. ; parameters key
  674. ;
  675. Shell $(UtilityInf) FindService, $(KeyProduct)
  676. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  677. goto Shell_Code_Error
  678. endif
  679. ifstr(i) $($R0) != NO_ERROR
  680. goto Fatal_Registry
  681. endif
  682. set KeyParameters = $($R2)
  683. ;
  684. ; We don't need the services key, so close it.
  685. ;
  686. CloseRegKey $($R1)
  687. ifstr $(KeyParameters) == $(KeyNull)
  688. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  689. goto Fatal_Registry
  690. endif
  691. set OldVersionExisted = $(TRUE)
  692. ;
  693. ; Get the old values
  694. ;
  695. set ValueName = ""
  696. set ValueData = ""
  697. set ValueStr = ""
  698. set ValueList = {}
  699. EnumRegValue $(KeyParameters) ValueList
  700. ForListDo $(ValueList)
  701. set ValueItem = $($)
  702. set ValueName = *($(ValueItem),1)
  703. set ValueData = *($(ValueItem),4)
  704. ifstr(i) $(ValueName) == "InterruptNumber"
  705. set IrqNumber = $(ValueData)
  706. else-ifstr(i) $(ValueName) == "IoLocation"
  707. set IoLocation = $(ValueData)
  708. else-ifstr(i) $(ValueName) == "IoBaseAddress"
  709. set IoLocation = $(ValueData)
  710. else-ifstr(i) $(ValueName) == "DmaChannel"
  711. set DmaChannel = $(ValueData)
  712. else-ifstr(i) $(ValueName) == "SlotNumber"
  713. set SlotNumber = $(ValueData)
  714. else-ifstr(i) $(ValueName) == $(McaEisaKeyword)
  715. set McaEisaId = $(ValueData)
  716. else-ifstr(i) $(ValueName) == "MaxFrameSize"
  717. set MaxFrameSize = $(ValueData)
  718. else-ifstr(i) $(ValueName) == "NetworkAddress"
  719. set LAA = $(ValueData)
  720. else-ifstr(i) $(ValueName) == "RxTxSlots"
  721. set RxTxSlots = $(ValueData)
  722. else-ifstr(i) $(ValueName) == "PromiscuousModeX"
  723. set StatsFlag = $(ValueData)
  724. else-ifstr(i) $(ValueName) == "Multiprocessor"
  725. set MpFlag = $(ValueData)
  726. else-ifstr(i) $(ValueName) == "NoMmio"
  727. set NoMmioFlag = $(ValueData)
  728. else-ifstr(i) $(ValueName) == "Force16"
  729. set SpeedFlag = 2
  730. else-ifstr(i) $(ValueName) == "Force4"
  731. set SpeedFlag = 1
  732. else-ifstr(i) $(ValueName) == "TransferType"
  733. set TransferType = $(ValueData)
  734. endif
  735. EndForListDo
  736. ;
  737. ; For backward compatibility we translate a DMA channel of 0x8000
  738. ; into a DMA channel of $(GENERAL_PIO) and a multiprocessor flag of 1.
  739. ;
  740. ifint $(DmaChannel) == 32768
  741. set DmaChannel = $(GENERAL_PIO)
  742. set MpFlag = 1
  743. endif
  744. ;
  745. ; We now need to merge the DmaChannel and NoMmioFlag to produce a
  746. ; DmaChannel that completely specifies the transfer mode. When
  747. ; we called the detection DLL to get the defaults DmaChannel will
  748. ; have been set up properly, including setting unspecific DMA for
  749. ; EISA, MC and PCI. If we have an MMIO supporting adapter the rule is
  750. ; as follows.
  751. ;
  752. ; If the NoMmio flag is set then we must not use so MMIO we force
  753. ; the transfer type to be PIO.
  754. ;
  755. ; If the NoMmio flag is not set then we use MMIO.
  756. ;
  757. ifcontains(i) $(GENERAL_MMIO) in $(DmaList)
  758. ifint $(NoMmioFlag) != 0
  759. set DmaChannel = $(GENERAL_PIO)
  760. else
  761. set DmaChannel = $(GENERAL_MMIO)
  762. endif
  763. endif
  764. ;
  765. ; If the TransferType flag is set to PIO and this adapter supports
  766. ; PIO then force PIO irrespective of the current value of DmaChannel.
  767. ;
  768. ifint $(TransferType) == $(TRANSFER_PIO)
  769. ifcontains(i) $(GENERAL_PIO) in $(DmaList)
  770. set DmaChannel = $(GENERAL_PIO)
  771. endif
  772. endif
  773. ;
  774. ; If the TransferType flag is set to unspecified DMA and this
  775. ; adapter supports unspecified DMA then force unspecified DMA
  776. ; irrespective of the current value of DMA channel. This
  777. ; code is needed for adapters like PCI (BM) where both
  778. ; PIO and unspecific DMA is supported (EISA and MC adapters
  779. ; only support unspecific DMA and ISA devices have DmaChannel
  780. ; set to a specific value.)
  781. ;
  782. ifint $(TransferType) == $(TRANSFER_DMA)
  783. ifcontains(i) $(GENERAL_DMA) in $(DmaList)
  784. set DmaChannel = $(GENERAL_DMA)
  785. endif
  786. endif
  787. ;
  788. ; Make a note of the current values.
  789. ;
  790. set OldSlotNumber = $(SlotNumber)
  791. set OldIoLocation = $(IoLocation)
  792. set OldIrqNumber = $(IrqNumber)
  793. set OldDmaChannel = $(DmaChannel)
  794. set OldMpFlag = $(MpFlag)
  795. set OldValueTitle = $(OldValueTitleConfigure)
  796. EndWait
  797. ; -----------------------------------------------------------------------
  798. ; Let the user set options.
  799. ; -----------------------------------------------------------------------
  800. Get_Adapter_Options = +
  801. Debug-Output "OEMNADMA.INF: Get_Adapter_Options"
  802. StartWait
  803. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  804. ifstr(i) $(!STF_NCDETINFO) == {}
  805. ifstr(i) $(!AutoNetInterfaceType) != ""
  806. set BusInterfaceType = $(!AutoNetInterfaceType)
  807. else
  808. set BusInterfaceType = 1 ;ISA
  809. endif
  810. ifstr(i) $(!AutoNetBusNumber) != ""
  811. set BusNumber = $(!AutoNetBusNumber)
  812. else
  813. set BusNumber = 0
  814. endif
  815. else
  816. ifstr(i) $(!AutoNetInterfaceType) != ""
  817. set BusInterfaceType = $(!AutoNetInterfaceType)
  818. else
  819. set BusInterfaceType = *($(!STF_NCDETINFO),5)
  820. endif
  821. ifstr(i) $(!AutoNetBusNumber) != ""
  822. set BusNumber = $(!AutoNetBusNumber)
  823. else
  824. set BusNumber = *($(!STF_NCDETINFO),6)
  825. endif
  826. endif
  827. goto adapterverify
  828. endif
  829. ;
  830. ; Need to be able to tell if the LAA or statistics gathering
  831. ; flag have changed.
  832. ;
  833. set OldLAA = $(LAA)
  834. set OldStatsFlag = $(StatsFlag)
  835. set OldSpeedFlag = $(SpeedFlag)
  836. ;
  837. ; Set up the list of adapter ring speeds.
  838. ;
  839. set SpeedRawList = $(SpeedRawList$(Option))
  840. set SpeedUserList = $(SpeedUserList$(Option))
  841. ;
  842. ; Map the parameter lists into the form we present to the user.
  843. ; We only ever do this once.
  844. ;
  845. ifstr(i) $(MappedRawParameters) == FALSE
  846. ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  847. set TempList = $(IoList)
  848. set IoList = {}
  849. ForListDo $(TempList)
  850. set IoList = >($(IoList), *($(IoUserList),~($(IoRawList),$($))))
  851. EndForListDo
  852. set TempList = $(IrqList)
  853. set IrqList = {}
  854. ForListDo $(TempList)
  855. set IrqList = >($(IrqList), *($(IrqUserList),~($(IrqRawList),$($))))
  856. EndForListDo
  857. else
  858. set TempList = $(SlotList)
  859. set SlotList = {}
  860. ForListDo $(TempList)
  861. set SlotList = >($(SlotList), *($(SlotUserList),~($(SlotRawList),$($))))
  862. EndForListDo
  863. endif
  864. set TempList = $(DmaList)
  865. set DmaList = {}
  866. ForListDo $(TempList)
  867. set DmaList = >($(DmaList), *($(DmaUserList),~($(DmaRawList),$($))))
  868. EndForListDo
  869. set TempList = $(MpList)
  870. set MpList = {}
  871. ForListDo $(TempList)
  872. set MpList = >($(MpList), *($(MpUserList),~($(MpRawList),$($))))
  873. EndForListDo
  874. set MappedRawParameters = TRUE
  875. endif
  876. EndWait
  877. Get_Adapter_Options_Restart = +
  878. ;
  879. ; We will start here if parameter validation fails.
  880. ;
  881. StartWait
  882. set From = Get_Adapter_Options_Restart
  883. ;
  884. ; Map the currently selected values into user from.
  885. ;
  886. ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  887. set IoLocation = *($(IoUserList),~($(IoRawList),$(IoLocation)))
  888. set OldIoLocation = *($(IoUserList),~($(IoRawList),$(OldIoLocation)))
  889. set IrqNumber = *($(IrqUserList),~($(IrqRawList),$(IrqNumber)))
  890. set OldIrqNumber = *($(IrqUserList),~($(IrqRawList),$(OldIrqNumber)))
  891. else
  892. set SlotNumber = *($(SlotUserList),~($(SlotRawList),$(SlotNumber)))
  893. set OldSlotNumber = *($(SlotUserList),~($(SlotRawList),$(OldSlotNumber)))
  894. endif
  895. set DmaChannel = *($(DmaUserList),~($(DmaRawList),$(DmaChannel)))
  896. set OldDmaChannel = *($(DmaUserList),~($(DmaRawList),$(OldDmaChannel)))
  897. set MpFlag = *($(MpUserList),~($(MpRawList),$(MpFlag)))
  898. set OldMpFlag = *($(MpUserList),~($(MpRawList),$(OldMpFlag)))
  899. set StatsFlag = *($(StatsUserList),~($(StatsRawList),$(StatsFlag)))
  900. set RxTxSlots = *($(RxTxUserList),~($(RxTxRawList),$(RxTxSlots)))
  901. set SpeedFlag = *($(SpeedUserList),~($(SpeedRawList),$(SpeedFlag)))
  902. ;
  903. ; Set up the input dialog box text and lists.
  904. ;
  905. read-syms FileDependentDlg$(!STF_LANGUAGE)
  906. ;
  907. ; Decide which dialog box to use.
  908. ;
  909. Debug-Output "MADGE: Option = "$(Option)
  910. Debug-Output "MADGE: SlotNumberAdapters = "$(SlotNumberAdapters)
  911. ifcontains(i) $(Option) in $(SlotNumberAdapters)
  912. set DlgTemplate = "MDGEISA"
  913. else
  914. set DlgTemplate = "MDGISA"
  915. endif
  916. Debug-Output "MADGE: DlgTemplate = "$(DlgTemplate)
  917. ;
  918. ; To allow us to re-use the EISA/MCA dialog box for PCI we need
  919. ; to change Combo8Label.
  920. ;
  921. ifstr(i) $(Option) == "MSMDGMPPCI"
  922. set Combo8Label = $(PciCombo8Label)
  923. endif
  924. ;
  925. ; Let the user press some keys.
  926. ;
  927. LoadLibrary "x" $(DialogDllName) MdgDialog
  928. EndWait
  929. ui start "InputDlg" $(MdgDialog)
  930. StartWait
  931. ifstr(i) $(DLGEVENT) == "EXIT"
  932. set CommonStatus = STATUS_USERCANCEL
  933. ui pop 1
  934. FreeLibrary $(MdgDialog)
  935. goto End
  936. else-ifstr(i) $(DLGEVENT) != "CONTINUE"
  937. ui pop 1
  938. FreeLibrary $(MdgDialog)
  939. goto End
  940. endif
  941. ;
  942. ; Get the values the user selected out of the dialog box.
  943. ;
  944. set IrqNumber = $(Combo1Out)
  945. set IoLocation = $(Combo2Out)
  946. set DmaChannel = $(Combo3Out)
  947. set RxTxSlots = $(Combo4Out)
  948. set StatsFlag = $(Combo5Out)
  949. set MpFlag = $(Combo7Out)
  950. set SlotNumber = $(Combo8Out)
  951. set SpeedFlag = $(Combo9Out)
  952. set MaxFrameSize = *($(EditTextOut), 1)
  953. set LAA = *($(EditTextOut), 2)
  954. ui pop 1
  955. FreeLibrary $(MdgDialog)
  956. Debug-Output "MADGE: SlotNumber = "$(SlotNumber)
  957. Debug-Output "MADGE: IoLocation = "$(IoLocation)
  958. Debug-Output "MADGE: IrqNumber = "$(IrqNumber)
  959. Debug-Output "MADGE: DmaChannel = "$(DmaChannel)
  960. Debug-Output "MADGE: MpFlag = "$(MpFlag)
  961. Debug-Output "MADGE: RxTxSlots = "$(RxTxSlots)
  962. Debug-Output "MADGE: StatsFlag = "$(StatsFlag)
  963. ;
  964. ; Convert the values the user has chosen into internal form.
  965. ;
  966. ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  967. set IoLocation = *($(IoRawList),~($(IoUserList),$(IoLocation)))
  968. set OldIoLocation = *($(IoRawList),~($(IoUserList),$(OldIoLocation)))
  969. set IrqNumber = *($(IrqRawList),~($(IrqUserList),$(IrqNumber)))
  970. set OldIrqNumber = *($(IrqRawList),~($(IrqUserList),$(OldIrqNumber)))
  971. else
  972. set SlotNumber = *($(SlotRawList),~($(SlotUserList),$(SlotNumber)))
  973. set OldSlotNumber = *($(SlotRawList),~($(SlotUserList),$(OldSlotNumber)))
  974. endif
  975. set DmaChannel = *($(DmaRawList),~($(DmaUserList),$(DmaChannel)))
  976. set OldDmaChannel = *($(DmaRawList),~($(DmaUserList),$(OldDmaChannel)))
  977. set MpFlag = *($(MpRawList),~($(MpUserList),$(MpFlag)))
  978. set OldMpFlag = *($(MpRawList),~($(MpUserList),$(OldMpFlag)))
  979. set StatsFlag = *($(StatsRawList),~($(StatsUserList),$(StatsFlag)))
  980. set RxTxSlots = *($(RxTxRawList),~($(RxTxUserList),$(RxTxSlots)))
  981. set SpeedFlag = *($(SpeedRawList),~($(SpeedUserList),$(SpeedFlag)))
  982. Debug-Output "MADGE: SlotNumber = "$(SlotNumber)
  983. Debug-Output "MADGE: IoLocation = "$(IoLocation)
  984. Debug-Output "MADGE: IrqNumber = "$(IrqNumber)
  985. Debug-Output "MADGE: DmaChannel = "$(DmaChannel)
  986. Debug-Output "MADGE: MpFlag = "$(MpFlag)
  987. Debug-Output "MADGE: RxTxSlots = "$(RxTxSlots)
  988. Debug-Output "MADGE: StatsFlag = "$(StatsFlag)
  989. EndWait
  990. ; -----------------------------------------------------------------------
  991. ; Verify the adapter options.
  992. ; -----------------------------------------------------------------------
  993. Adapter_Verify = +
  994. StartWait
  995. ;
  996. ; If the user entered an LAA then validate it.
  997. ;
  998. ifstr $(LAA) != ""
  999. ;
  1000. ; NB A line of spaces will come through here, and will fail the
  1001. ; check - do we want this?
  1002. ;
  1003. LoadLibrary "x" $(DialogDllName) MdgDialog
  1004. set FLibraryErrCtl = 1
  1005. LibraryProcedure MdgResult $(MdgDialog) MadgeLAACheck $(LAA)
  1006. set FLibraryErrCtl = 0
  1007. FreeLibrary $(MdgDialog)
  1008. ifstr $(MdgResult) != "MADGE_STATUS_SUCCESS"
  1009. ;
  1010. ;
  1011. ; Illegal LAA supplied in the install dialog
  1012. ; Display error message and go around again
  1013. ;
  1014. set Error = $(MdgResult)
  1015. ;
  1016. ; This will go back to Get_Adapter_Options or to end.
  1017. ;
  1018. goto Non_Fatal
  1019. endif
  1020. endif
  1021. ifint $(MaxFrameSize) > 17839
  1022. ;
  1023. ; 17839 is the maximum frame size at 16Mbps, while at 4Mbps it is 4472.
  1024. ; Unfortunately, we can't tell here what the ring speed is, so guess at
  1025. ; 16Mbps, which is the most sensible.
  1026. ;
  1027. set MaxFrameSize = 17839
  1028. set Error = $(TRIMMED_MFS)
  1029. set From = Update_Registry
  1030. goto Non_Fatal_Info
  1031. endif
  1032. ifstr(i) $(!STF_NCDETINFO) == {}
  1033. Shell $(UtilityInf), GetBusTypeDialog, $(ProductHardware$(Option)Description) $(BusNumber)
  1034. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1035. goto Shell_Code_Error
  1036. endif
  1037. set BusInterfaceType = $($R1)
  1038. set BusNumber = $($R2)
  1039. else
  1040. set BusInterfaceType = *($(!STF_NCDETINFO),5)
  1041. set BusNumber = *($(!STF_NCDETINFO),6)
  1042. endif
  1043. adapterverify = +
  1044. Debug-Output "At adapterverify"
  1045. Shell "" DebugConfiguration "after running dialog"
  1046. ;===================================================
  1047. ; Netcard Detection logic
  1048. ;
  1049. ; If this is a detected card, attempt to validate the options
  1050. ;
  1051. Ifstr(i) $(AdapterDetected) != TRUE
  1052. Goto Update_Registry
  1053. Endif
  1054. Debug-Output "OEMNADMA.INF: Calling Param_VerifyCard"
  1055. Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  1056. Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  1057. Debug-Output "OEMNADMA.INF: Param_VerifyCard succeeded"
  1058. Goto Update_Registry
  1059. Endif
  1060. ;
  1061. ; Give the user a chance to retry or force the options given.
  1062. ;
  1063. Set from = Get_Adapter_Options
  1064. Set to = Update_Registry
  1065. Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  1066. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1067. Debug-Output "ShellCode error: cannot get an error string."
  1068. goto ShellCodeError
  1069. endif
  1070. set Error = $($R0)
  1071. Goto Warning
  1072. ;
  1073. ; End Netcard Detection logic
  1074. ;===================================================
  1075. EndWait
  1076. ; -----------------------------------------------------------------------
  1077. ; We have checked the options so add the software parameters to the
  1078. ; registry.
  1079. ; -----------------------------------------------------------------------
  1080. Update_Registry = +
  1081. ;
  1082. ; If installing, go create the necessary keys;
  1083. ; if configuring, they're already open.
  1084. ;
  1085. ifint $(OldVersionExisted) == $(TRUE)
  1086. ifstr(i) $(!NTN_InstallMode) == configure
  1087. goto Write_Parameters
  1088. endif
  1089. endif
  1090. StartWait
  1091. ;
  1092. ; Add Software Component.
  1093. ;
  1094. ifint $(OldVersionExisted) == $(FALSE)
  1095. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  1096. $(ProductSoftwareName), +
  1097. $(ProductSoftwareName), +
  1098. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  1099. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  1100. $(MadgeEventLogFile)
  1101. Set OEM_ABANDON_SOFTWARE = TRUE
  1102. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1103. goto Shell_Code_Error
  1104. endif
  1105. ;
  1106. ; At this point:
  1107. ; $R1 contains the product version key handle;
  1108. ; $R2 contains the NetRules subkey handle;
  1109. ; $R3 contains the new Services key handle; and
  1110. ; $R4 contains the Parameters key
  1111. ; $R5 contains the Linkage Key
  1112. ;
  1113. set RegistryErrorIndex = $($R0)
  1114. set KeyProduct = $($R1)
  1115. Set SoftNetRulesKey = $($R2)
  1116. CloseRegKey $($R3)
  1117. CloseRegKey $($R4)
  1118. CloseRegKey $($R5)
  1119. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1120. ;
  1121. CloseRegKey $(KeyProduct)
  1122. CloseRegKey $(SoftNetRulesKey)
  1123. goto Fatal_Registry
  1124. ;
  1125. endif
  1126. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  1127. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  1128. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  1129. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  1130. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  1131. {PathName,$(NoTitle),$(!REG_VT_SZ),$(!STF_CWDDIR)},+
  1132. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  1133. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1134. Shell $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  1135. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1136. goto Shell_Code_Error
  1137. endif
  1138. set RegistryErrorIndex = $($R0)
  1139. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1140. CloseRegKey $(KeyProduct)
  1141. CloseRegKey $(SoftNetRulesKey)
  1142. goto Fatal_Registry
  1143. endif
  1144. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  1145. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  1146. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  1147. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  1148. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  1149. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, +
  1150. {Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)} }
  1151. Shell $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  1152. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1153. goto Shell_Code_Error
  1154. endif
  1155. set RegistryErrorIndex = $($R0)
  1156. CloseRegKey $(KeyProduct)
  1157. CloseRegKey $(SoftNetRulesKey)
  1158. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1159. goto Fatal_Registry
  1160. endif
  1161. endif
  1162. ;
  1163. ; Create the HARDWARE\Netcard region and its corresponding service
  1164. ;
  1165. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  1166. ifint $($R4) != -1
  1167. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  1168. endif
  1169. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1170. goto Shell_Code_Error
  1171. endif
  1172. set RegistryErrorIndex = $($R0)
  1173. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1174. CloseRegKey $($R1)
  1175. CloseRegKey $($R2)
  1176. CloseRegKey $($R3)
  1177. goto Fatal_Registry
  1178. endif
  1179. ;
  1180. ; At this point:
  1181. ; $R1 Registry key variable for HARDWARE\Netcard\(n)
  1182. ; $R2 Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  1183. ; $R3 Registry key handle for <service>\Parameters key
  1184. ; $R4 Adapter number assigned to adapter
  1185. ; $R5 Service name generated by combining svc name with adapter number
  1186. ;
  1187. set KeyParameters = $($R3)
  1188. set KeyAdapterRules = $($R2)
  1189. set AdapterNumber = $($R4)
  1190. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  1191. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  1192. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  1193. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  1194. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  1195. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  1196. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1197. Shell $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  1198. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1199. goto Shell_Code_Error
  1200. endif
  1201. CloseRegKey $($R1)
  1202. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  1203. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  1204. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  1205. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  1206. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  1207. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, +
  1208. {Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)}}
  1209. Shell $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  1210. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1211. goto Shell_Code_Error
  1212. endif
  1213. set RegistryErrorIndex = $($R0)
  1214. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1215. CloseRegKey $(KeyParameters)
  1216. CloseRegKey $(KeyAdapterRules)
  1217. goto Fatal_Registry
  1218. endif
  1219. CloseRegKey $(KeyAdapterRules)
  1220. EndWait
  1221. ; ----------------------------------------------------------------------
  1222. ; Write the adapter parameters into the registry.
  1223. ; ----------------------------------------------------------------------
  1224. ;
  1225. ; REQUIRED: $(KeyParameters) contains service Parameters key handle.
  1226. ;
  1227. Write_Parameters = +
  1228. StartWait
  1229. ;
  1230. ; It would appear that when installing a PCMCIA adapter
  1231. ; one should give the bus type of the PCMCIA controller
  1232. ; rather than PCMCIA itself.
  1233. ;
  1234. ifstr(i) $(Option) == "MSMDGMPPCMCIA"
  1235. set BusInterfaceType = 1
  1236. endif
  1237. ;
  1238. ; We need to examine DmaChannel to decide on how to set DmaChannel
  1239. ; and NoMmio. We use a very simple test - if DmaChannel is not
  1240. ; $(GENERAL_MMIO) then we set NoMmio, otherwise we clear it. We
  1241. ; probably should abandon this flag since we can convey the same
  1242. ; information in a more consistent form in the TransferType
  1243. ; parameter below. We'll keep it for backwards compatability.
  1244. ;
  1245. ifint $(DmaChannel) == $(GENERAL_MMIO)
  1246. set NoMmioFlag = 0
  1247. else
  1248. set NoMmioFlag = 1
  1249. endif
  1250. ;
  1251. ; Work out the general transfer type.
  1252. ;
  1253. ifint $(DmaChannel) == $(GENERAL_PIO)
  1254. set TransferType = $(TRANSFER_PIO)
  1255. else-ifint $(DmaChannel) == $(GENERAL_MMIO)
  1256. set TransferType = $(TRANSFER_MMIO)
  1257. else
  1258. set TransferType = $(TRANSFER_DMA)
  1259. endif
  1260. ;
  1261. ; Derive the adapter type.
  1262. ;
  1263. set AdapterTypeFlag = $(AdapterTypeFlag$(Option))
  1264. ;
  1265. ; Add the rest of the parameters to the Services adapter area.
  1266. ;
  1267. ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  1268. set NewValueList = {{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IrqNumber)},+
  1269. {BusType, $(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
  1270. {BusNumber, $(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  1271. {MediaType, $(NoTitle),$(!REG_VT_DWORD),2},+
  1272. {IoLocation, $(NoTitle),$(!REG_VT_DWORD),$(IoLocation)},+
  1273. {IoBaseAddress, $(NoTitle),$(!REG_VT_DWORD),$(IoLocation)},+
  1274. {DmaChannel, $(NoTitle),$(!REG_VT_DWORD),$(DmaChannel)},+
  1275. {NoMmio, $(NoTitle),$(!REG_VT_DWORD),$(NoMmioFlag)},+
  1276. {TransferType, $(NoTitle),$(!REG_VT_DWORD),$(TransferType)},+
  1277. {RxTxSlots, $(NoTitle),$(!REG_VT_DWORD),$(RxTxSlots)},+
  1278. {Multiprocessor, $(NoTitle),$(!REG_VT_DWORD),$(MpFlag)},+
  1279. {MaxFrameSize, $(NoTitle),$(!REG_VT_DWORD),$(MaxFrameSize)},+
  1280. {AdapterType, $(NoTitle),$(!REG_VT_DWORD),$(AdapterTypeFlag)}}
  1281. else
  1282. set NewValueList = {+
  1283. {BusType, $(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
  1284. {BusNumber, $(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  1285. {MediaType, $(NoTitle),$(!REG_VT_DWORD),2},+
  1286. {SlotNumber, $(NoTitle),$(!REG_VT_DWORD),$(SlotNumber)},+
  1287. {NoMmio, $(NoTitle),$(!REG_VT_DWORD),$(NoMmioFlag)},+
  1288. {TransferType, $(NoTitle),$(!REG_VT_DWORD),$(TransferType)},+
  1289. {RxTxSlots, $(NoTitle),$(!REG_VT_DWORD),$(RxTxSlots)},+
  1290. {Multiprocessor, $(NoTitle),$(!REG_VT_DWORD),$(MpFlag)},+
  1291. {MaxFrameSize, $(NoTitle),$(!REG_VT_DWORD),$(MaxFrameSize)},+
  1292. {AdapterType, $(NoTitle),$(!REG_VT_DWORD),$(AdapterTypeFlag)}}
  1293. endif
  1294. ;
  1295. ; Add specific card ID
  1296. ;
  1297. ifstr(i) $(ID$(Option)) != ""
  1298. set NewValueList = >($(NewValueList),+
  1299. {$(IDV$(Option)), $(NoTitle), $(!REG_VT_DWORD), $(ID$(Option))})
  1300. endif
  1301. ;
  1302. ; Add the LAA if there is one.
  1303. ;
  1304. ifstr $(LAA) != ""
  1305. set NewValueList = >($(NewValueList),+
  1306. {NetworkAddress, $(NoTitle), $(!REG_VT_SZ), $(LAA)})
  1307. endif
  1308. ;
  1309. ; Enable promiscuous mode if required.
  1310. ;
  1311. ifstr $(StatsFlag) == "1"
  1312. set NewValueList = >($(NewValueList),+
  1313. {PromiscuousModeX, $(NoTitle), $(!REG_VT_DWORD), $(StatsFlag)})
  1314. endif
  1315. ;
  1316. ; Enable Force4 mode if required.
  1317. ;
  1318. ifstr $(SpeedFlag) == "1"
  1319. set NewValueList = >($(NewValueList),+
  1320. {Force4, $(NoTitle), $(!REG_VT_DWORD), 1})
  1321. endif
  1322. ;
  1323. ; Enable Force16 mode if required.
  1324. ;
  1325. ifstr $(SpeedFlag) == "2"
  1326. set NewValueList = >($(NewValueList),+
  1327. {Force16, $(NoTitle), $(!REG_VT_DWORD), 1})
  1328. endif
  1329. ;
  1330. ; If this is a PCMCIA adapter we need to a PCMCIA flag.
  1331. ;
  1332. ifstr(i) $(Option) == "MSMDGMPPCMCIA"
  1333. set NewValueList = >($(NewValueList),+
  1334. {Pcmcia, $(NoTitle), $(!REG_VT_DWORD), 1})
  1335. endif
  1336. ;
  1337. ; And add the parameters to the registry.
  1338. ;
  1339. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  1340. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1341. goto Shell_Code_Error
  1342. endif
  1343. set RegistryErrorIndex = $($R0)
  1344. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1345. CloseRegKey $(KeyParameters)
  1346. goto Fatal_Registry
  1347. endif
  1348. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  1349. Shell $(UtilityInf),AddDefaultNetCardParameters,$(KeyParameters)
  1350. endif
  1351. ;
  1352. ; If the old LAA has been cleared then so delete the key
  1353. ; from registry.
  1354. ;
  1355. ifstr $(OldLAA) != ""
  1356. ifstr $(LAA) == ""
  1357. DeleteRegValue $(KeyParameters) NetworkAddress
  1358. endif
  1359. endif
  1360. ;
  1361. ; If Force4 mode has been disabled then delete the key.
  1362. ;
  1363. ifstr $(OldSpeedFlag) == "1"
  1364. ifstr $(SpeedFlag) != "1"
  1365. DeleteRegValue $(KeyParameters) Force4
  1366. endif
  1367. endif
  1368. ;
  1369. ; If Force16 mode has been disabled then delete the key.
  1370. ;
  1371. ifstr $(OldSpeedFlag) == "2"
  1372. ifstr $(SpeedFlag) != "2"
  1373. DeleteRegValue $(KeyParameters) Force16
  1374. endif
  1375. endif
  1376. ;
  1377. ; If promiscuous mode has been disabled then delete the key.
  1378. ;
  1379. ifstr $(OldStatsFlag) != "0"
  1380. ifstr $(StatsFlag) == "0"
  1381. DeleteRegValue $(KeyParameters) PromiscuousModeX
  1382. endif
  1383. endif
  1384. CloseRegKey $(KeyParameters)
  1385. EndWait
  1386. goto Successful
  1387. ; -----------------------------------------------------------------------
  1388. ; Binding section
  1389. ; -----------------------------------------------------------------------
  1390. Binding_Adapter =+
  1391. set Error = "Binding: Sorry, not yet implemented."
  1392. goto Fatal
  1393. ; -----------------------------------------------------------------------
  1394. ; Removal section
  1395. ; -----------------------------------------------------------------------
  1396. Remove_Adapter = +
  1397. StartWait
  1398. ;
  1399. ; Remove the software component if required.
  1400. ;
  1401. ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1402. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1403. $(ProductSoftwareName)
  1404. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1405. goto Shell_Code_Error
  1406. endif
  1407. set RegistryErrorIndex = $($R0)
  1408. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1409. goto Fatal_Registry
  1410. endif
  1411. ;
  1412. ; Or, the hardware component.
  1413. ;
  1414. else
  1415. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1416. $(ProductSoftwareName), $(!NTN_RegBase)
  1417. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1418. goto Shell_Code_Error
  1419. endif
  1420. set RegistryErrorIndex = $($R0)
  1421. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1422. goto Fatal_Registry
  1423. endif
  1424. endif
  1425. EndWait
  1426. goto End
  1427. ; -----------------------------------------------------------------------
  1428. ; Upgrade Software section.
  1429. ; -----------------------------------------------------------------------
  1430. Upgrade_Software = +
  1431. StartWait
  1432. ;
  1433. ; First determine whether we want to do upgrade or update for software
  1434. ; or hardware component. Then we will determine whether the Mode is
  1435. ; update or upgrade.
  1436. ;
  1437. ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1438. ;
  1439. ;
  1440. ; Upgrade software component
  1441. ;
  1442. ; see whether the same version exist or not
  1443. ;
  1444. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1445. ifstr $(KeyProduct) != $(KeyNull)
  1446. GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1447. set Version = *($(VersionInfo), 4)
  1448. ;
  1449. ; Update the binaries
  1450. ;
  1451. shell $(UtilityInf) GetInfFileNameFromRegistry $(KeyProduct)
  1452. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1453. goto Shell_Code_Error
  1454. endif
  1455. set !UG_Filename = $($R0)
  1456. ifstr(i) $(!UG_Filename) != ""
  1457. install "Install-Update"
  1458. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1459. goto Fatal
  1460. endif
  1461. endif
  1462. CloseRegKey $(KeyProduct)
  1463. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1464. ;
  1465. ; Upgrade the version number
  1466. ;
  1467. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1468. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1469. ifint $(Version) != $(ProductMajorVersion)
  1470. ;
  1471. ;
  1472. ; If the major version number is not the same,
  1473. ; it is major upgrade. So let Upgrade the product
  1474. ;
  1475. ;
  1476. ; make other upgrade change if necessary
  1477. ;
  1478. ;
  1479. endif
  1480. CloseRegKey $(KeyProduct)
  1481. else
  1482. ;
  1483. ;
  1484. ; Cannot Open software key, goto ERROR
  1485. ;
  1486. goto Fatal_Registry
  1487. ;
  1488. endif
  1489. ;
  1490. ; Enumerate all netcards installed of this type and update them
  1491. ;
  1492. set iSearch = 1
  1493. nextnetcard = +
  1494. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  1495. set KeyNetcard = $($R0)
  1496. set iSearch = $($R1)
  1497. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  1498. Ifstr $(KeyNetcard) != $(KeyNull)
  1499. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  1500. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  1501. CloseRegKey $(KeyNetcard)
  1502. goto nextnetcard
  1503. Endif
  1504. else
  1505. ;
  1506. ; We cannot upgrade the hardware component.
  1507. ;
  1508. set Error = ""
  1509. set OEM_ABANDON_ON = FALSE
  1510. goto Not_Supported
  1511. endif
  1512. EndWait
  1513. goto End
  1514. ; -----------------------------------------------------------------------
  1515. ; Escape hatches
  1516. ; -----------------------------------------------------------------------
  1517. Successful = +
  1518. goto End
  1519. ; -----------------------------------------------------------------------
  1520. Abandon = +
  1521. ForListDo $(OEM_ABANDON_OPTIONS)
  1522. ;
  1523. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1524. $(ProductSoftwareName), $($)
  1525. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1526. ;
  1527. goto Shell_Code_Error
  1528. ;
  1529. endif
  1530. set RegistryErrorIndex = $($R0)
  1531. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1532. ;
  1533. goto Fatal_Registry
  1534. ;
  1535. endif
  1536. ;
  1537. EndForListDo
  1538. ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1539. ;
  1540. ;
  1541. ; Remove Software Component
  1542. ;
  1543. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1544. $(ProductSoftwareName), FALSE
  1545. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1546. ;
  1547. goto Shell_Code_Error
  1548. ;
  1549. endif
  1550. set RegistryErrorIndex = $($R0)
  1551. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1552. ;
  1553. goto Fatal_Registry
  1554. ;
  1555. endif
  1556. ;
  1557. endif
  1558. goto End
  1559. ; -----------------------------------------------------------------------
  1560. Warning = +
  1561. EndWait
  1562. Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1563. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1564. ;
  1565. goto Shell_Code_Error
  1566. ;
  1567. endif
  1568. ifstr(i) $($R1) == "OK"
  1569. ;
  1570. goto $(To)
  1571. ;
  1572. else-ifstr(i) $($R1) == "CANCEL"
  1573. ;
  1574. goto $(From)
  1575. ;
  1576. endif
  1577. goto End
  1578. ; -----------------------------------------------------------------------
  1579. Non_Fatal_Info = +
  1580. set Severity = STATUS
  1581. set CommonStatus = STATUS_USERCANCEL
  1582. goto Non_Fatal_Msg
  1583. ; -----------------------------------------------------------------------
  1584. Non_Fatal = +
  1585. set Severity = NONFATAL
  1586. goto Non_Fatal_Msg
  1587. ; -----------------------------------------------------------------------
  1588. Non_Fatal_Msg = +
  1589. EndWait
  1590. ifstr(i) $(Error) == ""
  1591. ;
  1592. set Severity = NONFATAL
  1593. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1594. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1595. ;
  1596. goto Shell_Code_Error
  1597. ;
  1598. endif
  1599. set Error = $($R0)
  1600. ;
  1601. endif
  1602. Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  1603. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1604. ;
  1605. goto Shell_Code_Error
  1606. ;
  1607. endif
  1608. ifstr(i) $($R1) == "OK"
  1609. ;
  1610. goto $(From)
  1611. ;
  1612. endif
  1613. goto End
  1614. ; -----------------------------------------------------------------------
  1615. Fatal_Registry = +
  1616. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1617. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1618. ;
  1619. goto Shell_Code_Error
  1620. ;
  1621. endif
  1622. set Error = $($R0)
  1623. goto Fatal
  1624. ; -----------------------------------------------------------------------
  1625. ;
  1626. ; Netcard detection failure
  1627. ;
  1628. fataldetect = +
  1629. Debug-Output "At fataldetect"
  1630. Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1631. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1632. Debug-Output "ShellCode error: cannot get an error string."
  1633. goto ShellCodeError
  1634. endif
  1635. set Error = $($R0)
  1636. Goto fatal
  1637. ; -----------------------------------------------------------------------
  1638. Fatal = +
  1639. EndWait
  1640. ifstr(i) $(Error) == ""
  1641. ;
  1642. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1643. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1644. ;
  1645. goto Shell_Code_Error
  1646. ;
  1647. endif
  1648. set Error = $($R0)
  1649. ;
  1650. endif
  1651. Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1652. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1653. ;
  1654. goto Shell_Code_Error
  1655. ;
  1656. endif
  1657. goto Set_Failed
  1658. ; -----------------------------------------------------------------------
  1659. Not_Supported = +
  1660. EndWait
  1661. ifstr(i) $(Error) == ""
  1662. ;
  1663. Shell $(UtilityInf) RegistryErrorString "OPERATION_UNIMPLEMENTED"
  1664. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1665. ;
  1666. goto Shell_Code_Error
  1667. ;
  1668. endif
  1669. set Error = $($R0)
  1670. ;
  1671. endif
  1672. Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1673. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1674. ;
  1675. goto Shell_Code_Error
  1676. ;
  1677. endif
  1678. goto End
  1679. ; -----------------------------------------------------------------------
  1680. Shell_Code_Error = +
  1681. EndWait
  1682. set DlgType = "MessageBox"
  1683. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1684. set STF_MB_TEXT = $(ShellCodeErrorText)
  1685. set STF_MB_TYPE = 1
  1686. set STF_MB_ICON = 3
  1687. set STF_MB_DEF = 1
  1688. ui start "Error Message"
  1689. goto Set_Failed
  1690. ; -----------------------------------------------------------------------
  1691. Set_Failed = +
  1692. set CommonStatus = STATUS_FAILED
  1693. ;
  1694. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1695. ;
  1696. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1697. ;
  1698. set OEM_ABANDON_ON = FALSE
  1699. goto Abandon
  1700. ;
  1701. endif
  1702. goto End
  1703. ; -----------------------------------------------------------------------
  1704. End = +
  1705. goto Term
  1706. ; -----------------------------------------------------------------------
  1707. Term = +
  1708. Return $(CommonStatus)
  1709. ; -----------------------------------------------------------------------
  1710. ; Install sections
  1711. ; -----------------------------------------------------------------------
  1712. [Install-Update]
  1713. set STF_VITAL = ""
  1714. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  1715. AddSectionFilesToCopyList Files-Helper $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1716. AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1717. exit
  1718. [Install-Option]
  1719. set STF_VITAL = ""
  1720. AddSectionFilesToCopyList Files-Helper $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1721. AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1722. ifstr(i) $(DoCopy) == "YES"
  1723. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1724. CopyFilesInCopyList
  1725. else
  1726. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\mdgmpdlg.DLL $(!STF_WINDOWSSYSPATH)\mdgmpdlg.DLL
  1727. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\mdgmpdlg.HLP $(!STF_WINDOWSSYSPATH)\mdgmpdlg.HLP
  1728. Endif
  1729. exit
  1730. ; ******** End of file OEMSETUP.INF *****************************************
  1731.