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.

983 lines
29 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADEE.INF
  4. ;
  5. ; 3Com Elink 3 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 Novell 3200 setup
  12. ; terryk 02-Apr-1992 Code review changed
  13. ; davidhov 03-Apr-1992 Enhanced to use new INF section
  14. ; structure from SunilP, et al.
  15. ;
  16. ;***********************************************************************
  17. ;-----------------------------------------------------------------------
  18. ; OPTION TYPE
  19. ; -----------
  20. ; This identifies the Option type we are dealing with. The different
  21. ; possible types are:
  22. ;
  23. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  24. ;
  25. ; Types specific to networking:
  26. ;
  27. ; NetAdapter, a netcard / adapter combination or just a netcard
  28. ; NetDriver, just a netcard driver
  29. ; NetTransport, a complete NDIS-compliant TDI transport stack
  30. ; NetService, an NT networking service
  31. ; NetWork, a complete network ensemble.
  32. ; NetProvider a complete network which supports NT MPR protocol
  33. ;-----------------------------------------------------------------------
  34. [Identification]
  35. OptionType = NetAdapter
  36. ;-----------------------------------------------------------------------
  37. ; PlatformsSupported
  38. ; ------------------
  39. ; This identifies the platforms supported by the adapter card.
  40. ; Possible types are:
  41. ;
  42. ; ISA, EISA and MCA
  43. ;-----------------------------------------------------------------------
  44. [PlatformsSupported]
  45. EISA
  46. "Jazz-Internal Bus"
  47. ;-----------------------------------------------------------------------
  48. ; OPTION LIST
  49. ; -----------
  50. ; This section lists the OEM Option key names. These keys are locale
  51. ; independent and used to represent the option in a locale independent
  52. ; manner.
  53. ;
  54. ;-----------------------------------------------------------------------
  55. [Options]
  56. ELNK3EISA
  57. ;***********************************************************************
  58. ; CONSTANTS FOR USING DIALOGS
  59. ;***********************************************************************
  60. [FileConstants]
  61. ;
  62. ; File names, etc.
  63. ;
  64. UtilityInf = "UTILITY.INF"
  65. subroutineinf = "SUBROUTN.INF"
  66. SoftwareType = "driver"
  67. Exit_Code = 0
  68. ;ShellCode = 0
  69. ;
  70. ; EventLog Message File
  71. ;
  72. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  73. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  74. ;
  75. ; Network card signature
  76. ;
  77. ELNK3EISA_COMPRESSID = 5270864 ;0x506d50
  78. ELNK3EISA_1BYTE = 2421189968 ;0x90506d50
  79. ELNK3EISA_MASK = 4043309055 ;0xf0ffffff
  80. ;
  81. ; Product Info
  82. ;
  83. Manufacturer = "Microsoft"
  84. ProductMajorVersion = "4"
  85. ProductMinorVersion = "0"
  86. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  87. ;
  88. ; Software
  89. ;
  90. ProductSoftwareName = "Elnk3"
  91. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\elnk3.sys"
  92. NetRuleSoftwareType = "elnk3Sys ndisDriver elnk3Driver"
  93. NetRuleSoftwareUse = $(SoftwareType)
  94. NetRuleSoftwareBindForm = """elnk3Sys"" yes no container"
  95. NetRuleSoftwareClass = {"elnk3Driver basic"}
  96. NetRuleSoftwareBindable = {"elnk3Driver elnk3Adapter non exclusive 100"}
  97. ;
  98. ; Hardware
  99. ;
  100. ProductHardwareName = "Elnk3"
  101. NetRuleHardwareType = "elnk3 elnk3Adapter"
  102. NetRuleHardwareBindForm = " yes yes container"
  103. NetRuleHardwareClass = {"elnk3Adapter basic"}
  104. ProductOpSupport = 132 ; 0x0084 ; Display,Removable,Not Properties,Not Updatable
  105. ;
  106. ; Registry Key
  107. ;
  108. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  109. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  110. [GeneralConstants]
  111. ;
  112. ; Program flow control variables.
  113. ;
  114. from = ""
  115. to = ""
  116. ;
  117. ; Return codes; Exit_Code is set to one of these
  118. ;
  119. ExitCodeOk = 0
  120. ExitCodeCancel = 1
  121. ExitCodeFatal = 2
  122. KeyNull = ""
  123. MAXIMUM_ALLOWED = 33554432
  124. RegistryErrorIndex = NO_ERROR
  125. KeyProduct = ""
  126. KeyParameters = ""
  127. TRUE = 1
  128. FALSE = 0
  129. NoTitle = 0
  130. ExitState = "Active"
  131. OldVersionExisted = $(FALSE)
  132. DriverPath = $(!STF_NTPATH)\drivers
  133. [date]
  134. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  135. ; Minute, Second }
  136. Now = {} ? $(!LIBHANDLE) GetSystemDate
  137. ;---------------------------------------------------------------------------
  138. ; 1. Identify
  139. ;
  140. ; DESCRIPTION: To verify that this INF deals with the same type of options
  141. ; as we are choosing currently.
  142. ;
  143. ; INPUT: None
  144. ;
  145. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  146. ; $($R1): Option Type (COMPUTER ...)
  147. ; $($R2): Diskette description
  148. ;---------------------------------------------------------------------------
  149. [Identify]
  150. ;
  151. ;
  152. read-syms Identification
  153. set Status = STATUS_SUCCESSFUL
  154. set Identifier = $(OptionType)
  155. set Media = #("Source Media Descriptions", 1, 1)
  156. Return $(Status) $(Identifier) $(Media)
  157. ;------------------------------------------------------------------------
  158. ; 2. ReturnOptions:
  159. ;
  160. ; DESCRIPTION: To return the option list supported by this INF and the
  161. ; localised text list representing the options.
  162. ;
  163. ;
  164. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  165. ;
  166. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  167. ; STATUS_NOLANGUAGE
  168. ; STATUS_FAILED
  169. ; STATUS_NOTSUPPORTED
  170. ;
  171. ; $($R1): Option List
  172. ; $($R2): Option Text List
  173. ;------------------------------------------------------------------------
  174. [ReturnOptions]
  175. ;
  176. ;
  177. set Status = STATUS_FAILED
  178. set OptionList = {}
  179. set OptionTextList = {}
  180. ;
  181. ; Check if the language requested is supported
  182. ;
  183. set LanguageList = ^(LanguagesSupported, 1)
  184. Ifcontains(i) $($0) in $(LanguageList)
  185. ;
  186. ; Check if the platforms requested is supported
  187. ;
  188. ifstr(i) $($1) == ""
  189. goto returnoptions
  190. endif
  191. set PlatformList = ^(PlatformsSupported, 1)
  192. Ifcontains(i) $($1) in $(PlatformList)
  193. goto returnoptions
  194. else
  195. set Status = STATUS_NOTSUPPORTED
  196. goto finish_ReturnOptions
  197. endif
  198. else
  199. set Status = STATUS_NOLANGUAGE
  200. goto finish_ReturnOptions
  201. endif
  202. ;
  203. ; form a list of all the options and another of the text representing
  204. ;
  205. returnoptions = +
  206. set OptionList = ^(Options, 1)
  207. set OptionTextList = ^(OptionsText$($0), 1)
  208. set Status = STATUS_SUCCESSFUL
  209. finish_ReturnOptions = +
  210. Return $(Status) $(OptionList) $(OptionTextList)
  211. ;----------InstallOption-------------------------------------------------
  212. ;
  213. ; InstallOption:
  214. ;
  215. ; This section is shelled to by main installation processing
  216. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  217. ;
  218. ;
  219. ; FUNCTION: To copy files representing Options
  220. ; To configure the installed option
  221. ; To update the registry for the installed option
  222. ;
  223. ; INPUT: $($0): Language to use
  224. ; $($1): OptionID to install
  225. ; $($2): SourceDirectory
  226. ; $($3): AddCopy (YES | NO)
  227. ; $($4): DoCopy (YES | NO)
  228. ; $($5): DoConfig (YES | NO)
  229. ;
  230. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  231. ; STATUS_NOLANGUAGE |
  232. ; STATUS_USERCANCEL |
  233. ; STATUS_FAILED
  234. ;
  235. ;------------------------------------------------------------------------
  236. [InstallOption]
  237. ;
  238. ; extract parameters
  239. ;
  240. set Option = $($1)
  241. set SrcDir = $($2)
  242. set AddCopy = $($3)
  243. set DoCopy = $($4)
  244. set DoConfig = $($5)
  245. ;
  246. ; Check if the language requested is supported
  247. ;
  248. set LanguageList = ^(LanguagesSupported, 1)
  249. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  250. Return STATUS_NOLANGUAGE
  251. endif
  252. Debug-Output "OEMNADEE.INF: STF_CWDIR is: "$(!STF_CWDIR)
  253. Debug-Output "OEMNADEE.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  254. ; define all the constants
  255. set-subst LF = "\n"
  256. read-syms GeneralConstants
  257. read-syms FileConstants
  258. read-syms DialogConstants$(!STF_LANGUAGE)
  259. ifstr(i) $(!NTN_Origination) == "NCPA"
  260. set Continue = $(OK)
  261. endif
  262. read-syms FileConstants$(!STF_LANGUAGE)
  263. detect date
  264. set-title $(FunctionTitle)
  265. set to = Begin
  266. set from = Begin
  267. ;
  268. ; Assume all is well.
  269. ;
  270. set CommonStatus = STATUS_SUCCESSFUL
  271. EndWait
  272. ;
  273. ; Set up the operation-mode-based variables and gaily welcome
  274. ; the user. If the "install mode" variable is improperly set,
  275. ; assume this is a new installation.
  276. ;
  277. Begin = +
  278. Ifstr(i) $(!NTN_InstallMode) == deinstall
  279. set StartLabel = removeadapter
  280. else-Ifstr(i) $(!NTN_InstallMode) == Update
  281. set StartLabel = UpgradeSoftware
  282. else-Ifstr(i) $(!NTN_InstallMode) == bind
  283. set StartLabel = bindingadapter
  284. else-Ifstr(i) $(!NTN_InstallMode) == configure
  285. set CommonStatus = STATUS_REBOOT
  286. ;
  287. ; You cannot config the software/hardware component
  288. ;
  289. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  290. Debug-Output "Cannot configure the elnk3 driver software."
  291. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  292. else
  293. Debug-Output "Cannot configure the elnk3 adapter card."
  294. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_HARDWARE
  295. endif
  296. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  297. Debug-Output "ShellCode error: cannot get an error string."
  298. goto ShellCodeError
  299. endif
  300. set Error = $($R0)
  301. set from = end
  302. set to = end
  303. goto nonfatalinfo
  304. else
  305. set StartLabel = installadapter
  306. set OEM_ABANDON_OPTIONS = {}
  307. set OEM_ABANDON_SOFTWARE = FALSE
  308. set OEM_ABANDON_ON = TRUE
  309. endif
  310. set from = $(fatal)
  311. set to = $(fatal)
  312. goto $(StartLabel)
  313. ;-----------------------------------------------
  314. ; Installation Section
  315. ;-----------------------------------------------
  316. installadapter = +
  317. ;
  318. ; First, check whether the same version of the software exists
  319. ;
  320. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  321. Ifstr $(KeyProduct) != $(KeyNull)
  322. ;
  323. ; Same version already existed in the local machine
  324. ; Popup the dialog and ask the user whether he wants to continue
  325. ;
  326. CloseRegKey $(KeyProduct)
  327. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  328. ;
  329. ; Cannot Install the same software again
  330. ;
  331. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  332. $(ProductVersion)
  333. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  334. Debug-Output "ShellCode error: cannot get an error string."
  335. goto ShellCodeError
  336. endif
  337. goto end
  338. else
  339. ;
  340. ; Add a new adapter card?
  341. ;
  342. Shell $(UtilityInf), CardExistedDlg
  343. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  344. Debug-Output "ShellCode error: cannot get an error string."
  345. goto ShellCodeError
  346. endif
  347. ifstr(i) $($R1) != "OK"
  348. set CommonStatus = STATUS_USERCANCEL
  349. goto end
  350. endif
  351. set OldVersionExisted = $(TRUE)
  352. endif
  353. endif
  354. goto nextstep
  355. ;-----------------------------------------------
  356. ; Configuration Section
  357. ;-----------------------------------------------
  358. configureadapter = +
  359. ;
  360. ; we should delete the old data here
  361. ;
  362. set Error = "Configure: Sorry, not yet implemented."
  363. goto fatal
  364. ;
  365. ; If installing, go create the necessary keys;
  366. ; if configuring, they're already open.
  367. ;
  368. nextstep = +
  369. StartWait
  370. ;
  371. ; Call the EISA find
  372. ;
  373. Shell $(UtilityInf), EISAFindBus, $(ELNK3EISA_1BYTE), $(ELNK3EISA_MASK)
  374. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  375. goto ShellCodeError
  376. endif
  377. ifstr $($R0) != "NO_ERROR"
  378. set Error = $($R0)
  379. goto fatal
  380. endif
  381. ifstr(i) $($R1) == {}
  382. set Error = $(CANNOT_FIND_ANY_CARD)
  383. set CommonStatus = STATUS_USERCANCEL
  384. set from = "end"
  385. goto nonfatal
  386. endif
  387. set AdapterList = $($R1)
  388. ;
  389. ; Install Software Component
  390. ;
  391. ifint $(OldVersionExisted) == $(FALSE)
  392. ifstr(i) $(!NTN_InstallMode) == "install"
  393. Ifstr(i) $(DoCopy) == "YES"
  394. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  395. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  396. Goto ShellCodeError
  397. Else-Ifstr(i) $($R0) == STATUS_FAILED
  398. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  399. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  400. goto ShellCodeError
  401. endif
  402. set Error = $($R0)
  403. Goto fatal
  404. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  405. Goto successful
  406. Endif
  407. Set SrcDir = $($R1)
  408. Endif
  409. install "Install-Option"
  410. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  411. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  412. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  413. goto ShellCodeError
  414. endif
  415. set Error = $($R0)
  416. goto fatal
  417. endif
  418. endif
  419. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  420. $(ProductSoftwareName), +
  421. $(ProductSoftwareName), +
  422. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  423. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  424. $(NetEventDLL)
  425. Set OEM_ABANDON_SOFTWARE = TRUE
  426. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  427. goto ShellCodeError
  428. endif
  429. set RegistryErrorIndex = $($R0)
  430. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  431. EndWait
  432. CloseRegKey $($R1)
  433. CloseRegKey $($R2)
  434. CloseRegKey $($R3)
  435. CloseRegKey $($R4)
  436. CloseRegKey $($R5)
  437. goto fatalregistry
  438. endif
  439. ;
  440. ; At this point:
  441. ; $R1 contains the product version key handle;
  442. ; $R2 contains the NetRules subkey handle;
  443. ; $R3 contains the new Services key handle; and
  444. ; $R4 contains the Parameters key
  445. ; $R5 contains the Linkage Key
  446. ;
  447. set SoftProductKey = $($R1)
  448. Set SoftNetRuleKey = $($R2)
  449. Set SoftServiceKey = $($R3)
  450. Set SoftParameterKey = $($R4)
  451. Set SoftLinkageKey = $($R5)
  452. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  453. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  454. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  455. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  456. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  457. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  458. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  459. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  460. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  461. goto ShellCodeError
  462. endif
  463. set RegistryErrorIndex = $($R0)
  464. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  465. EndWait
  466. CloseRegKey $(SoftProductKey)
  467. CloseRegKey $(SoftNetRuleKey)
  468. CloseRegKey $(SoftServiceKey)
  469. CloseRegKey $(SoftParameterKey)
  470. CloseRegKey $(SoftLinkageKey)
  471. goto fatalregistry
  472. endif
  473. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  474. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  475. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  476. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  477. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  478. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  479. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  480. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  481. goto ShellCodeError
  482. endif
  483. set RegistryErrorIndex = $($R0)
  484. CloseRegKey $(SoftProductKey)
  485. CloseRegKey $(SoftNetRuleKey)
  486. CloseRegKey $(SoftServiceKey)
  487. CloseRegKey $(SoftParameterKey)
  488. CloseRegKey $(SoftLinkageKey)
  489. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  490. EndWait
  491. goto fatalregistry
  492. endif
  493. endif
  494. ForListDo $(AdapterList)
  495. set BusNum = *($($),1)
  496. set SlotNum = *($($),2)
  497. Debug-Output $(BusNum)
  498. Debug-Output $(SlotNum)
  499. Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  500. $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  501. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  502. goto ShellCodeError
  503. endif
  504. ifstr $($R0) != "NO_ERROR"
  505. set Error = $($R0)
  506. goto fatal
  507. endif
  508. ifstr(i) $($R1) != "YES"
  509. ;
  510. ; Create the HARDWARE\Netcard region and
  511. ; its corresponding service
  512. ;
  513. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  514. ifint $($R4) != -1
  515. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  516. endif
  517. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  518. goto ShellCodeError
  519. endif
  520. set RegistryErrorIndex = $($R0)
  521. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  522. EndWait
  523. CloseRegKey $($R1)
  524. CloseRegKey $($R2)
  525. CloseRegKey $($R3)
  526. goto fatalregistry
  527. endif
  528. ;
  529. ; At this point:
  530. ; $R1 Registry key variable for
  531. ; HARDWARE\Netcard\(n)
  532. ; $R2 Registry key variable for
  533. ; HARDWARE\Netcard\(n)\\NetRules
  534. ; $R3 Registry key handle for
  535. ; <service>\Parameters key
  536. ; $R4 Adapter number assigned to adapter
  537. ; $R5 Service name generated by combining
  538. ; svc name with adapter number
  539. ;
  540. Set HardNetCardKey = $($R1)
  541. Set HardNetRuleKey = $($R2)
  542. Set HardParameterKey = $($R3)
  543. set AdapterNumber = $($R4)
  544. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  545. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  546. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  547. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  548. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  549. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  550. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  551. Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  552. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  553. goto ShellCodeError
  554. endif
  555. set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  556. {CardType,$(NoTitle),$(!REG_VT_DWORD),1},+
  557. {BusType,$(NoTitle),$(!REG_VT_DWORD),2},+
  558. {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  559. {EisaCompressedId,$(NoTitle),$(!REG_VT_DWORD),$(ELNK3EISA_COMPRESSID)},+
  560. {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}}
  561. Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  562. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  563. goto ShellCodeError
  564. endif
  565. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  566. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  567. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  568. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  569. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  570. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  571. Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  572. CloseRegKey $(HardNetCardKey)
  573. CloseRegKey $(HardNetRuleKey)
  574. CloseRegKey $(HardParameterKey)
  575. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  576. goto ShellCodeError
  577. endif
  578. endif
  579. EndForListDo
  580. goto writeparameters
  581. ;
  582. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  583. ;
  584. writeparameters = +
  585. EndWait
  586. goto successful
  587. ;-----------------------------------------------
  588. ; Binding section
  589. ;-----------------------------------------------
  590. bindingadapter =+
  591. set Error = "Binding: Sorry, not yet implemented."
  592. goto fatal
  593. ;-----------------------------------------------
  594. ; Removeadapter section
  595. ;-----------------------------------------------
  596. removeadapter = +
  597. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  598. ; Remove Software Component
  599. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  600. $(ProductSoftwareName)
  601. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  602. Debug-Output "ShellCode error"
  603. goto ShellCodeError
  604. endif
  605. set RegistryErrorIndex = $($R0)
  606. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  607. goto fatalregistry
  608. endif
  609. else
  610. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  611. $(ProductSoftwareName), $(!NTN_RegBase)
  612. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  613. Debug-Output "ShellCode error"
  614. goto ShellCodeError
  615. endif
  616. set RegistryErrorIndex = $($R0)
  617. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  618. goto fatalregistry
  619. endif
  620. endif
  621. goto end
  622. ;Shell $(UtilityInf) RemoveNetworkCardEntry, $(ProductHardwareName)
  623. ;ifint $($ShellCode) != $(!SHELL_CODE_OK)
  624. ; goto ShellCodeError
  625. ;endif
  626. ;-----------------------------------------------
  627. ; Upgrade Software section
  628. ;-----------------------------------------------
  629. UpgradeSoftware = +
  630. ; Upgrade software component
  631. ;
  632. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  633. Ifstr $(KeyProduct) != $(KeyNull)
  634. install "Install-Update"
  635. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  636. goto fatal
  637. endif
  638. ; Upgrade the version number
  639. ;
  640. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  641. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  642. ;
  643. ; do nothing for update
  644. ;
  645. CloseRegKey $(KeyProduct)
  646. else
  647. ;
  648. ; Cannot Open software key, goto ERROR
  649. ;
  650. goto fatalregistry
  651. endif
  652. ;
  653. ; Enumerate all netcards installed of this type and update them
  654. ;
  655. set iSearch = 1
  656. nextnetcard = +
  657. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  658. set KeyNetcard = $($R0)
  659. set iSearch = $($R1)
  660. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  661. Ifstr $(KeyNetcard) != $(KeyNull)
  662. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  663. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  664. CloseRegKey $(KeyNetcard)
  665. goto nextnetcard
  666. Endif
  667. goto end
  668. ;
  669. ; End of Upgrade Software
  670. ;
  671. ;
  672. ; Escape hatches
  673. ;
  674. successful = +
  675. goto end
  676. abandon = +
  677. ForListDo $(OEM_ABANDON_OPTIONS)
  678. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  679. $(ProductSoftwareName), $($)
  680. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  681. Debug-Output "ShellCode error"
  682. goto ShellCodeError
  683. endif
  684. set RegistryErrorIndex = $($R0)
  685. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  686. goto fatalregistry
  687. endif
  688. EndForListDo
  689. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  690. ; Remove Software Component
  691. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  692. $(ProductSoftwareName), FALSE
  693. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  694. Debug-Output "ShellCode error"
  695. goto ShellCodeError
  696. endif
  697. set RegistryErrorIndex = $($R0)
  698. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  699. goto fatalregistry
  700. endif
  701. endif
  702. goto end
  703. ;
  704. ; warning display
  705. ;
  706. warning = +
  707. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  708. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  709. goto ShellCodeError
  710. endif
  711. ifstr(i) $($R1) == "OK"
  712. goto $(to)
  713. else-ifstr(i) $($R1) == "CANCEL"
  714. goto $(from)
  715. else
  716. ; Debug-Msg "Error Error Bad DLGEVENT"
  717. goto "end"
  718. endif
  719. ;
  720. ; non fatal error display
  721. ;
  722. nonfatalinfo = +
  723. Set CommonStatus = STATUS_USERCANCEL
  724. Set Severity = STATUS
  725. goto nonfatalmsg
  726. nonfatal = +
  727. Set Severity = NONFATAL
  728. goto nonfatalmsg
  729. nonfatalmsg = +
  730. ifstr(i) $(Error) == ""
  731. Set Severity = NONFATAL
  732. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  733. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  734. goto ShellCodeError
  735. endif
  736. set Error = $($R0)
  737. endif
  738. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  739. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  740. goto ShellCodeError
  741. endif
  742. ifstr(i) $($R1) == "OK"
  743. goto $(from)
  744. else
  745. goto "end"
  746. endif
  747. ;
  748. ; Registry is broken
  749. ;
  750. fatalregistry = +
  751. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  752. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  753. goto ShellCodeError
  754. endif
  755. set Error = $($R0)
  756. goto fatal
  757. ;
  758. ; fatal error display
  759. ;
  760. fatal = +
  761. ifstr(i) $(Error) == ""
  762. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  763. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  764. goto ShellCodeError
  765. endif
  766. set Error = $($R0)
  767. endif
  768. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  769. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  770. goto ShellCodeError
  771. endif
  772. goto setfailed
  773. ;
  774. ; Shelling error
  775. ;
  776. ShellCodeError = +
  777. set DlgType = "MessageBox"
  778. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  779. set STF_MB_TEXT = $(ShellCodeErrorText)
  780. set STF_MB_TYPE = 1
  781. set STF_MB_ICON = 3
  782. set STF_MB_DEF = 1
  783. ui start "Error Message"
  784. goto setfailed
  785. setfailed = +
  786. set CommonStatus = STATUS_FAILED
  787. ;
  788. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  789. ;
  790. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  791. set OEM_ABANDON_ON = FALSE
  792. goto abandon
  793. endif
  794. goto end
  795. end = +
  796. goto term
  797. term = +
  798. Return $(CommonStatus)
  799. ;***************************************************************
  800. ; INSTALL SECTIONS
  801. ;***************************************************************
  802. [Install-Option]
  803. set STF_VITAL = ""
  804. ifstr(i) $(AddCopy) == "YES"
  805. ;
  806. ; Add the files to the copy list
  807. ;
  808. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  809. ; the other INF files
  810. ;
  811. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  812. endif
  813. ifstr(i) $(DoCopy) == "YES"
  814. ;
  815. ; Copy files in the copy list
  816. ;
  817. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  818. CopyFilesInCopyList
  819. endif
  820. ifstr(i) $(DoConfig) == "YES"
  821. ;
  822. ; Add product to registry
  823. ;
  824. ;
  825. ; Finish up
  826. endif
  827. Exit
  828. [Install-Update]
  829. set STF_VITAL = ""
  830. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  831. ;set STF_VERSION = "YES"
  832. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  833. exit
  834.