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.

985 lines
29 KiB

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