home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 February / VPR9602A.ISO / drvlib / netcard / x86 / madge.mca / oemsetup.inf < prev    next >
INI File  |  1995-10-27  |  76KB  |  3,002 lines

  1. ; **********************************************************************
  2. ;
  3. ; OEMSETUP.INF 
  4. ;
  5. ; Copyright (c) Madge Networks Ltd. 1994
  6. ;
  7. ; MADGE Smart Ringnode Driver installer for MdgMPort.SYS
  8. ;
  9. ; VeRsIoN=OEMSETUP.INF 3.00.55 (for use with MdgMPort.SYS 2.00.61)
  10. ; **********************************************************************
  11.  
  12. ; ----------------------------------------------------------------------
  13. ; Mandatory configuration information.
  14. ; ----------------------------------------------------------------------
  15.  
  16. [Identification]
  17.     OptionType = NetAdapter
  18.  
  19. [PlatformsSupported]
  20.     MCA
  21.  
  22. [LanguagesSupported]
  23.     ENG
  24.  
  25. [Options]
  26.     MDGMPMCA
  27.     MDGMPMC32
  28.  
  29. ;-----------------------------------------------------------------------
  30. ; Text strings to identify adapter options.
  31. ;-----------------------------------------------------------------------
  32.  
  33. [OptionsTextENG]
  34.     MDGMPMCA   = "Madge Smart 16/4 MC Ringnode"
  35.     MDGMPMC32  = "Madge Smart 16/4 MC32 Ringnode"
  36.  
  37. ;-----------------------------------------------------------------------
  38. ; Text strings to identify Madge adapters in a machine.
  39. ;-----------------------------------------------------------------------
  40.  
  41. [OptionsChoiceENG]
  42.     MDGMPISA   = "Smart 16/4 AT Ringnode / IO location "
  43.     MDGMPATP   = "Smart 16/4 AT Plus Ringnode / IO location "
  44.     MDGMPISAC  = "Smart 16/4 ISA Client Ringnode / IO location "
  45.     MDGMPISACP = "Smart 16/4 ISA Client Plus Ringnode / IO location "
  46.     MDGMPPC    = "Smart 16/4 PC Ringnode / IO location "
  47.     MDGMPEISA  = "Smart 16/4 EISA Ringnode / slot number "
  48.     MDGMPMCA   = "Smart 16/4 MC Ringnode / slot number "
  49.     MDGMPMC32  = "Smart 16/4 MC32 Ringnode / slot number "
  50.     MDGMPSM16  = "Smart 16 Ringnode / IO location "
  51.     MDGMPPNP   = "Smart 16/4 ISA Client PnP Ringnode / IO location "
  52.     MDGMPPCI   = "Smart 16/4 PCI Ringnode / PCI device ID "
  53.     MDGMPPCMCIA = "Smart 16/4 PCMCIA Ringnode / IO location "
  54.  
  55. ;-----------------------------------------------------------------------
  56. ; Adapter options that require a slot number and a transfer method.
  57. ; Others require an IO location a transfer method and an IRQ number.
  58. ;-----------------------------------------------------------------------
  59.  
  60. [SlotNumberOnlyOptions]
  61.     MDGMPEISA
  62.     MDGMPMCA
  63.     MDGMPMC32
  64.     MDGMPPCI
  65.  
  66. ;-----------------------------------------------------------------------
  67. ; Adapter options that support MMIO.
  68. ;-----------------------------------------------------------------------
  69.  
  70. [MmioOptions]
  71.     MDGMPPCI
  72.  
  73. ; ----------------------------------------------------------------------
  74. ; Miscellaneous declarations for initialsing lists.
  75. ; ----------------------------------------------------------------------
  76.  
  77. [IoLocationChoices]
  78.     "0x0a20",2592
  79.     "0x1a20",6688
  80.     "0x2a20",10784
  81.     "0x3a20",14880
  82.     "0x4a20",18976
  83.     "0x4e20",20000
  84.     "0x5a20",23072
  85.     "0x5e20",24096
  86.     "0x6a20",27168
  87.     "0x6e20",28192
  88.     "0x7a20",31264
  89.     "0x7e20",32288
  90.     "0x0140",320
  91.     "0x0920",2336
  92.     "0x0940",2368
  93.     "0x0960",2400
  94.     "0x0980",2432
  95.     "0x0a40",2624
  96.     "0x0a60",2656
  97.     "0x0a80",2688
  98.     "0x0aa0",2720
  99.     "0x0b20",2848
  100.     "0x0b40",2880
  101.     "0x0b60",2912
  102.     "0x0b80",2944
  103.     "UNKNOWN",65535
  104.  
  105. [DmaChannelChoices]
  106.     "PIO",0
  107.     "DMA Channel 01",1
  108.     "DMA Channel 02",2
  109.     "DMA Channel 03",3
  110.     "DMA Channel 04",4
  111.     "DMA Channel 05",5
  112.     "DMA Channel 06",6
  113.     "DMA Channel 07",7
  114.     "DMA Channel 08",8
  115.     "DMA Channel 09",9
  116.     "DMA Channel 10",10
  117.     "DMA Channel 11",11
  118.     "DMA Channel 12",12
  119.     "DMA Channel 13",13
  120.     "DMA Channel 14",14
  121.     "DMA Channel 15",15
  122.     "DMA",500
  123.     "MMIO",501
  124.     "UNKNOWN",65535
  125.  
  126. [IrqNumberChoices]
  127.     "01",1
  128.     "02",2
  129.     "03",3
  130.     "04",4
  131.     "05",5
  132.     "06",6
  133.     "07",7
  134.     "08",8
  135.     "09",9
  136.     "10",10
  137.     "11",11
  138.     "12",12
  139.     "13",13
  140.     "14",14
  141.     "15",15
  142.     "UNKNOWN",65535
  143.  
  144. [SlotNumberChoices]
  145.     "00",0
  146.     "01",1
  147.     "02",2
  148.     "03",3
  149.     "04",4
  150.     "05",5
  151.     "06",6
  152.     "07",7
  153.     "08",8
  154.     "09",9
  155.     "10",10
  156.     "11",11
  157.     "12",12
  158.     "13",13
  159.     "14",14
  160.     "15",15
  161.     "16",16
  162.     "17",17
  163.     "18",18
  164.     "19",19
  165.     "20",20
  166.     "21",21
  167.     "22",22
  168.     "23",23
  169.     "24",24
  170.     "25",25
  171.     "26",26
  172.     "27",27
  173.     "28",28
  174.     "29",29
  175.     "30",30
  176.     "31",31
  177.     "UNKNOWN",65535
  178.  
  179. [RxTxSlotsChoices]
  180.     "Rx=02 Tx=02",0
  181.     "Rx=03 Tx=03",1
  182.     "Rx=04 Tx=04",2
  183.     "Rx=06 Tx=06",3
  184.     "Rx=08 Tx=08",4
  185.     "Rx=10 Tx=10",5
  186.  
  187. [StatsChoices]
  188.     "Disabled",0
  189.     "Enabled",1
  190.  
  191. [MpChoices]
  192.     "One",0
  193.     "Multiple",1
  194.     "UNKNOWN",65535
  195.     
  196. ; ----------------------------------------------------------------------
  197. ; Constants specific to the driver.
  198. ; ----------------------------------------------------------------------
  199.  
  200. [FileConstants]
  201.  
  202. ;
  203. ;  File names, etc.
  204. ;
  205.  
  206. DialogDllName = "MDGMPDLG.DLL"
  207. DetectDllName = "MDGNCDET.DLL"
  208. SoftwareType  = "driver"
  209. Exit_Code     = 0
  210.  
  211. ;
  212. ; Product Information.
  213. ;
  214.  
  215. Manufacturer        = "Madge"
  216. ProductMajorVersion = "2"
  217. ProductMinorVersion = "00"
  218. ProductRevision     = ".61"
  219. ProductVersion      = $(ProductMajorVersion)"."$(ProductMinorVersion)$(ProductRevision)
  220.  
  221. ;
  222. ; Software information.
  223. ;
  224.  
  225. ProductSoftwareName     = "MdgMPort"
  226. ProductSoftwareImagePath = "%SystemRoot%\system32\drivers\"$(ProductSoftwareName)".sys"
  227.  
  228. NetRuleSoftwareType     = "mdgtrSys ndisDriver mdgtrDriver"
  229. NetRuleSoftwareUse      = $(SoftwareType)
  230. NetRuleSoftwareBindForm = """mdgtrSys"" yes no container"
  231. NetRuleSoftwareClass    = {"mdgtrDriver basic"}
  232. NetRuleSoftwareBindable = {"mdgtrDriver mdgtrAdapter non exclusive 100"}
  233.  
  234. ;
  235. ; Hardware information.
  236. ;
  237.  
  238. ProductHardwareName         = "MdgMPort"
  239. NetRuleHardwareType         = "mdgtr mdgtrAdapter"
  240. NetRuleHardwareBindForm     = " yes yes container"
  241. NetRuleHardwareClass        = {"mdgtrAdapter basic"}
  242.  
  243. ;
  244. ; Registry Key.
  245. ;
  246.  
  247. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  248. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  249.  
  250. ;
  251. ; EventLog Message File.
  252. ;
  253.  
  254. MadgeEventLogFile = $(ProductSoftwareImagePath)
  255.  
  256. ; ---------------------------------------------------------------------
  257. ; General constants.
  258. ; ---------------------------------------------------------------------
  259.  
  260. [GeneralConstants]
  261.  
  262. ;
  263. ;  File names, etc.
  264. ;
  265.  
  266. UtilityInf    = "UTILITY.INF"
  267. SubroutineInf = "SUBROUTN.INF"
  268. ParamInf      = "NCPARAM.INF"
  269.  
  270. ;
  271. ; Program flow control variables.
  272. ;
  273.  
  274. From      = ""
  275. To        = ""
  276.  
  277. ;
  278. ; Return codes; Exit_Code is set to one of these
  279. ;
  280.  
  281. ExitCodeOk     = 0
  282. ExitCodeCancel = 1
  283. ExitCodeFatal  = 2
  284.  
  285. ;
  286. ; Miscellaneous.
  287. ;
  288.  
  289. MAXIMUM_ALLOWED    = 33554432
  290. RegistryErrorIndex = NO_ERROR
  291. KeyNull            = ""
  292. KeyProduct         = ""
  293. KeyParameters      = ""
  294.  
  295. TRUE    = 1
  296. FALSE   = 0
  297. NoTitle = 0
  298.  
  299. ExitState         = "Active"
  300. OldVersionExisted = $(FALSE)
  301.  
  302. DriverPath      = $(!STF_NTPATH)\drivers
  303.  
  304. ;
  305. ; Resource values returned by the detection DLL, so do not change them.
  306. ;
  307.  
  308. VALUE_UNKNOWN   = 65535
  309. GENERAL_PIO     = 0
  310. GENERAL_DMA     = 500
  311. GENERAL_MMIO    = 501
  312.  
  313. ;
  314. ; Lists used to the raw internal form of parameters to and from
  315. ; the form shown to users.
  316. ;
  317.  
  318. IoUserList    = ^(IoLocationChoices, 1)
  319. IoRawList     = ^(IoLocationChoices, 2)
  320.  
  321. SlotUserList  = ^(SlotNumberChoices, 1)
  322. SlotRawList   = ^(SlotNumberChoices, 2)
  323.  
  324. DmaUserList   = ^(DmaChannelChoices, 1)
  325. DmaRawList    = ^(DmaChannelChoices, 2)
  326.  
  327. IrqUserList   = ^(IrqNumberChoices, 1)
  328. IrqRawList    = ^(IrqNumberChoices, 2)
  329.  
  330. RxTxUserList  = ^(RxTxSlotsChoices,1)
  331. RxTxRawList   = ^(RxTxSlotsChoices,2)
  332.  
  333. StatsUserList = ^(StatsChoices,1)
  334. StatsRawList  = ^(StatsChoices,2)
  335.  
  336. MpUserList    = ^(MpChoices,1)
  337. MpRawList     = ^(MpChoices,2)
  338.  
  339. ;
  340. ; Adapter classification lists.
  341. ;
  342.  
  343. MadgeAdapterOptions  = ^(Options,1)
  344. SlotNumberAdapters   = ^(SlotNumberOnlyOptions,1)
  345. MmioAdapters         = ^(MmioOptions,1)
  346.  
  347.  
  348. ;
  349. ; Help identifiers.
  350. ;
  351.  
  352. MadgeHelpIdMin         = 6000
  353. MadgeHelpIdMax         = 6003
  354. MadgeHelpIdMDGMPISA    = 6001
  355. MadgeHelpIdMDGMPATP    = 6001
  356. MadgeHelpIdMDGMPISAC   = 6001
  357. MadgeHelpIdMDGMPISACP  = 6001
  358. MadgeHelpIdMDGMPPC     = 6001
  359. MadgeHelpIdMDGMPSM16   = 6001
  360. MadgeHelpIdMDGMPPNP    = 6001
  361. MadgeHelpIdMDGMPPCMCIA = 6001
  362. MadgeHelpIdMDGMPEISA   = 6002
  363. MadgeHelpIdMDGMPMCA    = 6002
  364. MadgeHelpIdMDGMPMC32   = 6002
  365. MadgeHelpIdMDGMPPCI    = 6003
  366.  
  367. ; ----------------------------------------------------------------------
  368. ; Language dependent constants specific to the driver.
  369. ; ----------------------------------------------------------------------
  370.  
  371. [FileConstantsENG]
  372.  
  373. ;
  374. ; Product Info
  375. ;
  376.  
  377. FunctionTitle   = "MdgMPort v"$(ProductVersion)": Madge Smart Ringnode Setup"
  378.  
  379. ;
  380. ; Software.
  381. ;
  382.  
  383. ProductSoftwareTitle       = "MdgMPort"
  384. ProductSoftwareDescription = "MdgMPort: Madge Smart Ringnode NDIS3 Miniport Driver"
  385.  
  386. ;
  387. ; Hardware.
  388. ;
  389.  
  390. ProductHardwareMDGMPISATitle   = "Madge Smart 16/4 AT Ringnode"
  391. ProductHardwareMDGMPATPTitle   = "Madge Smart 16/4 AT Plus Ringnode"
  392. ProductHardwareMDGMPISACTitle  = "Madge Smart 16/4 ISA Client Ringnode"
  393. ProductHardwareMDGMPISACPTitle = "Madge Smart 16/4 ISA Client Plus Ringnode"
  394. ProductHardwareMDGMPPCTitle    = "Madge Smart 16/4 PC Ringnode"
  395. ProductHardwareMDGMPEISATitle  = "Madge Smart 16/4 EISA Ringnode"
  396. ProductHardwareMDGMPMCATitle   = "Madge Smart 16/4 MC Ringnode"
  397. ProductHardwareMDGMPMC32Title  = "Madge Smart 16/4 MC32 Ringnode"
  398. ProductHardwareMDGMPSM16Title  = "Madge Smart 16 Ringnode"
  399. ProductHardwareMDGMPPNPTitle   = "Madge Smart 16/4 ISA Client PnP Ringnode"
  400. ProductHardwareMDGMPPCITitle   = "Madge Smart 16/4 PCI Ringnode"
  401. ProductHardwareMDGMPPCMCIATitle  = "Madge Smart 16/4 PCMCIA Ringnode"
  402.  
  403. ProductHardwareMDGMPISADescription   = "Madge Smart 16/4 AT Ringnode"
  404. ProductHardwareMDGMPATPDescription   = "Madge Smart 16/4 AT Plus Ringnode"
  405. ProductHardwareMDGMPISACDescription  = "Madge Smart 16/4 ISA Client Ringnode"
  406. ProductHardwareMDGMPISACPDescription = "Madge Smart 16/4 ISA Client Plus Ringnode"
  407. ProductHardwareMDGMPPCDescription    = "Madge Smart 16/4 PC Ringnode"
  408. ProductHardwareMDGMPEISADescription  = "Madge Smart 16/4 EISA Ringnode"
  409. ProductHardwareMDGMPMCADescription   = "Madge Smart 16/4 MC Ringnode"
  410. ProductHardwareMDGMPMC32Description  = "Madge Smart 16/4 MC32 Ringnode"
  411. ProductHardwareMDGMPSM16Description  = "Madge Smart 16 Ringnode"
  412. ProductHardwareMDGMPPNPDescription   = "Madge Smart 16/4 ISA Client PnP Ringnode"
  413. ProductHardwareMDGMPPCIDescription   = "Madge Smart 16/4 PCI Ringnode"
  414. ProductHardwareMDGMPPCMCIADescription   = "Madge Smart 16/4 PCMCIA Ringnode"
  415.  
  416. ;
  417. ; Ring speed selection.
  418. ;
  419.  
  420. SpeedUserListMDGMPISA    = {"Set at adapter", "Force 16 MBit/s"}
  421. SpeedRawListMDGMPISA     = {0, 2}
  422.  
  423. SpeedUserListMDGMPATP    = {"Set at adapter", "Force 4 MBit/s", "Force 16 MBit/s"}
  424. SpeedRawListMDGMPATP     = {0, 1, 2}
  425.  
  426. SpeedUserListMDGMPISAC   = {"Set at adapter", "Force 16 MBit/s"}
  427. SpeedRawListMDGMPISAC    = {0, 2}
  428.  
  429. SpeedUserListMDGMPISACP  = {"Set at adapter", "Force 4 MBit/s", "Force 16 MBit/s"}
  430. SpeedRawListMDGMPISACP   = {0, 1, 2}
  431.  
  432. SpeedUserListMDGMPPC     = {"Set at adapter", "Force 16 MBit/s"}
  433. SpeedRawListMDGMPPC      = {0, 2}
  434.  
  435. SpeedUserListMDGMPEISA   = {"Set at adapter"}
  436. SpeedRawListMDGMPEISA    = {0}
  437.  
  438. SpeedUserListMDGMPMCA    = {"Set at adapter"}
  439. SpeedRawListMDGMPMCA     = {0}
  440.  
  441. SpeedUserListMDGMPMC32   = {"Set at adapter"}
  442. SpeedRawListMDGMPMC32    = {0}
  443.  
  444. SpeedUserListMDGMPSM16   = {"Always 16 MBit/s"}
  445. SpeedRawListMDGMPSM16    = {0}
  446.  
  447. SpeedUserListMDGMPPNP    = {"Set at adapter", "Force 4 MBit/s", "Force 16 MBit/s"}
  448. SpeedRawListMDGMPPNP     = {0, 1, 2}
  449.  
  450. SpeedUserListMDGMPPCI    = {"Set at adapter", "Force 4 MBit/s", "Force 16 MBit/s"}
  451. SpeedRawListMDGMPPCI     = {0, 1, 2}
  452.  
  453. SpeedUserListMDGMPPCMCIA = {"Set at adapter", "Force 4 MBit/s", "Force 16 MBit/s"}
  454. SpeedRawListMDGMPPCMCIA  = {0, 1, 2}
  455.  
  456. ;
  457. ; Adapter types.
  458. ;
  459.  
  460. AdapterTypeFlagMDGMPISA    = 100
  461. AdapterTypeFlagMDGMPATP    = 100
  462. AdapterTypeFlagMDGMPISAC   = 100
  463. AdapterTypeFlagMDGMPISACP  = 100
  464. AdapterTypeFlagMDGMPPC     = 100
  465. AdapterTypeFlagMDGMPEISA   = 500
  466. AdapterTypeFlagMDGMPMCA    = 600
  467. AdapterTypeFlagMDGMPMC32   = 600
  468. AdapterTypeFlagMDGMPSM16   = 400
  469. AdapterTypeFlagMDGMPPNP    = 300
  470. AdapterTypeFlagMDGMPPCI    = 700
  471. AdapterTypeFlagMDGMPPCMCIA = 200
  472.  
  473. ;
  474. ; Messages.
  475. ;
  476.  
  477. CANNOT_FIND_ANY_CARD = "Cannot find a Madge Smart Ringnode in the machine. "+
  478.                        "If you are certain that a Madge Smart Ringode is "+
  479.                        "present then try choosing the adapter type "+
  480.                        "instead of automatic installation. Please note "+
  481.                        "that EISA and MCA adapters will only be found if "+
  482.                        "the EISA configuration utility or PS/2 reference "+
  483.                        "diskette respectively have been used to configure "+
  484.                        "the adapter. Also not that automated installation "+
  485.                        "will not find PCI adapters - please choose the " +
  486.                        "Madge Smart 16/4 PCI Ringnode option directly."
  487.  
  488. TRIMMED_MFS = "WARNING: The maximum frame size at 16Mbps is 17839 bytes"+
  489.           "  and you have specified a value greater than that. This"+
  490.           "  value has been reduced to 17839 for you. If you are in"+
  491.           "  fact running at 4Mbps, the maximum frame size is 4472,"+
  492.           "  but do not worry -  the driver will automatically  set"+
  493.           "  the correct value, and write it to the Event Log."
  494.  
  495. ShellCodeErrorTitle = "Error: "$(FunctionTitle)
  496. ShellCodeErrorText  = "Shell Code Error"
  497.  
  498. ProCaption   = "Windows NT Setup"
  499. ProCancel    = "Cancel"
  500. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  501.                "Are you sure you want to cancel copying files?"
  502. ProCancelCap = "Network Setup Message"
  503. ProText1     = "Copying:"
  504. ProText2     = "To:"
  505.  
  506. ; ---------------------------------------------------------------------
  507. ; Language dependant general dialog constants.
  508. ; ---------------------------------------------------------------------
  509.  
  510. [DialogConstantsENG]
  511.  
  512. ;
  513. ; Common button names, etc.
  514. ;
  515.  
  516. Help        = "&Help"
  517. Exit        = "&Cancel"
  518. OK          = "&OK"
  519. Continue    = "C&ontinue"
  520. Cancel      = "C&ancel"
  521. HelpContext = ""
  522.  
  523. OldValueTitleInstall   = "Current hardware settings"
  524. OldValueTitleConfigure = "Currently configured settings"
  525.  
  526. ConsultHelp = "Consult help before changing the settings below"
  527.  
  528. [date]
  529.  
  530.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  531.     ; Minute, Second }
  532.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  533.  
  534. ; -----------------------------------------------------------------------
  535. ; Language depentant input dialog constants.
  536. ; -----------------------------------------------------------------------
  537.  
  538. [FileDependentDlgENG]
  539.  
  540. DlgType     = "RadioCombination"
  541. DlgTemplate = $(Option)
  542.  
  543. Caption = $(FunctionTitle)
  544.  
  545. Combo1Label = "&IRQ Level:"
  546. Combo2Label = "I/O &Location:"
  547. Combo3Label = "&Transfer method:"
  548. Combo4Label = "Rx/Tx &Buffers:"
  549. Combo5Label = "Traffic &Statistics Gathering:"
  550. Combo6Label = "Please choose a Madge adapter to install"
  551. Combo7Label = "Number of processors in &PC:"
  552. Combo8Label = "Slot &Number:"
  553. Combo9Label = "&Ring Speed:"
  554.  
  555. PciCombo8Label = "PCI &Device ID:"
  556.  
  557. Combo1List = $(IrqList)
  558. Combo1Out  = $(IrqNumber)
  559.  
  560. Combo2List = $(IoList)
  561. Combo2Out  = $(IoLocation)
  562.  
  563. Combo3List = $(DmaList)
  564. Combo3Out  = $(DmaChannel)
  565.  
  566. Combo4List = $(RxTxUserList)
  567. Combo4Out  = $(RxTxSlots)
  568.  
  569. Combo5List = $(StatsUserList)
  570. Combo5Out  = $(StatsFlag)
  571.  
  572. Combo6List = $(AdapterDescList)
  573. Combo6Out  = $(AdapterType)
  574.  
  575. Combo7List = $(MpList)
  576. Combo7Out  = $(MpFlag)
  577.  
  578. Combo8List = $(SlotList)
  579. Combo8Out  = $(SlotNumber)
  580.  
  581. Combo9List = $(SpeedUserList)
  582. Combo9Out  = $(SpeedFlag)
  583.  
  584. ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List, Combo5List, Combo6List, Combo7List, Combo8List, Combo9List}
  585. ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out, Combo5Out, Combo6Out, Combo7Out, Combo8Out, Combo9Out}
  586.  
  587. Edit1Label  = "Max&FrameSize:"
  588. Edit2Label  = "&LAA:"
  589. EditTextIn  = {$(MaxFrameSize), $(LAA)}
  590. EditTextLim = {5,17}
  591. EditTextOut = {}
  592.  
  593. CBOptionsGreyed = {}
  594. NotifyFields = {NO, NO, NO, NO, NO, NO, NO, NO}
  595.  
  596. HelpContext = $(MadgeHelpId$(Option))
  597.  
  598. AdapterTitle = #(OptionsText$(!STF_LANGUAGE),$(Option),1)
  599.  
  600. ;---------------------------------------------------------------------------
  601. ; Identify the INF file to NT.
  602. ;
  603. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  604. ;                as we are choosing currently.
  605. ;
  606. ; INPUT:         None
  607. ;
  608. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  609. ;                $($R1): Option Type (COMPUTER ...)
  610. ;                $($R2): Diskette description
  611. ;---------------------------------------------------------------------------
  612.  
  613. [Identify]
  614.  
  615.     read-syms Identification
  616.  
  617.     set Status     = STATUS_SUCCESSFUL
  618.     set Identifier = $(OptionType)
  619.     set Media      = #("Source Media Descriptions", 1, 1)
  620.  
  621.     return $(Status) $(Identifier) $(Media)
  622.  
  623. ;------------------------------------------------------------------------
  624. ; Return the options supported by this INF file.
  625. ;
  626. ; DESCRIPTION:   To return the option list supported by this INF and the
  627. ;                localised text list representing the options.
  628. ;
  629. ;
  630. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  631. ;
  632. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  633. ;                                STATUS_NOLANGUAGE
  634. ;                                STATUS_FAILED
  635. ;                                STATUS_NOTSUPPORTED
  636. ;
  637. ;                $($R1): Option List
  638. ;                $($R2): Option Text List
  639. ;------------------------------------------------------------------------
  640.  
  641. [ReturnOptions]
  642.  
  643.     set Status         = STATUS_FAILED
  644.     set OptionList     = {}
  645.     set OptionTextList = {}
  646.  
  647.     ;
  648.     ; Check if the language requested is supported.
  649.     ;
  650.  
  651.     set LanguageList = ^(LanguagesSupported, 1)
  652.  
  653.     ifcontains(i) $($0) in $(LanguageList)
  654.     ;
  655.     ;
  656.     ; Check if the platforms requested is supported
  657.     ;
  658.  
  659.     ifstr(i) $($1) == ""
  660.         ;
  661.         goto Return_Options
  662.         ;
  663.     endif
  664.  
  665.     set PlatformList = ^(PlatformsSupported, 1)
  666.  
  667.     ifcontains(i) $($1) in $(PlatformList)
  668.         ;
  669.         goto Return_Options
  670.         ;
  671.     else
  672.         ;
  673.         set Status = STATUS_NOTSUPPORTED
  674.  
  675.         goto Finish_ReturnOptions
  676.         ;
  677.     endif
  678.     ;
  679.     else
  680.     ;
  681.         set Status = STATUS_NOLANGUAGE
  682.  
  683.     goto Finish_ReturnOptions
  684.     ;
  685.     endif
  686.  
  687.     ;
  688.     ; form a list of all the options and another of the text representing
  689.     ;
  690.  
  691. Return_Options = +
  692.  
  693.     set OptionList     = ^(Options, 1)
  694.     set OptionTextList = ^(OptionsText$($0), 1)
  695.     set Status         = STATUS_SUCCESSFUL
  696.  
  697. Finish_ReturnOptions = +
  698.  
  699.     return $(Status) $(OptionList) $(OptionTextList)
  700.  
  701.  
  702. ;----------------------------------------------------------------------------
  703. ; Prepare an adapter detection DLL for use.
  704. ;----------------------------------------------------------------------------
  705.  
  706. [PrepareDetectionDll]
  707.  
  708.     set NewDllName = $($0)
  709.     set Status     = STATUS_FAILED
  710.  
  711.     read-syms GeneralConstants
  712.  
  713.     set DllValueName = "NetcardDlls"
  714.  
  715.     OpenRegKey $(!REG_H_LOCAL) "" "System\Setup" $(MAXIMUM_ALLOWED) KeySetup
  716.  
  717.     ifstr(i) $(KeySetup) == $(KeyNull)
  718.     ;
  719.     goto PDD_Return
  720.     ;
  721.     endif
  722.  
  723.     set DllFound = 0
  724.  
  725.     GetRegValue $(KeySetup) $(DllValueName) DllNamesValue
  726.  
  727.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  728.     ;
  729.     goto PDD_Return
  730.     ;
  731.     endif
  732.  
  733.     set DllNames = *($(DllNamesValue),4)
  734.  
  735.     ForListDo $(DllNames)
  736.     ;
  737.     ifstr(i) $($) == $(NewDllName)
  738.         ;
  739.         set DllFound = 1
  740.         ;
  741.     endif
  742.     ;
  743.     EndForListDo
  744.  
  745.     ifint $(DllFound) == 0
  746.     ;
  747.     set DllNames  = >($(DllNames),$(NewDllName))
  748.     set ValueInfo = {$(DllValueName), $(NoTitle), $(!REG_VT_MULTI_SZ), $(DllNames)}
  749.  
  750.         SetRegValue $(KeySetup) $(ValueInfo)
  751.  
  752.     ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  753.         ;
  754.         Set Status = STATUS_SUCCESSFUL
  755.         ;
  756.     endif
  757.     ;
  758.     else
  759.     ;
  760.     set Status = STATUS_SUCCESSFUL
  761.     ;
  762.     endif
  763.  
  764.     CloseRegKey $(KeySetup)
  765.  
  766. PDD_Return = +
  767.  
  768.     return $(Status)
  769.  
  770. ;------------------------------------------------------------------------
  771. ; InstallOption:
  772. ;
  773. ;      This section is shelled to by main installation processing
  774. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  775. ;
  776. ;
  777. ; FUNCTION:  To copy files representing Options
  778. ;            To configure the installed option
  779. ;            To update the registry for the installed option
  780. ;
  781. ; INPUT:     $($0):  Language to use
  782. ;            $($1):  OptionID to install
  783. ;            $($2):  SourceDirectory
  784. ;            $($3):  AddCopy  (YES | NO)
  785. ;            $($4):  DoCopy   (YES | NO)
  786. ;            $($5):  DoConfig (YES | NO)
  787. ;
  788. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  789. ;                            STATUS_NOLANGUAGE |
  790. ;                            STATUS_USERCANCEL |
  791. ;                            STATUS_FAILED
  792. ;------------------------------------------------------------------------
  793.  
  794. [InstallOption]
  795.  
  796.     StartWait
  797.     
  798.     ;
  799.     ; Un-comment for debugging.
  800.     ;
  801.  
  802.     ; set !DebugOutputControl = 1
  803.  
  804.     ;
  805.     ; Set default values.
  806.     ;
  807.  
  808.     set Status = STATUS_FAILED
  809.  
  810.     ;
  811.     ; extract parameters
  812.     ;
  813.  
  814.     set Option   = $($1)
  815.     set SrcDir   = $($2)
  816.     set AddCopy  = $($3)
  817.     set DoCopy   = $($4)
  818.     set DoConfig = $($5)
  819.  
  820.     Debug-Output "MADGE: STF_CWDIR    = "$(!STF_CWDIR)
  821.     Debug-Output "MADGE: STF_LANGUAGE = "$(!STF_LANGUAGE)
  822.     Debug-Output "MADGE: Option       = "$(Option)
  823.     Debug-Output "MADGE: SrcDir       = "$(SrcDir)
  824.     Debug-Output "MADGE: AddCopy      = "$(AddCopy)
  825.     Debug-Output "MADGE: DoCopy       = "$(DoCopy)
  826.     Debug-Output "MADGE: DoConfig     = "$(DoConfig)
  827.  
  828.     ;
  829.     ; Check if the language requested is supported
  830.     ;
  831.  
  832.     set LanguageList = ^(LanguagesSupported, 1)
  833.     
  834.     ifcontains(i) $($0) NOT-IN $(LanguageList)
  835.     ;
  836.     return STATUS_NOLANGUAGE
  837.     ;
  838.     endif
  839.  
  840.     ;
  841.     ; Define all the constants
  842.     ;
  843.  
  844.     set-subst LF = "\n"
  845.  
  846.     read-syms GeneralConstants
  847.     read-syms FileConstants
  848.     read-syms DialogConstants$(!STF_LANGUAGE)
  849.  
  850.     ifstr(i) $(!NTN_Origination) == "NCPA"
  851.     ;
  852.     set Continue = $(OK)
  853.     ;
  854.     endif
  855.  
  856.     read-syms FileConstants$(!STF_LANGUAGE)
  857.  
  858.     SetHelpFile "mdgmpdlg.hlp" $(MadgeHelpIdMin) $(MadgeHelpIdMax)
  859.  
  860.     detect date
  861.  
  862.     set-title $(FunctionTitle)
  863.  
  864.     set To   = Begin
  865.     set From = Begin
  866.  
  867.     ;
  868.     ; Assume all is well.
  869.     ;
  870.  
  871.     set CommonStatus = STATUS_SUCCESSFUL
  872.  
  873.     EndWait
  874.  
  875. ; -----------------------------------------------------------------------
  876. ; Set up the operation-mode-based variables and gaily welcome
  877. ; the user.  If the "install mode" variable is improperly set,
  878. ; assume this is a new installation.
  879. ; -----------------------------------------------------------------------
  880.  
  881. Begin = +
  882.  
  883.     ;
  884.     ; Until proven otherwise we assume that the adapter has not been
  885.     ; detected by our NetDetect DLL and we have not done any raw->user
  886.     ; mapping of parameter lists.
  887.     ;
  888.  
  889.     set AdapterDetected     = FALSE
  890.     set MappedRawParameters = FALSE
  891.  
  892.     ifstr(i) $(!NTN_InstallMode) == deinstall
  893.     ;
  894.         set StartLabel = Remove_Adapter
  895.     ;
  896.     else-ifstr(i) $(!NTN_InstallMode) == Update
  897.     ;
  898.     set StartLabel = Upgrade_Software
  899.     ;
  900.     else-ifstr(i) $(!NTN_InstallMode) == bind
  901.     ;
  902.         set StartLabel = Binding_Adapter
  903.     ;
  904.     else-ifstr(i) $(!NTN_InstallMode) == configure
  905.     ;
  906.         set CommonStatus = STATUS_REBOOT
  907.         set StartLabel = Configure_Adapter
  908.  
  909.         ;
  910.         ;   You cannot config the software component
  911.         ;
  912.  
  913.         ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  914.         ;
  915.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  916.  
  917.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  918.             ;
  919.         goto Shell_Code_Error
  920.             ;
  921.         endif
  922.  
  923.         set Error = $($R0)
  924.         set From  = End
  925.         set To    = End
  926.         goto Non_Fatal_Info
  927.         ;
  928.     endif
  929.     ;
  930.     else
  931.     ;
  932.     set StartLabel           = Install_Adapter
  933.     set OEM_ABANDON_OPTIONS  = {}
  934.     set OEM_ABANDON_SOFTWARE = FALSE
  935.     set OEM_ABANDON_ON       = TRUE
  936.     ;
  937.     endif
  938.  
  939.     set From = Fatal
  940.     set To   = Fatal
  941.  
  942.     goto $(StartLabel)
  943.  
  944.  
  945. ; ----------------------------------------------------------------------
  946. ; Installation Section
  947. ; ----------------------------------------------------------------------
  948.  
  949. Install_Adapter = +
  950.  
  951.     ;
  952.     ; First, check whether the same version of the software exists
  953.     ;
  954.  
  955.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  956.  
  957.     Ifstr $(KeyProduct) != $(KeyNull)
  958.     ;
  959.     ;
  960.     ; Same version already existed in the local machine
  961.     ; Popup the dialog and ask the user whether he wants to continue
  962.     ;
  963.     CloseRegKey $(KeyProduct)
  964.  
  965.     ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
  966.         ;
  967.        ;
  968.        ; Cannot Install the same software again
  969.        ;
  970.  
  971.        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  972.            $(ProductVersion)
  973.  
  974.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  975.            ;
  976.            goto Shell_Code_Error
  977.            ;
  978.        endif
  979.  
  980.        goto End
  981.         ;
  982.     else
  983.         ;
  984.            ;
  985.            ; Make sure the user really wants to add a new adapter.
  986.            ; Don't bother for automatic installation.
  987.            ;
  988.  
  989.            ifstr(i) $(Option) != "MDGMPAUTO"
  990.            ;
  991.                ;
  992.            ; Add a new adapter card?
  993.            ;
  994.  
  995.               Shell $(UtilityInf), CardExistedDlg
  996.  
  997.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  998.                ;
  999.                goto Shell_Code_Error
  1000.                ;
  1001.            endif
  1002.  
  1003.            ifstr(i) $($R1) != "OK"
  1004.                ;
  1005.                goto End
  1006.                ;
  1007.            endif
  1008.            ;
  1009.            endif
  1010.  
  1011.        set OldVersionExisted = $(TRUE)
  1012.         ;
  1013.     endif
  1014.     ;
  1015.     endif
  1016.  
  1017. ; -----------------------------------------------------------------------
  1018. ; Copy the driver and helper files from the distribution disk.
  1019. ; -----------------------------------------------------------------------
  1020.  
  1021. Install_Files = +
  1022.  
  1023.     ifint $(OldVersionExisted) == $(FALSE)
  1024.     ;
  1025.     ifstr(i) $(!NTN_InstallMode) == "install"
  1026.         ;
  1027.             ;
  1028.             ; NB !STF_SRCDIR is set to something unhelpful like E:\i386\, 
  1029.             ; but if we omit the last parameter, DoAskSource will default 
  1030.             ; to using A:\
  1031.             ;
  1032.             ; Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR)
  1033.             ;
  1034.  
  1035.         Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR)
  1036.  
  1037.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1038.             ;
  1039.             goto Shell_Code_Error
  1040.             ;
  1041.         else-ifstr(i) $($R0) == STATUS_FAILED
  1042.             ;
  1043.         shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  1044.  
  1045.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1046.                 ;
  1047.                 goto Shell_Code_Error
  1048.                 ;
  1049.             endif
  1050.  
  1051.             set Error = $($R0)
  1052.             goto Fatal
  1053.  
  1054.         else-ifstr(i) $($R0) == STATUS_USERCANCEL
  1055.             ;
  1056.             goto Successful
  1057.             ;
  1058.         endif
  1059.  
  1060.         set SrcDir = $($R1)   ; Referenced in install sections.
  1061.  
  1062.             ;
  1063.             ; Install the detection DLL.
  1064.             ;
  1065.  
  1066.             Shell "" PrepareDetectionDll $(DetectDllName)
  1067.  
  1068.             ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1069.             ;
  1070.                 goto Fatal
  1071.             ;
  1072.             endif
  1073.  
  1074.         install "Install-Option"
  1075.  
  1076.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1077.             ;
  1078.         shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  1079.  
  1080.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1081.                 ;
  1082.             goto Shell_Code_Error
  1083.                 ;
  1084.         endif
  1085.  
  1086.         set Error = $($R0)
  1087.         goto Fatal
  1088.             ;
  1089.         endif
  1090.         ;
  1091.     endif
  1092.     ;
  1093.     endif
  1094.  
  1095. ; -----------------------------------------------------------------------
  1096. ; If the adapter option is MDGMPAUTO then we need to perform some adapter
  1097. ; detection. In addition, we may not have been asked to detect the 
  1098. ; adapter but NCPA may have already done it for use. If it has then set 
  1099. ; up the detection variables from the values passed by NCPA.
  1100. ; -----------------------------------------------------------------------
  1101.  
  1102.     ifstr(i) $(!STF_NCDETECT) == YES
  1103.     ;
  1104.         ifstr(i) $(!STF_NCOPTION) == $(Option)
  1105.         ;
  1106.             set AdapterDetected = TRUE
  1107.             set DetectOption    = $(!STF_NCOPTION)
  1108.             set DetectIndex     = $(!STF_NCDETCARD)
  1109.  
  1110.             goto Set_Installation_Defaults
  1111.         ;
  1112.         endif
  1113.     ;
  1114.     endif
  1115.  
  1116.     ;
  1117.     ; If NCPA has not already detected an adapter then we must
  1118.     ; initialize the detection DLL. We mustn't re-initalise it
  1119.     ; if NCPA has detected an adapter else we will trash the
  1120.     ; adapter information found by NCPA.
  1121.     ;
  1122.  
  1123.     Shell $(ParamInf) Param_ControlDetection DTEND
  1124.     Shell $(ParamInf) Param_ControlDetection DTSTART
  1125.  
  1126.     ifstr(i) $(Option) != "MDGMPAUTO"
  1127.     ;
  1128.         goto Set_Installation_Defaults
  1129.     ;
  1130.     endif
  1131.  
  1132. ; -----------------------------------------------------------------------
  1133. ; We have been asked to search for adapters. We will call our NetDetec
  1134. ; DLL via helper functions to build a list of Madge adapters present in
  1135. ; the machine that have not yet been installed.
  1136. ; -----------------------------------------------------------------------
  1137.  
  1138. Detect_Adapters = +
  1139.  
  1140.     StartWait
  1141.  
  1142.     ;
  1143.     ; Initialise the adapter description and detection index lists.
  1144.     ;
  1145.  
  1146.     set AdapterOptionList = {}
  1147.     set AdapterDescList   = {}
  1148.     set AdapterIndexList  = {}
  1149.  
  1150. DA_Loop = +
  1151.  
  1152.     ;
  1153.     ; Call the detection DLL via a helper function to find the
  1154.     ; next adapter.
  1155.     ;
  1156.  
  1157.     Shell $(ParamInf) Param_DetectCard
  1158.  
  1159.     set DetectResult = $($R0)
  1160.     set Status       = *($(DetectResult),1)
  1161.  
  1162.     ifstr(i) $(Status) != 0
  1163.     ;
  1164.     goto DA_Loop_End
  1165.     ;
  1166.     endif
  1167.  
  1168.     set DetectOption = *($(DetectResult),2)
  1169.     set DetectIndex  = *($(DetectResult),3)
  1170.  
  1171.     ;
  1172.     ; If the adapter is not a Madge adapter then start the
  1173.     ; loop again to skip the adapter.
  1174.     ;
  1175.  
  1176.     ifcontains(i) $(DetectOption) not-in $(MadgeAdapterOptions)
  1177.     ;
  1178.         goto DA_Loop
  1179.     ;
  1180.     endif
  1181.  
  1182.     ;
  1183.     ; Now find out the slot number or IO location to show to the
  1184.     ; user.
  1185.     ;
  1186.  
  1187.     ifcontains(i) $(DetectOption) in $(SlotNumberAdapters)
  1188.     ;
  1189.         set TypeList = {{SLOTNUMBER,SlotList,SlotNumber},+
  1190.                         {DMACHANNEL,DmaList,DmaChannel},+
  1191.                         {MULTIPROCESSOR,MpList,MpFlag}}
  1192.     ;
  1193.     else
  1194.     ;
  1195.         set TypeList = {{IOLOCATION,IoList,IoLocation},+
  1196.                         {DMACHANNEL,DmaList,DmaChannel},+
  1197.                         {INTERRUPTNUMBER,IrqList,IrqNumber},+
  1198.                         {MULTIPROCESSOR,MpList,MpFlag}}
  1199.     ;
  1200.     endif
  1201.  
  1202.     Shell $(ParamInf) Param_BuildTypeLists $(DetectOption) $(TypeList)
  1203.  
  1204.     set Status = $($R0)
  1205.  
  1206.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  1207.     ;
  1208.     goto Fatal
  1209.     ;
  1210.     endif
  1211.  
  1212.     Shell $(ParamInf) Param_QueryCard $(DetectIndex)
  1213.  
  1214.     set Status    = $($R0)
  1215.     set ParamList = $($R1)
  1216.  
  1217.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  1218.     ;
  1219.     goto Fatal
  1220.     ;
  1221.     endif
  1222.  
  1223.     Shell $(ParamInf) Param_SetDefaults $(ParamList)
  1224.  
  1225.     ;
  1226.     ; Build a list of adapters to show to the user.
  1227.     ;
  1228.  
  1229.     set AdapterOptionList = >($(AdapterOptionList),$(DetectOption))
  1230.     set AdapterIndexList  = >($(AdapterIndexList),$(DetectIndex))
  1231.     set AdapterDesc       = #(OptionsChoice$(!STF_LANGUAGE),$(DetectOption),1)
  1232.  
  1233.     ifcontains(i) $(DetectOption) in $(SlotNumberAdapters)
  1234.     ;
  1235.         set AdapterDesc     = $(AdapterDesc)$(SlotNumber)
  1236.         set AdapterDescList = >($(AdapterDescList),$(AdapterDesc))
  1237.     ;
  1238.     else
  1239.     ;
  1240.         set IoLocation      = *($(IoUserList),~($(IoRawList),$(IoLocation)))
  1241.         set AdapterDesc     = $(AdapterDesc)$(IoLocation)
  1242.         set AdapterDescList = >($(AdapterDescList),$(AdapterDesc))
  1243.     ;
  1244.     endif
  1245.  
  1246.     ;
  1247.     ; And look for another adapter.
  1248.     ;
  1249.  
  1250.     goto DA_Loop
  1251.  
  1252. DA_Loop_End = +
  1253.  
  1254.     EndWait
  1255.  
  1256.     Debug-Output "MADGE: AdapterOptionList  = "$(AdapterOptionList)
  1257.     Debug-Output "MADGE: AdapterDescList    = "$(AdapterDescList)
  1258.     Debug-Output "MADGE: AdapterIndexList   = "$(AdapterIndexList)
  1259.  
  1260.     ;
  1261.     ; Give up if we can't find any adapters.
  1262.     ;
  1263.  
  1264.     ifstr(i) $(AdapterOptionList) == {}
  1265.     ;
  1266.         set Error = $(CANNOT_FIND_ANY_CARD)
  1267.         goto Fatal
  1268.     ;
  1269.     endif
  1270.  
  1271. ;------------------------------------------------------------------------
  1272. ; We now have a list of adapter descriptions and detection indexes. 
  1273. ; Pop up a dialog box from which the user can choose which adapter
  1274. ; to install.
  1275. ;------------------------------------------------------------------------
  1276.  
  1277. Choose_Adapter = +
  1278.  
  1279.     StartWait
  1280.  
  1281.     ;
  1282.     ; Set the default choice.
  1283.     ;
  1284.  
  1285.     set AdapterType = *(AdapterDescList,1)
  1286.  
  1287.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  1288.  
  1289.     set DlgTemplate = "MDGADAPTERS"
  1290.  
  1291.     ;
  1292.     ; Load the DLL.
  1293.     ;
  1294.  
  1295.     LoadLibrary "x" $(DialogDllName) MdgDialog
  1296.  
  1297.     ;
  1298.     ; Display the dialog box.
  1299.     ;
  1300.  
  1301.     EndWait
  1302.  
  1303.     ui start "InputDlg" $(MdgDialog)
  1304.  
  1305.     StartWait
  1306.  
  1307.     ifstr(i) $(DLGEVENT) == "EXIT"
  1308.     ;
  1309.     set CommonStatus = STATUS_USERCANCEL
  1310.     ui pop 1
  1311.     FreeLibrary $(MdgDialog)
  1312.     goto End
  1313.     ;
  1314.     else-ifstr(i) $(DLGEVENT) != "CONTINUE"
  1315.     ;
  1316.     ui pop 1
  1317.     FreeLibrary $(MdgDialog)
  1318.     goto End
  1319.     ;
  1320.     endif
  1321.  
  1322.     set AdapterType = $(Combo6Out)
  1323.  
  1324.     ui pop 1
  1325.     FreeLibrary $(MdgDialog)
  1326.  
  1327.     ;
  1328.     ; AdapterType now contains the description of the adapter
  1329.     ; the user wants to install. Find the option and detection index 
  1330.     ; value this corresponds to.
  1331.     ;
  1332.  
  1333.     Debug-Output "MADGE: AdapterType  = "$(AdapterType)
  1334.  
  1335.     set DetectOption = *($(AdapterOptionList),~($(AdapterDescList),$(AdapterType)))
  1336.     set DetectIndex  = *($(AdapterIndexList),~($(AdapterDescList),$(AdapterType)))
  1337.  
  1338.     Debug-Output "MADGE: DetectOption = "$(DetectOption)
  1339.     Debug-Output "MADGE: DetectIndex  = "$(DetectIndex)
  1340.  
  1341.     ;
  1342.     ; Set the flag to say that the adapter was detected and change the
  1343.     ; Option to the detected type.
  1344.     ;
  1345.  
  1346.     set AdapterDetected = TRUE
  1347.     set Option          = $(DetectOption)
  1348.  
  1349.     EndWait
  1350.  
  1351. ; -----------------------------------------------------------------------
  1352. ; Set some defaults that apply to all card types
  1353. ; -----------------------------------------------------------------------
  1354.  
  1355. Set_Installation_Defaults = +
  1356.  
  1357.     StartWait
  1358.  
  1359.     ; 
  1360.     ; Set up some defaults that are not affected by automatic detection.
  1361.     ;
  1362.  
  1363.     set MaxFrameSize  = 4096
  1364.     set LAA           = ""
  1365.     set RxTxSlots     = *($(RxTxRawList),3)
  1366.     set StatsFlag     = *($(StatsRawList),1)
  1367.     set SpeedFlag     = 0
  1368.  
  1369.     set OldIrqNumber  = $(VALUE_UNKNOWN)
  1370.     set OldDmaChannel = $(VALUE_UNKNOWN)
  1371.     set OldIoLocation = $(VALUE_UNKNOWN)
  1372.     set OldSlotNumber = $(VALUE_UNKNOWN)
  1373.     set OldMpFlag     = $(VALUE_UNKNOWN)
  1374.  
  1375.     ;
  1376.     ; Now set up the options for adapter options.
  1377.     ;
  1378.  
  1379.     ifcontains(i) $(Option) in $(SlotNumberAdapters)
  1380.     ;
  1381.         set TypeList = {{SLOTNUMBER,SlotList,SlotNumber},+
  1382.                         {DMACHANNEL,DmaList,DmaChannel},+
  1383.                         {MULTIPROCESSOR,MpList,MpFlag}}
  1384.     ;
  1385.     else
  1386.     ;
  1387.         set TypeList = {{IOLOCATION,IoList,IoLocation},+
  1388.                         {DMACHANNEL,DmaList,DmaChannel},+
  1389.                         {INTERRUPTNUMBER,IrqList,IrqNumber},+
  1390.                         {MULTIPROCESSOR,MpList,MpFlag}}
  1391.     ;
  1392.     endif
  1393.  
  1394.     Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  1395.  
  1396.     set Status = $($R0)
  1397.  
  1398.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  1399.     ;
  1400.         goto Fatal
  1401.     ;
  1402.     endif
  1403.  
  1404.     ;
  1405.     ; If the adapter was automatically detected then call the
  1406.     ; DLL to find out what the parameters are.
  1407.     ;
  1408.  
  1409.     ifstr(i) $(AdapterDetected) == TRUE
  1410.     ;
  1411.         Shell $(ParamInf) Param_QueryCard $(DetectIndex)
  1412.  
  1413.         set Status    = $($R0)
  1414.         set ParamList = $($R1)
  1415.  
  1416.         ifstr(i) $(Status) != STATUS_SUCCESSFUL
  1417.         ;
  1418.             goto Fatal
  1419.         ;
  1420.         endif
  1421.     ;
  1422.     endif
  1423.  
  1424.     ;
  1425.     ; And set the defaults. This will be the automatically detected
  1426.     ; value if the adapter was detected or the first allowable choice
  1427.     ; otherwise. 
  1428.     ;
  1429.  
  1430.     Shell $(ParamInf) Param_SetDefaults $(ParamList)
  1431.  
  1432.     Debug-Output "MADGE: SlotNumber = "$(SlotNumber)
  1433.     Debug-Output "MADGE: IoLocation = "$(IoLocation)
  1434.     Debug-Output "MADGE: IrqNumber  = "$(IrqNumber)
  1435.     Debug-Output "MADGE: DmaChannel = "$(DmaChannel)
  1436.     Debug-Output "MADGE: MpFlag     = "$(MpFlag)
  1437.     Debug-Output "MADGE: SlotList   = "$(SlotList)
  1438.     Debug-Output "MADGE: IoList     = "$(IoList)
  1439.     Debug-Output "MADGE: IrqList    = "$(IrqList)
  1440.     Debug-Output "MADGE: DmaList    = "$(DmaList)
  1441.     Debug-Output "MADGE: MpList     = "$(MpList)
  1442.  
  1443.     ;
  1444.     ; Note what the hardware detectable values are for later.
  1445.     ;
  1446.  
  1447.     ifstr(i) $(AdapterDetected) == TRUE
  1448.     ;
  1449.         set OldSlotNumber = $(SlotNumber)
  1450.         set OldIoLocation = $(IoLocation)
  1451.         set OldIrqNumber  = $(IrqNumber)
  1452.         set OldDmaChannel = $(DmaChannel)
  1453.         set OldMpFlag     = $(MpFlag)
  1454.     ;
  1455.     endif
  1456.  
  1457.     set OldValueTitle = $(OldValueTitleInstall)
  1458.  
  1459.     EndWait
  1460.  
  1461.     goto Get_Adapter_Options
  1462.  
  1463. ; -----------------------------------------------------------------------
  1464. ; Configuration Section
  1465. ; -----------------------------------------------------------------------
  1466.  
  1467. Configure_Adapter = +
  1468.  
  1469.     StartWait
  1470.  
  1471.     ;
  1472.     ; Initialise the detection DLL.
  1473.     ;
  1474.  
  1475.     Shell $(ParamInf) Param_ControlDetection DTEND
  1476.     Shell $(ParamInf) Param_ControlDetection DTSTART
  1477.  
  1478.     ;
  1479.     ; Now set up the options for adapter options.
  1480.     ;
  1481.  
  1482.     ifcontains(i) $(Option) in $(SlotNumberAdapters)
  1483.     ;
  1484.         set TypeList = {{SLOTNUMBER,SlotList,SlotNumber},+
  1485.                         {DMACHANNEL,DmaList,DmaChannel},+
  1486.                         {MULTIPROCESSOR,MpList,MpFlag}}
  1487.     ;
  1488.     else
  1489.     ;
  1490.         set TypeList = {{IOLOCATION,IoList,IoLocation},+
  1491.                         {DMACHANNEL,DmaList,DmaChannel},+
  1492.                         {INTERRUPTNUMBER,IrqList,IrqNumber},+
  1493.                         {MULTIPROCESSOR,MpList,MpFlag}}
  1494.     ;
  1495.     endif
  1496.  
  1497.     Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  1498.  
  1499.     set Status = $($R0)
  1500.  
  1501.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  1502.     ;
  1503.         goto Fatal
  1504.     ;
  1505.     endif
  1506.  
  1507.     ;
  1508.     ; And set the defaults. 
  1509.     ;
  1510.  
  1511.     Shell $(ParamInf) Param_SetDefaults $(ParamList)
  1512.  
  1513.     ;
  1514.     ; Set up the defaults not done by the help interface the
  1515.     ; detection DLL above.
  1516.     ;
  1517.  
  1518.     set MaxFrameSize = 4096
  1519.     set LAA          = ""
  1520.     set RxTxSlots    = *($(RxTxRawList),3)
  1521.     set StatsFlag    = *($(StatsRawList),1)
  1522.     set NoMmioFlag   = 0
  1523.     set SpeedFlag    = 0
  1524.  
  1525.     ;
  1526.     ; NB !NTN_RegBase, for hardware components, is :
  1527.     ;    \SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\0x
  1528.     ;
  1529.  
  1530.     ;
  1531.     ; This next IF is redundant - it will always be NULL
  1532.     ;
  1533.  
  1534.     ifstr $(KeyProduct) == $(KeyNull)
  1535.     ;
  1536.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  1537.  
  1538.     ifstr $(KeyProduct) == $(KeyNull)
  1539.         ;
  1540.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  1541.         goto Fatal_Registry
  1542.         ;
  1543.     endif
  1544.     ;
  1545.     endif
  1546.  
  1547.     ;
  1548.     ; Get the other parameters; they're attached to the service 
  1549.     ; parameters key
  1550.     ;
  1551.  
  1552.     Shell $(UtilityInf) FindService, $(KeyProduct)
  1553.  
  1554.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1555.     ;
  1556.         goto Shell_Code_Error
  1557.     ;
  1558.     endif
  1559.  
  1560.     ifstr(i) $($R0) != NO_ERROR
  1561.     ;
  1562.         goto Fatal_Registry
  1563.     ;
  1564.     endif
  1565.  
  1566.     set KeyParameters = $($R2)
  1567.  
  1568.     ;
  1569.     ; We don't need the services key, so close it.
  1570.     ;
  1571.  
  1572.     CloseRegKey $($R1)
  1573.  
  1574.     ifstr $(KeyParameters) == $(KeyNull)
  1575.     ;
  1576.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  1577.         goto Fatal_Registry
  1578.     ;
  1579.     endif
  1580.  
  1581.     set OldVersionExisted = $(TRUE)
  1582.  
  1583.     ;
  1584.     ; Get the old values
  1585.     ;
  1586.  
  1587.     set ValueName = ""
  1588.     set ValueData = ""
  1589.     set ValueStr  = ""
  1590.     set ValueList = {}
  1591.  
  1592.     EnumRegValue $(KeyParameters) ValueList
  1593.  
  1594.     ForListDo $(ValueList)
  1595.     ;
  1596.     set ValueItem = $($)
  1597.     set ValueName = *($(ValueItem),1)
  1598.     set ValueData = *($(ValueItem),4)
  1599.  
  1600.     ifstr(i) $(ValueName) == "InterruptNumber"
  1601.         ;
  1602.         set IrqNumber = $(ValueData)
  1603.         ;
  1604.     else-ifstr(i) $(ValueName) == "IoLocation"
  1605.         ;
  1606.         set IoLocation = $(ValueData)
  1607.         ;
  1608.     else-ifstr(i) $(ValueName) == "IoBaseAddress"
  1609.         ;
  1610.         set IoLocation = $(ValueData)
  1611.         ;
  1612.     else-ifstr(i) $(ValueName) == "DmaChannel"
  1613.         ;
  1614.         set DmaChannel = $(ValueData)
  1615.         ;
  1616.     else-ifstr(i) $(ValueName) == "SlotNumber"
  1617.         ;
  1618.         set SlotNumber = $(ValueData)
  1619.         ;
  1620.     else-ifstr(i) $(ValueName) == $(McaEisaKeyword)
  1621.         ;
  1622.         set McaEisaId = $(ValueData)
  1623.         ;
  1624.     else-ifstr(i) $(ValueName) == "MaxFrameSize"
  1625.         ;
  1626.         set MaxFrameSize = $(ValueData)
  1627.         ;
  1628.     else-ifstr(i) $(ValueName) == "NetworkAddress"
  1629.         ;
  1630.         set LAA = $(ValueData)
  1631.         ;
  1632.         else-ifstr(i) $(ValueName) == "RxTxSlots"
  1633.         ;
  1634.             set RxTxSlots = $(ValueData)
  1635.         ;
  1636.         else-ifstr(i) $(ValueName) == "PromiscuousModeX"
  1637.         ;
  1638.             set StatsFlag = $(ValueData)
  1639.         ;
  1640.         else-ifstr(i) $(ValueName) == "Multiprocessor"
  1641.         ;
  1642.             set MpFlag = $(ValueData)
  1643.         ;
  1644.         else-ifstr(i) $(ValueName) == "NoMmio"
  1645.         ;
  1646.             set NoMmioFlag = $(ValueData)
  1647.         ;
  1648.         else-ifstr(i) $(ValueName) == "Force16"
  1649.         ;
  1650.             set SpeedFlag = 2
  1651.         ;
  1652.         else-ifstr(i) $(ValueName) == "Force4"
  1653.         ;
  1654.             set SpeedFlag = 1
  1655.         ;
  1656.     endif
  1657.  
  1658.     ;
  1659.     EndForListDo
  1660.  
  1661.     ;
  1662.     ; For backward compatibility we translate a DMA channel of 0x8000
  1663.     ; into a DMA channel of $(GENERAL_PIO) and a multiprocessor flag of 1.
  1664.     ; 
  1665.  
  1666.     ifint $(DmaChannel) == 32768
  1667.     ;
  1668.         set DmaChannel = $(GENERAL_PIO)
  1669.         set MpFlag     = 1
  1670.     ;
  1671.     endif
  1672.  
  1673.     ;
  1674.     ; We now need to merge the DmaChannel and NoMmioFlag to produce a
  1675.     ; DmaChannel that completely specifies the transfer mode. When
  1676.     ; we called the detection DLL to get the defaults DmaChannel will
  1677.     ; have been set up properly, including setting unspecific DMA for
  1678.     ; EISA and MC. If we have an MMIO supporting adapter the rule is
  1679.     ; as follows. 
  1680.     ;
  1681.     ; If the NoMmio flag is set then we must not use MMIO, so:
  1682.     ;
  1683.     ;     If DmaChannel is NOT set to $(GENERAL_MMIO) then we leave it
  1684.     ;     as it is. If DmaChannel is set to $(GENERAL_MMIO) then we
  1685.     ;     change it to $(GENERAL_PIO). This rule assumes that the 
  1686.     ;     detection routine will return a none $(GENERAL_MMIO) value
  1687.     ;     as the default OR the adapter supports PIO.
  1688.     ;
  1689.     ; If the NoMmio flag is not set then we may use MMIO, so:
  1690.     ;     
  1691.     ;     We set DmaChannel to $(GENERAL_MMIO).
  1692.     ;     
  1693.  
  1694.     ifcontains(i) $(Option) in $(MmioAdapters)
  1695.     ;
  1696.         ifint $(NoMmioFlag) == 0
  1697.         ;
  1698.             set DmaChannel = $(GENERAL_MMIO)
  1699.         ;
  1700.         else
  1701.         ;
  1702.             ifstr(i) $(DmaChannel) == $(GENERAL_MMIO)
  1703.             ;
  1704.                 set DmaChannel = $(GENERAL_PIO)
  1705.             ;
  1706.             endif
  1707.         ;
  1708.         endif
  1709.     ;
  1710.     endif
  1711.  
  1712.     ;
  1713.     ; Make a note of the current values.
  1714.     ;
  1715.  
  1716.     set OldSlotNumber = $(SlotNumber)
  1717.     set OldIoLocation = $(IoLocation)
  1718.     set OldIrqNumber  = $(IrqNumber)
  1719.     set OldDmaChannel = $(DmaChannel)
  1720.     set OldMpFlag     = $(MpFlag)
  1721.     
  1722.     set OldValueTitle = $(OldValueTitleConfigure)
  1723.  
  1724.     EndWait
  1725.  
  1726. ; -----------------------------------------------------------------------
  1727. ; Let the user set options.
  1728. ; -----------------------------------------------------------------------
  1729.  
  1730. Get_Adapter_Options = +
  1731.  
  1732.     StartWait
  1733.  
  1734.     ;
  1735.     ; Need to be able to tell if the LAA or statistics gathering
  1736.     ; flag have changed.
  1737.     ;
  1738.  
  1739.     set OldLAA       = $(LAA)
  1740.     set OldStatsFlag = $(StatsFlag)
  1741.     set OldSpeedFlag = $(SpeedFlag)
  1742.  
  1743.     ;
  1744.     ; Set up the list of adapter ring speeds.
  1745.     ;
  1746.  
  1747.     set SpeedRawList  = $(SpeedRawList$(Option))
  1748.     set SpeedUserList = $(SpeedUserList$(Option))
  1749.     
  1750.     ;
  1751.     ; Map the parameter lists into the form we present to the user.
  1752.     ; We only ever do this once.
  1753.     ;
  1754.  
  1755.     ifstr(i) $(MappedRawParameters) == FALSE
  1756.     ;
  1757.         ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  1758.         ;
  1759.             set TempList = $(IoList)
  1760.             set IoList   = {}
  1761.             ForListDo $(TempList)
  1762.             ;
  1763.                 set IoList = >($(IoList), *($(IoUserList),~($(IoRawList),$($))))
  1764.             ;
  1765.             EndForListDo
  1766.  
  1767.             set TempList = $(IrqList)
  1768.             set IrqList  = {}
  1769.             ForListDo $(TempList)
  1770.             ;
  1771.                 set IrqList = >($(IrqList), *($(IrqUserList),~($(IrqRawList),$($))))
  1772.             ;
  1773.             EndForListDo
  1774.         ;
  1775.         else
  1776.         ;
  1777.             set TempList = $(SlotList)
  1778.             set SlotList  = {}
  1779.             ForListDo $(TempList)
  1780.             ;
  1781.                 set SlotList = >($(SlotList), *($(SlotUserList),~($(SlotRawList),$($))))
  1782.             ;
  1783.             EndForListDo
  1784.         ;
  1785.         endif
  1786.  
  1787.         set TempList = $(DmaList)
  1788.         set DmaList  = {}
  1789.         ForListDo $(TempList)
  1790.         ;
  1791.             set DmaList = >($(DmaList), *($(DmaUserList),~($(DmaRawList),$($))))
  1792.         ;
  1793.         EndForListDo
  1794.  
  1795.         set TempList = $(MpList)
  1796.         set MpList   = {}
  1797.         ForListDo $(TempList)
  1798.         ;
  1799.             set MpList = >($(MpList), *($(MpUserList),~($(MpRawList),$($))))
  1800.         ;
  1801.         EndForListDo
  1802.  
  1803.         set MappedRawParameters = TRUE
  1804.     ;
  1805.     endif
  1806.  
  1807.     EndWait
  1808.  
  1809. Get_Adapter_Options_Restart = +
  1810.  
  1811.     ;
  1812.     ; We will start here if parameter validation fails.
  1813.     ;
  1814.  
  1815.     StartWait
  1816.  
  1817.     set From = Get_Adapter_Options_Restart
  1818.  
  1819.     ;
  1820.     ; Map the currently selected values into user from.
  1821.     ;
  1822.  
  1823.     ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  1824.     ;
  1825.         set IoLocation    = *($(IoUserList),~($(IoRawList),$(IoLocation)))
  1826.         set OldIoLocation = *($(IoUserList),~($(IoRawList),$(OldIoLocation)))
  1827.         set IrqNumber     = *($(IrqUserList),~($(IrqRawList),$(IrqNumber)))
  1828.         set OldIrqNumber  = *($(IrqUserList),~($(IrqRawList),$(OldIrqNumber)))
  1829.     ;
  1830.     else
  1831.     ;
  1832.         set SlotNumber    = *($(SlotUserList),~($(SlotRawList),$(SlotNumber)))
  1833.         set OldSlotNumber = *($(SlotUserList),~($(SlotRawList),$(OldSlotNumber)))
  1834.     ;
  1835.     endif
  1836.  
  1837.     set DmaChannel    = *($(DmaUserList),~($(DmaRawList),$(DmaChannel)))
  1838.     set OldDmaChannel = *($(DmaUserList),~($(DmaRawList),$(OldDmaChannel)))
  1839.     set MpFlag        = *($(MpUserList),~($(MpRawList),$(MpFlag)))
  1840.     set OldMpFlag     = *($(MpUserList),~($(MpRawList),$(OldMpFlag)))
  1841.     set StatsFlag     = *($(StatsUserList),~($(StatsRawList),$(StatsFlag)))
  1842.     set RxTxSlots     = *($(RxTxUserList),~($(RxTxRawList),$(RxTxSlots)))
  1843.     set SpeedFlag     = *($(SpeedUserList),~($(SpeedRawList),$(SpeedFlag)))
  1844.  
  1845.     ;
  1846.     ; Set up the input dialog box text and lists.
  1847.     ;
  1848.  
  1849.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  1850.  
  1851.     ;
  1852.     ; Decide which dialog box to use.
  1853.     ;
  1854.  
  1855.     Debug-Output "MADGE: Option             = "$(Option)
  1856.     Debug-Output "MADGE: SlotNumberAdapters = "$(SlotNumberAdapters)
  1857.  
  1858.     ifcontains(i) $(Option) in $(SlotNumberAdapters)
  1859.     ;
  1860.     set DlgTemplate = "MDGEISA"
  1861.     ;
  1862.     else
  1863.     ;
  1864.         set DlgTemplate = "MDGISA"
  1865.     ;
  1866.     endif
  1867.  
  1868.     Debug-Output "MADGE: DlgTemplate = "$(DlgTemplate)
  1869.  
  1870.     ;
  1871.     ; To allow us to re-use the EISA/MCA dialog box for PCI we need
  1872.     ; to change Combo8Label.
  1873.     ;
  1874.  
  1875.     ifstr(i) $(Option) == "MDGMPPCI"
  1876.     ;
  1877.         set Combo8Label = $(PciCombo8Label)
  1878.     ;
  1879.     endif
  1880.  
  1881.     ;
  1882.     ; Let the user press some keys.
  1883.     ;
  1884.  
  1885.     LoadLibrary "x" $(DialogDllName) MdgDialog
  1886.  
  1887.     EndWait
  1888.  
  1889.     ui start "InputDlg" $(MdgDialog)
  1890.  
  1891.     StartWait
  1892.  
  1893.     ifstr(i) $(DLGEVENT) == "EXIT"
  1894.     ;
  1895.     set CommonStatus = STATUS_USERCANCEL
  1896.     ui pop 1
  1897.     FreeLibrary $(MdgDialog)
  1898.     goto End
  1899.     ;
  1900.     else-ifstr(i) $(DLGEVENT) != "CONTINUE"
  1901.     ;
  1902.     ui pop 1
  1903.     FreeLibrary $(MdgDialog)
  1904.     goto End
  1905.     ;
  1906.     endif
  1907.  
  1908.     ;
  1909.     ; Get the values the user selected out of the dialog box.
  1910.     ;
  1911.  
  1912.     set IrqNumber    = $(Combo1Out)
  1913.     set IoLocation   = $(Combo2Out)
  1914.     set DmaChannel   = $(Combo3Out)
  1915.     set RxTxSlots    = $(Combo4Out)
  1916.     set StatsFlag    = $(Combo5Out)
  1917.     set MpFlag       = $(Combo7Out)
  1918.     set SlotNumber   = $(Combo8Out)
  1919.     set SpeedFlag    = $(Combo9Out)
  1920.  
  1921.     set MaxFrameSize = *($(EditTextOut), 1)
  1922.     set LAA          = *($(EditTextOut), 2)
  1923.  
  1924.     ui pop 1
  1925.     FreeLibrary $(MdgDialog)
  1926.  
  1927.     Debug-Output "MADGE: SlotNumber = "$(SlotNumber)
  1928.     Debug-Output "MADGE: IoLocation = "$(IoLocation)
  1929.     Debug-Output "MADGE: IrqNumber  = "$(IrqNumber)
  1930.     Debug-Output "MADGE: DmaChannel = "$(DmaChannel)
  1931.     Debug-Output "MADGE: MpFlag     = "$(MpFlag)
  1932.     Debug-Output "MADGE: RxTxSlots  = "$(RxTxSlots)
  1933.     Debug-Output "MADGE: StatsFlag  = "$(StatsFlag)
  1934.  
  1935.     ;
  1936.     ; Convert the values the user has chosen into internal form.
  1937.     ;
  1938.  
  1939.     ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  1940.     ;
  1941.         set IoLocation    = *($(IoRawList),~($(IoUserList),$(IoLocation)))
  1942.         set OldIoLocation = *($(IoRawList),~($(IoUserList),$(OldIoLocation)))
  1943.         set IrqNumber     = *($(IrqRawList),~($(IrqUserList),$(IrqNumber)))
  1944.         set OldIrqNumber  = *($(IrqRawList),~($(IrqUserList),$(OldIrqNumber)))
  1945.     ;
  1946.     else
  1947.     ;
  1948.         set SlotNumber    = *($(SlotRawList),~($(SlotUserList),$(SlotNumber)))
  1949.         set OldSlotNumber = *($(SlotRawList),~($(SlotUserList),$(OldSlotNumber)))
  1950.     ;
  1951.     endif
  1952.  
  1953.     set DmaChannel    = *($(DmaRawList),~($(DmaUserList),$(DmaChannel)))
  1954.     set OldDmaChannel = *($(DmaRawList),~($(DmaUserList),$(OldDmaChannel)))
  1955.     set MpFlag        = *($(MpRawList),~($(MpUserList),$(MpFlag)))
  1956.     set OldMpFlag     = *($(MpRawList),~($(MpUserList),$(OldMpFlag)))
  1957.     set StatsFlag     = *($(StatsRawList),~($(StatsUserList),$(StatsFlag)))
  1958.     set RxTxSlots     = *($(RxTxRawList),~($(RxTxUserList),$(RxTxSlots)))
  1959.     set SpeedFlag     = *($(SpeedRawList),~($(SpeedUserList),$(SpeedFlag)))
  1960.  
  1961.     Debug-Output "MADGE: SlotNumber = "$(SlotNumber)
  1962.     Debug-Output "MADGE: IoLocation = "$(IoLocation)
  1963.     Debug-Output "MADGE: IrqNumber  = "$(IrqNumber)
  1964.     Debug-Output "MADGE: DmaChannel = "$(DmaChannel)
  1965.     Debug-Output "MADGE: MpFlag     = "$(MpFlag)
  1966.     Debug-Output "MADGE: RxTxSlots  = "$(RxTxSlots)
  1967.     Debug-Output "MADGE: StatsFlag  = "$(StatsFlag)
  1968.  
  1969.     EndWait
  1970.  
  1971. ; -----------------------------------------------------------------------
  1972. ; Verify the adapter options.
  1973. ; -----------------------------------------------------------------------
  1974.  
  1975. Adapter_Verify = +
  1976.  
  1977.     StartWait
  1978.  
  1979.     ;
  1980.     ; If the user entered an LAA then validate it.
  1981.     ;
  1982.  
  1983.     ifstr $(LAA) != ""
  1984.     ;
  1985.         ;
  1986.     ; NB A line of spaces will come through here, and will fail the
  1987.     ;    check - do we want this?
  1988.         ;
  1989.  
  1990.         LoadLibrary "x" $(DialogDllName) MdgDialog
  1991.  
  1992.     set FLibraryErrCtl = 1
  1993.  
  1994.     LibraryProcedure MdgResult $(MdgDialog) MadgeLAACheck $(LAA)
  1995.  
  1996.     set FLibraryErrCtl = 0
  1997.  
  1998.         FreeLibrary $(MdgDialog)
  1999.  
  2000.     ifstr $(MdgResult) != "MADGE_STATUS_SUCCESS"
  2001.         ;
  2002.             ;
  2003.         ; Illegal LAA supplied in the install dialog
  2004.         ; Display error message and go around again
  2005.             ;
  2006.  
  2007.         set Error = $(MdgResult)
  2008.  
  2009.             ;
  2010.             ; This will go back to Get_Adapter_Options or to end.
  2011.             ;
  2012.  
  2013.         goto Non_Fatal 
  2014.         ;
  2015.     endif
  2016.     ;
  2017.     endif
  2018.  
  2019.     ifint $(MaxFrameSize) > 17839
  2020.     ;
  2021.         ;
  2022.         ; 17839 is the maximum frame size at 16Mbps, while at 4Mbps it is 4472.
  2023.         ; Unfortunately, we can't tell here what the ring speed is, so guess at
  2024.         ; 16Mbps, which is the most sensible.
  2025.         ;
  2026.  
  2027.     set MaxFrameSize = 17839
  2028.     set Error        = $(TRIMMED_MFS)
  2029.     set From         = Update_Registry
  2030.  
  2031.     goto Non_Fatal_Info
  2032.     ;
  2033.     endif
  2034.  
  2035.     EndWait
  2036.  
  2037. ; -----------------------------------------------------------------------
  2038. ; We have checked the options so add the software parameters to the
  2039. ; registry.
  2040. ; -----------------------------------------------------------------------
  2041.  
  2042. Update_Registry = +
  2043.  
  2044.     ;
  2045.     ; If installing, go create the necessary keys;
  2046.     ; if configuring, they're already open.
  2047.     ;
  2048.  
  2049.     ifint $(OldVersionExisted) == $(TRUE)
  2050.     ;
  2051.     ifstr(i) $(!NTN_InstallMode) == configure
  2052.         ;
  2053.         goto Write_Parameters
  2054.         ;
  2055.     endif
  2056.     ;
  2057.     endif
  2058.  
  2059.     StartWait
  2060.  
  2061.     ;
  2062.     ; Add Software Component.
  2063.     ;
  2064.  
  2065.     ifint $(OldVersionExisted) == $(FALSE)
  2066.     ;
  2067.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  2068.         $(ProductSoftwareName), +
  2069.         $(ProductSoftwareName), +
  2070.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  2071.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  2072.         $(MadgeEventLogFile)
  2073.  
  2074.     Set OEM_ABANDON_SOFTWARE = TRUE
  2075.  
  2076.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2077.         ;
  2078.         goto Shell_Code_Error
  2079.         ;
  2080.     endif
  2081.  
  2082.     ;
  2083.     ; At this point:
  2084.     ;     $R1 contains the product version key handle;
  2085.     ;     $R2 contains the NetRules subkey handle;
  2086.     ;     $R3 contains the new Services key handle; and
  2087.     ;     $R4 contains the Parameters key
  2088.     ;     $R5 contains the Linkage Key
  2089.     ;
  2090.  
  2091.     set RegistryErrorIndex = $($R0)
  2092.     set KeyProduct         = $($R1)
  2093.     Set SoftNetRulesKey    = $($R2)
  2094.     CloseRegKey $($R3)
  2095.     CloseRegKey $($R4)
  2096.     CloseRegKey $($R5)
  2097.  
  2098.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2099.         ;
  2100.         CloseRegKey $(KeyProduct)
  2101.         CloseRegKey $(SoftNetRulesKey)
  2102.         goto Fatal_Registry
  2103.         ;
  2104.     endif
  2105.  
  2106.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  2107.                {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  2108.                {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  2109.                {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  2110.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  2111.                {PathName,$(NoTitle),$(!REG_VT_SZ),$(!STF_CWDDIR)},+
  2112.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  2113.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  2114.  
  2115.     Shell $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  2116.  
  2117.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2118.         ;
  2119.         goto Shell_Code_Error
  2120.         ;
  2121.     endif
  2122.  
  2123.     set RegistryErrorIndex = $($R0)
  2124.  
  2125.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2126.         ;
  2127.         CloseRegKey $(KeyProduct)
  2128.         CloseRegKey $(SoftNetRulesKey)
  2129.  
  2130.         goto Fatal_Registry
  2131.         ;
  2132.     endif
  2133.  
  2134.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  2135.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  2136.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  2137.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  2138.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  2139.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, +
  2140.                 {Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)} }
  2141.  
  2142.     Shell $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  2143.  
  2144.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2145.         ;
  2146.         goto Shell_Code_Error
  2147.         ;
  2148.     endif
  2149.  
  2150.     set RegistryErrorIndex = $($R0)
  2151.  
  2152.     CloseRegKey $(KeyProduct)
  2153.     CloseRegKey $(SoftNetRulesKey)
  2154.  
  2155.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2156.         ;
  2157.         goto Fatal_Registry
  2158.         ;
  2159.     endif
  2160.     ;
  2161.     endif
  2162.  
  2163.     ;
  2164.     ; Create the HARDWARE\Netcard region and its corresponding service
  2165.     ;
  2166.  
  2167.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  2168.  
  2169.     ifint $($R4) != -1
  2170.     ;
  2171.     Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  2172.     ;
  2173.     endif
  2174.         
  2175.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2176.     ;
  2177.     goto Shell_Code_Error
  2178.     ;
  2179.     endif
  2180.  
  2181.     set RegistryErrorIndex = $($R0)
  2182.  
  2183.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2184.     ;
  2185.     CloseRegKey $($R1)
  2186.     CloseRegKey $($R2)
  2187.     CloseRegKey $($R3)
  2188.     goto Fatal_Registry
  2189.     ;
  2190.     endif
  2191.  
  2192.     ;
  2193.     ; At this point:
  2194.     ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  2195.     ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  2196.     ;     $R3  Registry key handle for <service>\Parameters key
  2197.     ;     $R4  Adapter number assigned to adapter
  2198.     ;     $R5  Service name generated by combining svc name with adapter number
  2199.     ;
  2200.  
  2201.     set KeyParameters   = $($R3)
  2202.     set KeyAdapterRules = $($R2)
  2203.     set AdapterNumber   = $($R4)
  2204.  
  2205.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  2206.                {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  2207.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  2208.                {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  2209.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  2210.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  2211.  
  2212.     Shell $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  2213.  
  2214.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2215.     ;
  2216.     goto Shell_Code_Error
  2217.     ;
  2218.     endif
  2219.  
  2220.     CloseRegKey $($R1)
  2221.  
  2222.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  2223.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  2224.  
  2225.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  2226.             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  2227.             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  2228.             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, +
  2229.             {Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)}}
  2230.  
  2231.     Shell $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  2232.  
  2233.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2234.     ;
  2235.     goto Shell_Code_Error
  2236.     ;
  2237.     endif
  2238.  
  2239.     set RegistryErrorIndex = $($R0)
  2240.  
  2241.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2242.     ;
  2243.     CloseRegKey $(KeyParameters)
  2244.     CloseRegKey $(KeyAdapterRules)
  2245.     goto Fatal_Registry
  2246.     ;
  2247.     endif
  2248.  
  2249.     CloseRegKey $(KeyAdapterRules)
  2250.  
  2251.     EndWait
  2252.  
  2253. ; ----------------------------------------------------------------------
  2254. ; Write the adapter parameters into the registry.
  2255. ; ----------------------------------------------------------------------
  2256.  
  2257. ;
  2258. ; REQUIRED: $(KeyParameters) contains service Parameters key handle.
  2259. ;
  2260.  
  2261. Write_Parameters = +
  2262.  
  2263.     StartWait
  2264.  
  2265.     Shell $(UtilityInf), GetBusTypeDialog, $(ProductHardware$(Option)Description)
  2266.  
  2267.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2268.     ;
  2269.     goto Shell_Code_Error
  2270.     ;
  2271.     endif
  2272.  
  2273.     ifstr(i) $($R0) == ERROR
  2274.     ;
  2275.         Shell $(UtilityInf), GetBusTypeNum
  2276.  
  2277.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2278.         ;
  2279.             goto Shell_Code_Error
  2280.         ;
  2281.         endif
  2282.  
  2283.         set BusTypeNum = $($R1)
  2284.         set BusNumber  = 0
  2285.     ;
  2286.     else
  2287.     ;
  2288.         set BusTypeNum = $($R1)
  2289.         set BusNumber  = $($R2)
  2290.     ;
  2291.     endif
  2292.  
  2293.     ;
  2294.     ; We need to examine DmaChannel to decide on how to set DmaChannel
  2295.     ; and NoMmio. We use a very simple test - if DmaChannel is not
  2296.     ; $(GENERAL_MMIO) then we set NoMMio, otherwise we clear it.
  2297.     ; Note that at the moment we don't register the DmaChannel
  2298.     ; parameter for slot number adapters. This may need to change
  2299.     ; if PCI adapters ever get DMA.
  2300.     ;
  2301.  
  2302.     ifstr(i) $(DmaChannel) == $(GENERAL_MMIO)
  2303.     ;
  2304.         set NoMmioFlag = 0
  2305.     ;
  2306.     else
  2307.     ;
  2308.         set NoMmioFlag = 1
  2309.     ;
  2310.     endif
  2311.  
  2312.     ;
  2313.     ; Derive the adapter type.
  2314.     ;
  2315.  
  2316.     set AdapterTypeFlag = $(AdapterTypeFlag$(Option))
  2317.  
  2318.     ;
  2319.     ; Add the rest of the parameters to the Services adapter area.
  2320.     ;
  2321.  
  2322.     ifcontains(i) $(Option) not-in $(SlotNumberAdapters)
  2323.     ;
  2324.     set NewValueList = {{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IrqNumber)},+
  2325.             {BusType,        $(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  2326.             {BusNumber,      $(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  2327.             {MediaType,      $(NoTitle),$(!REG_VT_DWORD),2},+
  2328.             {IoLocation,     $(NoTitle),$(!REG_VT_DWORD),$(IoLocation)},+
  2329.             {IoBaseAddress,  $(NoTitle),$(!REG_VT_DWORD),$(IoLocation)},+
  2330.             {DmaChannel,     $(NoTitle),$(!REG_VT_DWORD),$(DmaChannel)},+
  2331.             {NoMmio,         $(NoTitle),$(!REG_VT_DWORD),$(NoMmioFlag)},+
  2332.                         {RxTxSlots,      $(NoTitle),$(!REG_VT_DWORD),$(RxTxSlots)},+
  2333.                         {Multiprocessor, $(NoTitle),$(!REG_VT_DWORD),$(MpFlag)},+
  2334.             {MaxFrameSize,   $(NoTitle),$(!REG_VT_DWORD),$(MaxFrameSize)},+
  2335.                         {AdapterType,    $(NoTitle),$(!REG_VT_DWORD),$(AdapterTypeFlag)}}
  2336.     else
  2337.     set NewValueList = {+
  2338.             {BusType,        $(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  2339.             {BusNumber,      $(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  2340.             {MediaType,      $(NoTitle),$(!REG_VT_DWORD),2},+
  2341. ;;;;            {$(McaEisaKeyword), $(NoTitle), $(!REG_VT_DWORD), $(McaEisaId)},+
  2342.             {SlotNumber,     $(NoTitle),$(!REG_VT_DWORD),$(SlotNumber)},+
  2343.             {NoMmio,         $(NoTitle),$(!REG_VT_DWORD),$(NoMmioFlag)},+
  2344.                         {RxTxSlots,      $(NoTitle),$(!REG_VT_DWORD),$(RxTxSlots)},+
  2345.                         {Multiprocessor, $(NoTitle),$(!REG_VT_DWORD),$(MpFlag)},+
  2346.             {MaxFrameSize,   $(NoTitle),$(!REG_VT_DWORD),$(MaxFrameSize)},+
  2347.                         {AdapterType,    $(NoTitle),$(!REG_VT_DWORD),$(AdapterTypeFlag)}}
  2348.     ;
  2349.     endif
  2350.     
  2351.     ;
  2352.     ; Add the LAA if there is one.
  2353.     ;
  2354.  
  2355.     ifstr $(LAA) != ""
  2356.     ;
  2357.     set NewValueList = >($(NewValueList),+
  2358.                  {NetworkAddress, $(NoTitle), $(!REG_VT_SZ), $(LAA)})
  2359.     ;
  2360.     endif
  2361.  
  2362.     ;
  2363.     ; Enable promiscuous mode if required.
  2364.     ;
  2365.  
  2366.     ifstr $(StatsFlag) == "1"
  2367.     ;
  2368.     set NewValueList = >($(NewValueList),+
  2369.                  {PromiscuousModeX, $(NoTitle), $(!REG_VT_DWORD), $(StatsFlag)})
  2370.     ;
  2371.     endif
  2372.  
  2373.     ;
  2374.     ; Enable Force4 mode if required.
  2375.     ;
  2376.  
  2377.     ifstr $(SpeedFlag) == "1"
  2378.     ;
  2379.     set NewValueList = >($(NewValueList),+
  2380.                  {Force4, $(NoTitle), $(!REG_VT_DWORD), 1})
  2381.     ;
  2382.     endif
  2383.  
  2384.     ;
  2385.     ; Enable Force16 mode if required.
  2386.     ;
  2387.  
  2388.     ifstr $(SpeedFlag) == "2"
  2389.     ;
  2390.     set NewValueList = >($(NewValueList),+
  2391.                  {Force16, $(NoTitle), $(!REG_VT_DWORD), 1})
  2392.     ;
  2393.     endif
  2394.  
  2395.     ;
  2396.     ; If this is a PCMCIA adapter we need to a PCMCIA flag.
  2397.     ;
  2398.  
  2399.     ifstr(i) $(Option) == "MDGMPPCMCIA"
  2400.     ;
  2401.     set NewValueList = >($(NewValueList),+
  2402.                  {Pcmcia, $(NoTitle), $(!REG_VT_DWORD), 1})
  2403.     ;
  2404.     endif
  2405.  
  2406.       
  2407.     ;
  2408.     ; And add the parameters to the registry.
  2409.     ;
  2410.  
  2411.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  2412.  
  2413.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2414.     ;
  2415.     goto Shell_Code_Error
  2416.     ;
  2417.     endif
  2418.  
  2419.     set RegistryErrorIndex = $($R0)
  2420.  
  2421.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2422.     ;
  2423.     CloseRegKey $(KeyParameters)
  2424.     goto Fatal_Registry
  2425.     ;
  2426.     endif
  2427.  
  2428.     ;
  2429.     ; If the old LAA has been cleared then so delete the key 
  2430.     ; from registry.
  2431.     ;
  2432.  
  2433.     ifstr $(OldLAA) != ""
  2434.     ;
  2435.     ifstr $(LAA) == ""
  2436.         ;
  2437.         DeleteRegValue $(KeyParameters) NetworkAddress
  2438.         ;
  2439.     endif
  2440.     ;
  2441.     endif
  2442.  
  2443.     ;
  2444.     ; If Force4 mode has been disabled then delete the key.
  2445.     ;
  2446.  
  2447.     ifstr $(OldSpeedFlag) == "1"
  2448.     ;
  2449.     ifstr $(SpeedFlag) != "1"
  2450.         ;
  2451.         DeleteRegValue $(KeyParameters) Force4
  2452.         ;
  2453.     endif
  2454.     ;
  2455.     endif
  2456.  
  2457.     ;
  2458.     ; If Force16 mode has been disabled then delete the key.
  2459.     ;
  2460.  
  2461.     ifstr $(OldSpeedFlag) == "2"
  2462.     ;
  2463.     ifstr $(SpeedFlag) != "2"
  2464.         ;
  2465.         DeleteRegValue $(KeyParameters) Force16
  2466.         ;
  2467.     endif
  2468.     ;
  2469.     endif
  2470.  
  2471.     ;
  2472.     ; If promiscuous mode has been disabled then delete the key.
  2473.     ;
  2474.  
  2475.     ifstr $(OldStatsFlag) != "0"
  2476.     ;
  2477.     ifstr $(StatsFlag) == "0"
  2478.         ;
  2479.         DeleteRegValue $(KeyParameters) PromiscuousModeX
  2480.         ;
  2481.     endif
  2482.     ;
  2483.     endif
  2484.  
  2485.     CloseRegKey $(KeyParameters)
  2486.  
  2487.     EndWait
  2488.  
  2489.     goto Successful
  2490.  
  2491. ; -----------------------------------------------------------------------
  2492. ; Binding section
  2493. ; -----------------------------------------------------------------------
  2494.  
  2495. Binding_Adapter =+
  2496.  
  2497.     set Error = "Binding: Sorry, not yet implemented."
  2498.  
  2499.     goto Fatal
  2500.  
  2501. ; -----------------------------------------------------------------------
  2502. ; Removal section
  2503. ; -----------------------------------------------------------------------
  2504.  
  2505. Remove_Adapter = +
  2506.  
  2507.     StartWait
  2508.  
  2509.     ;
  2510.     ; Remove the software component if required.
  2511.     ;
  2512.  
  2513.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  2514.     ;
  2515.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  2516.         $(ProductSoftwareName)
  2517.  
  2518.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2519.         ;
  2520.         goto Shell_Code_Error
  2521.         ;
  2522.     endif
  2523.  
  2524.     set RegistryErrorIndex = $($R0)
  2525.  
  2526.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2527.         ;
  2528.         goto Fatal_Registry
  2529.         ;
  2530.     endif
  2531.     ;
  2532.  
  2533.     ;
  2534.     ; Or, the hardware component.
  2535.     ;
  2536.  
  2537.     else
  2538.     ;
  2539.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  2540.         $(ProductSoftwareName), $(!NTN_RegBase)     
  2541.  
  2542.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2543.         ;
  2544.         goto Shell_Code_Error
  2545.         ;
  2546.     endif
  2547.  
  2548.     set RegistryErrorIndex = $($R0)
  2549.  
  2550.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2551.         ;
  2552.         goto Fatal_Registry
  2553.         ;
  2554.     endif
  2555.     ;
  2556.     endif
  2557.  
  2558.     EndWait
  2559.  
  2560.     goto End
  2561.  
  2562. ; -----------------------------------------------------------------------
  2563. ; Upgrade Software section.
  2564. ; -----------------------------------------------------------------------
  2565.  
  2566. Upgrade_Software = +
  2567.  
  2568.     StartWait
  2569.  
  2570.     ;
  2571.     ; First determine whether we want to do upgrade or update for software
  2572.     ; or hardware component. Then we will determine whether the Mode is
  2573.     ; update or upgrade.
  2574.     ;
  2575.  
  2576.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  2577.     ;
  2578.         ;
  2579.     ; Upgrade software component
  2580.     ;
  2581.     ; see whether the same version exist or not
  2582.     ;
  2583.  
  2584.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  2585.  
  2586.     ifstr $(KeyProduct) != $(KeyNull)
  2587.         ;
  2588.         GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  2589.         set Version = *($(VersionInfo), 4)
  2590.  
  2591.         ;
  2592.         ; Update the binaries
  2593.         ;
  2594.  
  2595.         shell $(UtilityInf) GetInfFileNameFromRegistry $(KeyProduct)
  2596.  
  2597.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2598.             ;
  2599.         goto Shell_Code_Error
  2600.             ;
  2601.         endif
  2602.  
  2603.         set !UG_Filename = $($R0)
  2604.  
  2605.         ifstr(i) $(!UG_Filename) != ""
  2606.             ;
  2607.         install "Install-Update"
  2608.  
  2609.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  2610.                 ;
  2611.             goto Fatal
  2612.                 ;
  2613.         endif
  2614.             ;
  2615.         endif
  2616.  
  2617.         CloseRegKey $(KeyProduct)
  2618.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  2619.  
  2620.             ;
  2621.         ; Upgrade the version number
  2622.         ;
  2623.  
  2624.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  2625.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  2626.  
  2627.         ifint $(Version) != $(ProductMajorVersion)
  2628.             ;
  2629.            ;
  2630.            ; If the major version number is not the same,
  2631.            ; it is major upgrade. So let Upgrade the product
  2632.            ;
  2633.            ;
  2634.            ; make other upgrade change if necessary
  2635.            ;
  2636.             ;
  2637.         endif
  2638.  
  2639.         CloseRegKey $(KeyProduct)
  2640.  
  2641.             ;
  2642.             ; Install the detection DLL in case we are upgrading from a
  2643.             ; version that did not use detection.
  2644.             ;
  2645.  
  2646.             Shell "" PrepareDetectionDll $(DetectDllName)
  2647.  
  2648.             ifstr(i) $($R0) != STATUS_SUCCESSFUL
  2649.             ;
  2650.                 goto Fatal
  2651.             ;
  2652.             endif
  2653.  
  2654.         ;
  2655.     else
  2656.         ;
  2657.         ;
  2658.         ; Cannot Open software key, goto ERROR
  2659.         ;
  2660.  
  2661.         goto Fatal_Registry
  2662.         ;
  2663.     endif
  2664.     ;
  2665.     else
  2666.     ;
  2667.         ;
  2668.         ; We cannot upgrade the hardware component.
  2669.         ;
  2670.  
  2671.         set Error          = ""
  2672.         set OEM_ABANDON_ON = FALSE
  2673.  
  2674.         goto Not_Supported
  2675.     ;
  2676.     endif
  2677.      
  2678.     EndWait
  2679.                                         
  2680.     goto End
  2681.  
  2682. ; -----------------------------------------------------------------------
  2683. ; Escape hatches
  2684. ; -----------------------------------------------------------------------
  2685.  
  2686. Successful = +
  2687.  
  2688.     goto End
  2689.  
  2690. ; -----------------------------------------------------------------------
  2691.  
  2692. Abandon = +
  2693.  
  2694.     ForListDo $(OEM_ABANDON_OPTIONS)
  2695.     ;
  2696.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  2697.         $(ProductSoftwareName), $($)        
  2698.  
  2699.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2700.         ;
  2701.         goto Shell_Code_Error
  2702.         ;
  2703.     endif
  2704.  
  2705.     set RegistryErrorIndex = $($R0)
  2706.  
  2707.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2708.         ;
  2709.         goto Fatal_Registry
  2710.         ;
  2711.     endif
  2712.     ;
  2713.     EndForListDo
  2714.  
  2715.     ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  2716.     ;
  2717.         ;
  2718.     ; Remove Software Component
  2719.         ;
  2720.  
  2721.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  2722.         $(ProductSoftwareName), FALSE
  2723.  
  2724.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2725.         ;
  2726.         goto Shell_Code_Error
  2727.         ;
  2728.     endif
  2729.  
  2730.     set RegistryErrorIndex = $($R0)
  2731.  
  2732.     ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2733.         ;
  2734.         goto Fatal_Registry
  2735.         ;
  2736.     endif
  2737.     ;
  2738.     endif
  2739.  
  2740.     goto End
  2741.  
  2742. ; -----------------------------------------------------------------------
  2743.  
  2744. Warning = +
  2745.  
  2746.     EndWait
  2747.  
  2748.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  2749.  
  2750.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2751.     ;
  2752.     goto Shell_Code_Error
  2753.     ;
  2754.     endif
  2755.  
  2756.     ifstr(i) $($R1) == "OK"
  2757.     ;
  2758.     goto $(To)
  2759.     ;
  2760.     else-ifstr(i) $($R1) == "CANCEL"
  2761.     ;
  2762.     goto $(From)
  2763.     ;
  2764.     endif
  2765.  
  2766.     goto End
  2767.  
  2768. ; -----------------------------------------------------------------------
  2769.  
  2770. Non_Fatal_Info = +
  2771.  
  2772.     set Severity     = STATUS
  2773.     set CommonStatus = STATUS_USERCANCEL
  2774.     goto Non_Fatal_Msg
  2775.  
  2776. ; -----------------------------------------------------------------------
  2777.  
  2778. Non_Fatal = +
  2779.  
  2780.     set  Severity = NONFATAL
  2781.     goto Non_Fatal_Msg
  2782.  
  2783. ; -----------------------------------------------------------------------
  2784.  
  2785. Non_Fatal_Msg = +
  2786.  
  2787.     EndWait
  2788.  
  2789.     ifstr(i) $(Error) == ""
  2790.     ;
  2791.     set Severity = NONFATAL
  2792.  
  2793.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  2794.  
  2795.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2796.         ;
  2797.         goto Shell_Code_Error
  2798.         ;
  2799.     endif
  2800.  
  2801.     set Error = $($R0)
  2802.     ;
  2803.     endif
  2804.  
  2805.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  2806.  
  2807.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2808.     ;
  2809.     goto Shell_Code_Error
  2810.     ;
  2811.     endif
  2812.  
  2813.     ifstr(i) $($R1) == "OK"
  2814.     ;
  2815.     goto $(From)
  2816.     ;
  2817.     endif
  2818.  
  2819.     goto End
  2820.  
  2821. ; -----------------------------------------------------------------------
  2822.  
  2823. Fatal_Registry = +
  2824.  
  2825.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  2826.  
  2827.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2828.     ;
  2829.     goto Shell_Code_Error
  2830.     ;
  2831.     endif
  2832.  
  2833.     set Error = $($R0)
  2834.  
  2835.     goto Fatal
  2836.  
  2837. ; -----------------------------------------------------------------------
  2838.  
  2839. Fatal = +
  2840.  
  2841.     EndWait
  2842.  
  2843.     ifstr(i) $(Error) == ""
  2844.     ;
  2845.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  2846.  
  2847.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2848.         ;
  2849.         goto Shell_Code_Error
  2850.         ;
  2851.     endif
  2852.  
  2853.     set Error = $($R0)
  2854.     ;
  2855.     endif
  2856.  
  2857.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  2858.  
  2859.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2860.     ;
  2861.     goto Shell_Code_Error
  2862.     ;
  2863.     endif
  2864.  
  2865.     goto Set_Failed
  2866.  
  2867. ; -----------------------------------------------------------------------
  2868.  
  2869. Not_Supported = +
  2870.  
  2871.     EndWait
  2872.  
  2873.     ifstr(i) $(Error) == ""
  2874.     ;
  2875.     Shell $(UtilityInf) RegistryErrorString "OPERATION_UNIMPLEMENTED"
  2876.  
  2877.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2878.         ;
  2879.         goto Shell_Code_Error
  2880.         ;
  2881.     endif
  2882.  
  2883.     set Error = $($R0)
  2884.     ;
  2885.     endif
  2886.  
  2887.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  2888.  
  2889.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2890.     ;
  2891.     goto Shell_Code_Error
  2892.     ;
  2893.     endif
  2894.  
  2895.     goto End
  2896.  
  2897. ; -----------------------------------------------------------------------
  2898.  
  2899. Shell_Code_Error = +
  2900.  
  2901.     EndWait
  2902.  
  2903.     set DlgType      = "MessageBox"
  2904.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  2905.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  2906.     set STF_MB_TYPE  = 1
  2907.     set STF_MB_ICON  = 3
  2908.     set STF_MB_DEF   = 1
  2909.     ui start "Error Message"
  2910.     goto Set_Failed
  2911.  
  2912. ; -----------------------------------------------------------------------
  2913.  
  2914. Set_Failed = +
  2915.  
  2916.     set CommonStatus = STATUS_FAILED
  2917.  
  2918.     ;
  2919.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  2920.     ;
  2921.  
  2922.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  2923.     ;
  2924.     set OEM_ABANDON_ON = FALSE
  2925.     goto Abandon
  2926.     ;
  2927.     endif
  2928.  
  2929.     goto End
  2930.  
  2931. ; -----------------------------------------------------------------------
  2932.  
  2933. End = +
  2934.  
  2935.     goto Term
  2936.  
  2937. ; -----------------------------------------------------------------------
  2938.  
  2939. Term = +
  2940.  
  2941.     Return $(CommonStatus)
  2942.  
  2943. ; -----------------------------------------------------------------------
  2944. ; Install sections
  2945. ; -----------------------------------------------------------------------
  2946.  
  2947. [Files-Inf]
  2948. 1, oemsetup.inf, SIZE=1000, RENAME=$(!UG_Filename)
  2949.  
  2950. [Files-Driver]
  2951. 1, mdgmport.sys, SIZE=40080
  2952. 1, mdgmport.bin, SIZE=46558
  2953.  
  2954. [Files-Helper]
  2955. 1, mdgmpdlg.dll, SIZE=17920
  2956. 1, mdgmpdlg.hlp, SIZE=12672
  2957.  
  2958. [Files-MDGNCDET.DLL]
  2959. 1, mdgncdet.dll, SIZE=47616
  2960.  
  2961. ; -----------------------------------------------------------------------
  2962.  
  2963. [Install-Update]
  2964.  
  2965.    set STF_VITAL        = ""
  2966.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  2967.  
  2968.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2969.    AddSectionFilesToCopyList Files-Helper $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2970.    AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  2971.    AddSectionFilesToCopyList Files-MDGNCDET.DLL $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2972.  
  2973.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  2974.    CopyFilesInCopyList
  2975.  
  2976.    exit
  2977.  
  2978. [Install-Option]
  2979.  
  2980.    set STF_VITAL        = ""
  2981.  
  2982.    AddSectionFilesToCopyList Files-Helper $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2983.    AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  2984.    AddSectionFilesToCopyList Files-MDGNCDET.DLL $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2985.  
  2986.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  2987.    CopyFilesInCopyList
  2988.  
  2989.    exit
  2990.  
  2991. [Source Media Descriptions]
  2992.     1  = "Madge Driver Disk" 
  2993.     2  = "Windows NT Setup CD-ROM Disk"  
  2994.  
  2995. [ProductType]
  2996. STF_PRODUCT  = Winnt
  2997. STF_PLATFORM = I386
  2998.  
  2999. ; ******** End of file OEMSETUP.INF *****************************************
  3000.  
  3001.