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.

729 lines
27 KiB

  1. [Identification]
  2. OptionType = NetAdapter
  3. [PlatformsSupported]
  4. ISA
  5. EISA
  6. "Jazz-Internal Bus"
  7. [Options]
  8. IBMTOK2ISA
  9. [FileConstants]
  10. UtilityInf = "UTILITY.INF"
  11. ParamInf = "NCPARAM.INF"
  12. subroutineinf = "SUBROUTN.INF"
  13. SoftwareType = "driver"
  14. Exit_Code = 0
  15. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  16. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  17. Manufacturer = "Microsoft"
  18. ProductMajorVersion = "4"
  19. ProductMinorVersion = "0"
  20. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  21. ProductSoftwareName = "IBMTOK2I"
  22. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\ibmtok2i.sys"
  23. NetRuleSoftwareType = "ibmtok2iSys ndisDriver ibmtok2iDriver"
  24. NetRuleSoftwareUse = $(SoftwareType)
  25. NetRuleSoftwareBindForm = """IBMTOK2ISys"" yes no container"
  26. NetRuleSoftwareClass = {"ibmtok2iDriver basic"}
  27. NetRuleSoftwareBindable = {"ibmtok2iDriver ibmtok2iAdapter non exclusive 100"}
  28. ProductHardwareName = "IBMTOK2I"
  29. NetRuleHardwareType = "ibmtok2i ibmtok2iAdapter"
  30. NetRuleHardwareBindForm = " yes yes container"
  31. NetRuleHardwareClass = {"ibmtok2iIAdapter basic"}
  32. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  33. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  34. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  35. [GeneralConstants]
  36. from = ""
  37. to = ""
  38. ExitCodeOk = 0
  39. ExitCodeCancel = 1
  40. ExitCodeFatal = 2
  41. KeyNull = ""
  42. MAXIMUM_ALLOWED = 33554432
  43. RegistryErrorIndex = NO_ERROR
  44. KeyProduct = ""
  45. KeyParameters = ""
  46. TRUE = 1
  47. FALSE = 0
  48. NoTitle = 0
  49. ExitState = "Active"
  50. OldVersionExisted = $(FALSE)
  51. DriverPath = $(!STF_NTPATH)\drivers
  52. [date]
  53. Now = {} ? $(!LIBHANDLE) GetSystemDate
  54. [Identify]
  55. read-syms Identification
  56. set Status = STATUS_SUCCESSFUL
  57. set Identifier = $(OptionType)
  58. set Media = #("Source Media Descriptions", 1, 1)
  59. Return $(Status) $(Identifier) $(Media)
  60. [ReturnOptions]
  61. set Status = STATUS_FAILED
  62. set OptionList = {}
  63. set OptionTextList = {}
  64. set LanguageList = ^(LanguagesSupported, 1)
  65. Ifcontains(i) $($0) in $(LanguageList)
  66. ifstr(i) $($1) == ""
  67. goto returnoptions
  68. endif
  69. set PlatformList = ^(PlatformsSupported, 1)
  70. Ifcontains(i) $($1) in $(PlatformList)
  71. goto returnoptions
  72. else
  73. set Status = STATUS_NOTSUPPORTED
  74. goto finish_ReturnOptions
  75. endif
  76. else
  77. set Status = STATUS_NOLANGUAGE
  78. goto finish_ReturnOptions
  79. endif
  80. returnoptions = +
  81. set OptionList = ^(Options, 1)
  82. set OptionTextList = ^(OptionsText$($0), 1)
  83. set Status = STATUS_SUCCESSFUL
  84. finish_ReturnOptions = +
  85. Return $(Status) $(OptionList) $(OptionTextList)
  86. [InstallOption]
  87. set Status = STATUS_FAILED
  88. set Option = $($1)
  89. set SrcDir = $($2)
  90. set AddCopy = $($3)
  91. set DoCopy = $($4)
  92. set DoConfig = $($5)
  93. set LanguageList = ^(LanguagesSupported, 1)
  94. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  95. Return STATUS_NOLANGUAGE
  96. endif
  97. set-subst LF = "\n"
  98. read-syms GeneralConstants
  99. read-syms FileConstants
  100. read-syms DialogConstants$(!STF_LANGUAGE)
  101. ifstr(i) $(!NTN_Origination) == "NCPA"
  102. set Continue = $(OK)
  103. endif
  104. read-syms FileConstants$(!STF_LANGUAGE)
  105. detect date
  106. set-title $(FunctionTitle)
  107. set to = Begin
  108. set from = Begin
  109. set CommonStatus = STATUS_SUCCESSFUL
  110. EndWait
  111. Begin = +
  112. Set ActivateDetection = FALSE
  113. Ifstr(i) $(!NTN_InstallMode) == deinstall
  114. set StartLabel = removeadapter
  115. else-Ifstr(i) $(!NTN_InstallMode) == Update
  116. set StartLabel = UpgradeSoftware
  117. else-Ifstr(i) $(!NTN_InstallMode) == bind
  118. set StartLabel = bindingadapter
  119. else-Ifstr(i) $(!NTN_InstallMode) == configure
  120. set CommonStatus = STATUS_REBOOT
  121. set ActivateDetection = TRUE
  122. set StartLabel = configureadapter
  123. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  124. Debug-Output "Cannot configure the Token Ring 16/4 II driver software."
  125. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  126. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  127. Debug-Output "ShellCode error: cannot get an error string."
  128. goto ShellCodeError
  129. endif
  130. set Error = $($R0)
  131. set from = end
  132. set to = end
  133. goto nonfatalinfo
  134. endif
  135. else
  136. set ActivateDetection = TRUE
  137. set StartLabel = installadapter
  138. set OEM_ABANDON_OPTIONS = {}
  139. set OEM_ABANDON_SOFTWARE = FALSE
  140. set OEM_ABANDON_ON = TRUE
  141. endif
  142. Debug-Output "oemnadt2.INF: =================================================="
  143. Debug-Output "oemnadt2.INF: STF_CWDIR is: "$(!STF_CWDIR)
  144. Debug-Output "oemnadt2.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  145. Debug-Output "oemnadt2.INF: Option is: "$(Option)
  146. Debug-Output "oemnadt2.INF: !STF_NCDETECT is: "$(!STF_NCDETECT)
  147. Debug-Output "oemnadt2.INF: !STF_NCOPTION is: "$(!STF_NCOPTION)
  148. Debug-Output "oemnadt2.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  149. Debug-Output "oemnadt2.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  150. Debug-Output "oemnadt2.INF: =================================================="
  151. Set DetectedCard = FALSE
  152. Ifstr(i) $(ActivateDetection) != TRUE
  153. Goto $(StartLabel)
  154. Endif
  155. Set TypeList = {{IOADDR, IOADDR_Addr_List, IOBaseAddrValue}}
  156. Debug-Output "oemnadt2.INF: Calling Param_BuildTypeLists"
  157. Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  158. Set Status = $($R0)
  159. ifstr(i) $(Status) != STATUS_SUCCESSFUL
  160. Goto fataldetect
  161. Endif
  162. Debug-Output "oemnadt2.INF: Calling Param_SetDefaults"
  163. Shell $(ParamInf) Param_SetDefaults {}
  164. Shell $(ParamInf) HexListFromDecList $(IOADDR_Addr_List)
  165. Set IOADDR_Hex_List = $($R0)
  166. Ifstr(i) $(!STF_NCDETECT) == YES
  167. Ifstr(i) $(!STF_NCOPTION) == $(Option)
  168. Set DetectedCard = TRUE
  169. Debug-Output "oemnadt2.INF: Setting DetectedCard to TRUE"
  170. Endif
  171. Endif
  172. Shell "" DebugConfiguration "After parameter querying"
  173. Set from = $(fatal)
  174. Set to = $(fatal)
  175. Goto $(StartLabel)
  176. installadapter = +
  177. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  178. Ifstr $(KeyProduct) != $(KeyNull)
  179. CloseRegKey $(KeyProduct)
  180. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  181. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  182. $(ProductVersion)
  183. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  184. Debug-Output "ShellCode error: cannot get an error string."
  185. goto ShellCodeError
  186. endif
  187. goto end
  188. else
  189. Shell $(UtilityInf), CardExistedDlg
  190. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  191. Debug-Output "ShellCode error: cannot get an error string."
  192. goto ShellCodeError
  193. endif
  194. ifstr(i) $($R1) != "OK"
  195. set CommonStatus = STATUS_USERCANCEL
  196. goto end
  197. endif
  198. set OldVersionExisted = $(TRUE)
  199. endif
  200. endif
  201. Set CurrParamSettings = {}
  202. Ifstr(i) $(DetectedCard) != TRUE
  203. Goto adaptersetup
  204. Endif
  205. StartWait
  206. Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
  207. EndWait
  208. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  209. Goto adaptersetup
  210. Endif
  211. Set DetectedParams = $($R1)
  212. Debug-Output "oemnadt2.INF: Calling Param_SetDefaults to merge detected params"
  213. Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
  214. goto adaptersetup
  215. configureadapter = +
  216. Ifstr $(KeyProduct) == $(KeyNull)
  217. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  218. Ifstr $(KeyProduct) == $(KeyNull)
  219. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  220. Debug-Output "Cannot find component product key"
  221. goto fatalregistry
  222. Endif
  223. Endif
  224. Debug-Output "INF: Shelling to FindService"
  225. Shell $(UtilityInf) FindService, $(KeyProduct)
  226. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  227. Debug-Output "INF: FindService shell failure"
  228. Goto ShellCodeError
  229. Endif
  230. Ifstr(i) $($R0) != NO_ERROR
  231. Debug-Output "INF: FindService Shell error: "$($R0)
  232. Goto fatalregistry
  233. endif
  234. Set KeyParameters = $($R2)
  235. CloseRegKey $($R1)
  236. Ifstr $(KeyParameters) == $(KeyNull)
  237. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  238. Debug-Output "Cannot find component service"
  239. goto fatalregistry
  240. endif
  241. set OldVersionExisted = $(TRUE)
  242. set ValueName = ""
  243. set ValueData = ""
  244. set ValueStr = ""
  245. set ValueList = {}
  246. EnumRegValue $(KeyParameters) ValueList
  247. ForListDo $(ValueList)
  248. set ValueItem = $($)
  249. set ValueName = *($(ValueItem),1)
  250. set ValueData = *($(ValueItem),4)
  251. Ifstr(i) $(ValueName) == "IoBaseAddress"
  252. set IOBaseAddrValue = $(ValueData)
  253. else-Ifstr(i) $(ValueName) == "NetworkAddress"
  254. set NetworkAddress = $(ValueData)
  255. else-ifstr(i) $(ValueName) == "BusType"
  256. set BusInterfaceType = $(ValueData)
  257. else-ifstr(i) $(ValueName) == "BusNumber"
  258. set BusNumber = $(ValueData)
  259. endif
  260. EndForListDo
  261. Shell $(ParamInf) Param_SaveValues
  262. Set CurrParamSettings = $($R0)
  263. adaptersetup = +
  264. Shell "" DebugConfiguration "before displaying dialog"
  265. Set from = adapteroptions
  266. Set IOADDR_Hex_Value = *($(IOADDR_Hex_List), ~($(IOADDR_Addr_List),$(IOBaseAddrValue)))
  267. Shell $(ParamInf) Param_ParameterConfidence
  268. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  269. Debug-Output "oemnadt2.INF: parameter confidence too low to bypass configuration"
  270. Goto adapteroptions
  271. Endif
  272. Ifstr(i) $(DetectedCard) == TRUE
  273. Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
  274. set BusInterfaceType = *($(!STF_NCDETINFO),5)
  275. set BusNumber = *($(!STF_NCDETINFO),6)
  276. Goto adapterverify
  277. Endif
  278. Endif
  279. adapteroptions = +
  280. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  281. ifstr(i) $(!AutoNetInterfaceType) != ""
  282. set BusInterfaceType = $(!AutoNetInterfaceType)
  283. else
  284. set BusInterfaceType = 1 ;ISA
  285. endif
  286. ifstr(i) $(!AutoNetBusNumber) != ""
  287. set BusNumber = $(!AutoNetBusNumber)
  288. else
  289. set BusNumber = 0
  290. endif
  291. goto adapterverify
  292. endif
  293. read-syms FileDependentDlg$(!STF_LANGUAGE)
  294. ui start "InputDlg"
  295. ifstr(i) $(DLGEVENT) == "CONTINUE"
  296. set IOADDR_Hex_Value = $(Combo1Out)
  297. set NetworkAddress = *($(EditTextOut),1)
  298. Set IOBaseAddrValue = *($(IOADDR_Addr_List), ~($(IOADDR_Hex_List),$(IOADDR_Hex_Value)))
  299. ui pop 1
  300. else-ifstr(i) $(DLGEVENT) == "BACK"
  301. set CommonStatus = STATUS_USERCANCEL
  302. Debug-Output "Action: exit. Bye."
  303. ui pop 1
  304. goto end
  305. else
  306. Debug-Output "Action: unknown. Bye."
  307. ui pop 1
  308. goto end
  309. endif
  310. ifstr(i) $(!STF_NCDETINFO) == {}
  311. Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
  312. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  313. Debug-Output "ShellCode error."
  314. goto ShellCodeError
  315. endif
  316. set BusInterfaceType = $($R1)
  317. set BusNumber = $($R2)
  318. else
  319. set BusInterfaceType = *($(!STF_NCDETINFO),5)
  320. set BusNumber = *($(!STF_NCDETINFO),6)
  321. endif
  322. adapterverify = +
  323. Shell "" DebugConfiguration "after running dialog"
  324. Ifstr(i) $(DetectedCard) != TRUE
  325. Shell $(ParamInf) Param_SaveValues
  326. Set NewParamSettings = $($R0)
  327. Ifstr(i) $(CurrParamSettings) == {}
  328. Set DiffParamSettings = $(NewParamSettings)
  329. Else
  330. Shell $(ParamInf) Param_DiffValues $(CurrParamSettings)
  331. Set DiffParamSettings = $($R0)
  332. Endif
  333. Debug-Output "oemnadt2.INF: Calling Param_VerifyResources"
  334. Shell $(ParamInf) Param_VerifyResources $(DiffParamSettings)
  335. Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  336. Debug-Output "oemnadt2.INF: Param_VerifyResources succeeded"
  337. Goto skipoptions
  338. Endif
  339. Else
  340. Set CardVerifyIndex = $(!STF_NCDETCARD)
  341. Debug-Output "oemnadt2.INF: Calling Param_VerifyCard"
  342. Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  343. Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  344. Debug-Output "oemnadt2.INF: Param_VerifyCard succeeded"
  345. Goto skipoptions
  346. Endif
  347. Endif
  348. Set from = adapteroptions
  349. Set to = skipoptions
  350. Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  351. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  352. Debug-Output "ShellCode error: cannot get an error string."
  353. goto ShellCodeError
  354. endif
  355. set Error = $($R0)
  356. Goto Warning
  357. skipoptions =+
  358. ifint $(OldVersionExisted) == $(TRUE)
  359. ifstr(i) $(!NTN_InstallMode) == configure
  360. goto writeparameters
  361. endif
  362. endif
  363. StartWait
  364. ifint $(OldVersionExisted) == $(FALSE)
  365. ifstr(i) $(!NTN_InstallMode) == "install"
  366. Ifstr(i) $(DoCopy) == "YES"
  367. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  368. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  369. Goto ShellCodeError
  370. Else-Ifstr(i) $($R0) == STATUS_FAILED
  371. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  372. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  373. goto ShellCodeError
  374. endif
  375. set Error = $($R0)
  376. Goto fatal
  377. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  378. Goto successful
  379. Endif
  380. Set SrcDir = $($R1)
  381. Endif
  382. install "Install-Option"
  383. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  384. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  385. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  386. goto ShellCodeError
  387. endif
  388. set Error = $($R0)
  389. goto fatal
  390. endif
  391. endif
  392. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  393. $(ProductSoftwareName), +
  394. $(ProductSoftwareName), +
  395. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  396. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  397. $(NetEventDLL)
  398. Set OEM_ABANDON_SOFTWARE = TRUE
  399. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  400. Debug-Output "ShellCode error"
  401. goto ShellCodeError
  402. endif
  403. set RegistryErrorIndex = $($R0)
  404. set KeyProduct = $($R1)
  405. Set SoftNetRulesKey = $($R2)
  406. CloseRegKey $($R3)
  407. CloseRegKey $($R4)
  408. CloseRegKey $($R5)
  409. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  410. EndWait
  411. Debug-Output "Registry error: add software components"
  412. CloseRegKey $(KeyProduct)
  413. CloseRegKey $(SoftNetRulesKey)
  414. goto fatalregistry
  415. endif
  416. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  417. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  418. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  419. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  420. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  421. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  422. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  423. Shell $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  424. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  425. Debug-Output "ShellCode error."
  426. goto ShellCodeError
  427. endif
  428. set RegistryErrorIndex = $($R0)
  429. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  430. EndWait
  431. Debug-Output "Registry error: add value list."
  432. CloseRegKey $(KeyProduct)
  433. CloseRegKey $(SoftNetRulesKey)
  434. goto fatalregistry
  435. endif
  436. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  437. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  438. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  439. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  440. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  441. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  442. Shell $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  443. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  444. Debug-Output "ShellCode error."
  445. goto ShellCodeError
  446. endif
  447. set RegistryErrorIndex = $($R0)
  448. CloseRegKey $(KeyProduct)
  449. CloseRegKey $(SoftNetRulesKey)
  450. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  451. EndWait
  452. Debug-Output "Resgitry error: add value list."
  453. goto fatalregistry
  454. endif
  455. endif
  456. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  457. ifint $($R4) != -1
  458. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  459. endif
  460. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  461. Debug-Output "Cannot add hardware component"
  462. goto ShellCodeError
  463. endif
  464. set RegistryErrorIndex = $($R0)
  465. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  466. EndWait
  467. Debug-Output "Registry error: add hardware component"
  468. CloseRegKey $($R1)
  469. CloseRegKey $($R2)
  470. CloseRegKey $($R3)
  471. goto fatalregistry
  472. endif
  473. set KeyParameters = $($R3)
  474. set KeyAdapterRules = $($R2)
  475. set AdapterNumber = $($R4)
  476. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  477. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  478. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  479. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  480. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  481. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  482. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  483. Shell $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  484. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  485. Debug-Output "ShellCode error"
  486. goto ShellCodeError
  487. endif
  488. CloseRegKey $($R1)
  489. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  490. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  491. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  492. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  493. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  494. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  495. Shell $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  496. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  497. Debug-Output "ShellCode error."
  498. goto ShellCodeError
  499. endif
  500. set RegistryErrorIndex = $($R0)
  501. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  502. EndWait
  503. Debug-Output "Resgitry error: add value list."
  504. CloseRegKey $(KeyParameters)
  505. CloseRegKey $(KeyAdapterRules)
  506. goto fatalregistry
  507. endif
  508. CloseRegKey $(KeyAdapterRules)
  509. goto writeparameters
  510. writeparameters = +
  511. Set NewValueList = {+
  512. {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
  513. {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  514. {CardType,$(NoTitle),$(!REG_VT_DWORD),0},+
  515. {MediaType,$(NoTitle),$(!REG_VT_DWORD),2},+
  516. {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  517. {NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)}}
  518. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  519. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  520. Shell $(UtilityInf),AddDefaultNetCardParameters,$(KeyParameters)
  521. endif
  522. CloseRegKey $(KeyParameters)
  523. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  524. Debug-Output "ShellCode error."
  525. goto ShellCodeError
  526. endif
  527. set RegistryErrorIndex = $($R0)
  528. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  529. Debug-Output "Registry error: Add value list"
  530. goto fatalregistry
  531. endif
  532. EndWait
  533. goto successful
  534. bindingadapter =+
  535. set Error = "Binding: Sorry, not yet implemented."
  536. goto fatal
  537. removeadapter = +
  538. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  539. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  540. $(ProductSoftwareName)
  541. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  542. Debug-Output "ShellCode error"
  543. goto ShellCodeError
  544. endif
  545. set RegistryErrorIndex = $($R0)
  546. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  547. goto fatalregistry
  548. endif
  549. else
  550. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  551. $(ProductSoftwareName), $(!NTN_RegBase)
  552. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  553. Debug-Output "ShellCode error"
  554. goto ShellCodeError
  555. endif
  556. set RegistryErrorIndex = $($R0)
  557. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  558. goto fatalregistry
  559. endif
  560. endif
  561. goto end
  562. UpgradeSoftware = +
  563. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  564. Ifstr $(KeyProduct) != $(KeyNull)
  565. install "Install-Update"
  566. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  567. goto fatal
  568. endif
  569. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  570. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  571. CloseRegKey $(KeyProduct)
  572. else
  573. goto fatalregistry
  574. endif
  575. ;
  576. ; Enumerate all netcards installed of this type and update them
  577. ;
  578. set iSearch = 1
  579. nextnetcard = +
  580. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  581. set KeyNetcard = $($R0)
  582. set iSearch = $($R1)
  583. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  584. Ifstr $(KeyNetcard) != $(KeyNull)
  585. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  586. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  587. CloseRegKey $(KeyNetcard)
  588. goto nextnetcard
  589. Endif
  590. goto end
  591. successful = +
  592. goto end
  593. abandon = +
  594. ForListDo $(OEM_ABANDON_OPTIONS)
  595. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  596. $(ProductSoftwareName), $($)
  597. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  598. Debug-Output "ShellCode error"
  599. goto ShellCodeError
  600. endif
  601. set RegistryErrorIndex = $($R0)
  602. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  603. goto fatalregistry
  604. endif
  605. EndForListDo
  606. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  607. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  608. $(ProductSoftwareName), FALSE
  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. warning = +
  620. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  621. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  622. goto ShellCodeError
  623. endif
  624. ifstr(i) $($R1) == "OK"
  625. goto $(to)
  626. else-ifstr(i) $($R1) == "CANCEL"
  627. goto $(from)
  628. else
  629. goto "end"
  630. endif
  631. nonfatalinfo = +
  632. Set Severity = STATUS
  633. Set CommonStatus = STATUS_USERCANCEL
  634. goto nonfatalmsg
  635. nonfatal = +
  636. Set Severity = NONFATAL
  637. goto nonfatalmsg
  638. nonfatalmsg = +
  639. ifstr(i) $(Error) == ""
  640. Set Severity = NONFATAL
  641. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  642. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  643. goto ShellCodeError
  644. endif
  645. set Error = $($R0)
  646. endif
  647. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  648. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  649. goto ShellCodeError
  650. endif
  651. ifstr(i) $($R1) == "OK"
  652. goto $(from)
  653. else
  654. goto "end"
  655. endif
  656. fatalregistry = +
  657. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  658. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  659. goto ShellCodeError
  660. endif
  661. set Error = $($R0)
  662. goto fatal
  663. fataldetect = +
  664. Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  665. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  666. Debug-Output "ShellCode error: cannot get an error string."
  667. goto ShellCodeError
  668. endif
  669. set Error = $($R0)
  670. Goto fatal
  671. fatal = +
  672. ifstr(i) $(Error) == ""
  673. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  674. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  675. goto ShellCodeError
  676. endif
  677. set Error = $($R0)
  678. endif
  679. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  680. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  681. goto ShellCodeError
  682. endif
  683. goto setfailed
  684. ShellCodeError = +
  685. set DlgType = "MessageBox"
  686. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  687. set STF_MB_TEXT = $(ShellCodeErrorText)
  688. set STF_MB_TYPE = 1
  689. set STF_MB_ICON = 3
  690. set STF_MB_DEF = 1
  691. ui start "Error Message"
  692. goto setfailed
  693. setfailed = +
  694. set CommonStatus = STATUS_FAILED
  695. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  696. set OEM_ABANDON_ON = FALSE
  697. goto abandon
  698. endif
  699. goto end
  700. end = +
  701. goto term
  702. term = +
  703. Return $(CommonStatus)
  704. [DebugConfiguration]
  705. Set InfName = "oemnadt2.INF"
  706. Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  707. Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  708. return
  709. [Install-Option]
  710. set STF_VITAL = ""
  711. ifstr(i) $(AddCopy) == "YES"
  712. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  713. endif
  714. ifstr(i) $(DoCopy) == "YES"
  715. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  716. CopyFilesInCopyList
  717. endif
  718. Exit
  719. [Install-Update]
  720. set STF_VITAL = ""
  721. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  722. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  723. exit
  724.