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.

825 lines
29 KiB

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