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