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.

980 lines
29 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADIM.INF
  4. ;
  5. ; Intel Ether Express MCA Adapter setup inf
  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 ELNKMC 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. MCA
  46. ;-----------------------------------------------------------------------
  47. ; OPTION LIST
  48. ; -----------
  49. ; This section lists the OEM Option key names. These keys are locale
  50. ; independent and used to represent the option in a locale independent
  51. ; manner.
  52. ;
  53. ;-----------------------------------------------------------------------
  54. [Options]
  55. EE16MC
  56. ;***********************************************************************
  57. ; CONSTANTS FOR USING DIALOGS
  58. ;***********************************************************************
  59. [FileConstants]
  60. ;
  61. ; File names, etc.
  62. ;
  63. UtilityInf = "UTILITY.INF"
  64. subroutineinf = "SUBROUTN.INF"
  65. SoftwareType = "driver"
  66. Exit_Code = 0
  67. ;ShellCode = 0
  68. ;
  69. ; EventLog Message File
  70. ;
  71. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  72. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  73. EE16MC_1BYTE = 139
  74. EE16MC_2BYTE = 98
  75. NETCARD_ID = 25227
  76. ;
  77. ; Product Info
  78. ;
  79. Manufacturer = "Microsoft"
  80. ProductMajorVersion = "4"
  81. ProductMinorVersion = "0"
  82. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  83. ;
  84. ; Software
  85. ;
  86. ProductSoftwareName = "Ee16mc"
  87. ProductSoftwareImagePath = "\SystemRoot\system32\drivers\ee16.sys"
  88. NetRuleSoftwareType = "ee16mcSys ndisDriver ee16mcDriver"
  89. NetRuleSoftwareUse = $(SoftwareType)
  90. NetRuleSoftwareBindForm = """Ee16mcSys"" yes no container"
  91. NetRuleSoftwareClass = {"ee16mcDriver basic"}
  92. NetRuleSoftwareBindable = {"ee16mcDriver ee16mcAdapter non exclusive 100"}
  93. ;
  94. ; Hardware
  95. ;
  96. ProductHardwareName = "Ee16mc"
  97. NetRuleHardwareType = "ee16mc ee16mcAdapter"
  98. NetRuleHardwareBindForm = " yes yes container"
  99. NetRuleHardwareClass = {"ee16mcAdapter basic"}
  100. ProductOpSupport = 132 ; 0x0084 ; Display,Removable,Not Properties,Not Updatable
  101. ;
  102. ; Registry Key
  103. ;
  104. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  105. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  106. [GeneralConstants]
  107. ;
  108. ; Program flow control variables.
  109. ;
  110. from = ""
  111. to = ""
  112. ;
  113. ; Return codes; Exit_Code is set to one of these
  114. ;
  115. ExitCodeOk = 0
  116. ExitCodeCancel = 1
  117. ExitCodeFatal = 2
  118. KeyNull = ""
  119. MAXIMUM_ALLOWED = 33554432
  120. RegistryErrorIndex = NO_ERROR
  121. KeyProduct = ""
  122. KeyParameters = ""
  123. TRUE = 1
  124. FALSE = 0
  125. NoTitle = 0
  126. ExitState = "Active"
  127. OldVersionExisted = $(FALSE)
  128. DriverPath = $(!STF_NTPATH)\drivers
  129. [date]
  130. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  131. ; Minute, Second }
  132. Now = {} ? $(!LIBHANDLE) GetSystemDate
  133. ;---------------------------------------------------------------------------
  134. ; 1. Identify
  135. ;
  136. ; DESCRIPTION: To verify that this INF deals with the same type of options
  137. ; as we are choosing currently.
  138. ;
  139. ; INPUT: None
  140. ;
  141. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  142. ; $($R1): Option Type (COMPUTER ...)
  143. ; $($R2): Diskette description
  144. ;---------------------------------------------------------------------------
  145. [Identify]
  146. ;
  147. ;
  148. read-syms Identification
  149. set Status = STATUS_SUCCESSFUL
  150. set Identifier = $(OptionType)
  151. set Media = #("Source Media Descriptions", 1, 1)
  152. Return $(Status) $(Identifier) $(Media)
  153. ;------------------------------------------------------------------------
  154. ; 2. ReturnOptions:
  155. ;
  156. ; DESCRIPTION: To return the option list supported by this INF and the
  157. ; localised text list representing the options.
  158. ;
  159. ;
  160. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  161. ;
  162. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  163. ; STATUS_NOLANGUAGE
  164. ; STATUS_FAILED
  165. ; STATUS_NOTSUPPORTED
  166. ;
  167. ; $($R1): Option List
  168. ; $($R2): Option Text List
  169. ;------------------------------------------------------------------------
  170. [ReturnOptions]
  171. ;
  172. ;
  173. set Status = STATUS_FAILED
  174. set OptionList = {}
  175. set OptionTextList = {}
  176. ;
  177. ; Check if the language requested is supported
  178. ;
  179. set LanguageList = ^(LanguagesSupported, 1)
  180. Ifcontains(i) $($0) in $(LanguageList)
  181. ;
  182. ; Check if the platforms requested is supported
  183. ;
  184. ifstr(i) $($1) == ""
  185. goto returnoptions
  186. endif
  187. set PlatformList = ^(PlatformsSupported, 1)
  188. Ifcontains(i) $($1) in $(PlatformList)
  189. goto returnoptions
  190. else
  191. set Status = STATUS_NOTSUPPORTED
  192. goto finish_ReturnOptions
  193. endif
  194. else
  195. set Status = STATUS_NOLANGUAGE
  196. goto finish_ReturnOptions
  197. endif
  198. ;
  199. ; form a list of all the options and another of the text representing
  200. ;
  201. returnoptions = +
  202. set OptionList = ^(Options, 1)
  203. set OptionTextList = ^(OptionsText$($0), 1)
  204. set Status = STATUS_SUCCESSFUL
  205. finish_ReturnOptions = +
  206. Return $(Status) $(OptionList) $(OptionTextList)
  207. ;----------InstallOption-------------------------------------------------
  208. ;
  209. ; InstallOption:
  210. ;
  211. ; This section is shelled to by main installation processing
  212. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  213. ;
  214. ;
  215. ; FUNCTION: To copy files representing Options
  216. ; To configure the installed option
  217. ; To update the registry for the installed option
  218. ;
  219. ; INPUT: $($0): Language to use
  220. ; $($1): OptionID to install
  221. ; $($2): SourceDirectory
  222. ; $($3): AddCopy (YES | NO)
  223. ; $($4): DoCopy (YES | NO)
  224. ; $($5): DoConfig (YES | NO)
  225. ;
  226. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  227. ; STATUS_NOLANGUAGE |
  228. ; STATUS_USERCANCEL |
  229. ; STATUS_FAILED
  230. ;
  231. ;------------------------------------------------------------------------
  232. [InstallOption]
  233. ;
  234. ; extract parameters
  235. ;
  236. set Option = $($1)
  237. set SrcDir = $($2)
  238. set AddCopy = $($3)
  239. set DoCopy = $($4)
  240. set DoConfig = $($5)
  241. ;
  242. ; Check if the language requested is supported
  243. ;
  244. set LanguageList = ^(LanguagesSupported, 1)
  245. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  246. Return STATUS_NOLANGUAGE
  247. endif
  248. Debug-Output "OEMNADIM.INF: STF_CWDIR is: "$(!STF_CWDIR)
  249. Debug-Output "OEMNADIM.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  250. ; define all the constants
  251. set-subst LF = "\n"
  252. read-syms GeneralConstants
  253. read-syms FileConstants
  254. read-syms DialogConstants$(!STF_LANGUAGE)
  255. read-syms FileConstants$(!STF_LANGUAGE)
  256. detect date
  257. set-title $(FunctionTitle)
  258. set to = Begin
  259. set from = Begin
  260. ;
  261. ; Assume all is well.
  262. ;
  263. set CommonStatus = STATUS_SUCCESSFUL
  264. EndWait
  265. ;
  266. ; Set up the operation-mode-based variables and gaily welcome
  267. ; the user. If the "install mode" variable is improperly set,
  268. ; assume this is a new installation.
  269. ;
  270. Begin = +
  271. Ifstr(i) $(!NTN_InstallMode) == deinstall
  272. set StartLabel = removeadapter
  273. else-Ifstr(i) $(!NTN_InstallMode) == Update
  274. set StartLabel = UpgradeSoftware
  275. else-Ifstr(i) $(!NTN_InstallMode) == bind
  276. set StartLabel = bindingadapter
  277. else-Ifstr(i) $(!NTN_InstallMode) == configure
  278. set CommonStatus = STATUS_REBOOT
  279. ;
  280. ; You cannot config the software component
  281. ;
  282. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  283. Debug-Output "Cannot configure the elink II driver software."
  284. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  285. else
  286. Debug-Output "Cannot configure the elink II adapter card."
  287. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_HARDWARE
  288. endif
  289. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  290. Debug-Output "ShellCode error: cannot get an error string."
  291. goto ShellCodeError
  292. endif
  293. set Error = $($R0)
  294. set from = end
  295. set to = end
  296. goto nonfatalinfo
  297. else
  298. set StartLabel = installadapter
  299. set OEM_ABANDON_OPTIONS = {}
  300. set OEM_ABANDON_SOFTWARE = FALSE
  301. set OEM_ABANDON_ON = TRUE
  302. endif
  303. set from = $(fatal)
  304. set to = $(fatal)
  305. goto $(StartLabel)
  306. ;-----------------------------------------------
  307. ; Installation Section
  308. ;-----------------------------------------------
  309. installadapter = +
  310. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  311. Ifstr $(KeyProduct) != $(KeyNull)
  312. ;
  313. ; Same version already existed in the local machine
  314. ; Popup the dialog and ask the user whether he wants to continue
  315. ;
  316. CloseRegKey $(KeyProduct)
  317. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  318. ;
  319. ; Cannot Install the same software again
  320. ;
  321. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  322. $(ProductVersion)
  323. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  324. Debug-Output "ShellCode error: cannot get an error string."
  325. goto ShellCodeError
  326. endif
  327. goto end
  328. else
  329. ;
  330. ; Add a new adapter card?
  331. ;
  332. Shell $(UtilityInf), CardExistedDlg
  333. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  334. Debug-Output "ShellCode error: cannot get an error string."
  335. goto ShellCodeError
  336. endif
  337. ifstr(i) $($R1) != "OK"
  338. Set CommonStatus = STATUS_USERCANCEL
  339. goto end
  340. endif
  341. set OldVersionExisted = $(TRUE)
  342. endif
  343. endif
  344. goto nextstep
  345. ;-----------------------------------------------
  346. ; Configuration Section
  347. ;-----------------------------------------------
  348. configureadapter = +
  349. ;
  350. ; we should delete the old data here
  351. ;
  352. set Error = "Configure: Not Implmemented yet"
  353. goto fatal
  354. ;
  355. ; If installing, go create the necessary keys;
  356. ; if configuring, they're already open.
  357. ;
  358. nextstep = +
  359. StartWait
  360. installproduct = +
  361. Shell $(UtilityInf), MCAFindBus, $(EE16MC_1BYTE), $(EE16MC_2BYTE)
  362. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  363. goto ShellCodeError
  364. endif
  365. ifstr $($R0) != "NO_ERROR"
  366. set Error = $($R0)
  367. goto fatal
  368. endif
  369. ifstr(i) $($R1) == {}
  370. set Error = $(CANNOT_FIND_ANY_CARD)
  371. set CommonStatus = STATUS_USERCANCEL
  372. set from = "end"
  373. goto nonfatal
  374. endif
  375. set AdapterList = $($R1)
  376. ;
  377. ; Install Software Component
  378. ;
  379. ifint $(OldVersionExisted) == $(FALSE)
  380. ifstr(i) $(!NTN_InstallMode) == "install"
  381. Ifstr(i) $(DoCopy) == "YES"
  382. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  383. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  384. Goto ShellCodeError
  385. Else-Ifstr(i) $($R0) == STATUS_FAILED
  386. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  387. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  388. goto ShellCodeError
  389. endif
  390. set Error = $($R0)
  391. Goto fatal
  392. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  393. Goto successful
  394. Endif
  395. Set SrcDir = $($R1)
  396. Endif
  397. install "Install-Option"
  398. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  399. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  400. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  401. goto ShellCodeError
  402. endif
  403. set Error = $($R0)
  404. goto fatal
  405. endif
  406. endif
  407. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  408. $(ProductSoftwareName), +
  409. $(ProductSoftwareName), +
  410. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  411. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  412. $(NetEventDLL)
  413. Set OEM_ABANDON_SOFTWARE = TRUE
  414. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  415. goto ShellCodeError
  416. endif
  417. set RegistryErrorIndex = $($R0)
  418. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  419. EndWait
  420. CloseRegKey $($R1)
  421. CloseRegKey $($R2)
  422. CloseRegKey $($R3)
  423. CloseRegKey $($R4)
  424. CloseRegKey $($R5)
  425. goto fatalregistry
  426. endif
  427. ;
  428. ; At this point:
  429. ; $R1 contains the product version key handle;
  430. ; $R2 contains the NetRules subkey handle;
  431. ; $R3 contains the new Services key handle; and
  432. ; $R4 contains the Parameters key
  433. ; $R5 contains the Linkage Key
  434. ;
  435. Set SoftProductKey = $($R1)
  436. Set SoftNetRuleKey = $($R2)
  437. Set SoftServiceKey = $($R3)
  438. Set SoftParameterKey = $($R4)
  439. Set SoftLinkageKey = $($R5)
  440. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  441. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  442. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  443. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  444. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  445. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  446. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  447. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  448. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  449. goto ShellCodeError
  450. endif
  451. set RegistryErrorIndex = $($R0)
  452. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  453. EndWait
  454. CloseRegKey $(SoftProductKey)
  455. CloseRegKey $(SoftNetRuleKey)
  456. CloseRegKey $(SoftServiceKey)
  457. CloseRegKey $(SoftParameterKey)
  458. CloseRegKey $(SoftLinkageKey)
  459. goto fatalregistry
  460. endif
  461. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  462. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  463. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  464. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  465. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  466. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  467. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  468. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  469. goto ShellCodeError
  470. endif
  471. set RegistryErrorIndex = $($R0)
  472. CloseRegKey $(SoftProductKey)
  473. CloseRegKey $(SoftNetRuleKey)
  474. CloseRegKey $(SoftServiceKey)
  475. CloseRegKey $(SoftParameterKey)
  476. CloseRegKey $(SoftLinkageKey)
  477. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  478. EndWait
  479. goto fatalregistry
  480. endif
  481. endif
  482. ;
  483. ; Install Hardware component
  484. ;
  485. ForListDo $(AdapterList)
  486. set BusNum = *($($),1)
  487. set SlotNum = *($($),2)
  488. Debug-Output $(BusNum)
  489. Debug-Output $(SlotNum)
  490. Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  491. $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  492. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  493. goto ShellCodeError
  494. endif
  495. ifstr $($R0) != "NO_ERROR"
  496. set Error = $($R0)
  497. goto fatal
  498. endif
  499. ifstr(i) $($R1) != "YES"
  500. ;
  501. ; Create the HARDWARE\Netcard region and
  502. ; its corresponding service
  503. ;
  504. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  505. ifint $($R4) != -1
  506. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  507. endif
  508. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  509. goto ShellCodeError
  510. endif
  511. set RegistryErrorIndex = $($R0)
  512. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  513. EndWait
  514. CloseRegKey $($R1)
  515. CloseRegKey $($R2)
  516. CloseRegKey $($R3)
  517. goto fatalregistry
  518. endif
  519. ;
  520. ; At this point:
  521. ; $R1 Registry key variable for
  522. ; HARDWARE\Netcard\(n)
  523. ; $R2 Registry key variable for
  524. ; HARDWARE\Netcard\(n)\\NetRules
  525. ; $R3 Registry key handle for
  526. ; <service>\Parameters key
  527. ; $R4 Adapter number assigned to adapter
  528. ; $R5 Service name generated by combining
  529. ; svc name with adapter number
  530. ;
  531. Set HardNetCardKey = $($R1)
  532. Set HardNetRuleKey = $($R2)
  533. Set HardParameterKey = $($R3)
  534. set AdapterNumber = $($R4)
  535. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  536. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  537. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  538. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  539. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  540. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  541. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  542. Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  543. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  544. goto ShellCodeError
  545. endif
  546. set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  547. {BusType,$(NoTitle),$(!REG_VT_DWORD),3},+
  548. {McaPosId,$(NoTitle),$(!REG_VT_DWORD),$(NETCARD_ID)},+
  549. {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  550. {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}}
  551. Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  552. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  553. goto ShellCodeError
  554. endif
  555. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  556. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  557. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  558. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  559. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  560. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  561. Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  562. CloseRegKey $(HardNetCardKey)
  563. CloseRegKey $(HardNetRuleKey)
  564. CloseRegKey $(HardParameterKey)
  565. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  566. goto ShellCodeError
  567. endif
  568. endif
  569. EndForListDo
  570. goto writeparameters
  571. ;
  572. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  573. ;
  574. writeparameters = +
  575. EndWait
  576. goto successful
  577. ;-----------------------------------------------
  578. ; Binding section
  579. ;-----------------------------------------------
  580. bindingadapter =+
  581. set Error = "Binding: Not Implmemented yet"
  582. goto fatal
  583. ;-----------------------------------------------
  584. ; Removeadapter section
  585. ;-----------------------------------------------
  586. removeadapter = +
  587. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  588. ; Remove Software Component
  589. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  590. $(ProductSoftwareName)
  591. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  592. Debug-Output "ShellCode error"
  593. goto ShellCodeError
  594. endif
  595. set RegistryErrorIndex = $($R0)
  596. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  597. goto fatalregistry
  598. endif
  599. else
  600. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  601. $(ProductSoftwareName), $(!NTN_RegBase)
  602. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  603. Debug-Output "ShellCode error"
  604. goto ShellCodeError
  605. endif
  606. set RegistryErrorIndex = $($R0)
  607. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  608. goto fatalregistry
  609. endif
  610. endif
  611. goto end
  612. ; Shell $(UtilityInf) RemoveNetworkCardEntry, $(ProductHardwareName)
  613. ; ifint $($ShellCode) != $(!SHELL_CODE_OK)
  614. ; goto ShellCodeError
  615. ; endif
  616. ;-----------------------------------------------
  617. ; Upgrade Software section
  618. ;-----------------------------------------------
  619. UpgradeSoftware = +
  620. ;
  621. ; First determine whether we want to do upgrade or update for software
  622. ; or hardware component. Then we will determine whether the Mode is
  623. ; update or upgrade.
  624. ;
  625. ; If the same version of the product existed in the registry, we do
  626. ; update. Otherwise, we will do a upgrade
  627. ;
  628. ; Upgrade software component
  629. ;
  630. ; see whether the same version exist or not
  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