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.

1058 lines
32 KiB

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