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.

734 lines
26 KiB

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