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. ; OEMNADNE.INF
  4. ;
  5. ; Novell 3200 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. NE3200
  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. NE3200_1BYTE = 511034
  78. ;
  79. ; Product Info
  80. ;
  81. Manufacturer = "Microsoft"
  82. ProductMajorVersion = "4"
  83. ProductMinorVersion = "0"
  84. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  85. ;
  86. ; Software
  87. ;
  88. ProductSoftwareName = "NE3200"
  89. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\ne3200.sys"
  90. NetRuleSoftwareType = "ne3200Sys ndisDriver ne3200Driver"
  91. NetRuleSoftwareUse = $(SoftwareType)
  92. NetRuleSoftwareBindForm = """Ne3200Sys"" yes no container"
  93. NetRuleSoftwareClass = {"ne3200Driver basic"}
  94. NetRuleSoftwareBindable = {"ne3200Driver ne3200Adapter non exclusive 100"}
  95. ;
  96. ; Hardware
  97. ;
  98. ProductHardwareName = "NE3200"
  99. NetRuleHardwareType = "ne3200 ne3200Adapter"
  100. NetRuleHardwareBindForm = " yes yes container"
  101. NetRuleHardwareClass = {"ne3200Adapter 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 novell 3200 driver software."
  289. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  290. else
  291. Debug-Output "Cannot configure the novell 3200 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. ;
  316. ; First, check whether the same version of the software exists
  317. ;
  318. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  319. Ifstr $(KeyProduct) != $(KeyNull)
  320. ;
  321. ; Same version already existed in the local machine
  322. ; Popup the dialog and ask the user whether he wants to continue
  323. ;
  324. CloseRegKey $(KeyProduct)
  325. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  326. ;
  327. ; Cannot Install the same software again
  328. ;
  329. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  330. $(ProductVersion)
  331. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  332. Debug-Output "ShellCode error: cannot get an error string."
  333. goto ShellCodeError
  334. endif
  335. goto end
  336. else
  337. ;
  338. ; Add a new adapter card?
  339. ;
  340. Shell $(UtilityInf), CardExistedDlg
  341. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  342. Debug-Output "ShellCode error: cannot get an error string."
  343. goto ShellCodeError
  344. endif
  345. ifstr(i) $($R1) != "OK"
  346. set CommonStatus = STATUS_USERCANCEL
  347. goto end
  348. endif
  349. set OldVersionExisted = $(TRUE)
  350. endif
  351. endif
  352. goto nextstep
  353. ;-----------------------------------------------
  354. ; Configuration Section
  355. ;-----------------------------------------------
  356. configureadapter = +
  357. ;
  358. ; we should delete the old data here
  359. ;
  360. set Error = "Configure: Sorry, not yet implemented."
  361. goto fatal
  362. ;
  363. ; If installing, go create the necessary keys;
  364. ; if configuring, they're already open.
  365. ;
  366. nextstep = +
  367. StartWait
  368. ;
  369. ; Call the EISA find
  370. ;
  371. Shell $(UtilityInf), EISAFindBus, $(NE3200_1BYTE)
  372. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  373. goto ShellCodeError
  374. endif
  375. ifstr $($R0) != "NO_ERROR"
  376. set Error = $($R0)
  377. goto fatal
  378. endif
  379. ifstr(i) $($R1) == {}
  380. set Error = $(CANNOT_FIND_ANY_CARD)
  381. set CommonStatus = STATUS_USERCANCEL
  382. set from = "end"
  383. goto nonfatal
  384. endif
  385. set AdapterList = $($R1)
  386. ;
  387. ; Install Software Component
  388. ;
  389. ifint $(OldVersionExisted) == $(FALSE)
  390. ifstr(i) $(!NTN_InstallMode) == "install"
  391. Ifstr(i) $(DoCopy) == "YES"
  392. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  393. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  394. Goto ShellCodeError
  395. Else-Ifstr(i) $($R0) == STATUS_FAILED
  396. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  397. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  398. goto ShellCodeError
  399. endif
  400. set Error = $($R0)
  401. Goto fatal
  402. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  403. Goto successful
  404. Endif
  405. Set SrcDir = $($R1)
  406. Endif
  407. install "Install-Option"
  408. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  409. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  410. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  411. goto ShellCodeError
  412. endif
  413. set Error = $($R0)
  414. goto fatal
  415. endif
  416. endif
  417. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  418. $(ProductSoftwareName), +
  419. $(ProductSoftwareName), +
  420. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  421. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  422. $(NetEventDLL)
  423. Set OEM_ABANDON_SOFTWARE = TRUE
  424. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  425. goto ShellCodeError
  426. endif
  427. set RegistryErrorIndex = $($R0)
  428. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  429. EndWait
  430. CloseRegKey $($R1)
  431. CloseRegKey $($R2)
  432. CloseRegKey $($R3)
  433. CloseRegKey $($R4)
  434. CloseRegKey $($R5)
  435. goto fatalregistry
  436. endif
  437. ;
  438. ; At this point:
  439. ; $R1 contains the product version key handle;
  440. ; $R2 contains the NetRules subkey handle;
  441. ; $R3 contains the new Services key handle; and
  442. ; $R4 contains the Parameters key
  443. ; $R5 contains the Linkage Key
  444. ;
  445. set SoftProductKey = $($R1)
  446. Set SoftNetRuleKey = $($R2)
  447. Set SoftServiceKey = $($R3)
  448. Set SoftParameterKey = $($R4)
  449. Set SoftLinkageKey = $($R5)
  450. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  451. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  452. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  453. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  454. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  455. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  456. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  457. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  458. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  459. goto ShellCodeError
  460. endif
  461. set RegistryErrorIndex = $($R0)
  462. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  463. EndWait
  464. CloseRegKey $(SoftProductKey)
  465. CloseRegKey $(SoftNetRuleKey)
  466. CloseRegKey $(SoftServiceKey)
  467. CloseRegKey $(SoftParameterKey)
  468. CloseRegKey $(SoftLinkageKey)
  469. goto fatalregistry
  470. endif
  471. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  472. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  473. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  474. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  475. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  476. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  477. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  478. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  479. goto ShellCodeError
  480. endif
  481. set RegistryErrorIndex = $($R0)
  482. CloseRegKey $(SoftProductKey)
  483. CloseRegKey $(SoftNetRuleKey)
  484. CloseRegKey $(SoftServiceKey)
  485. CloseRegKey $(SoftParameterKey)
  486. CloseRegKey $(SoftLinkageKey)
  487. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  488. EndWait
  489. goto fatalregistry
  490. endif
  491. endif
  492. ForListDo $(AdapterList)
  493. set BusNum = *($($),1)
  494. set SlotNum = *($($),2)
  495. Debug-Output $(BusNum)
  496. Debug-Output $(SlotNum)
  497. Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  498. $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  499. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  500. goto ShellCodeError
  501. endif
  502. ifstr $($R0) != "NO_ERROR"
  503. set Error = $($R0)
  504. goto fatal
  505. endif
  506. ifstr(i) $($R1) != "YES"
  507. ;
  508. ; Create the HARDWARE\Netcard region and
  509. ; its corresponding service
  510. ;
  511. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  512. ifint $($R4) != -1
  513. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  514. endif
  515. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  516. goto ShellCodeError
  517. endif
  518. set RegistryErrorIndex = $($R0)
  519. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  520. EndWait
  521. CloseRegKey $($R1)
  522. CloseRegKey $($R2)
  523. CloseRegKey $($R3)
  524. goto fatalregistry
  525. endif
  526. ;
  527. ; At this point:
  528. ; $R1 Registry key variable for
  529. ; HARDWARE\Netcard\(n)
  530. ; $R2 Registry key variable for
  531. ; HARDWARE\Netcard\(n)\\NetRules
  532. ; $R3 Registry key handle for
  533. ; <service>\Parameters key
  534. ; $R4 Adapter number assigned to adapter
  535. ; $R5 Service name generated by combining
  536. ; svc name with adapter number
  537. ;
  538. Set HardNetCardKey = $($R1)
  539. Set HardNetRuleKey = $($R2)
  540. Set HardParameterKey = $($R3)
  541. set AdapterNumber = $($R4)
  542. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  543. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  544. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  545. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  546. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  547. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  548. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  549. Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  550. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  551. goto ShellCodeError
  552. endif
  553. set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  554. {BusType,$(NoTitle),$(!REG_VT_DWORD),2},+
  555. {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  556. {EisaCompressedId,$(NoTitle),$(!REG_VT_DWORD),$(NE3200_1BYTE)},+
  557. {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}}
  558. Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  559. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  560. goto ShellCodeError
  561. endif
  562. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  563. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  564. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  565. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  566. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  567. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  568. Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  569. CloseRegKey $(HardNetCardKey)
  570. CloseRegKey $(HardNetRuleKey)
  571. CloseRegKey $(HardParameterKey)
  572. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  573. goto ShellCodeError
  574. endif
  575. endif
  576. EndForListDo
  577. goto writeparameters
  578. ;
  579. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  580. ;
  581. writeparameters = +
  582. EndWait
  583. goto successful
  584. ;-----------------------------------------------
  585. ; Binding section
  586. ;-----------------------------------------------
  587. bindingadapter =+
  588. set Error = "Binding: Sorry, not yet implemented."
  589. goto fatal
  590. ;-----------------------------------------------
  591. ; Removeadapter section
  592. ;-----------------------------------------------
  593. removeadapter = +
  594. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  595. ; Remove Software Component
  596. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  597. $(ProductSoftwareName)
  598. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  599. Debug-Output "ShellCode error"
  600. goto ShellCodeError
  601. endif
  602. set RegistryErrorIndex = $($R0)
  603. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  604. goto fatalregistry
  605. endif
  606. else
  607. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  608. $(ProductSoftwareName), $(!NTN_RegBase)
  609. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  610. Debug-Output "ShellCode error"
  611. goto ShellCodeError
  612. endif
  613. set RegistryErrorIndex = $($R0)
  614. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  615. goto fatalregistry
  616. endif
  617. endif
  618. goto end
  619. ;Shell $(UtilityInf) RemoveNetworkCardEntry, $(ProductHardwareName)
  620. ;ifint $($ShellCode) != $(!SHELL_CODE_OK)
  621. ; goto ShellCodeError
  622. ;endif
  623. ;-----------------------------------------------
  624. ; Upgrade Software section
  625. ;-----------------------------------------------
  626. UpgradeSoftware = +
  627. ; Upgrade software component
  628. ;
  629. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  630. Ifstr $(KeyProduct) != $(KeyNull)
  631. install "Install-Update"
  632. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  633. goto fatal
  634. endif
  635. ; Upgrade the version number
  636. ;
  637. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  638. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  639. ;
  640. ; do nothing for update
  641. ;
  642. CloseRegKey $(KeyProduct)
  643. else
  644. ;
  645. ; Cannot Open software key, goto ERROR
  646. ;
  647. goto fatalregistry
  648. endif
  649. ;
  650. ; Enumerate all netcards installed of this type and update them
  651. ;
  652. set iSearch = 1
  653. nextnetcard = +
  654. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  655. set KeyNetcard = $($R0)
  656. set iSearch = $($R1)
  657. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  658. Ifstr $(KeyNetcard) != $(KeyNull)
  659. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  660. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  661. CloseRegKey $(KeyNetcard)
  662. goto nextnetcard
  663. Endif
  664. goto end
  665. ;
  666. ; End of Upgrade Software
  667. ;
  668. ;
  669. ; Escape hatches
  670. ;
  671. successful = +
  672. goto end
  673. abandon = +
  674. ForListDo $(OEM_ABANDON_OPTIONS)
  675. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  676. $(ProductSoftwareName), $($)
  677. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  678. Debug-Output "ShellCode error"
  679. goto ShellCodeError
  680. endif
  681. set RegistryErrorIndex = $($R0)
  682. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  683. goto fatalregistry
  684. endif
  685. EndForListDo
  686. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  687. ; Remove Software Component
  688. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  689. $(ProductSoftwareName), FALSE
  690. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  691. Debug-Output "ShellCode error"
  692. goto ShellCodeError
  693. endif
  694. set RegistryErrorIndex = $($R0)
  695. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  696. goto fatalregistry
  697. endif
  698. endif
  699. goto end
  700. ;
  701. ; warning display
  702. ;
  703. warning = +
  704. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  705. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  706. goto ShellCodeError
  707. endif
  708. ifstr(i) $($R1) == "OK"
  709. goto $(to)
  710. else-ifstr(i) $($R1) == "CANCEL"
  711. goto $(from)
  712. else
  713. ; Debug-Msg "Error Error Bad DLGEVENT"
  714. goto "end"
  715. endif
  716. ;
  717. ; non fatal error display
  718. ;
  719. nonfatalinfo = +
  720. Set CommonStatus = STATUS_USERCANCEL
  721. Set Severity = STATUS
  722. goto nonfatalmsg
  723. nonfatal = +
  724. Set Severity = NONFATAL
  725. goto nonfatalmsg
  726. nonfatalmsg = +
  727. ifstr(i) $(Error) == ""
  728. Set Severity = NONFATAL
  729. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  730. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  731. goto ShellCodeError
  732. endif
  733. set Error = $($R0)
  734. endif
  735. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  736. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  737. goto ShellCodeError
  738. endif
  739. ifstr(i) $($R1) == "OK"
  740. goto $(from)
  741. else
  742. goto "end"
  743. endif
  744. ;
  745. ; Registry is broken
  746. ;
  747. fatalregistry = +
  748. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  749. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  750. goto ShellCodeError
  751. endif
  752. set Error = $($R0)
  753. goto fatal
  754. ;
  755. ; fatal error display
  756. ;
  757. fatal = +
  758. ifstr(i) $(Error) == ""
  759. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  760. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  761. goto ShellCodeError
  762. endif
  763. set Error = $($R0)
  764. endif
  765. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  766. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  767. goto ShellCodeError
  768. endif
  769. goto setfailed
  770. ;
  771. ; Shelling error
  772. ;
  773. ShellCodeError = +
  774. set DlgType = "MessageBox"
  775. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  776. set STF_MB_TEXT = $(ShellCodeErrorText)
  777. set STF_MB_TYPE = 1
  778. set STF_MB_ICON = 3
  779. set STF_MB_DEF = 1
  780. ui start "Error Message"
  781. goto setfailed
  782. setfailed = +
  783. set CommonStatus = STATUS_FAILED
  784. ;
  785. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  786. ;
  787. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  788. set OEM_ABANDON_ON = FALSE
  789. goto abandon
  790. endif
  791. goto end
  792. end = +
  793. goto term
  794. term = +
  795. Return $(CommonStatus)
  796. ;***************************************************************
  797. ; INSTALL SECTIONS
  798. ;***************************************************************
  799. [Install-Option]
  800. set STF_VITAL = ""
  801. ifstr(i) $(AddCopy) == "YES"
  802. ;
  803. ; Add the files to the copy list
  804. ;
  805. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  806. ; the other INF files
  807. ;
  808. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  809. endif
  810. ifstr(i) $(DoCopy) == "YES"
  811. ;
  812. ; Copy files in the copy list
  813. ;
  814. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  815. CopyFilesInCopyList
  816. endif
  817. ifstr(i) $(DoConfig) == "YES"
  818. ;
  819. ; Add product to registry
  820. ;
  821. ;
  822. ; Finish up
  823. endif
  824. Exit
  825. [Install-Update]
  826. set STF_VITAL = ""
  827. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  828. ;set STF_VERSION = "YES"
  829. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  830. exit
  831.