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.

1019 lines
30 KiB

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