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.

666 lines
23 KiB

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