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.

938 lines
28 KiB

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