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