Leaked source code of windows server 2003
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.

1131 lines
43 KiB

  1. [Identification]
  2. OptionType = NetTransport
  3. [LanguagesSupported]
  4. ENG
  5. [Options]
  6. atmarpc
  7. [OptionsTextENG]
  8. atmarpc = "IP over ATM (RFC 1577) Client"
  9. [FileConstants]
  10. UtilityInf = "UTILITY.INF"
  11. subroutineinf = "SUBROUTN.INF"
  12. SoftwareType = "transport"
  13. TSoftwareType = "driver"
  14. Exit_Code = 0
  15. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  16. Manufacturer = "Microsoft"
  17. ProductMajorVersion = "1"
  18. ProductMinorVersion = "0"
  19. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  20. TProductMajorVersion = "1"
  21. TProductMinorVersion = "0"
  22. TProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  23. ProductSoftwareName = "atmarpc"
  24. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\atmarpc.sys"
  25. TProductSoftwareName = "ipatmarp"
  26. TProductSoftwareImagePath = "\SystemRoot\System32\drivers\ipatmarp.sys"
  27. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  28. TProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(TProductSoftwareName)"\CurrentVersion"
  29. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Parameters"
  30. ServiceKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)
  31. TServiceKeyName = $(!NTN_ServiceBase)"\"$(TProductSoftwareName)
  32. LinkageKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Linkage"
  33. TLinkageKeyName = $(!NTN_ServiceBase)"\"$(TProductSoftwareName)"\Linkage"
  34. ProductRegBase = "SOFTWARE\Microsoft\atmarpc\CurrentVersion"
  35. TProductRegBase = "SOFTWARE\Microsoft\ipatmarp\CurrentVersion"
  36. ; type = Name,Class
  37. NetRuleSoftwareType = "atmarpc ipatmclient"
  38. TNetRuleSoftwareType = "ipatmarpsys atmvirtualdriver ipatmarpdriver"
  39. ; Class = new class name {existing class name | basic no|yes }
  40. NetRuleSoftwareClass = {"ipatmclient basic"}
  41. TNetRuleSoftwareClass = {"ipatmarpdriver basic", "atmvirtualdriver basic"}
  42. ; Use = Service | Transport | driver | adapter, yes|no, yes|no
  43. NetRuleSoftwareUse = $(SoftwareType)" no yes"
  44. TNetRuleSoftwareUse = $(TSoftwareType)
  45. ; BindForm = ObjectName yes|no yes|no container|simple|stream
  46. NetRuleSoftwareBindForm = """atmarpc"" yes no container"
  47. TNetRuleSoftwareBindForm = """ipatmarpsys"" yes no container"
  48. TNetRuleSoftwareBindable = {"ipatmarpdriver AtmArpVirtualAdapter non exclusive 100",+
  49. "tcpipTransport atmvirtualdriver non non 100",+
  50. "netbtTransport atmvirtualdriver non non 100"}
  51. TcpipLLInterface = "AtmArpC"
  52. TpcipUseZeroBroadcast = 0
  53. [HardwareConstants]
  54. ProductHardwareName = "ipatmarp"
  55. ProductHardwareTitle = "Virtual ATMARP Interface Adapter"
  56. ProductHardwareDescription = "ATMARP Interface Adapter"
  57. NetRuleHardwareType = "ipatmarp AtmArpVirtualAdapter"
  58. NetRuleHardwareBindForm = " yes yes container"
  59. NetRuleHardwareClass = {"AtmArpVirtualAdapter basic"}
  60. [GeneralConstants]
  61. from = ""
  62. to = ""
  63. ExitCodeOk = 0
  64. ExitCodeCancel = 1
  65. ExitCodeFatal = 2
  66. KeyNull = ""
  67. MAXIMUM_ALLOWED = 33554432
  68. RegistryErrorIndex = NO_ERROR
  69. KeyProduct = ""
  70. KeyParameters = ""
  71. TRUE = 1
  72. FALSE = 0
  73. NoTitle = 0
  74. ExitState = "Active"
  75. OldVersionExisted = $(FALSE)
  76. DriverPath = $(!STF_NTPATH)\drivers
  77. [date]
  78. Now = {} ? $(!LIBHANDLE) GetSystemDate
  79. [platform]
  80. STF_PLATFORM = "" ? $(!LIBHANDLE) GetPlatform
  81. [Identify]
  82. read-syms Identification
  83. set Status = STATUS_SUCCESSFUL
  84. set Identifier = $(OptionType)
  85. set Media = #("Source Media Descriptions", 1, 1)
  86. Return $(Status) $(Identifier) $(Media)
  87. [ReturnOptions]
  88. set Status = STATUS_FAILED
  89. set OptionList = {}
  90. set OptionTextList = {}
  91. set LanguageList = ^(LanguagesSupported, 1)
  92. Ifcontains(i) $($0) in $(LanguageList)
  93. goto returnoptions
  94. else
  95. set Status = STATUS_NOLANGUAGE
  96. goto finish_ReturnOptions
  97. endif
  98. returnoptions = +
  99. set OptionList = ^(Options, 1)
  100. set OptionTextList = ^(OptionsText$($0), 1)
  101. set Status = STATUS_SUCCESSFUL
  102. finish_ReturnOptions = +
  103. Return $(Status) $(OptionList) $(OptionTextList)
  104. [InstallOption]
  105. set !DebugOutputControl = 1
  106. set Option = $($1)
  107. set SrcDir = $($2)
  108. set AddCopy = $($3)
  109. set DoCopy = $($4)
  110. set DoConfig = $($5)
  111. Debug-Output "ATMARPC: NTN_REGBASE is "$(!NTN_RegBase)
  112. Debug-Output "ATMARPC: Arg 1"$($1)
  113. Debug-Output "ATMARPC: Arg 2"$($2)
  114. Debug-Output "ATMARPC: Arg 3"$($3)
  115. Debug-Output "ATMARPC: Arg 4"$($4)
  116. Debug-Output "ATMARPC: Arg 5"$($5)
  117. Debug-Output "ATMARPC: Arg 6"$($6)
  118. set LanguageList = ^(LanguagesSupported, 1)
  119. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  120. Return STATUS_NOLANGUAGE
  121. endif
  122. Debug-Output "ATMARPC: STF_CWDDIR is: "$(!STF_CWDDIR)
  123. Debug-Output "ATMARPC: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  124. set-subst LF = "\n"
  125. read-syms GeneralConstants
  126. read-syms FileConstants
  127. read-syms HardwareConstants
  128. read-syms DialogConstants$(!STF_LANGUAGE)
  129. ifstr(i) $(!NTN_Origination) == "NCPA"
  130. set Continue = $(OK)
  131. endif
  132. read-syms FileConstants$(!STF_LANGUAGE)
  133. detect date
  134. detect platform
  135. set-title $(FunctionTitle)
  136. set to = Begin
  137. set from = Begin
  138. set CommonStatus = STATUS_SUCCESSFUL
  139. EndWait
  140. Begin = +
  141. Debug-Output "ATMARPC: Install mode "$(!NTN_InstallMode)
  142. Debug-Output "ATMARPC: Registry base "$(!NTN_RegBase)
  143. Ifstr(i) $(!NTN_InstallMode) == deinstall
  144. set StartLabel = removeadapter
  145. else-Ifstr(i) $(!NTN_InstallMode) == Update
  146. set StartLabel = UpgradeSoftware
  147. else-Ifstr(i) $(!NTN_InstallMode) == bind
  148. set StartLabel = bindingadapter
  149. else-Ifstr(i) $(!NTN_InstallMode) == configure
  150. ; Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  151. ; ifint $($ShellCode) != $(!SHELL_CODE_OK)
  152. ; Debug-Output "ATMARPC: ShellCode error: cannot get an error string."
  153. ; goto ShellCodeError
  154. ; endif
  155. ; set Error = $($R0)
  156. ; set from = end
  157. ; set to = end
  158. ; goto nonfatalinfo
  159. Goto successful
  160. else
  161. set StartLabel = installadapter
  162. endif
  163. set RadioDefault = 2
  164. set RadioIn = {$(RadioDefault)}
  165. set from = $(fatal)
  166. set to = $(fatal)
  167. goto $(StartLabel)
  168. installadapter = +
  169. Debug-Output "ATMARPC: Installadapter"
  170. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  171. Ifstr $(KeyProduct) != $(KeyNull)
  172. CloseRegKey $(KeyProduct)
  173. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  174. $(ProductVersion)
  175. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  176. Debug-Output "ATMARPC: ShellCode error: cannot get an error string."
  177. goto ShellCodeError
  178. endif
  179. goto end
  180. endif
  181. CloseRegKey $(KeyProduct)
  182. goto installproduct
  183. installproduct = +
  184. StartWait
  185. ifint $(OldVersionExisted) == $(FALSE)
  186. Ifstr(i) $(DoCopy) == "YES"
  187. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  188. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  189. Goto ShellCodeError
  190. Else-Ifstr(i) $($R0) == STATUS_FAILED
  191. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  192. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  193. goto ShellCodeError
  194. endif
  195. Goto fatal
  196. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  197. Goto successful
  198. Endif
  199. Set SrcDir = $($R1)
  200. Endif
  201. Shell "" StripTrailSlash $(SrcDir)
  202. set PlatformDir = $($R0)"\"$(STF_PLATFORM)
  203. set InfDir = $($R0)"\"
  204. install "Install-Option"
  205. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  206. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  207. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  208. goto ShellCodeError
  209. endif
  210. set Error = $($R0)
  211. goto fatal
  212. endif
  213. set OEM_ABANDON_ON = TRUE
  214. Debug-Output "ATMARPC: AddSoftwareing "$(ProductSoftwareName)" now"
  215. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  216. $(ProductSoftwareName), +
  217. $(ProductSoftwareName), +
  218. $(ProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
  219. $(ProductSoftwareImagePath), "kernel", "PNP_TDI", {}, "",+
  220. $(NetEventDLL)
  221. set RegistryErrorIndex = $($R0)
  222. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  223. EndWait
  224. CloseRegKey $($R1)
  225. CloseRegKey $($R2)
  226. CloseRegKey $($R3)
  227. CloseRegKey $($R4)
  228. CloseRegKey $($R5)
  229. Debug-Output "ATMARPC: ** Failed to Add myself -- 1"
  230. goto fatalRegistry
  231. endif
  232. Set SoftProductKey = $($R1)
  233. Set SoftNetRuleKey = $($R2)
  234. Set SoftServiceKey = $($R3)
  235. set SoftParameterKey = $($R4)
  236. Set SoftLinkageKey = $($R5)
  237. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  238. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  239. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  240. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  241. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  242. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  243. {Review,$(NoTitle),$(!REG_VT_DWORD),1},+
  244. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  245. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  246. set RegistryErrorIndex = $($R0)
  247. Ifstr $(RegistryErrorIndex) != NO_ERROR
  248. CloseRegKey $(SoftProductKey)
  249. CloseRegKey $(SoftNetRuleKey)
  250. CloseRegKey $(SoftServiceKey)
  251. CloseRegKey $(SoftParameterKey)
  252. CloseRegKey $(SoftLinkageKey)
  253. goto fatalRegistry
  254. endif
  255. ; Setup the bindings net rules
  256. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)}, +
  257. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  258. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  259. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  260. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  261. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  262. set RegistryErrorIndex = $($R0)
  263. Ifstr $(RegistryErrorIndex) != NO_ERROR
  264. CloseRegKey $(SoftProductKey)
  265. CloseRegKey $(SoftNetRuleKey)
  266. CloseRegKey $(SoftServiceKey)
  267. CloseRegKey $(SoftParameterKey)
  268. CloseRegKey $(SoftLinkageKey)
  269. goto fatalRegistry
  270. endif
  271. CloseRegKey $(SoftProductKey)
  272. CloseRegKey $(SoftNetRuleKey)
  273. CloseRegKey $(SoftServiceKey)
  274. CloseRegKey $(SoftParameterKey)
  275. CloseRegKey $(SoftLinkageKey)
  276. ; Dummy driver now
  277. set OEM_ABANDON_ON = TRUE
  278. Debug-Output "ATMARPC: AddSoftwareing "$(TProductSoftwareName)" now"
  279. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  280. $(TProductSoftwareName), +
  281. $(TProductSoftwareName), +
  282. $(TProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
  283. $(TProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  284. $(NetEventDLL)
  285. set RegistryErrorIndex = $($R0)
  286. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  287. EndWait
  288. Debug-Output "ATMARPC: ** Failed to Add myself -- 2"
  289. goto fatalRegistry
  290. endif
  291. Set SoftProductKey = $($R1)
  292. Set SoftNetRuleKey = $($R2)
  293. Set SoftServiceKey = $($R3)
  294. set SoftParameterKey = $($R4)
  295. Set SoftLinkageKey = $($R5)
  296. Debug-Output "ATMARPC: Bind: SoftProductKey is "$(SoftProductKey)
  297. Debug-Output "ATMARPC: Bind: SoftNetRuleKey is "$(SoftNetRuleKey)
  298. Debug-Output "ATMARPC: Bind: SoftServiceKey is "$(SoftServiceKey)
  299. Debug-Output "ATMARPC: Bind: SoftParameterKey is "$(SoftParameterKey)
  300. Debug-Output "ATMARPC: Bind: SoftLinkageKey is "$(SoftLinkageKey)
  301. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(TSoftwareType)},+
  302. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(TProductMajorVersion)},+
  303. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(TProductMinorVersion)},+
  304. {Title,$(NoTitle),$(!REG_VT_SZ),$(TProductSoftwareTitle)},+
  305. {Description,$(NoTitle),$(!REG_VT_SZ),$(TProductSoftwareDescription)},+
  306. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(TProductSoftwareName)},+
  307. {Review,$(NoTitle),$(!REG_VT_DWORD),1},+
  308. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  309. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  310. set RegistryErrorIndex = $($R0)
  311. Ifstr $(RegistryErrorIndex) != NO_ERROR
  312. CloseRegKey $(SoftProductKey)
  313. CloseRegKey $(SoftNetRuleKey)
  314. CloseRegKey $(SoftServiceKey)
  315. CloseRegKey $(SoftParameterKey)
  316. CloseRegKey $(SoftLinkageKey)
  317. goto fatalRegistry
  318. endif
  319. ; Setup the bindings net rules
  320. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(TNetRuleSoftwareType)}, +
  321. {use,$(NoTitle),$(!REG_VT_SZ),$(TNetRuleSoftwareUse)}, +
  322. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TNetRuleSoftwareClass)}, +
  323. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TNetRuleSoftwareBindForm)}, +
  324. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TNetRuleSoftwareBindable)}, +
  325. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  326. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  327. set RegistryErrorIndex = $($R0)
  328. Ifstr $(RegistryErrorIndex) != NO_ERROR
  329. Debug-Output "ATMARPC: failed to add netrules for dummy driver"
  330. CloseRegKey $(SoftProductKey)
  331. CloseRegKey $(SoftNetRuleKey)
  332. CloseRegKey $(SoftServiceKey)
  333. CloseRegKey $(SoftParameterKey)
  334. CloseRegKey $(SoftLinkageKey)
  335. goto fatalRegistry
  336. endif
  337. CloseRegKey $(SoftProductKey)
  338. CloseRegKey $(SoftNetRuleKey)
  339. CloseRegKey $(SoftServiceKey)
  340. CloseRegKey $(SoftParameterKey)
  341. CloseRegKey $(SoftLinkageKey)
  342. endif
  343. goto successful
  344. bindingadapter =+
  345. ; Trying to avoid "cannot start service" for dummy driver by setting its
  346. ; Start type to "Manual" rather than "Automatic"
  347. ;
  348. Debug-Output "ATMARPC: Updating Start value to 3 for "$(TServiceKeyName)
  349. OpenRegKey $(!REG_H_LOCAL) "" $(TServiceKeyName) $(MAXIMUM_ALLOWED) TServiceKey
  350. ifstr(i) $(TServiceKey) != ""
  351. set ModuleStartValue = 3
  352. set NewValueList = {{Start,$(NoTitle),$(!REG_VT_DWORD),$(ModuleStartValue)}}
  353. Shell $(UtilityInf), AddValueList, $(TServiceKey), $(NewValueList)
  354. Debug-Output "Set start value to 3 under "$(TServiceKeyName)
  355. CloseRegKey $(TServiceKey)
  356. endif
  357. ifstr(i) $(!NTN_RegBase) == $(ProductRegBase)
  358. Debug-Output "ATMARPC: Binding Adapter, LinkageKeyName "$(LinkageKeyName)
  359. OpenRegKey $(!REG_H_LOCAL) "" $(LinkageKeyName) $(MAXIMUM_ALLOWED) LinkageKey
  360. ifstr(i) $(LinkageKey) != ""
  361. GetRegValue $(LinkageKey) "Bind" BindList
  362. Debug-Output "BindList: "$(BindList)
  363. Set Binding = *($(BindList),4)
  364. Debug-Output "Binding: "$(Binding)
  365. CloseRegKey $(LinkageKey)
  366. else
  367. Debug-Output "failed to open linkage for adapter"
  368. goto fatalregistry
  369. endif
  370. set CardList = {}
  371. set CreateCardList = {}
  372. ForListDo $(Binding)
  373. Split-String $($), "\", BindInfo
  374. QueryListSize BindListSize $(BindInfo)
  375. set CardName = *($(BindInfo),$(BindListSize))
  376. Debug-Output "Cardname: "$(CardName)
  377. ifstr(i) $(CardList) == {}
  378. set CardList = {$(CardName)}
  379. else
  380. set CardList = >($(CardList),$(CardName))
  381. endif
  382. EndForListDo
  383. Set AddedNewVirtualAdapter = "No"
  384. Debug-Output "Cardlist: "$(CardList)
  385. ForListDo $(CardList)
  386. ;
  387. ; For each real adapter we are bound to, we create a Logical IP Subnet (LIS).
  388. ; As of now, we create exactly ONE LIS, LIS0. For each LIS created, we
  389. ; AddHardwareComponent a dummy adapter, which is bindable to TCP/IP etc.
  390. ;
  391. Debug-Output "Will create LIS0 for "$($)
  392. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\AtmArpC"
  393. Debug-Output "about to open "$(RegKey)
  394. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ArpParamsKey
  395. ifstr(i) $(ArpParamsKey) == ""
  396. Debug-Output "creating ArpParamsKey key under the adapter"
  397. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ArpParamsKey
  398. else
  399. Debug-Output "ATMARPC: Have processed "$($)" already"
  400. CloseRegKey $(ArpParamsKey)
  401. goto continueCardList
  402. endif
  403. ifstr(i) $(ArpParamsKey) == ""
  404. Debug-Output "Failed to open/create the ArpParamsKey key under the adapter"
  405. goto fatalRegistry
  406. endif
  407. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0"
  408. Debug-Output "about to open "$(RegKey)
  409. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) LISKey
  410. ifstr(i) $(LISKey) == ""
  411. Debug-Output "creating LIS0 key under the adapter"
  412. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" LISKey
  413. endif
  414. set DefaultSapSelector = 1
  415. set DefaultPVCOnly = 0
  416. ;
  417. ; All timeouts and intervals are in terms of seconds.
  418. ;
  419. set DefaultServerConnectInterval = 5
  420. set DefaultServerRegistrationTimeout = 3
  421. set DefaultAddressResolutionTimeout = 3
  422. set DefaultARPEntryAgingTimeout = 900
  423. set DefaultInARPWaitTimeout = 5
  424. set DefaultServerRefreshTimeout = 900
  425. set DefaultMinWaitAfterNak = 10
  426. set DefaultMaxRegistrationAttempts = 5
  427. set DefaultMaxResolutionAttempts = 4
  428. ;
  429. ; Bandwidth is in bytes/sec
  430. ;
  431. set DefaultSendBandwidth = 50000
  432. set DefaultRecvBandwidth = 50000
  433. set DefaultSendMaxSize = 65535
  434. set DefaultRecvMaxSize = 65535
  435. ; Default MTU size, in bytes. This is what is reported to the IP layer.
  436. ; If this value isn't present, the ATMARP Client will use the value of
  437. ; Max AAL5 packet size supported by the miniport as the MTU.
  438. set DefaultMTUSize = 9180
  439. ;
  440. ; FlowInfoEnabled is set to 1 if we want the ATMARP Client to look below the
  441. ; FlowInfo subkey for information about configured flows. If FlowInfoEnabled
  442. ; is set to 0, the client will ignore all configured flow info.
  443. ;
  444. set DefaultFlowInfoEnabled = 0
  445. set NewValueList = {{SapSelector,$(NoTitle),$(!REG_VT_DWORD),$(DefaultSapSelector)},+
  446. {ServerConnectInterval,$(NoTitle),$(!REG_VT_DWORD),$(DefaultServerConnectInterval)},+
  447. {ServerRegistrationTimeout,$(NoTitle),$(!REG_VT_DWORD),$(DefaultServerRegistrationTimeout)},+
  448. {AddressResolutionTimeout,$(NoTitle),$(!REG_VT_DWORD),$(DefaultAddressResolutionTimeout)},+
  449. {ARPEntryAgingTimeout,$(NoTitle),$(!REG_VT_DWORD),$(DefaultARPEntryAgingTimeout)},+
  450. {InARPWaitTimeout,$(NoTitle),$(!REG_VT_DWORD),$(DefaultInARPWaitTimeout)},+
  451. {ServerRefreshTimeout,$(NoTitle),$(!REG_VT_DWORD),$(DefaultServerRefreshTimeout)},+
  452. {MinWaitAfterNak,$(NoTitle),$(!REG_VT_DWORD),$(DefaultMinWaitAfterNak)},+
  453. {MaxRegistrationAttempts,$(NoTitle),$(!REG_VT_DWORD),$(DefaultMaxRegistrationAttempts)},+
  454. {MaxResolutionAttempts,$(NoTitle),$(!REG_VT_DWORD),$(DefaultMaxResolutionAttempts)},+
  455. {MTU,$(NoTitle),$(!REG_VT_DWORD),$(DefaultMTUSize)},+
  456. {FlowInfoEnabled,$(NoTitle),$(!REG_VT_DWORD),$(DefaultFlowInfoEnabled)}}
  457. Shell $(UtilityInf), AddValueList, $(LISKey), $(NewValueList)
  458. ;
  459. ; Now create the FlowInfo key. NOTE: To enable all the following, set
  460. ; FlowInfoEnabled, above, to 1.
  461. ;
  462. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\FlowInfo"
  463. Debug-Output "about to open "$(RegKey)
  464. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) FlowInfoKey
  465. ifstr(i) $(FlowInfoKey) == ""
  466. Debug-Output "creating LIS0\FlowInfo key under the adapter"
  467. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" FlowInfoKey
  468. endif
  469. ifstr(i) $(FlowInfoKey) == ""
  470. Debug-Output "Failed to create FlowInfo subkey"
  471. goto fatalRegistry
  472. endif
  473. ;
  474. ; Create High Bandwidth FlowInfo subkey
  475. ;
  476. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\FlowInfo\HighBw"
  477. Debug-Output "about to open "$(RegKey)
  478. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) HighBwKey
  479. ifstr(i) $(HighBwKey) == ""
  480. Debug-Output "creating LIS0\FlowInfo\HighBw key under the adapter"
  481. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" HighBwKey
  482. endif
  483. ifstr(i) $(HighBwKey) == ""
  484. Debug-Output "Failed to create HighBw subkey"
  485. goto fatalRegistry
  486. endif
  487. ;
  488. ; Fill in flow info values for High Bandwidth flows
  489. ;
  490. Set DefaultHighBwPacketSizeLimit = 65536
  491. Set DefaultHighBwSendBandwidth = 249984
  492. Set DefaultHighBwRecvBandwidth = 249984
  493. Set DefaultHighBwGuarantee = 3
  494. Set DefaultHighBwVcAgingTime = 10
  495. set NewValueList = {{PacketSizeLimit,$(NoTitle),$(!REG_VT_DWORD),$(DefaultHighBwPacketSizeLimit)},+
  496. {SendBandwidth,$(NoTitle),$(!REG_VT_DWORD),$(DefaultHighBwSendBandwidth)},+
  497. {ReceiveBandwidth,$(NoTitle),$(!REG_VT_DWORD),$(DefaultHighBwRecvBandwidth)},+
  498. {Guarantee,$(NoTitle),$(!REG_VT_DWORD),$(DefaultHighBwGuarantee)},+
  499. {AgingTime,$(NoTitle),$(!REG_VT_DWORD),$(DefaultHighBwVcAgingTime)}}
  500. Shell $(UtilityInf), AddValueList, $(HighBwKey), $(NewValueList)
  501. CloseRegKey $(HighBwKey)
  502. ;
  503. ; Create Low Bandwidth FlowInfo subkey
  504. ;
  505. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\FlowInfo\LowBw"
  506. Debug-Output "about to open "$(RegKey)
  507. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) LowBwKey
  508. ifstr(i) $(LowBwKey) == ""
  509. Debug-Output "creating LIS0\FlowInfo\LowBw key under the adapter"
  510. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" LowBwKey
  511. endif
  512. ifstr(i) $(LowBwKey) == ""
  513. Debug-Output "Failed to create LowBw subkey"
  514. goto fatalRegistry
  515. endif
  516. ;
  517. ; Fill in flow info values for Low Bandwidth flows
  518. ;
  519. Set DefaultLowBwPacketSizeLimit = 256
  520. Set DefaultLowBwSendBandwidth = 6240
  521. Set DefaultLowBwRecvBandwidth = 6240
  522. Set DefaultLowBwGuarantee = 0
  523. Set DefaultLowBwVcAgingTime = 30
  524. set NewValueList = {{PacketSizeLimit,$(NoTitle),$(!REG_VT_DWORD),$(DefaultLowBwPacketSizeLimit)},+
  525. {SendBandwidth,$(NoTitle),$(!REG_VT_DWORD),$(DefaultLowBwSendBandwidth)},+
  526. {ReceiveBandwidth,$(NoTitle),$(!REG_VT_DWORD),$(DefaultLowBwRecvBandwidth)},+
  527. {Guarantee,$(NoTitle),$(!REG_VT_DWORD),$(DefaultLowBwGuarantee)},+
  528. {AgingTime,$(NoTitle),$(!REG_VT_DWORD),$(DefaultLowBwVcAgingTime)}}
  529. Shell $(UtilityInf), AddValueList, $(LowBwKey), $(NewValueList)
  530. CloseRegKey $(LowBwKey)
  531. ;
  532. ; Now create the ARP Server List subkey
  533. ;
  534. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\ARPServerList"
  535. Debug-Output "about to open "$(RegKey)
  536. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ServerListKey
  537. ifstr(i) $(ServerListKey) == ""
  538. Debug-Output "creating LIS0\ARPServerList key under the adapter"
  539. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ServerListKey
  540. endif
  541. ifstr(i) $(ServerListKey) == ""
  542. Debug-Output "Failed to create ARP Server list key"
  543. goto fatalRegistry
  544. endif
  545. set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\ARPServerList\Server1"
  546. Debug-Output "atmarpc: will open/create "$(RegKey)
  547. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) Server1Key
  548. ifstr(i) $(Server1Key) == ""
  549. Debug-Output "creating LIS0\ARPServerList\Server1 key under the adapter"
  550. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" Server1Key
  551. endif
  552. ifstr(i) $(Server1Key) == ""
  553. Debug-Output "Failed to create ARP Server 1 key"
  554. goto fatalRegistry
  555. endif
  556. set ServerAddress1 = "4700918100000000613e5bfe010000d10f9f5e00"
  557. set NewValueList = {{AtmAddress,$(NoTitle),$(!REG_VT_SZ),$(ServerAddress1)}}
  558. Shell $(UtilityInf), AddValueList, $(Server1Key), $(NewValueList)
  559. CloseRegKey $(Server1Key)
  560. ; set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\ARPServerList\Server2"
  561. ; Debug-Output "atmarpc: will open/create "$(RegKey)
  562. ; OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) Server2Key
  563. ; ifstr(i) $(Server2Key) == ""
  564. ; Debug-Output "creating LIS0\ARPServerList\Server2 key under the adapter"
  565. ; CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" Server2Key
  566. ; endif
  567. ; ifstr(i) $(Server2Key) == ""
  568. ; Debug-Output "Failed to create ARP Server 2 key"
  569. ; goto fatalRegistry
  570. ; endif
  571. ; set ServerAddress2 = "4700000000003c0000a000000000000000000800"
  572. ; set NewValueList = {{AtmAddress,$(NoTitle),$(!REG_VT_SZ),$(ServerAddress1)}}
  573. ; Shell $(UtilityInf), AddValueList, $(Server2Key), $(NewValueList)
  574. ; CloseRegKey $(Server2Key)
  575. CloseRegKey $(ServerListKey)
  576. ;
  577. ; Now create the MARS Server List subkey
  578. ;
  579. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\MARSList"
  580. Debug-Output "about to open "$(RegKey)
  581. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ServerListKey
  582. ifstr(i) $(ServerListKey) == ""
  583. Debug-Output "creating LIS0\MARSList key under the adapter"
  584. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ServerListKey
  585. endif
  586. ifstr(i) $(ServerListKey) == ""
  587. Debug-Output "Failed to create MARS Server list key"
  588. goto fatalRegistry
  589. endif
  590. set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc\LIS0\MARSList\Server1"
  591. Debug-Output "atmarpc: will open/create "$(RegKey)
  592. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) Server1Key
  593. ifstr(i) $(Server1Key) == ""
  594. Debug-Output "creating LIS0\MARSList\Server1 key under the adapter"
  595. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" Server1Key
  596. endif
  597. ifstr(i) $(Server1Key) == ""
  598. Debug-Output "Failed to create MARS Server 1 key"
  599. goto fatalRegistry
  600. endif
  601. set ServerAddress1 = "4700918100000000613e5bfe010000d10f9f5e00"
  602. set NewValueList = {{AtmAddress,$(NoTitle),$(!REG_VT_SZ),$(ServerAddress1)}}
  603. Shell $(UtilityInf), AddValueList, $(Server1Key), $(NewValueList)
  604. CloseRegKey $(Server1Key)
  605. CloseRegKey $(ServerListKey)
  606. ;
  607. ; Create the virtual adapter now.
  608. ;
  609. Debug-Output "ATMARPC: AddHardwareing ipatmarp now"
  610. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(TProductKeyName)
  611. set RegistryErrorIndex = $($R0)
  612. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  613. EndWait
  614. Debug-Output "ATMARPC: ** Failed to AddHardware myself"
  615. goto fatalRegistry
  616. endif
  617. set HardNetCardKey = $($R1)
  618. set HardNetRuleKey = $($R2)
  619. set HardParameterKey = $($R3)
  620. set AdapterNumber = $($R4)
  621. set LogicalAdapterName = $($R5)
  622. Debug-Output "ATMARPC: After AddHw, ServiceName "$($R5)
  623. Debug-Output "ATMARPC: HardParameterKey "$(HardParameterKey)
  624. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  625. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  626. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  627. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  628. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  629. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  630. Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  631. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  632. Debug-Output "ATMARPC: AddValueList failed for HardNetCardKey"
  633. goto ShellCodeError
  634. endif
  635. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  636. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  637. Debug-Output "ATMARPC: ProductHardwareName "$(ProductHardwareName)
  638. Debug-Output "ATMARPC: AdapterNumber "$(AdapterNumber)
  639. Debug-Output "ATMARPC: TempProdName "$(TempProdName)
  640. Debug-Output "ATMARPC: TempBindForm "$(TempBindForm)
  641. Debug-Output "ATMARPC: NetRuleHardwareType "$(NetRuleHardwareType)
  642. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  643. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  644. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  645. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  646. Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  647. CloseRegKey $(HardNetCardKey)
  648. CloseRegKey $(HardNetRuleKey)
  649. CloseRegKey $(HardParameterKey)
  650. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  651. goto ShellCodeError
  652. endif
  653. Set AddedNewVirtualAdapter = "Yes"
  654. ;
  655. ; Use the Logical Adapter name we got above to create the IP Config
  656. ; string to be used in the IPAddInterface() call. We store this within
  657. ; the LIS configuration.
  658. ;
  659. ifstr(i) $(LISKey) != ""
  660. set IPConfigString = $(LogicalAdapterName)"\Parameters\Tcpip"
  661. set NewValueList = {{IPConfig,$(NoTitle),$(!REG_VT_SZ),$(IPConfigString)}}
  662. Shell $(UtilityInf), AddValueList, $(LISKey), $(NewValueList)
  663. ;
  664. ; Save Adapter Number in LIS0 for use in RemoveAdapter
  665. ;
  666. set NewValueList = {{AdapterNumber,$(NoTitle),$(!REG_VT_SZ),$(AdapterNumber)}}
  667. Shell $(UtilityInf), AddValueList, $(LISKey), $(NewValueList)
  668. CloseRegKey $(LISKey)
  669. endif
  670. ifstr(i) $(ArpParamsKey) != ""
  671. CloseRegKey $(ArpParamsKey)
  672. endif
  673. ; TCP/IP parameters: first open/create TCP/IP's subkey
  674. Set TcpKeyName = $(!NTN_ServiceBase)"\"$(LogicalAdapterName)"\Parameters\Tcpip"
  675. Debug-Output "about to open "$(TcpKeyName)
  676. OpenRegKey $(!REG_H_LOCAL) "" $(TcpKeyName) $(MAXIMUM_ALLOWED) TcpKey
  677. ifstr(i) $(TcpKey) == ""
  678. CreateRegKey $(!REG_H_LOCAL) {$(TcpKeyName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" TcpKey
  679. endif
  680. ifstr(i) $(TcpKey) == ""
  681. Debug-Output "Failed to open/create the TCP key under the virtual adapter"
  682. goto fatalRegistry
  683. endif
  684. set NewValueList = {{LLInterface,$(NoTitle),$(!REG_VT_SZ),$(TcpipLLInterface)},+
  685. {UseZeroBroadcast,$(NoTitle),$(!REG_VT_DWORD),$(UseZeroBroadcast)}}
  686. Shell $(UtilityInf), AddValueList, $(TcpKey), $(NewValueList)
  687. continueCardList = +
  688. EndForListDo
  689. ;
  690. ; If we added atleast one virtual adapter, tell NCPA to review bindings
  691. ; after this completes.
  692. ;
  693. ifstr(i) $(AddedNewVirtualAdapter) == "Yes"
  694. Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\NCPA\CurrentVersion"
  695. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) NcpaKey
  696. ifstr(i) $(NcpaKey) != ""
  697. SetRegValue $(NcpaKey) {"BindRestart",$(NoTitle),$(!REG_VT_DWORD),1}
  698. Debug-Output "ATMARPC: set BindRestart to 1 in "$(RegKey)
  699. CloseRegKey $(NcpaKey)
  700. else
  701. Debug-Output "ATMARPC: failed to open "$(RegKey)
  702. endif
  703. endif
  704. Set RegKey = $(!NTN_ServiceBase)"\atmarpc"
  705. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ArpCKey
  706. ifstr(i) $(ArpCKey) != ""
  707. SetRegValue $(ArpCKey) {"DependOnService",$(NoTitle),$(!REG_VT_MULTI_SZ),{"Tcpip","ATMCallManager"}}
  708. CloseRegKey $(ArpCKey)
  709. else
  710. Debug-Output "failed to open ArpCKey key "$(RegKey)
  711. goto fatalRegistry
  712. endif
  713. endif
  714. ifstr(i) $(!NTN_RegBase) == $(TProductRegBase)
  715. Debug-Output "ATMARPC/Virtual: Binding Adapter, LinkageKeyName "$(TLinkageKeyName)
  716. OpenRegKey $(!REG_H_LOCAL) "" $(TLinkageKeyName) $(MAXIMUM_ALLOWED) LinkageKey
  717. ifstr(i) $(LinkageKey) != ""
  718. GetRegValue $(LinkageKey) "Bind" BindList
  719. Debug-Output "BindList: "$(BindList)
  720. Set Binding = *($(BindList),4)
  721. Debug-Output "Binding: "$(Binding)
  722. CloseRegKey $(LinkageKey)
  723. else
  724. Debug-Output "failed to open linkage for adapter"
  725. goto fatalregistry
  726. endif
  727. set CardList = {}
  728. set CreateCardList = {}
  729. ForListDo $(Binding)
  730. Split-String $($), "\", BindInfo
  731. QueryListSize BindListSize $(BindInfo)
  732. set CardName = *($(BindInfo),$(BindListSize))
  733. Debug-Output "Cardname: "$(CardName)
  734. ifstr(i) $(CardList) == {}
  735. set CardList = {$(CardName)}
  736. else
  737. set CardList = >($(CardList),$(CardName))
  738. endif
  739. EndForListDo
  740. Debug-Output "Cardlist: "$(CardList)
  741. ForListDo $(CardList)
  742. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\atmarpc"
  743. Debug-Output "about to open "$(RegKey)
  744. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) AdapterParamKey
  745. ifstr(i) $(AdapterParamKey) == ""
  746. Debug-Output "creating atmarpc key under the adapter"
  747. CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" AdapterParamKey
  748. endif
  749. ifstr(i) $(AdapterParamKey) != ""
  750. CloseRegKey $(AdapterParamKey)
  751. else
  752. Debug-Output "Failed to open/create the atmarpc key under the adapter"
  753. goto fatalRegistry
  754. endif
  755. EndForListDo
  756. Set RegKey = $(!NTN_ServiceBase)"\ipatmarp"
  757. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) IpAtmArpKey
  758. ifstr(i) $(IpAtmArpKey) != ""
  759. SetRegValue $(IpAtmArpKey) {"DependOnService",$(NoTitle),$(!REG_VT_MULTI_SZ),{"Tcpip","ATMCallManager"}}
  760. CloseRegKey $(IpAtmArpKey)
  761. else
  762. Debug-Output "failed to open IPATMARP key "$(RegKey)
  763. goto fatalRegistry
  764. endif
  765. endif
  766. goto successful
  767. removeadapter = +
  768. Debug-Output "ATMARPC: removeadapter: NTN_REGBASE is "$(!NTN_RegBase)
  769. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  770. Debug-Output "ATMARPC: removing software "$(ProductSoftwareName)
  771. ; Go thru all our bindings and remove the ATMARPC subkey there so
  772. ; that we will redo parameter keys if we are installed again.
  773. ;
  774. OpenRegKey $(!REG_H_LOCAL) "" $(LinkageKeyName) $(MAXIMUM_ALLOWED) LinkageKey
  775. ifstr(i) $(LinkageKey) != ""
  776. GetRegValue $(LinkageKey) "Bind" BindList
  777. Debug-Output "Remove: BindList: "$(BindList)
  778. Set Binding = *($(BindList),4)
  779. Debug-Output "Remove: Binding: "$(Binding)
  780. CloseRegKey $(LinkageKey)
  781. else
  782. Debug-Output "failed to open linkage for adapter"
  783. goto skipRemoveBindings
  784. endif
  785. set CardList = {}
  786. set CreateCardList = {}
  787. ForListDo $(Binding)
  788. Split-String $($), "\", BindInfo
  789. QueryListSize BindListSize $(BindInfo)
  790. set CardName = *($(BindInfo),$(BindListSize))
  791. Debug-Output "Remove: Cardname: "$(CardName)
  792. ifstr(i) $(CardList) == {}
  793. set CardList = {$(CardName)}
  794. else
  795. set CardList = >($(CardList),$(CardName))
  796. endif
  797. EndForListDo
  798. Debug-Output "Cardlist: "$(CardList)
  799. ForListDo $(CardList)
  800. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters"
  801. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ParamsKey
  802. ifstr(i) $(ParamsKey) != ""
  803. ;
  804. ;
  805. ; Go into the LIS0 subkey, get the Virtual Adapter number, and delete the
  806. ; virtual adapter for LIS0. NOTE: this has to be repeated for each LISi.
  807. ;
  808. Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\AtmArpC\LIS0"
  809. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) LISKey
  810. ifstr(i) $(LISKey) != ""
  811. GetRegValue $(LISKey) "AdapterNumber" AdapterNoValue
  812. CloseRegKey $(LISKey)
  813. endif
  814. Set AdapterNo = *($(AdapterNoValue),4)
  815. Set AdapterRegBase = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$(AdapterNo)
  816. Debug-Output "ATMARPC: removing adapter "$(AdapterNo)
  817. Debug-Output "ATMARPC: remove: AdapterRegBase "$(AdapterRegBase)
  818. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  819. $(ProductHardwareName), $(AdapterRegBase)
  820. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  821. Debug-Output "ShellCode error"
  822. goto ShellCodeError
  823. endif
  824. Debug-Output "Remove: deleting AtmArpC under "$(RegKey)
  825. DeleteRegTree $(ParamsKey) "AtmArpC"
  826. CloseRegKey $(ParamsKey)
  827. endif
  828. EndForListDo
  829. skipRemoveBindings =+
  830. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  831. $(ProductSoftwareName)
  832. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  833. Debug-Output "ShellCode error"
  834. goto ShellCodeError
  835. endif
  836. else
  837. Ifstr(i) $(TProductKeyName) == $(!NTN_RegBase)
  838. Debug-Output "ATMARPC: removing software "$(TProductSoftwareName)
  839. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  840. $(TProductSoftwareName)
  841. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  842. Debug-Output "ShellCode error"
  843. goto ShellCodeError
  844. endif
  845. else
  846. Debug-Output "ATMARPC: removing hardware "$(ProductHardwareName)
  847. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  848. $(ProductHardwareName), $(!NTN_RegBase)
  849. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  850. Debug-Output "ShellCode error"
  851. goto ShellCodeError
  852. endif
  853. endif
  854. endif
  855. set RegistryErrorIndex = $($R0)
  856. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  857. goto fatalregistry
  858. endif
  859. goto end
  860. UpgradeSoftware = +
  861. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  862. Ifstr $(KeyProduct) != $(KeyNull)
  863. install "Install-Update"
  864. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  865. goto fatal
  866. endif
  867. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  868. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  869. SetRegValue $(KeyProduct) {"Description",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  870. SetRegValue $(KeyProduct) {"Title",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)}
  871. CloseRegKey $(KeyProduct)
  872. OpenRegKey $(!REG_H_LOCAL) "" $(ServiceKeyName) $(MAXIMUM_ALLOWED) ServiceKey
  873. ifstr(i) $(ServiceKey) != ""
  874. SetRegValue $(ServiceKey) {"DisplayName",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDisplayName)}
  875. CloseRegKey $(ServiceKey)
  876. endif
  877. else
  878. goto fatalregistry
  879. endif
  880. goto end
  881. successful = +
  882. goto end
  883. warning = +
  884. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  885. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  886. goto ShellCodeError
  887. endif
  888. ifstr(i) $($R1) == "OK"
  889. goto $(to)
  890. else-ifstr(i) $($R1) == "CANCEL"
  891. goto $(from)
  892. else
  893. goto "end"
  894. endif
  895. nonfatalinfo = +
  896. Set CommonStatus = STATUS_USERCANCEL
  897. Set Severity = STATUS
  898. goto nonfatalmsg
  899. nonfatal = +
  900. Set Severity = NONFATAL
  901. goto nonfatalmsg
  902. nonfatalmsg = +
  903. ifstr(i) $(Error) == ""
  904. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  905. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  906. goto ShellCodeError
  907. endif
  908. set Error = $($R0)
  909. endif
  910. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  911. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  912. goto ShellCodeError
  913. endif
  914. ifstr(i) $($R1) == "OK"
  915. goto $(from)
  916. else
  917. goto "end"
  918. endif
  919. fatalregistry = +
  920. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  921. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  922. goto ShellCodeError
  923. endif
  924. set Error = $($R0)
  925. goto fatal
  926. fatal = +
  927. ifstr(i) $(Error) == ""
  928. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  929. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  930. goto ShellCodeError
  931. endif
  932. set Error = $($R0)
  933. endif
  934. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  935. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  936. goto ShellCodeError
  937. endif
  938. goto setfailed
  939. ShellCodeError = +
  940. set DlgType = "MessageBox"
  941. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  942. set STF_MB_TEXT = $(ShellCodeErrorText)
  943. set STF_MB_TYPE = 1
  944. set STF_MB_ICON = 3
  945. set STF_MB_DEF = 1
  946. ui start "Error Message"
  947. goto setfailed
  948. setfailed = +
  949. set CommonStatus = STATUS_FAILED
  950. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  951. set OEM_ABANDON_ON = FALSE
  952. goto removeadapter
  953. endif
  954. goto end
  955. end = +
  956. goto term
  957. term = +
  958. Return $(CommonStatus)
  959. [StripTrailSlash]
  960. Split-String $($0) "\" InList
  961. QueryListSize InListSize, $(InList)
  962. Ifint $(InListSize) <= 1
  963. Return $($0)
  964. Endif
  965. Set NewString = ""
  966. ForListDo $(InList)
  967. ifint $(#) < $(InListSize)
  968. Set NewString = $(NewString)$($)
  969. else-ifstr $($) != "\"
  970. Set NewString = $(NewString)$($)
  971. endif
  972. EndForListDo
  973. Return $(NewString)
  974. [Install-Option]
  975. set STF_VITAL = ""
  976. ifstr(i) $(AddCopy) == "YES"
  977. AddSectionFilesToCopyList Files-Platform-Drivers $(PlatformDir) $(!STF_WINDOWSSYSPATH)\drivers
  978. AddSectionFilesToCopyList Files-Platform-Utils $(PlatformDir) $(!STF_WINDOWSSYSPATH)
  979. endif
  980. ifstr(i) $(DoCopy) == "YES"
  981. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  982. CopyFilesInCopyList
  983. endif
  984. ifstr(i) $(DoConfig) == "YES"
  985. endif
  986. Exit
  987. [Install-Update]
  988. set STF_VITAL = ""
  989. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  990. AddSectionFilesToCopyList Files-Platform-Drivers $(PlatformDir) $(!STF_WINDOWSSYSPATH)\drivers
  991. AddSectionFilesToCopyList Files-Platform-Utils $(PlatformDir) $(!STF_WINDOWSSYSPATH)
  992. AddSectionFilesToCopyList Files-Inf $(InfDir) $(!STF_WINDOWSSYSPATH)
  993. exit
  994. [Source Media Descriptions]
  995. 1 = "Microsoft ATMARP Client Installation Disk"
  996. [ProductType]
  997. STF_PRODUCT = Winnt
  998. [Files-Inf]
  999. 1, OEMSETUP.INF, SIZE=999, RENAME=$(!UG_Filename)
  1000. [Files-Platform-Drivers]
  1001. 1, ATMARPC.SYS , SIZE=999
  1002. [Files-Platform-Utils]
  1003. [FileConstantsENG]
  1004. ProCaption = "Windows NT Setup"
  1005. ProCancel = "Cancel"
  1006. ProCancelMsg = "Windows NT Networking is not correctly installed. "+
  1007. "Are you sure you want to cancel copying files?"
  1008. ProCancelCap = "Network Setup Message"
  1009. ProText1 = "Copying:"
  1010. ProText2 = "To:"
  1011. FunctionTitle = "IP Over ATM Client"
  1012. ProductSoftwareDescription = "IP Over ATM (RFC 1577) Client Software"
  1013. ProductSoftwareDisplayName = "IP Over ATM Client (ATM ARP Module)"
  1014. ProductSoftwareTitle = "IP over ATM Client"
  1015. TProductSoftwareDescription = "Virtual ATMARP Interface"
  1016. TProductSoftwareDisplayName = "Virtual ATMARP Adapter"
  1017. TProductSoftwareTitle = "Virtual ATMARP Interface"
  1018. ShellCodeErrorTitle = "Error: "$(FunctionTitle)
  1019. ShellCodeErrorText = "Shell Code Error."
  1020. [DialogConstantsENG]
  1021. Help = "&Help"
  1022. Exit = "Cancel"
  1023. OK = "OK"
  1024. HelpContext = ""
  1025. Continue = "Continue"
  1026. Cancel = "Cancel"