OEMSETUP.INF Driver File Contents (ntnicdrv.exe)

;-------------------------------------------------------------------
;
;   MODULE NAME:   OEMSETUP.INF
;
;   DESCRIPTION:   Installation parameter script for PIT
;                  adapter driver running under
;                  Microsoft Windows NT.
;
;                  This script is interpreted by SETUP.EXE
;                  during driver installation.  It consists
;                  of the following four required sections
;                  and other supporting sections:
;
;                  1.  Identify
;                  2.  ReturnOptions
;                  3.  InstallOption
;                  4.  Source Media Descriptions
;-------------------------------------------------------------------

;-------------------------------------------------------------------
;   SECTION NAME:       Identify
;
;   DESCRIPTION:        This required section verifies that this
;                       script supports the option currently selected.
;
;   INPUT:              None.
;
;   OUTPUT:             $($R0)      Status
;                       $($R1)      Option Type
;                       $($R2)      Diskette Description
;-------------------------------------------------------------------

[Identify]

    set Status      =   STATUS_SUCCESSFUL
    set OptionType  =   NetAdapter
    set Identifier  =   $(OptionType)
    set Media       =   #("Source Media Descriptions", 1, 1)
    return $(Status) $(OptionType) $(Media)

;-------------------------------------------------------------------
;   SECTION NAME:       ReturnOptions
;
;   DESCRIPTION:        This required section returns the list of
;                       options supported by this script and the
;                       text list representing the options.
;
;
;   INPUT:              $($0)       Language code
;
;   OUTPUT:             $($R0)      Status
;                       $($R1)      Option List
;                       $($R2)      Option Text List
;-------------------------------------------------------------------

[ReturnOptions]

    set Status          =   STATUS_FAILED
    set OptionList      =   {}
    set OptionTextList  =   {}
    set LanguageList    =   ^(LanguagesSupported, 1)


;    Set !G:DebugOutputControl = 1

    ifcontains(i) $($0) not-in $(LanguageList)
        set Status = STATUS_NOLANGUAGE
        goto End_ReturnOptions
    endif

    ifstr(i) $($1) == ""
        goto OK_ReturnOptions
    endif

    set PlatformList = ^(PlatformsSupported, 1)
    Ifcontains(i) $($1) in $(PlatformList)
        goto OK_ReturnOptions
    else
        set Status = STATUS_NOTSUPPORTED
        goto End_ReturnOptions
    endif

OK_ReturnOptions = +
    set OptionList      = ^(Options, 1)
    set OptionTextList  = ^(OptionsText$($0), 1)
    set Status          = STATUS_SUCCESSFUL

End_ReturnOptions = +
    Return $(Status) $(OptionList) $(OptionTextList)

[LanguagesSupported]

    ENG

[PlatformsSupported]

    PCI

[Options]

    IBMTRP

[OptionsTextENG]

    IBMTRP    =   "IBM PCI Token-Ring Adapter"


;-----------------------------------------------------------------
;
;   SECTION NAME:       Source Media Description
;
;   DESCRIPTION:        This is a required DETECT section.
;
;
; Note that TAGFILE = disk1 etc must be separated by whitespace.
; This is a Detect section
;
;------------------------------------------------------------------

[Source Media Descriptions]

    1  = "IBM PCI Token-Ring Adapter Installation Disk", TAGFILE = diskn3
    2  = "Windows NT Setup CD-ROM Disk", TAGFILE = disk2


;-------------------------------------------------------------------
;   SECTION NAME:       InstallOption
;
;   DESCRIPTION:        Main entry point.  Shelled to by main
;                       installation processing or by NCPASHEL.INF
;                       during reconfiguration, removal, update,
;                       etc.  It performs three main functions:
;
;                       1.  Copies files representing options
;                       2.  Configures the installed option
;                       3.  Updates the registry for the installed
;                           option.
;
;   INPUT:              $($0)       Language to use
;                       $($1)       OptionID to install
;                       $($2)       SourceDirectory
;                       $($3)       AddCopy  (YES | NO)
;                       $($4)       DoCopy   (YES | NO)
;                       $($5)       DoConfig (YES | NO)
;
;   OUTPUT:             $($R0)      Status
;
;-------------------------------------------------------------------

[InstallOption]

    StartWait                     ; causes the hourglass cursor to showup

    set Status  =   STATUS_FAILED

    set Option   = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)

    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) NOT-IN $(LanguageList)
        Return STATUS_NOLANGUAGE
    endif

    read-syms GeneralConstants
    read-syms FileConstants
    read-syms FileConstants$(!STF_LANGUAGE)

    detect date

    set-title  $(FunctionTitle)

    set to   = Begin
    set from = Begin

    set CommonStatus = STATUS_SUCCESSFUL

    EndWait

;   -----------------------------------------------------------------
;   Begin   -   Determine what option we are being called with
;   -----------------------------------------------------------------

Begin = +

    Debug-Output "AutoNetBusNumber        = "$(!AutoNetBusNumber)
    Debug-Output "AutoNetInterfaceType    = "$(!AutoNetInterfaceType)
    Debug-Output "LIBHANDLE               = "$(!LIBHANDLE)
    Debug-Output "NTN_InstallMode         = "$(!NTN_InstallMode)
    Debug-Output "NTN_Origination         = "$(!NTN_Origination)
    Debug-Output "NTN_RegBase             = "$(!NTN_RegBase)
    Debug-Output "NTN_ServiceBase         = "$(!NTN_ServiceBase)
    Debug-Output "NTN_SoftwareBase        = "$(!NTN_SoftwareBase)
    Debug-Output "REG_H_LOCAL             = "$(!REG_H_LOCAL)
    Debug-Output "REG_VT_DWORD            = "$(!REG_VT_DWORD)
    Debug-Output "REG_VT_MULTI_SZ         = "$(!REG_VT_MULTI_SZ)
    Debug-Output "REG_VT_SZ               = "$(!REG_VT_SZ)
    Debug-Output "Shell_CODE_OK           = "$(!Shell_CODE_OK)
    Debug-Output "STF_CWDDIR              = "$(!STF_CWDDIR)
    Debug-Output "STF_GUI_UNATTENDED      = "$(!STF_GUI_UNATTENDED)
    Debug-Output "STF_HWND                = "$(!STF_HWND)
    Debug-Output "STF_INSTALL_MODE        = "$(!STF_INSTALL_MODE)
    Debug-Output "STF_LANGUAGE            = "$(!STF_LANGUAGE)
    Debug-Output "STF_NCDETCARD           = "$(!STF_NCDETCARD)
    Debug-Output "STF_NCDETECT            = "$(!STF_NCDETECT)
    Debug-Output "STF_NCDETINFO           = "$(!STF_NCDETINFO)
    Debug-Output "STF_NCOPTION            = "$(!STF_NCOPTION)
    Debug-Output "STF_NCPA_FLUSH_COPYLIST = "$(!STF_NCPA_FLUSH_COPYLIST)
    Debug-Output "STF_NTPATH              = "$(!STF_NTPATH)
    Debug-Output "STF_PLATFORM            = "$(!STF_PLATFORM)
    Debug-Output "STF_WINDOWSSYSPATH      = "$(!STF_WINDOWSSYSPATH)
    Debug-Output "UG_Filename             = "$(!UG_Filename)

    ;   Typical values:

    ;  AutoNetBusNumber        =
    ;  AutoNetInterfaceType    =
    ;  LIBHANDLE               = |1985806336
    ;  NTN_InstallMode         = install
    ;  NTN_Origination         = ncpa or install
    ;  NTN_RegBase             =
    ;  NTN_ServiceBase         = SYSTEM\CurrentControlSet\SERVICES
    ;  NTN_SoftwareBase        = SOFTWARE
    ;  REG_H_LOCAL             = |-2147483646
    ;  REG_VT_DWORD            = 4
    ;  REG_VT_MULTI_SZ         = 7
    ;  REG_VT_SZ               = 1
    ;  Shell_CODE_OK           = 0
    ;  STF_CWDDIR              = C:\WINNT\system32\
    ;  STF_GUI_UNATTENDED      = NO
    ;  STF_HWND                = 8009e
    ;  STF_INSTALL_MODE        = CUSTOM
    ;  STF_LANGUAGE            = ENG
    ;  STF_NCDETCARD           = 0
    ;  STF_NCDETECT            = NO (NCPA) or YES (SETUP)
    ;  STF_NCDETINFO           = {}
    ;  STF_NCOPTION            =
    ;  STF_NCPA_FLUSH_COPYLIST =
    ;  STF_NTPATH              = C:\WINNT\System32
    ;  STF_PLATFORM            = I386
    ;  STF_WINDOWSSYSPATH      = C:\WINNT\System32
    ;  UG_Filename             =

    ifstr(i) $(!NTN_InstallMode) == DeInstall
        set from = fatal
        set to   = fatal
        goto RemoveAdapter
    endif

    ifstr(i) $(!NTN_InstallMode) == Update
        set from = fatal
        set to   = fatal
        goto UpgradeSoftware
    endif

    ifstr(i) $(!NTN_InstallMode) == Bind
        set from = fatal
        set to   = fatal
        goto BindingAdapter
    endif

    ifstr(i) $(!NTN_InstallMode) == Configure
        set CommonStatus = STATUS_REBOOT
        Debug-Output "$(ProductKeyName)      = "$(ProductKeyName)
        Debug-Output "$(!NTN_RegBase)        = "$(!NTN_RegBase)
        ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
            Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
            set Error = $($R0)
            set from  = end
            set to    = end
            Debug-Output "Going to NonFatalInfo"
            goto NonFatalInfo
        endif
        set from = fatal
        set to   = fatal
        Debug-Output "to = fatal & from = fatal & Going to ConfigureAdapter"
        goto ConfigureAdapter
    endif

    set OEM_ABANDON_OPTIONS = {}
    set OEM_ABANDON_SOFTWARE = FALSE
    set OEM_ABANDON_ON = TRUE
    set from = fatal
    set to = fatal
    goto InstallAdapter

;   -----------------------------------------------------------------
;   InstallAdapter   -
;   -----------------------------------------------------------------

InstallAdapter = +

    Debug-Output "Inside InstallAdapter  "
    Debug-Output "ProductKeyName = "$(ProductKeyName)

    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct

    Debug-Output " Just after OpenRegKey "
    Debug-Output "KeyProduct = "$(KeyProduct)
    Debug-Output "KeyNull = "$(KeyNull)

    Ifstr $(KeyProduct) == $(KeyNull)
        set OldVersionExisted = $(FALSE)
        goto LoadDLL
    endif

;   -----------------------------------------------------------------
;   OldInstall   -
;   -----------------------------------------------------------------

OldInstall = +

    CloseRegKey $(KeyProduct)

    ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
        Debug-Output "(!NTN_RegBase)="$(!NTN_RegBase)
        Debug-Output "(ProductKeyName)="$(ProductKeyName)
        Debug-Output "(ProductSoftwareTitle)="$(ProductSoftwareTitle)
        Debug-Output "(ProductVersion)="$(ProductVersion)
        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
            $(ProductVersion)

        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif

        goto end

    endif

    Shell $(UtilityInf), CardExistedDlg

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif

    ifstr(i) $($R1) != "OK"
        Set CommonStatus = STATUS_USERCANCEL
        goto end
    endif

    set OldVersionExisted = $(TRUE)

;   -----------------------------------------------------------------
;   LoadDLL   -  Copy the DLL and help file from diskette
;   -----------------------------------------------------------------

LoadDLL = +

    set OldSource = $(!STF_SRCDIR)

    Debug-Output "OldSource = "$(OldSource)
    Debug-Output "STF_CWDDIR = "$(!STF_CWDDIR)
    Debug-Output "STF_SRCDIR = "$(!STF_SRCDIR)

    Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR)

    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
    Debug-Output "ShellCode = "$($ShellCode)
        goto fatal
    endif
    Ifstr(i) $($R0) == STATUS_FAILED
    Debug-Output "R0  = "$($R0)
        goto fatal
    endif
    Ifstr(i) $($R0) == STATUS_USERCANCEL
        goto end
    endif

    set !STF_SRCDIR = $($R1)

    install "Install-Dll"

    set !STF_SRCDIR = $(OldSource)


    ;   ------------------------------------------------------------
    ;   Start of PCI logic
    ;   ------------------------------------------------------------

        Set PromptForPci = "NO"
        ifstr(i) $(!STF_BUSTYPE) == "PCI"
                Debug-Output "STF_BUSTYPE   = "$(!STF_BUSTYPE)
                Set PromptForPci = "YES"
        else
                ForListDo $(!STF_BUSTYPELIST)
                        ifstr(i) $($) == "PCI"
                                Set PromptForPci = "YES"
                        endif
                EndForListDo
        endif

             set Vendor_ID = 4116
             set Device_ID = $(DEVICE_ID)

               Shell $(UtilityInf), GetPCIInformation, $(Vendor_ID), $(Device_ID)

             ;  The reasoning here is that if OS is NT 3.50 then return code
             ;  would be NOT OK

               ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   set PCI_List = {{0,-1,0}}
               else
                   set PCI_List = $($R0)
               endif

              set AdapterList = {}

              ifstr(i) $(PCI_List) != {}

                Debug-Output "PCI_List   = "$(PCI_List)

                 ForListDo $(PCI_List)

                     Set BusSlotPCI = $($)

                     Set BusNumber     =   *($(BusSlotPCI),1)
                     Set SlotNumber    =   *($(BusSlotPCI),2)
                     Set NetcardId     =   $(PIT_ID)
                     Set BusSlotPCI    =   {$(BusNumber),$(SlotNumber),$(NetcardId)}
                     Set AdapterList   =   >($(AdapterList),$(BusSlotPCI))
                 EndForListDo   ; End of PCI_List
              endif

      Debug-Output "AdapterList  ="$(AdapterList)

    ;   ------------------------------------------------------------
    ;   End of PCI logic
    ;   ------------------------------------------------------------

  ifstr(i) $(AdapterList) == {}
        Debug-Output "Did not find any PIT adapter"
        set Error = $(CANNOT_FIND_ANY_CARD)
        set CommonStatus = STATUS_USERCANCEL
        set from = "end"
        goto nonfatal
  endif

;   -----------------------------------------------------------------
;   Prompt for type of adapter to install
;   -----------------------------------------------------------------
;   Here version is used in place of slotnumber to determine whether
;   the system is running NT 3.50 or 3.51.
;   if version = -1 then NT3.50


    set version = *(*($(AdapterList),1),2)
     Debug-Output "version = "$(version)

    ifint  $(version) == -1
       set ParmTypes = "3"
    else
       set ParmTypes = "2"
    endif

    Debug-Output "ParmTypes = "$(ParmTypes)

    ifint $(OldVersionExisted) == $(FALSE)
        goto NewDriverInstall
    else
        goto AfterNewDriverInstall
    endif




NewDriverInstall = +

    Ifstr(i) $(DoCopy) == "YES"
       Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
       Ifint $($ShellCode) != $(!SHELL_CODE_OK)
           Goto ShellCodeError
       Else-Ifstr(i) $($R0) == STATUS_FAILED
           Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
           ifint $($ShellCode) != $(!SHELL_CODE_OK)
               goto ShellCodeError
           endif
           set Error = $($R0)
           Goto fatal
       Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
           Goto successful
       Endif
       Set SrcDir = $($R1)
    Endif

    Debug-Output "About to call install-option"
    install "Install-Option"
    Debug-Output "Just after install-option"

    ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
       Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
       ifint $($ShellCode) != $(!SHELL_CODE_OK)
           goto ShellCodeError
       endif
       set Error = $($R0)
       Debug-Output "Error = "$(Error)
       goto fatal
    endif

       Debug-Output "Manufacturer = "$(Manufacturer)
       Debug-Output "ProductSoftwareName = "$(ProductSoftwareName)
       Debug-Output "ProductSoftwareTitle = "$(ProductSoftwareTitle)
       Debug-Output "STF_CONTEXTINFNAME = "$(STF_CONTEXTINFNAME)
       Debug-Output "ProductSoftwareImagePath = "$(ProductSoftwareImagePath)
       Debug-Output "NetEventDLL = "$(NetEventDLL)

       ;Manufacturer  = Microsoft
       ;ProductSoftwareName = IBMTRP
       ;ProductSoftwareTitle = IBM PCI Token-Ring Adapter Driver
       ;STF_CONTEXTINFNAME = C:\WINNT35F\System32\oemnad0.inf
       ;ProductSoftwareImagePath = %SystemRoot%\system32\drivers\IBMTRP.sys
       ;NetEventDLL = %SystemRoot%\System32\netevent.dll

    Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
        $(ProductSoftwareName), +
        $(ProductSoftwareName), +
        $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
        $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
        $(NetEventDLL)

    Set OEM_ABANDON_SOFTWARE = TRUE

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif

    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
        EndWait
        CloseRegKey $($R1)
        CloseRegKey $($R2)
        CloseRegKey $($R3)
        CloseRegKey $($R4)
        CloseRegKey $($R5)
        goto FatalRegistry
    endif

    Set SoftProductKey      = $($R1)
    Set SoftNetRuleKey      = $($R2)
    Set SoftServiceKey      = $($R3)
    Set SoftParameterKey    = $($R4)
    Set SoftLinkageKey      = $($R5)

    set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
                       {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
                       {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
                       {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
                       {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
                       {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
                       {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}


       Debug-Output "NewValueList = "$(NewValueList)
       Debug-Output "SoftProductKey ="$(SoftProductKey)
       Debug-Output "SoftNetRuleKey ="$(SoftNetRuleKey)
       Debug-Output "SoftServiceKey ="$(SoftServiceKey)
       Debug-Output "SoftParameterKey ="$(SoftParameterKey)
       Debug-Output "SoftLinkageKey ="$(SoftLinkageKey)

       ;NewValueList = {"{""SoftwareType"",""0"",""1"",""driver""}","{""MajorVersion"",""0"",""4"",""3""}","{""MinorVersion"",""0"",""4"",""1""}","{""Title"",""0"",""1"",""IBM PCI Token-Ring Adapter Driver""}","{""Description"",""0"",""1"",""IBM
       ;               PCI Token-Ring Adapter Driver""}","{""ServiceName"",""0"",""1"",""IBMTRP""}","{""InstallDate"",""0"",""4"",""822066521""}"}

    Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif

    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
        EndWait
        CloseRegKey $(SoftProductKey)
        CloseRegKey $(SoftNetRuleKey)
        CloseRegKey $(SoftServiceKey)
        CloseRegKey $(SoftParameterKey)
        CloseRegKey $(SoftLinkageKey)
        goto FatalRegistry
    endif

    set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
                        {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
                        {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
                        {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
                        {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
                        {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}

    Debug-Output "NewValueList = "$(NewValueList)

    Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif

    set RegistryErrorIndex = $($R0)
    CloseRegKey $(SoftProductKey)
    CloseRegKey $(SoftNetRuleKey)
    CloseRegKey $(SoftServiceKey)
    CloseRegKey $(SoftParameterKey)
    CloseRegKey $(SoftLinkageKey)
    Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
        EndWait
        goto FatalRegistry
    endif

AfterNewDriverInstall = +

    ForListDo $(AdapterList)

        Set BusSlotPci = $($)

        Set BusNumber  = *($(BusSlotPci),1)
        Set SlotNumber = *($(BusSlotPci),2)
        Set NetcardId  = *($(BusSlotPci),3)

        ;       -------------------------------------------------
        ;       If netcard is already installed, skip this entry
        ;       -------------------------------------------------

        Debug-Output "BusSlotPci = "$(BusSlotPci)
        Debug-Output "BusNumber = "$(BusNumber)
        Debug-Output "SlotNumber = "$(SlotNumber)
        Debug-Output "NetcardId = "$(NetcardId)

        Set AlreadyInstalled = "NO"

        ;   Make a list of all the installed netcards
        ;   OpenRegKey gets a handle to a Key

        OpenRegKey +
                        $(!REG_H_LOCAL),+
                        "",+
                        $(NetworkCardKeyName),+
                        $(MAXIMUM_ALLOWED),+
                        IE_KeyNetcards

        Ifstr $(IE_KeyNetcards) == $(KeyNull)
                set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
                goto FatalRegistry
        endif

        EnumRegKey $(IE_KeyNetcards) IE_KeyNameList

        ;       Compare all the NetworkCards entries to see whether
        ;       they match the current bus number, slot number, title,
        ;       and product name.

        Debug-Output "IE_KeyNameList ="$(IE_KeyNameList)

        ForListDo  $(IE_KeyNameList)
          set IE_KeyName = *($($),1)
          OpenRegKey +
                  $(IE_KeyNetcards),+
                  "",+
                  $(IE_KeyName),+
                  $(MAXIMUM_ALLOWED),+
                  IE_Card

          Debug-Output "IE_Card = "$(IE_Card)

          Ifstr $(IE_Card) == $(KeyNull)
             set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
             goto FatalRegistry
          endif

          GetRegValue $(IE_Card),"Description", DescriptionInfo
          GetRegValue $(IE_Card),"ProductName", ProductNameInfo
          set CardDescription     = *($(DescriptionInfo), 4)
          set CardProductName     = *($(ProductNameInfo), 4)

          Debug-Output "CardDescription = "$(CardDescription)
          Debug-Output "ProductHardwareDescription = "$(ProductHardwareDescription)
          Debug-Output "CardProductName = "$(CardProductName)
          Debug-Output "ProductHardwareName = "$(ProductHardwareName)

          ifstr(i) $(CardDescription) == $(ProductHardwareDescription)
            ifstr(i) $(CardProductName) == $(ProductHardwareName)

                ;       The product type matches.  Now check for a
                ;       match on bus number, slot number, and dual
                ;       port.

                GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo

                Set ServiceName = *($(ServiceNameInfo), 4)

                Debug-Output "ServiceName ="$(ServiceName)

                OpenRegKey +
                        $(!REG_H_LOCAL),+
                        "",+
                        "SYSTEM\CurrentControlSet\Services\"$(ServiceName)"\Parameters",+
                        $(MAXIMUM_ALLOWED),+
                        IE_KeyService

                Ifstr $(IE_KeyService) == $(KeyNull)
                   set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
                   goto FatalRegistry
                endif

                ;       We are now in the parameters key for the adapter
                ;       to which we are comparing the current adapter

                GetRegValue $(IE_KeyService), "BusNumber", BusInfo
                set CardBusNum = *($(BusInfo), 4)

                GetRegValue $(IE_KeyService), "SlotNumber", SlotInfo
                set CardSlotNum = *($(SlotInfo), 4)


                Debug-Output "CardBusNum ="$(CardBusNum)
                Debug-Output "BusNumber ="$(BusNumber)

                ifint $(CardBusNum) == $(BusNumber)
                   ifint $(CardSlotNum) == $(SlotNumber)
                              Set AlreadyInstalled = "YES"
                   endif
                endif
            endif
          endif
        EndForListDo

      ifstr $(AlreadyInstalled) == "YES"
              goto NextAdapter
      endif

      ;       -------------------------------------------------
      ;       The netcard has not yet been installed.  Add
      ;       it now.
      ;       -------------------------------------------------

      Shell $(UtilityInf), AddHardwareComponent, +
          $(ProductHardwareName),+
          $(STF_CONTEXTINFNAME),+
          $(ProductKeyName)

      Debug-Output "ProductKeyName ="$(ProductKeyName)

      ifint $($R4) != -1
          Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
      endif

      ifint $($ShellCode) != $(!SHELL_CODE_OK)
          goto ShellCodeError
      endif

      set RegistryErrorIndex = $($R0)

      Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
          EndWait
          CloseRegKey $($R1)
          CloseRegKey $($R2)
          CloseRegKey $($R3)
          goto FatalRegistry
      endif

      Set HardNetCardKey      = $($R1)
      Set HardNetRuleKey      = $($R2)
      Set HardParameterKey    = $($R3)
      Set AdapterNumber       = $($R4)

      Debug-Output "HardNetCardkey = "$(HardNetCardKey)
      Debug-Output "HardNetRuleKey = "$(HardNetRuleKey)
      Debug-Output "HardParameterKey = "$(HardParameterKey)
      Debug-Output "AdapterNumber = "$(AdapterNumber)
      Debug-Output "NetcardId = "$(NetcardId)
      Debug-Output "SlotNumber = "$(SlotNumber)

      ifint $(NetcardId) == $(PIT_ID)
          set MyTitle = "["$(AdapterNumber)"] IBM PCI Token-Ring Adapter"
      endif

      Debug-Output "MyTitle = "$(MyTitle)

      Set MyService = "IBMTRP"$(AdapterNumber)

      Set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
                         {Title,$(NoTitle),$(!REG_VT_SZ),$(MyTitle)},+
                         {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
                         {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
                         {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
                         {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}

      Debug-Output "NewValueList = "$(NewValueList)
      Debug-Output "HardNetCardKey = "$(HardNetCardKey)

      Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)

      ifint $($ShellCode) != $(!SHELL_CODE_OK)
          goto ShellCodeError
      endif


    ; --------------------------------------------------------------
    ; Now build the Parameter List and pass it
    ; to the DLL.
    ; --------------------------------------------------------------

    ;   -------------------------------------------------------------
    ;   For each parameter that was found, load it into the
    ;   parameter string that will be passed.  The parameter string
    ;   must have the format "KEYWORD=VALUE,KEYWORD=VALUE,..."
    ;   The keyword names are case-sensitive.  Order is not important.
    ;   -------------------------------------------------------------


        ;   ---------------------------------------------------------
        ;   PIT adapter.  Parameters are:

        ;       ParmTypes          (not visible to user)
        ;   1.  CardId           (NOTE: keyword is CardId=1014003E)
        ;   2.  NetAddress
        ;   3.  DataRate
        ;   4.  BusType            (not visible to user)
        ;   5.  BusNumber          (NT 3.50 visible/ NT 3.51 not visible to user)
        ;       MediaType          (not visible to user - used by some protocol stacks
        ;                           like SNA etc to differentiate TR & Ethernet
        ;                           TR = 2 & Ethernet = 1)
        ;   6.  FullDuplex
        ;   7.  LoopBack
        ;   8.  MinRcvBuffs
        ;   9.  RcvBuffSize
        ;  10.  MaxTransmits
        ;  11.  MaxTxFrameSize
        ;  12.  EnableTxEofInt
        ;  13.  TxRetries    - This parameter removed in v1.5, due to hardwr bug
        ;  14.  TxPriMax
        ;  15.  TxPriThresh
        ;  16.  LLCOnly
        ;  17.  TraceHead
        ;   ---------------------------------------------------------

        ;   Write parameters into dialog input parameter string

        Set ParmList = "CardId="$(PIT_ID)",ParmTypes="$(ParmTypes)",MyTitle="$(MyTitle)
        Debug-Output "ParmList is ("$(ParmList)")"

        set NetAddress               = ""
        set DataRate                 = ""
        set FullDuplex               = ""
        set LoopBack                 = ""
        set MinRcvBuffs              = ""
        set RcvBuffSize              = ""
        set MaxTransmits             = ""
        set MaxTxFrameSize           = ""
        set EnableTxEofInt           = ""
        ; set TxRetries                = "" - This paramtr removed
        set TxPriMax                 = ""
        set TxPriThresh              = ""
        set LLCOnly                  = ""
        set TraceHead                = ""

       ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
       goto AfterDll
       endif

       ifstr(i) $(ParmTypes) == "2"
        LoadLibrary "X" $(TrpinstDLL) hDLL
        LibraryProcedure Result $(hDLL) PitTokenRing $(ParmList)
        FreeLibrary $(hDLL)
       else-ifstr(i) $(ParmTypes) == "3"
        LoadLibrary "X" $(TrpinstDLL) hDLL
        LibraryProcedure Result $(hDLL) PitTokenRingNT350 $(ParmList)
        FreeLibrary $(hDLL)
       endif

AfterDll = +
        Debug-Output "Result = "$(Result)

        ;   Extract parameters from result string

        Split-String $(Result) "," ResultList
        ForListDo $(ResultList)
            Set Token = $($)
            ifstr $(Token) != ","
                Split-String $(Token) "=" KeyEqualsValue
                Set Key     =   *($(KeyEqualsValue), 1)
                Set Value   =   *($(KeyEqualsValue), 3)
                ifstr $(Key) == "STATUS"
                    ifstr $(Value) != "OK"
                        Set CommonStatus = STATUS_USERCANCEL
                        Debug-Output "Cancel button pressed in PitTokenRing()"
                        goto abandon
                    endif
                else-ifstr  $(Key) == "ParmTypes"
                    Set ParmTypes = $(Value)
                else-ifstr  $(Key) == "CardId"
                    Set CardId = $(Value)
                else-ifstr  $(Key) == "MyTitle"
                    Set MyTitle = $(Value)
                else-ifstr  $(Key) == "NetAddress"
                    set NetAddress       = $(Value)
                else-ifstr  $(Key) == "DataRate"
                    set DataRate         = $(Value)
                else-ifstr  $(Key) == "FullDuplex"
                    set FullDuplex       = $(Value)
                else-ifstr  $(Key) == "LoopBack"
                    set LoopBack         = $(Value)
                else-ifstr  $(Key) == "BusNumber"
                    set BusNumber        = $(Value)
                else-ifstr  $(Key) == "MinRcvBuffs"
                    set MinRcvBuffs      = $(Value)
                else-ifstr  $(Key) == "RcvBuffSize"
                    set RcvBuffSize      = $(Value)
                else-ifstr  $(Key) == "MaxTransmits"
                    set MaxTransmits      = $(Value)
                else-ifstr  $(Key) == "MaxTxFrameSize"
                    set MaxTxFrameSize     = $(Value)
                else-ifstr  $(Key) == "EnableTxEofInt"
                    set EnableTxEofInt   = $(Value)
                ;else-ifstr  $(Key) == "TxRetries"
                ;    set TxRetries        = $(Value)
                else-ifstr  $(Key) == "TxPriMax"
                    set TxPriMax         = $(Value)
                else-ifstr  $(Key) == "TxPriThresh"
                    set TxPriThresh      = $(Value)
                else-ifstr  $(Key) == "LLCOnly"
                    set LLCOnly          = $(Value)
                endif
            endif
        EndForListDo


        set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
        set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
        set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
                            {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
                            {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
                            {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}

        Debug-Output $(NewValueList)
        Debug-Output "TempProdName ="$(TempProdName)
        Debug-Output "HardNetRuleKey ="$(HardNetRuleKey)

        Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)

        ;   -------------------------------------------------------
        ;   Build the new value list.  Add common parameters first
        ;   -------------------------------------------------------

        Set NewValueList = {}

        Set List = {AdapterBusType,0,$(!REG_VT_DWORD),5}
        Set NewValueList = >($(NewValueList),$(List))
        Set List = {BusNumber,0,$(!REG_VT_DWORD),$(BusNumber)}
        Set NewValueList = >($(NewValueList),$(List))
        Set List = {BusType,0,$(!REG_VT_DWORD),5}
        Set NewValueList = >($(NewValueList),$(List))
        Set List = {CardId,0,$(!REG_VT_DWORD),$(PIT_ID)}
        Set NewValueList = >($(NewValueList),$(List))
        Set List = {MediaType,0,$(!REG_VT_DWORD),2}
        Set NewValueList = >($(NewValueList),$(List))
        Set List = {ParmTypes,0,$(!REG_VT_SZ),$(ParmTypes)}
        Set NewValueList = >($(NewValueList),$(List))
        Set List = {TraceHead,0,$(!REG_VT_DWORD),$(TraceHead)}
        Set NewValueList = >($(NewValueList),$(List))

        ifint $(SlotNumber) != -1
            Set List = {SlotNumber,0,$(!REG_VT_DWORD),$(SlotNumber)}
            Debug-Output "Adding "$(List)" to NewValueList"
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifstr $(NetAddress) != ""
            Set List = {NetAddress,0,$(!REG_VT_SZ),$(NetAddress)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifstr $(DataRate) != ""
            Set List = {DataRate,0,$(!REG_VT_SZ),$(DataRate)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifstr $(FullDuplex) != ""
            Set List = {FullDuplex,0,$(!REG_VT_SZ),$(FullDuplex)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifstr $(LoopBack) != ""
            Set List = {LoopBack,0,$(!REG_VT_SZ),$(LoopBack)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifstr $(EnableTxEofInt) != ""
            Set List = {EnableTxEofInt,0,$(!REG_VT_SZ),$(EnableTxEofInt)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifstr $(LLCOnly) != ""
            Set List = {LLCOnly,0,$(!REG_VT_SZ),$(LLCOnly)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifint $(MinRcvBuffs) != ""
            Set List = {MinRcvBuffs,0,$(!REG_VT_DWORD),$(MinRcvBuffs)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifint $(RcvBuffSize) != ""
            Set List = {RcvBuffSize,0,$(!REG_VT_DWORD),$(RcvBuffSize)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifint $(MaxTransmits) != ""
            Set List = {MaxTransmits,0,$(!REG_VT_DWORD),$(MaxTransmits)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifint $(MaxTxFrameSize) != ""
            Set List = {MaxTxFrameSize,0,$(!REG_VT_DWORD),$(MaxTxFrameSize)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ; ifint $(TxRetries) != ""
        ;    Set List = {TxRetries,0,$(!REG_VT_DWORD),$(TxRetries)}
        ;    Set NewValueList = >($(NewValueList),$(List))
        ; endif

        ifint $(TxPriMax) != ""
            Set List = {TxPriMax,0,$(!REG_VT_DWORD),$(TxPriMax)}
            Set NewValueList = >($(NewValueList),$(List))
        endif

        ifint $(TxPriThresh) != ""
            Set List = {TxPriThresh,0,$(!REG_VT_DWORD),$(TxPriThresh)}
            Set NewValueList = >($(NewValueList),$(List))
        endif


        Debug-Output "NewValueList = "$(NewValueList)
        Debug-Output "HardParameterKey = "$(HardParameterKey)

        Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)

        ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
              Shell "" ,AddDefaultNetCardParameters,$(HardParameterKey)
        endif

        CloseRegKey $(HardNetCardKey)
        CloseRegKey $(HardNetRuleKey)
        CloseRegKey $(HardParameterKey)

        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif

NextAdapter = +

    EndForListDo           ; End of AdapterList

LastAdapter = +

    EndWait

    goto successful

ConfigureAdapter = +

    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetCardKey
    ifstr(i) $(NetCardKey) == ""
        set CommonStatus = STATUS_USERCANCEL
        goto successful
    endif
    GetRegValue $(NetCardKey) "ServiceName" ServiceInfo
    set ServiceName = *($(ServiceInfo),4)
    GetRegValue $(NetCardKey) "Title" TitleInfo
    set MyTitle = *($(TitleInfo),4)
    CloseRegKey $(NetCardKey)

    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
    ifstr(i) $(ParamKey) == ""
        goto successful
    endif


    ; ParamKey is the open handle to "IBMTRP1-Parameter" key

    set BusType             = ""
    set SlotNumber          = ""
    set NetAddress          = ""
    set DataRate            = ""
    set FullDuplex          = ""
    set LoopBack            = ""
    set BusNumber           = ""
    set MinRcvBuffs         = ""
    set RcvBuffSize         = ""
    set MaxTransmits        = ""
    set MaxTxFrameSize      = ""
    set EnableTxEofInt      = ""
    set TxRetries           = ""
    ; set TxPriMax            = ""
    set TxPriThresh         = ""
    set LLCOnly             = ""
    set ParmTypes           = ""
    set TraceHead           = ""
    set ParmList            = "CardId="$(PIT_ID)",MyTitle="$(MyTitle)

    EnumRegValue $(ParamKey) ValueList

    ForListDo $(ValueList)

       set ValueItem = $($)
       set Key       = *($(ValueItem),1)
       set Value     = *($(ValueItem),4)

       ifstr(i)  $(Key) == "NetAddress"
           set NetAddress       = $(Value)
           set ParmList = $(ParmList)",NetAddress="$(Value)
       else-ifstr(i)  $(Key) == "BusType"
           set BusType         = $(Value)
           set ParmList = $(ParmList)",BusType="$(Value)
       else-ifstr(i)  $(Key) == "MyTitle"
           set MyTitle         = $(Value)
           set ParmList = $(ParmList)",MyTitle="$(Value)
       else-ifstr(i)  $(Key) == "SlotNumber"
           set SlotNumber       = $(Value)
           set ParmList = $(ParmList)",SlotNumber="$(Value)
       else-ifstr(i)  $(Key) == "ParmTypes"
           set ParmTypes       = $(Value)
           set ParmList = $(ParmList)",ParmTypes="$(Value)
       else-ifstr(i)  $(Key) == "DataRate"
           set DataRate         = $(Value)
           set ParmList = $(ParmList)",DataRate="$(Value)
       else-ifstr(i)  $(Key) == "FullDuplex"
           set FullDuplex       = $(Value)
           set ParmList = $(ParmList)",FullDuplex="$(Value)
       else-ifstr(i)  $(Key) == "LoopBack"
           set LoopBack         = $(Value)
           set ParmList = $(ParmList)",LoopBack="$(Value)
       else-ifstr(i)  $(Key) == "BusNumber"
           set BusNumber        = $(Value)
           set ParmList = $(ParmList)",BusNumber="$(Value)
       else-ifstr(i)  $(Key) == "MinRcvBuffs"
           set MinRcvBuffs       = $(Value)
           set ParmList = $(ParmList)",MinRcvBuffs="$(Value)
       else-ifstr(i)  $(Key) == "RcvBuffSize"
           set RcvBuffSize      = $(Value)
           set ParmList = $(ParmList)",RcvBuffSize="$(Value)
       else-ifstr(i)  $(Key) == "MaxTransmits"
           set MaxTransmits      = $(Value)
           set ParmList = $(ParmList)",MaxTransmits="$(Value)
       else-ifstr(i)  $(Key) == "MaxTxFrameSize"
           set MaxTxFrameSize     = $(Value)
           set ParmList = $(ParmList)",MaxTxFrameSize="$(Value)
       else-ifstr(i)  $(Key) == "EnableTxEofInt"
           set EnableTxEofInt   = $(Value)
           set ParmList = $(ParmList)",EnableTxEofInt="$(Value)
      ; else-ifstr(i)  $(Key) == "TxRetries"
      ;     set TxRetries        = $(Value)
      ;     set ParmList = $(ParmList)",TxRetries="$(Value)
       else-ifstr(i)  $(Key) == "TxPriMax"
           set TxPriMax         = $(Value)
           set ParmList = $(ParmList)",TxPriMax="$(Value)
       else-ifstr(i)  $(Key) == "TxPriThresh"
           set TxPriThresh      = $(Value)
           set ParmList = $(ParmList)",TxPriThresh="$(Value)
       else-ifstr(i)  $(Key) == "LLCOnly"
           set LLCOnly          = $(Value)
           set ParmList = $(ParmList)",LLCOnly="$(Value)
       endif
    EndForListDo

    Debug-Output "ParmList ="$(ParmList)


    ifstr(i) $(ParmTypes) == "2"
      LoadLibrary "X" $(TrpinstDLL) hDLL
      LibraryProcedure Result $(hDLL) PitTokenRing $(ParmList)
      FreeLibrary $(hDLL)
    else-ifstr(i) $(ParmTypes) == "3"
      LoadLibrary "X" $(TrpinstDLL) hDLL
      LibraryProcedure Result $(hDLL) PitTokenRingNT350 $(ParmList)
      FreeLibrary $(hDLL)
    endif

    set BusType              = ""
    set SlotNumber           = ""
    set NetAddress           = ""
    set DataRate             = ""
    set FullDuplex           = ""
    set LoopBack             = ""
    set MinRcvBuffs          = ""
    set RcvBuffSize          = ""
    set MaxTransmits         = ""
    set MaxTxFrameSize       = ""
    set EnableTxEofInt       = ""
    ;set TxRetries            = ""
    set TxPriMax             = ""
    set TxPriThresh          = ""
    set LLCOnly              = ""
    set ParmTypes            = ""
    set TraceHead            = ""


    ;   Extract parameters from result string

    Split-String $(Result) "," ResultList
    ForListDo $(ResultList)
        Set Token = $($)
        ifstr $(Token) != ","
            Split-String $(Token) "=" KeyEqualsValue
            Set Key     =   *($(KeyEqualsValue), 1)
            Set Value   =   *($(KeyEqualsValue), 3)
            ifstr $(Key) == "STATUS"
                ifstr $(Value) != "OK"
                    Set CommonStatus = STATUS_USERCANCEL
                    Debug-Output "Cancel button pressed in PitTokenRing()"
                    goto end
                endif
            else-ifstr  $(Key) == "ParmTypes"
                Set ParmTypes = $(Value)
            else-ifstr  $(Key) == "CardId"
                Set CardId = $(Value)
            else-ifstr  $(Key) == "BusType"
                set BusType         = $(Value)
            else-ifstr  $(Key) == "SlotNumber"
                set SlotNumber       = $(Value)
            else-ifstr  $(Key) == "NetAddress"
                set NetAddress       = $(Value)
            else-ifstr  $(Key) == "DataRate"
                set DataRate         = $(Value)
            else-ifstr  $(Key) == "FullDuplex"
                set FullDuplex       = $(Value)
            else-ifstr  $(Key) == "LoopBack"
                set LoopBack         = $(Value)
            else-ifstr  $(Key) == "BusNumber"
                set BusNumber        = $(Value)
            else-ifstr  $(Key) == "MinRcvBuffs"
                set MinRcvBuffs       = $(Value)
            else-ifstr  $(Key) == "RcvBuffSize"
                set RcvBuffSize      = $(Value)
            else-ifstr  $(Key) == "MaxTransmits"
                set MaxTransmits      = $(Value)
            else-ifstr  $(Key) == "MaxTxFrameSize"
                set MaxTxFrameSize     = $(Value)
            else-ifstr  $(Key) == "EnableTxEofInt"
                set EnableTxEofInt   = $(Value)
           ; else-ifstr  $(Key) == "TxRetries"
           ;     set TxRetries        = $(Value)
            else-ifstr  $(Key) == "TxPriMax"
                set TxPriMax         = $(Value)
            else-ifstr  $(Key) == "TxPriThresh"
                set TxPriThresh      = $(Value)
            else-ifstr  $(Key) == "LLCOnly"
                set LLCOnly          = $(Value)
            else-ifstr  $(Key) == "TraceHead"
                set TraceHead          = $(Value)
            endif
        endif
    EndForListDo


    ; Remove the parameters & rebuild the parameters based on user input

    EnumRegValue $(ParamKey) OldValueList

    Debug-Output "OldValueList="$(OldValueList)

    ForListDo $(OldValueList)
        set ValueItem = $($)
        set ValueName = *($(ValueItem),1)
        Debug-Output "Deleting value name="$(ValueName)
        DeleteRegValue $(ParamKey) $(ValueName)
    EndForListDo


    ;   Build the new value list.  Add common parameters first

    Set NewValueList = {}

    Set List = {BusType,0,$(!REG_VT_DWORD),5}
    Set NewValueList = >($(NewValueList),$(List))
    Set List = {AdapterBusType,0,$(!REG_VT_DWORD),5}
    Set NewValueList = >($(NewValueList),$(List))
    Set List = {CardId,0,$(!REG_VT_DWORD),$(PIT_ID)}
    Set NewValueList = >($(NewValueList),$(List))
    Set List = {MediaType,0,$(!REG_VT_DWORD),2}
    Set NewValueList = >($(NewValueList),$(List))
    Set List = {TraceHead,0,$(!REG_VT_DWORD),$(TraceHead)}
    Set NewValueList = >($(NewValueList),$(List))

    ifint $(SlotNumber) != ""
        Set List = {SlotNumber,0,$(!REG_VT_DWORD),$(SlotNumber)}
        Debug-Output "Adding "$(List)" to NewValueList"
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(ParmTypes) != ""
        Set List = {ParmTypes,0,$(!REG_VT_SZ),$(ParmTypes)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(NetAddress) != ""
        Set List = {NetAddress,0,$(!REG_VT_SZ),$(NetAddress)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(DataRate) != ""
        Set List = {DataRate,0,$(!REG_VT_SZ),$(DataRate)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(FullDuplex) != ""
        Set List = {FullDuplex,0,$(!REG_VT_SZ),$(FullDuplex)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(LoopBack) != ""
        Set List = {LoopBack,0,$(!REG_VT_SZ),$(LoopBack)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(BusNumber) != ""
        Set List = {BusNumber,0,$(!REG_VT_DWORD),$(BusNumber)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(EnableTxEofInt) != ""
        Set List = {EnableTxEofInt,0,$(!REG_VT_SZ),$(EnableTxEofInt)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifstr $(LLCOnly) != ""
        Set List = {LLCOnly,0,$(!REG_VT_SZ),$(LLCOnly)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifint $(MinRcvBuffs) != ""
        Set List = {MinRcvBuffs,0,$(!REG_VT_DWORD),$(MinRcvBuffs)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifint $(RcvBuffSize) != ""
        Set List = {RcvBuffSize,0,$(!REG_VT_DWORD),$(RcvBuffSize)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifint $(MaxTransmits) != ""
        Set List = {MaxTransmits,0,$(!REG_VT_DWORD),$(MaxTransmits)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifint $(MaxTxFrameSize) != ""
        Set List = {MaxTxFrameSize,0,$(!REG_VT_DWORD),$(MaxTxFrameSize)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ;ifint $(TxRetries) != ""
    ;    Set List = {TxRetries,0,$(!REG_VT_DWORD),$(TxRetries)}
    ;    Set NewValueList = >($(NewValueList),$(List))
    ;endif

    ifint $(TxPriMax) != ""
        Set List = {TxPriMax,0,$(!REG_VT_DWORD),$(TxPriMax)}
        Set NewValueList = >($(NewValueList),$(List))
    endif

    ifint $(TxPriThresh) != ""
        Set List = {TxPriThresh,0,$(!REG_VT_DWORD),$(TxPriThresh)}
        Set NewValueList = >($(NewValueList),$(List))
    endif


    Debug-Output $(NewValueList)
    Shell  $(UtilityInf), AddValueList, $(ParamKey), $(NewValueList)


    goto successful

BindingAdapter =+

    set Error = "Binding: Sorry, not yet implemented."
    goto fatal

RemoveAdapter = +

    Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)

        Shell $(UtilityInf), RemoveSoftwareComponent, +
            $(Manufacturer), +
            $(ProductSoftwareName)

        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif

        set RegistryErrorIndex = $($R0)

        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            goto FatalRegistry
        endif

    else

        Shell $(UtilityInf), RemoveHardwareComponent, +
            $(Manufacturer), +
            $(ProductSoftwareName), +
            $(!NTN_RegBase)

        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif

        set RegistryErrorIndex = $($R0)

        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            goto FatalRegistry
        endif

    endif

    goto end

UpgradeSoftware = +

    ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)

        OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct

        Ifstr $(KeyProduct) != $(KeyNull)

            GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
            set Version = *($(VersionInfo), 4)

            Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)

            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif

            set !UG_Filename = $($R0)

            ifstr(i) $(!UG_Filename) != ""
                install "Install-Update"
                ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
                    goto fatal
                endif
            endif

            SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
            SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}

            ifint $(Version) != $(ProductVersion)
            endif

            CloseRegKey $(KeyProduct)

        else

            goto FatalRegistry

        endif

    else

        OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
              $(MAXIMUM_ALLOWED) NetworkCardKey

        Ifstr(i) $(NetworkCardKey) != $(KeyNull)
            GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
            set ServiceName = *($(ServiceNameInfo), 4)
            OpenRegKey $(NetworkCardKey) "" "NetRules" +
                $(MAXIMUM_ALLOWED) NetRuleKey

            Ifstr(i) $(NetRuleKey) != $(KeyNull)
            else
                goto FatalRegistry
            endif

            CloseRegKey $(NetRules)
            CloseRegKey $(NetworkCardKey)
        else
            goto FatalRegistry
        endif

        OpenRegKey $(!REG_H_LOCAL) "" +
              $(!NTN_ServiceBase)"\"$(ServiceName) +
              $(MAXIMUM_ALLOWED) ServiceKey

        Ifstr(i) $(ServiceKey) != $(KeyNull)
            CloseRegKey $(ServiceKey)
        else
            goto FatalRegistry
        endif
    endif

    goto end

successful = +
    goto end

abandon = +
    ForListDo $(OEM_ABANDON_OPTIONS)
        Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
            $(ProductSoftwareName), $($)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            goto FatalRegistry
        endif
    EndForListDo

    Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
        Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
            $(ProductSoftwareName), FALSE
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            goto FatalRegistry
        endif
    endif
    goto end

warning = +
    Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
    ifstr(i) $($R1) == "OK"
        goto $(to)
    else-ifstr(i) $($R1) == "CANCEL"
        goto $(from)
    else
        goto "end"
    endif

NonFatalInfo = +
    Set CommonStatus = STATUS_USERCANCEL
    Set Severity = STATUS
    goto NonFatalMsg

nonfatal = +
    Set Severity = NONFATAL
    goto NonFatalMsg

NonFatalMsg = +
    ifstr(i) $(Error) == ""
        Set Severity = NONFATAL
        Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set Error = $($R0)
    endif
    Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
    ifstr(i) $($R1) == "OK"
        goto $(from)
    else
        goto "end"
    endif

FatalRegistry = +
    Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
    set Error = $($R0)
    goto fatal

fatal = +
    ifstr(i) $(Error) == ""
        Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set Error = $($R0)
    endif
    Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
    goto setfailed

ShellCodeError = +
    set DlgType      = "MessageBox"
    set STF_MB_TITLE = $(ShellCodeErrorTitle)
    set STF_MB_TEXT  = $(ShellCodeErrorText)
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 3
    set STF_MB_DEF   = 1
    ui start "Error Message"
    goto setfailed

setfailed = +
    set CommonStatus = STATUS_FAILED
    ifstr(i) $(OEM_ABANDON_ON) == TRUE
        set OEM_ABANDON_ON = FALSE
        goto abandon
    endif
    goto end

end = +
    goto term

term = +

    Return $(CommonStatus)

[GeneralConstants]

    from                =   ""
    to                  =   ""
    KeyNull             =   ""
    AdapterList         =   ""
    MAXIMUM_ALLOWED     =   33554432
    RegistryErrorIndex  =   NO_ERROR
    KeyProduct          =   ""
    TRUE                =   1
    FALSE               =   0
    NoTitle             =   0
    OldVersionExisted   =   $(FALSE)

[FileConstants]

    UtilityInf          =   "UTILITY.INF"
    SubroutineInf       =   "SUBROUTN.INF"
    SoftwareType        =   "driver"
    TrpinstDLL          =   $(!STF_WINDOWSSYSPATH)"\trpinst.dll"
    NetEventDLL         =   "%SystemRoot%\System32\netevent.dll"
    DLG_OK              =   5121        ;   User pressed "OK" pushbutton
    DLG_CANCEL          =   5122        ;   User pressed "CANCEL" pushbutton
    DEVICE_ID           =   62          ;   0x003E in decimal
    PIT_ID              =   269746238   ;   0x1014003E in decimal
    Manufacturer        =   "Microsoft"
    ProductMajorVersion =   "3"
    ProductMinorVersion =   "1"
    ProductVersion      =   $(ProductMajorVersion)"."$(ProductMinorVersion)
    ProductSoftwareName     = "IBMTRP"
    ProductSoftwareImagePath = "%SystemRoot%\system32\drivers\IBMTRP.sys"
    NetRuleSoftwareType     = "IBMTRPSys ndisDriver IBMTRPDriver"
    NetRuleSoftwareUse      = $(SoftwareType)
    NetRuleSoftwareBindForm = """IBMTRPSys"" yes no container"
    NetRuleSoftwareClass    = {"IBMTRP basic"}
    NetRuleSoftwareBindable = {"IBMTRPDriver IBMTRPAdapter non exclusive 100"}
    ProductHardwareName     = "IBMTRP"
    NetRuleHardwareType     = "IBMTRP IBMTRPAdapter"
    NetRuleHardwareBindForm = " yes yes container"
    NetRuleHardwareClass    = {"IBMTRPAdapter basic"}
    ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
    ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
        NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
    ; Following Lines added to eliminate error of " guage.c line 209" in chk build of NT 4.X
    ProCaption   = "Windows NT Setup"
    ProCancel    = "Cancel"
    ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
                   "Are you sure you want to cancel copying files?"
    ProCancelCap = "Network Setup Message"
    ProText1     = "Copying:"
    ProText2     = "To:"

[FileConstantsENG]

    FunctionTitle               = "IBM PCI Token-Ring Adapter Setup"
    ProductSoftwareDescription  = "IBM PCI Token-Ring Adapter Driver"
    ProductHardwareDescription  = "IBM PCI Token-Ring Adapter "
    CANNOT_FIND_ANY_CARD        = "Network card is not present in the system"
    ProductSoftwareTitle        = "IBM PCI Token-Ring Adapter Driver"
    ProductHardwareTitle        = "IBM PCI Token-Ring Adapter "
    ShellCodeErrorTitle         = "Error: "$(FunctionTitle)
    ShellCodeErrorText          = "OEMSETUP.INF Shell Code Error."

[date]
    Now = {} ? $(!LIBHANDLE) GetSystemDate

[Files-Dll]
1, trpinst.dll, SIZE=106116
1, trpinst.hlp, SIZE=13280
[Files-Inf]
1, oemsetup.inf, SIZE=42080, RENAME=$(!UG_Filename)

[Files-IBMTRP]

1, IBMTRP.SYS, SIZE=117184

[Install-Option]

    set STF_VITAL = ""

    ifstr(i) $(AddCopy) == "YES"

        AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers

    endif

    ifstr(i) $(DoCopy) == "YES"

       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       CopyFilesInCopyList

    endif

    Exit

[Install-Update]
   set STF_VITAL        = ""
   set STF_OVERWRITE    = "VERIFYSOURCEOLDER"

   AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
   AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)

   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   CopyFilesInCopyList
   exit

[Install-Dll]
   set STF_VITAL        = ""
   AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
   CopyFilesInCopyList
   exit

[AddDefaultNetCardParameters]
    set KeyParameter = $($0)
    ForListDo $(!NetCardParameterName)
        set Name = $($)
        set Value = *($(!NetCardParameterValue), $(#))
        ifstr(i) $(Name) == "NetAddress"
            set Type = $(!REG_VT_SZ)
        Else-Ifstr(i) $(Name) == "LoopBack"
            set Type = $(!REG_VT_SZ)
        Else-Ifstr(i) $(Name) == "FullDuplex"
            set Type = $(!REG_VT_SZ)
        Else-Ifstr(i) $(Name) == "DataRate"
            set Type = $(!REG_VT_SZ)
        Else-Ifstr(i) $(Name) == "EnableTxEofInt"
            set Type = $(!REG_VT_SZ)
        Else-Ifstr(i) $(Name) == "LLCOnly"
            set Type = $(!REG_VT_SZ)
        Else-Ifstr(i) $(Name) == "ParmTypes"
            set Type = $(!REG_VT_SZ)
        else
            set Type = $(!REG_VT_DWORD)
        endif
 Debug-Output "Name = "$(Name)
 Debug-Output "Value = "$(Value)
        SetRegValue $(KeyParameter) {$(Name),0,$(Type),$(Value)}
    EndForListDo
    return
Download Driver Pack

How To Update Drivers Manually

After your driver has been downloaded, follow these simple steps to install it.

  • Expand the archive file (if the download file is in zip or rar format).

  • If the expanded file has an .exe extension, double click it and follow the installation instructions.

  • Otherwise, open Device Manager by right-clicking the Start menu and selecting Device Manager.

  • Find the device and model you want to update in the device list.

  • Double-click on it to open the Properties dialog box.

  • From the Properties dialog box, select the Driver tab.

  • Click the Update Driver button, then follow the instructions.

Very important: You must reboot your system to ensure that any driver updates have taken effect.

For more help, visit our Driver Support section for step-by-step videos on how to install drivers for every file type.

server: web2, load: 1.25