[Identification]
    OptionType = NetAdapter
[PlatformsSupported]
    PCI
    EISA
[Options]
    CpqNF3
;
;  File names, etc.
;
[FileConstants]
UtilityInf      = "UTILITY.INF"
subroutineinf   = "SUBROUTN.INF"
SoftwareType    = "driver"
Exit_Code       = 0
NETFLEX3_E_1BYTE =   15798542
NETFLEX3_E_4BYTE =   552669454     
;
; EventLog Message Files
;
NetEventDLL     = "%SystemRoot%\System32\Netevent.dll;%SystemRoot%\System32\Drivers\NetFlx3.Sys"
IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
;
; Product Info
;
Manufacturer    = "Compaq"
ProductMajorVersion     = "3"
ProductMinorVersion     = "5"
ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
;
; Software
;
ProductSoftwareName     = "CpqNF3"
ProductSoftwareImagePath = "\SystemRoot\System32\Drivers\NetFlx3.sys"
NetRuleSoftwareType     = "CpqNF3Sys ndisDriver CpqNF3Driver"

NetRuleSoftwareUse      = $(SoftwareType)
NetRuleSoftwareBindForm = """CpqNF3Sys"" yes no container"
NetRuleSoftwareClass    = {"CpqNF3Driver basic"}
NetRuleSoftwareBindable = {"CpqNF3Driver CpqNF3Adapter non exclusive 100"}
;
; Hardware
;
ProductHardwareName     = "CpqNF3"
NetRuleHardwareType     = "CpqNF3 CpqNF3Adapter"
NetRuleHardwareBindForm = " yes yes container"
NetRuleHardwareClass    = {"CpqNF3Adapter basic"}
;
; Registry Key
;
ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
NetCardKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\Windows NT\CurrentVersion\NetworkCards"

[GeneralConstants]
from            = ""
to              = ""
ExitCodeOk      = 0
ExitCodeCancel  = 1
ExitCodeFatal   = 2
KeyNull         = ""
MAXIMUM_ALLOWED = 33554432
RegistryErrorIndex = NO_ERROR
KeyProduct      = ""
KeyParameters   = ""
TRUE            = 1
FALSE           = 0
NoTitle         = 0
ExitState       = "Active"
OldVersionExisted = $(FALSE)
DriverPath      = $(!STF_NTPATH)\drivers
;AdapterList = {{}}
AddAdapterCount = 0

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

[adapter]
    AdapterList = {} ? $(!NETFLEX3_HANDLE)  NetFlex3FindAdapter

;---------------------------------------------------------------------------
; 1. Identify
;
; DESCRIPTION:   To verify that this INF deals with the same type of options
;                as we are choosing currently.
;
; INPUT:         None
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
;                $($R1): Option Type (COMPUTER ...)
;                $($R2): Diskette description
;---------------------------------------------------------------------------
[Identify]
    read-syms Identification
    set Status     = STATUS_SUCCESSFUL
    set Identifier = $(OptionType)
    set Media      = #("Source Media Descriptions", 1, 1)
    Return $(Status) $(Identifier) $(Media)

;------------------------------------------------------------------------
; 2. ReturnOptions:
;
; DESCRIPTION:   To return the option list supported by this INF and the
;                localised text list representing the options.
;
;
; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
;                                STATUS_NOLANGUAGE
;                                STATUS_FAILED
;                                STATUS_NOTSUPPORTED
;
;                $($R1): Option List
;                $($R2): Option Text List
;------------------------------------------------------------------------
[ReturnOptions]
    set Status        = STATUS_FAILED
    set OptionList     = {}
    set OptionTextList = {}
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
        ifstr(i) $($1) == ""
           goto returnoptions
        endif
        set PlatformList = ^(PlatformsSupported, 1)
        Ifcontains(i) $($1) in $(PlatformList)
           goto returnoptions
        else
           set Status = STATUS_NOTSUPPORTED
           goto finish_ReturnOptions
        endif
    else
        set Status = STATUS_NOLANGUAGE
        goto finish_ReturnOptions
    endif
returnoptions = +
    set OptionList     = ^(Options, 1)
    set OptionTextList = ^(OptionsText$($0), 1)
    set Status         = STATUS_SUCCESSFUL
finish_ReturnOptions = +
    Return $(Status) $(OptionList) $(OptionTextList)

;------------------------------------------------------------------------
;
; InstallOption:
;
;      This section is shelled to by main installation processing
;      or by NCPASHEL.INF during reconfig, removal, update, etc.
;
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update 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: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;
 ;------------------------------------------------------------------------
[InstallOption]
    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
    set !DebugOutputControl = 1
    Debug-Output $(STF_CONTEXTINFNAME)": STF_CWDIR is: "$(!STF_CWDIR)
    Debug-Output $(STF_CONTEXTINFNAME)": STF_LANGUAGE is: "$(!STF_LANGUAGE)
    Debug-Output $(STF_CONTEXTINFNAME)": Option = "$(Option)
    set-subst LF = "\n"
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms DialogConstants$(!STF_LANGUAGE)
    ifstr(i) $(!NTN_Origination) == "NCPA"
        set Continue = $(OK)
    endif
    read-syms FileConstants$(!STF_LANGUAGE)
    detect date
    set-title  $(FunctionTitle)
    set to   = Begin
    set from = Begin
    set CommonStatus = STATUS_SUCCESSFUL
    EndWait
Begin = +
    Ifstr(i) $(!NTN_InstallMode) == deinstall
        set StartLabel = removeadapter
    else-Ifstr(i) $(!NTN_InstallMode) == Update
        set StartLabel = UpgradeSoftware
    else-Ifstr(i) $(!NTN_InstallMode) == Bind
        set StartLabel = bindingadapter
    else-Ifstr(i) $(!NTN_InstallMode) == Configure
        set CommonStatus = STATUS_REBOOT
        Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
            Debug-Output "Cannot configure the Compaq NetFlex-3 driver software."
            Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                Debug-Output "ShellCode error: cannot get an error string."
                goto ShellCodeError
            endif
            set Error = $($R0)
            set from = end
            set to = end
            goto nonfatal
        endif
        set CommonStatus = STATUS_REBOOT
        set StartLabel = ConfigureAdapter
    else
        set StartLabel = InstallAdapter
        set OEM_ABANDON_OPTIONS = {}
        set OEM_ABANDON_SOFTWARE = FALSE
        set OEM_ABANDON_ON = TRUE
    endif
    set from = $(fatal)
    set to = $(fatal)
    goto $(StartLabel)

;-----------------------------------------------
; Installation Section
;-----------------------------------------------

InstallAdapter = +
    Debug-Output $(STF_CONTEXTINFNAME)": Install Adapter"
    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
    Ifstr $(KeyProduct) != $(KeyNull)
    CloseRegKey $(KeyProduct)
        ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
                $(ProductVersion)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
            goto end
        else
            set OldVersionExisted = $(TRUE)
        endif
    endif
    goto nextstep

;-----------------------------------------------
; Configuration Section
;-----------------------------------------------
ConfigureAdapter = +
    Debug-Output $(STF_CONTEXTINFNAME)": Configure Adapter"
    Ifstr $(KeyProduct) == $(KeyNull)
        OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
        Ifstr $(KeyProduct) == $(KeyNull)
            set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
            Debug-Output "Cannot find component product key"
            goto fatalregistry
        Endif
    Endif
    ;
    ; Get the other parameters;  they're attached to the service parameters key
    ;
    Debug-Output "INF: Shelling to FindService "
    Shell $(UtilityInf) FindService, $(KeyProduct)
    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
        Debug-Output "INF: FindService shell failure"
        Goto ShellCodeError
    Endif
    Ifstr(i) $($R0) != NO_ERROR
        Debug-Output "INF: FindService Shell error: "$($R0)
        Goto fatalregistry
    endif

    Set KeyParameters = $($R2)

DoOptionsDlg = +
    ifstr(i) $(KeyParameters) != ""
        Debug-Output "NetFlex3 - Configure Options"
        LoadLibrary "x" $(!STF_CWDDIR)NETFLX3.DLL !NETFLEX3_HANDLE

        read-syms HelpIds
        SetHelpFile $(HelpFile) $(!MinimumID) $(!MaximumID) $(!InitialContentsID)

        ;
        ; Get the Adapter Settings so we can get/verify this cards phy
        ;
        GetRegValue $(KeyParameters),"BusNumber", BusNumberInfo
        set BusNumber = *($(BusNumberInfo), 4)
        GetRegValue $(KeyParameters),"BusType", BusTypeInfo
        set BusType = *($(BusTypeInfo), 4)
        GetRegValue $(KeyParameters),"SlotNumber", SlotNumberInfo
        set SlotNumber = *($(SlotNumberInfo), 4)
        GetRegValue $(KeyParameters),"PhyType", PhyTypeInfo
        set RegPhyType = *($(PhyTypeInfo), 4)


        Debug-Output "Bus Number  ="$(BusNumber)
        Debug-Output "Slot Number ="$(SlotNumber)
        Debug-Output "Bus Type    ="$(BusType)

        ifint $(BusType) == 5
            ; PCI
            GetRegValue $(KeyParameters),"IoBaseAddress", IoBaseAddressInfo
            set IoBaseAddress = *($(IoBaseAddressInfo), 4)
            GetRegValue $(KeyParameters),"DeviceFunctionNumber", DeviceFunctionNumberInfo
            set DeviceFunctionNumber = *($(DeviceFunctionNumberInfo), 4)
            Debug-Output "IoBaseAddr  ="$(IoBaseAddress)
            Debug-Output "DeviceFunction Number ="$(DeviceFunctionNumber)
        endif

        ;
        ; Get Driver Service name to pass to DLL
        ;
        Debug-Output "INF: Shelling to GetServiceName "
        Set ServiceName = ""
        Shell "" GetServiceName, $(KeyProduct)
        Ifstr(i) $($R0) != NO_ERROR
            Debug-Output "INF: GetServiceName Shell error: "$($R0)
            Goto fatalregistry
        endif
        Set ServiceName = $($R1)

;shell "" NetFlex3MessageBox
        ;
        ; Get PHY Type
        ;
        ifint $(BusType) == 5
            ; PCI
            LibraryProcedure Result $(!NETFLEX3_HANDLE), NetFlex3GetPhy, +
                $(ServiceName), $(BusNumber), $(BusType), $(DeviceFunctionNumber), $(IoBaseAddress)
        else
            ; EISA
            LibraryProcedure Result $(!NETFLEX3_HANDLE), NetFlex3GetPhy, +
                $(ServiceName), $(BusNumber), $(BusType), $(SlotNumber)
        endif

        Debug-Output "Result  ="$(Result)

        ifstr(i) $(Result) == ""
            Debug-Output "INF: NetFlex3GetPhy Shell error: "$($R0)
            read-syms ConfigureError$(!STF_LANGUAGE)
            Goto ShellCodeError
        endif

        set PhyTypeNum = $(Result)
        set PhyType = #(PhyTypes, $(PhyTypeNum), 1)
        Debug-Output "PhyType = "$(PhyType)

        ;
        ; Get Duplex Setting
        ;
        GetRegValue $(KeyParameters),"Duplex", DuplexInfo
        set DuplexValue = *($(DuplexInfo), 4)
        Debug-Output "NetFlex3 DuplexValue = "$(DuplexValue)

        ;
        ; Get Connector Type
        ;
        GetRegValue $(KeyParameters),"Connector", ConnectorInfo
        set ConnectorValue = *($(ConnectorInfo), 4)
        Debug-Output "NetFlex3 ConnectorValue = "$(ConnectorValue)

        ;
        ; Get Network Address
        ;
        GetRegValue $(KeyParameters),"NetworkAddress", NetworkAddressInfo
        set NetworkAddress = *($(NetworkAddressInfo), 4)
        Debug-Output "NetFlex3 NetworkAddress = "$(NetworkAddress)

        ;
        ; Get MediaSpeed Setting
        ;
        GetRegValue $(KeyParameters),"MediaSpeed", MediaSpeedInfo
        set MediaSpeedValue = *($(MediaSpeedInfo), 4)
        Debug-Output "NetFlex3 MediaSpeedValue = "$(MediaSpeedValue)

        ;
        ; See if the PhyType was changed
        ;
        ifint $(RegPhyType) != $(PhyTypeNum)
            ;
            ; Update registry with detected phy type
            ;
            Debug-Output "Phy has Changed!  Resetting Option Settings for "$(PhyType)

            set MediaSpeedValue = 0
            set ConnectorValue  = 0
            set DuplexValue     = 0
            ;
            ; save new type
            ;
            SetRegValue $(KeyParameters), {PhyType,$(NoTitle),$(!REG_VT_DWORD), $(PhyTypeNum) }
        endif

        read-syms OptionsLists
        read-syms OptionsDlg$(!STF_LANGUAGE)

DoDialog = +
        ;
        ; do the dialog
        ;
        ui start "IDD_OPTIONS" $(!NETFLEX3_HANDLE)
        set ReInit = NO
        ifstr(i) $(DLGEVENT) == "EXIT"
        set CommonStatus = STATUS_USERCANCEL
            goto exitopts
        else-ifstr(i) $(DLGEVENT) == "NOTIFY"
           Debug-Output "NetFlex3:Notify"
           set MediaSpeedValue = *($(MediaSpeedValueList),~($(MediaSpeedTextList), $(Combo1Out)))
           Debug-Output "MediaSpeedValue = "$(MediaSpeedValue)
           set DuplexValue = *($(DuplexValueList),~($(DuplexTextList), $(Combo2Out)))
           Debug-Output "DuplexValue = "$(DuplexValue)
           set ConnectorValue = *($(ConnectorValueList),~($(ConnectorTextList), $(Combo3Out)))
           Debug-Output "ConnectorValue = "$(ConnectorValue)
           set NetworkAddress = *($(EditTextOut),1)
           Debug-Output "NetworkAddress = "$(NetworkAddress)
           Debug-Output "ComboListItemsIn = "$(ComboListItemsIn)

           ;
           ; if PHY is 10BaseT and full-duplex and !UTP, then force UTP
           ;
           ifint $(PhyTypeNum) == 1
                ifint $(DuplexValue) == 2
                    ifint $(ConnectorValue) != 1
                        set ConnectorValue = #(ConnectorChoices$(PhyType)$(!STF_LANGUAGE),Connector_UTP, 2)
                        Debug-Output "ConnectorValue = "$(ConnectorValue)
                        set Combo3Out = *($(ConnectorTextList),~($(ConnectorValueList), $(ConnectorValue)))
                        debug-output "Set BNC Duplex Options"
                        set ReInit = YES
                        shell "" ForceUTPMessageBox$(!STF_LANGUAGE)
                    endif
                endif
           endif

           ;
           ; if PHY is 100BaseTX and full-duplex, then force speed if "auto" is selected
           ;
           ifint $(PhyTypeNum) == 3
                ifint $(MediaSpeedValue) == 0
                    ifint $(DuplexValue) == 2
                        set MediaSpeedValue = #(MediaSpeedChoices$(PhyType)$(!STF_LANGUAGE),MediaSpeed_100Mbps, 2)
                        Debug-Output "MediaSpeedValue = "$(MediaSpeedValue)
                        set Combo1Out = *($(MediaSpeedTextList),~($(MediaSpeedValueList), $(MediaSpeedValue)))
                        debug-output "Set 100Tx Speed Duplex Options"
                        set ReInit = YES
                        shell "" ForceTXSpeedMessageBox$(!STF_LANGUAGE)
                    endif
                endif
           endif

;           ForListDo $(ComboListItemsIn)
;               Debug-Output $($)" = "$($($))
;           EndForListDo
;           Debug-Output "ComboListItemsOut = "$(ComboListItemsOut)
;           ForListDo $(ComboListItemsOut)
;               Debug-Output $($)" = "$($($))
;           EndForListDo
           goto DoDialog
       else
            ;
            ; Save Media Speed Setting
            ;
            set MediaSpeedValue = *($(MediaSpeedValueList),~($(MediaSpeedTextList), $(Combo1Out)))
            Debug-Output "MediaSpeedValue = "$(MediaSpeedValue)
            SetRegValue $(KeyParameters), {MediaSpeed, $(NoTitle), $(!REG_VT_DWORD), $(MediaSpeedValue) }
            ;
            ; Save Duplex Setting
            ;
            set DuplexValue = *($(DuplexValueList),~($(DuplexTextList), $(Combo2Out)))
            Debug-Output "DuplexValue = "$(DuplexValue)
            SetRegValue $(KeyParameters), {Duplex, $(NoTitle), $(!REG_VT_DWORD), $(DuplexValue) }
            ;
            ; Save Connector Type Setting
            ;
            set ConnectorValue = *($(ConnectorValueList),~($(ConnectorTextList), $(Combo3Out)))
            Debug-Output "ConnectorValue = "$(ConnectorValue)
            SetRegValue $(KeyParameters), {Connector,$(NoTitle),$(!REG_VT_DWORD), $(ConnectorValue) }

            set NetworkAddress = *($(EditTextOut),1)
            SetRegValue $(KeyParameters) {NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)}
        endif

exitopts = +
        ui pop 1
        FreeLibrary $(!NETFLEX3_HANDLE)
        CloseRegKey $(KeyParameters)
    endif

    goto successful

nextstep = +
    StartWait

;shell "" NetFlex3MessageBox

    ifint $(OldVersionExisted) == $(FALSE)

        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)

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

    ;
    ; Find NetFlex-3/E Adapters
    ;
    Debug-Output "Find all NetFlex-3/E Cards"

    Shell $(UtilityInf), EISAFindBus, $(NETFLEX3_E_4BYTE),  4294967295

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

    ifstr $($R0) != "NO_ERROR"
        Debug-Output "Failed!"
        set Error = $($R0)
        goto fatal
    endif

    set AdapterList = $($R1)
    Debug-Output "AdapterList = "$(AdapterList)

    ;
    ;   Find all NetFlex-3/P Adapters
    ;
    Debug-Output "Find NetFlex3/P Cards"

    LoadLibrary "x" $(!STF_CWDDIR)NETFLX3.DLL !NETFLEX3_HANDLE
    LibraryProcedure Result $(!NETFLEX3_HANDLE), NetFlex3FindAdapter
    FreeLibrary $(!NETFLEX3_HANDLE)
    ifstr(i) $(AdapterList) == {}
        set AdapterList = $(Result)
    else
        ForListDo $(Result)
            set Adapter = $($)
            set AdapterList = >($(AdapterList),$(Adapter))
        EndForListDo
    endif
    Debug-Output "AdapterList = "$(AdapterList)

    ifstr(i) $(AdapterList) == {}
        set Error = $(CANNOT_FIND_ANY_CARD)
        set CommonStatus = STATUS_USERCANCEL
        set from = end
        goto nonfatal
    endif

    ifint $(OldVersionExisted) == $(FALSE)
        ifstr(i) $(!NTN_InstallMode) == "Install"
           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            
            install "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)
              goto fatal
           endif
        endif
        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)}}
        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)} }
        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
    endif

    ForListDo $(AdapterList)
        set BusNum  = *($($),1)
        Debug-Output "Bus Number  ="$(BusNum)

        set DetOption = *($($),3)

        ifstr $(DetOption) == "NetFlex3P"
            set BusType = *($($),4)
            set IoBaseAddress = *($($),5)
            set IoSpaceLength = *($($),6)
            set IRQ = *($($),7)
            set DeviceFunctionNumber = *($($),2)
            set SlotNumber = 0
            Debug-Output "DetOption = "$(DetOption)
            Debug-Output "Bus Type    ="$(BusType)
            Debug-Output "IoBaseAddr  ="$(IoBaseAddress)
            Debug-Output "IoSpaceLength="$(IoSpaceLength)
            Debug-Output "Interupt     ="$(IRQ)

            Shell "", IsPCINetCardAlreadyInstalled, $(BusNum), +
                $(DeviceFunctionNumber), $(ProductHardware$(DetOption)Description), $(ProductHardwareName)

        else
            set SlotNumber = *($($),2)
            Debug-Output "Slot Number ="$(SlotNumber)
            set BusType = 2
            set DetOption = "NetFlex3E"
            set Option_1Byte = $(NETFLEX3_E_1BYTE)
            Debug-Output "DetOption = "$(DetOption)
            Debug-Output "Bus Type    ="$(BusType)

            Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
                $(SlotNumber), $(ProductHardware$(DetOption)Description), $(ProductHardwareName)
        endif

        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        ifstr $($R0) != "NO_ERROR"
            set Error = $($R0)
            goto fatal
        endif

        set tempvar = $($R1)
        ifstr(i) $(tempvar) != "YES"
            ;
            ; We have one to install!
            ;
            Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(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)

            ;
            ; Find out Phy type so we can get the correct name
            ;
            LoadLibrary "x" $(!STF_CWDDIR)NETFLX3.DLL !NETFLEX3_HANDLE

            ifint $(BusType) == 5
                ; PCI
                LibraryProcedure Result $(!NETFLEX3_HANDLE), NetFlex3GetPhy, +
                    $(ServiceName), $(BusNumber), $(BusType), $(DeviceFunctionNumber), $(IoBaseAddress)

            else
                ; EISA
                LibraryProcedure Result $(!NETFLEX3_HANDLE), NetFlex3GetPhy, +
                    $(ServiceName), $(BusNumber), $(BusType), $(SlotNumber)
            endif
            FreeLibrary $(!NETFLEX3_HANDLE)

            Debug-Output "Result  ="$(Result)

            ifstr(i) $(Result) == ""
                Debug-Output "INF: NetFlex3GetPhy Shell error: "$($R0)
                read-syms ConfigureError$(!STF_LANGUAGE)
                Goto ShellCodeError
            endif

            set PhyTypeNum = $(Result)
            set ProdTitle = $(ProductHardware$(DetOption)Title)
            set ProdTitle = $(ProdTitle)#(PhyTypes, $(PhyTypeNum), 2)
            set ProdTitle = $(ProdTitle)$(ProductHardware$(DetOption)Suffix)
            Debug-Output "ProdTitle = "$(ProdTitle)

            set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
                                   {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProdTitle)},+
                                   {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(DetOption)Description)},+
                                   {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
                                   {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
                                   {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
            Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif

            ifstr $(DetOption) == "NetFlex3P"
                ; PCI
                set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
                       {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusType)},+
                       {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
                       {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IoBaseAddress)},+
                       {IoSpaceLength,$(NoTitle),$(!REG_VT_DWORD),$(IoSpaceLength)},+
                       {IRQ,$(NoTitle),$(!REG_VT_DWORD),$(IRQ)},+
                       {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNumber)},+
                       {DeviceFunctionNumber,$(NoTitle),$(!REG_VT_DWORD),$(DeviceFunctionNumber)},+
                       {PhyType,$(NoTitle),$(!REG_VT_DWORD), $(PhyTypeNum)},+
                       {Duplex,$(NoTitle),$(!REG_VT_DWORD),0},+
                       {Connector,$(NoTitle),$(!REG_VT_DWORD),0},+
                       {MediaSpeed,$(NoTitle),$(!REG_VT_DWORD),0}}
            else
                set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
                       {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusType)},+
                       {EisaCompressedId,$(NoTitle),$(!REG_VT_DWORD),$(Option_1Byte)},+
                       {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
                       {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNumber)},+
                       {PhyType,$(NoTitle),$(!REG_VT_DWORD), $(PhyTypeNum)},+
                       {Duplex,$(NoTitle),$(!REG_VT_DWORD),0},+
                       {Connector,$(NoTitle),$(!REG_VT_DWORD),0},+
                       {MediaSpeed,$(NoTitle),$(!REG_VT_DWORD),0}}
            endif

            Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif

            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)} }
            Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
            CloseRegKey $(HardNetCardKey)
            CloseRegKey $(HardNetRuleKey)
            CloseRegKey $(HardParameterKey)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
             goto ShellCodeError
            endif
        endif
    EndForListDo
    goto writeparameters
writeparameters = +
    EndWait
    goto successful

;-----------------------------------------------
; Binding section
;-----------------------------------------------
bindingadapter =+
    set Error = "Binding: Sorry, not yet implemented."
    goto fatal

;-----------------------------------------------
; Removeadapter section
;-----------------------------------------------
removeadapter = +
    Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
        Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
            $(ProductSoftwareName)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            Debug-Output "ShellCode error"
            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)
           Debug-Output "ShellCode error"
           goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
           goto fatalregistry
        endif
    endif
    goto end

;-----------------------------------------------
; Upgrade Software section
;-----------------------------------------------

UpgradeSoftware = +
    ;
    ; First determine whether we want to do upgrade or update for software
    ; or hardware component. Then we will determine whether the Mode is
    ; update or upgrade.
    ;
    ; If the same version of the product existed in the registry, we do
    ; update. Otherwise, we will do a upgrade
    ;
    Debug-Output $(STF_CONTEXTINFNAME)": UpgradeSoftware"
    Debug-Output $(STF_CONTEXTINFNAME)": ProductKeyName ="$(ProductKeyName)
    Debug-Output $(STF_CONTEXTINFNAME)": !NTN_RegBase   ="$(!NTN_RegBase)

    ;
    ; Upgrade software component
    ;
    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct

    Ifstr $(KeyProduct) != $(KeyNull)
        Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            set ShellErrorSection = UtilityInf:GetFileNameFromRegistry
            goto ShellCodeError
        endif
        set !UG_Filename = $($R0)

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

            ; Upgrade the version number
            ;
            SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
            SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}

            ;
            ; do nothing for update
            ;
            CloseRegKey $(KeyProduct)
        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)
            Debug-Output "ShellCode error"
            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)
            Debug-Output "ShellCode error"
            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
nonfatal = +
    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), "NONFATAL", $(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 = +
    Debug-Output $(STF_CONTEXTINFNAME)": Shell error, $(ShellErrorSection)"
    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)

[Install-Option]
    set STF_VITAL = ""
    ifstr(i) $(AddCopy) == "YES"
        AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers    
    endif
    ifstr(i) $(DoCopy) == "YES"
       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       CopyFilesInCopyList
    endif
    ifstr(i) $(DoConfig) == "YES"
    endif
    Exit
[Install-Update]
   set STF_VITAL        = ""
   set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
   AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
   AddSectionFilesToCopyList Files-DLL $(SrcDir) $(!STF_WINDOWSSYSPATH)
   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)
    set !STF_NCPA_FLUSH_COPYLIST = TRUE
    CopyFilesInCopyList
    Exit

[InitBaseVars]
KeyNull            = ""
MAXIMUM_ALLOWED    = 33554432
KeyInfo            = {}
RegistryErrorIndex = NO_ERROR
NoTitle            = 0
CurrentControlSet  = "SYSTEM\CurrentControlSet"
ServicesBaseName   = $(CurrentControlSet)"\Services"
NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
!RegLastError      = NO_ERROR

[BaseServiceKey]
    read-syms InitBaseVars
    set BS_KeyServices = ""
    OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName) $(MAXIMUM_ALLOWED) BS_KeyServices
    Ifstr $(BS_KeyServices) == $(KeyNull)
       Debug-Output "NetFlex3.INF: could not open Services base key"
       set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
    endif
B_S_Return = +
    return $(RegistryErrorIndex), $(BS_KeyServices)

[GetServiceName]
    read-syms InitBaseVars
    debug-output "GetServiceName"
    set FS_KeyThisService = ""
    set FS_KeyParameters  = ""
    set FS_KeyComponent   = $($0)
    set FS_TypeComponent  = $($1)
    Shell "" BaseServiceKey
    set FS_KeyServices = $($R1)
    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
       debug-output "GetServiceName:RegistryErrorIndex != NO_ERROR"$(RegistryErrorIndex)
       goto F_S_Return
    endif
    EnumRegValue $(FS_KeyComponent) FS_ValueList
    set FS_SvcName = ""
    ForListDo $(FS_ValueList)
        set FS_ValueName = *($($),1)
        Ifstr(i) $(FS_ValueName) == ServiceName
            set FS_SvcName = *($($),4)
            debug-output "FS_SvcName ="$(FS_SvcName)
            goto F_S_Break1
        endif
    EndForListDo
F_S_Break1 = +
    Ifstr $(FS_SvcName) == $(KeyNull)
       set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
       goto F_S_Return
    endif
F_S_Return = +
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
        Ifstr $(FS_KeyParameters) != $(KeyNull)
            CloseRegKey $(FS_KeyParameters)
        endif
        Ifstr $(FS_KeyThisService) != $(KeyNull)
           CloseRegKey $(FS_KeyThisService)
        endif
    endif
    return $(RegistryErrorIndex), $(FS_SvcName)


[Source Media Descriptions]
    1  = "Windows NT Setup Disk #1"
    2  = "Windows NT Workstation CD-ROM"
    3  = "Compaq NT Support Software Disk"

[Signature]
    FileType = MICROSOFT_FILE
[GetSignature]
    read-syms Signature
    return $(FileType)
[ProductType]
STF_PRODUCT  = Winnt
STF_PLATFORM = I386
[Files-Inf]
3, oemsetup.inf, SIZE=1000, RENAME=$(!UG_Filename)
[Files-DLL]
3, NetFlx3.DLL, SIZE=999
[Files-Driver]
3, NetFlx3.SYS, SIZE=999
[LanguagesSupported]
    ENG
[OptionsTextENG]
    NetFlex3    = "Compaq NetFlex-3 Controller"

[PhyTypes]
    1 = "10BaseT",      ""
    2 = "100BaseVG",    " 100VG"
    3 = "100BaseTX",    " 10/100TX"
    99 = "Unknown",     ""


[UnknownPhyTextENG]
    1 = "Unknown PHY"

[10BaseTPhyTextENG]
    1 = "10Base-T UTP/BNC"

[100BaseTXPhyTextENG]
    1 = "100Base-TX UTP"

[100BaseVGPhyTextENG]
    1 = "100VG-AnyLAN UTP"

[FileConstantsENG]
    ProCaption   = "Windows NT Setup"
    ProCancel    = "Cance&l"
    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:"
    FunctionTitle   = "Compaq NetFlex-3 Controller Setup"
    ProductSoftwareDescription        = "Compaq NetFlex-3 NDIS 3.0 Miniport Driver"
    ProductHardwareNetFlex3PDescription = "Compaq NetFlex-3/P Controller"
    ProductHardwareNetFlex3EDescription = "Compaq NetFlex-3/E Controller"
    CANNOT_FIND_ANY_CARD              = "Network card is not present in the system."
    ProductSoftwareTitle              = "Compaq NetFlex-3 Driver"
    ProductHardwareNetFlex3PTitle       = "NetFlex-3"
    ProductHardwareNetFlex3ETitle       = "NetFlex-3"
    ProductHardwareNetFlex3PSuffix      = "/P"
    ProductHardwareNetFlex3ESuffix      = "/E"
    ShellCodeErrorTitle     = "Error: "$(FunctionTitle)
    ShellCodeErrorText      = "Shell Code Error."

[DialogConstantsENG]
    Help        = "&Help"
    Exit        = "Cancel"
    OK          = "OK"
    HelpContext = ""
    Continue    = "Continue"
    Cancel      = "Cancel"

[FileDependentDlgENG]
    Edit1Label = "&Network Address:"
    DlgType = "Edit"
    DlgTemplate = "NETWORK_NUMBER"
    Caption = $(FunctionTitle)
    HelpContext = $(!IDH_DB_OEMNADVT_INS)
    EditTextLim = 17
    EditTextIn  = $(NetworkAddress)
    EditFocus   = "ALL"
    RCCtlFocusOn = 403

[MediaSpeedChoicesUnknownENG]
    MediaSpeed_Auto     = "Auto"        , 0
    MediaSpeed_10Mbps   = "10 Mbps"     , 10
    MediaSpeed_100Mbps  = "100 Mbps"    , 100

[MediaSpeedChoices10BaseTENG]
    MediaSpeed_10Mbps   = "10 Mbps"     , 0

[MediaSpeedChoices100BaseTXENG]
    MediaSpeed_Auto     = "Auto"        , 0
    MediaSpeed_10Mbps   = "10 Mbps"     , 10
    MediaSpeed_100Mbps  = "100 Mbps"    , 100

[MediaSpeedChoices100BaseVGENG]
    MediaSpeed_100Mbps  = "100 Mbps"    , 0

[DuplexChoicesUnknownENG]
    Dulplex_Auto    = "Auto"          , 0
    Dulplex_Half    = "Half Duplex"   , 1
    Dulplex_Full    = "Full Duplex"   , 2

[DuplexChoices10BaseTENG]
    Dulplex_Half    = "Half Duplex"   , 1
    Dulplex_Full    = "Full Duplex"   , 2

[DuplexChoices100BaseTXENG]
    Dulplex_Half    = "Half Duplex"   , 0  ; note: uses auto, not force half duplex
    Dulplex_Full    = "Full Duplex"   , 2

[DuplexChoices100BaseVGENG]
    Dulplex_Half    = "Half Duplex"   , 0  ; note: uses auto, not force half duplex

[ConnectorChoicesUnknownENG]
    Connector_Auto = "Auto"    , 0
    Connector_BNC  = "BNC"     , 1
    Connector_UTP  = "UTP"     , 2

[ConnectorChoices10BaseTENG]
    Connector_Auto = "Auto"    , 0
    Connector_UTP  = "UTP"     , 1

[ConnectorChoices100BaseVGENG]
    Connector_UTP  = "UTP"     , 0  ; note: uses auto, not force UTP

[ConnectorChoices100BaseTXENG]
    Connector_UTP  = "UTP"     , 0  ; note: uses auto, not force UTP

[OptionsLists]
    MediaSpeedTextList      = ^(MediaSpeedChoices$(PhyType)$(!STF_LANGUAGE), 1)
    MediaSpeedValueList     = ^(MediaSpeedChoices$(PhyType)$(!STF_LANGUAGE), 2)
    MediaSpeedTextDlgDefault= *($(MediaSpeedTextList),~($(MediaSpeedValueList), $(MediaSpeedValue)))
    DuplexTextList          = ^(DuplexChoices$(PhyType)$(!STF_LANGUAGE), 1)
    DuplexValueList         = ^(DuplexChoices$(PhyType)$(!STF_LANGUAGE), 2)
    DuplexTextDlgDefault    = *($(DuplexTextList),~($(DuplexValueList), $(DuplexValue)))
    ConnectorTextList       = ^(ConnectorChoices$(PhyType)$(!STF_LANGUAGE), 1)
    ConnectorValueList      = ^(ConnectorChoices$(PhyType)$(!STF_LANGUAGE), 2)
    ConnectorTextDlgDefault = *($(ConnectorTextList),~($(ConnectorValueList), $(ConnectorValue)))

    VerifyOptionsList = { {MediaSpeedTextList , MediaSpeedValueList, MediaSpeedTextDlgDefault} +
                          {DuplexTextList , DuplexValueList, DuplexTextDlgDefault} +
                          {ConnectorTextList , ConnectorValueList, ConnectorTextDlgDefault} }
[OptionsDlgENG]
    DlgType     = Combination
    DlgTemplate = IDD_OPTIONS
    Caption     = "Compaq NetFlex-3 Controller Configuration"
    DlgText1    = "Listed below are hardware configuration settings for the attached physical media interface.  "+
                  "Normally these values should be set to 'Auto', which lets "+
                  "the driver automatically determine the proper settings.  "+
                  "However, sometimes it is necessary to override these values." +
                  "Make any appropriate modifications and press Continue.  " +
                  "Press F1 or select the help button for additional help."
    GroupBox1               = "Configuration Settings:"
    GroupBox2               = "Option Module: "#($(PhyType)PhyText$(!STF_LANGUAGE), 1, 1)
    Combo1Label             = "Media &Speed:"
    Combo1List              = $(MediaSpeedTextList)
    Combo1Out               = $(MediaSpeedTextDlgDefault)
    Combo2Label             = "&Duplex Setting:"
    Combo2List              = $(DuplexTextList)
    Combo2Out               = $(DuplexTextDlgDefault)
    Combo3Label             = "Media &Connector:"
    Combo3List              = $(ConnectorTextList)
    Combo3Out               = $(ConnectorTextDlgDefault)
    ComboListItemsIn        = {Combo1List, Combo2List, Combo3List }
    ComboListItemsOut       = {Combo1Out, Combo2Out, Combo3Out  }
    GroupBox3               = "&Network Address:"
    EditTextIn              = $(NetworkAddress)
    EditTextLim             = 17
    Continue                = "&Continue"
    Exit                    = "E&xit"
    Help                    = "&Help"
    NotifyFields            = {YES, YES, YES}
    HelpContext             = $(!IDH_NETFLEX3_MEDIA_SCREEN)
    RCCtlFocusOn            = 403
    EditFocus               = ""

[ForceUTPMessageBoxENG]
    set DlgType      = "MessageBox"
    set STF_MB_TITLE = "Warning:"
    set STF_MB_TEXT  = "Selecting Full Duplex operation requires setting the Media Connector "+
                       "to Unshielded Twisted Pair (UTP)."
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 2
    set STF_MB_DEF   = 1
    ui start "Error Message"
    Return $(Status)

[ForceTXSpeedMessageBoxENG]
    set DlgType      = "MessageBox"
    set STF_MB_TITLE = "Warning:"
    set STF_MB_TEXT  = "Selecting Full Duplex operation requires setting the Media Speed.  "+
                       "By default the Media Speed will be set to 100Mbps."
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 2
    set STF_MB_DEF   = 1
    ui start "Error Message"
    Return $(Status)


[ConfigureErrorENG]
    ShellCodeErrorText ="Unable to locate this adapter, this could be the result "+
                        "of removing the adapter from the system, or if device "+
                        "configuration information was changed. "$(!CR)$(!LF)$(!LF)+
                        "Please remove the adapter instance, and then re-add the "+
                        "adapter if there is one in the system."


[HelpIds]
  !MinimumID = 0
  !MaximumID = 15
  !InitialContentsID = 15
  !IDH_NETFLEX3_MEDIA_SCREEN = 5
  HelpFile = NtReadMe.Hlp

[NetFlex3MessageBox]
    set DlgType      = "MessageBox"
    set STF_MB_TITLE = "MessageBox"
    set STF_MB_TEXT  = "Debug Pause"
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 3
    set STF_MB_DEF   = 1
    ui start "Error Message"
    Return $(Status)

[IsPCINetCardAlreadyInstalled]
    read-syms InitBaseVars
    set AlreadyExisted  = "NO"
    set BusNum  = $($0)
    set DeviceFunctionNumber = $($1)
    set Description = $($2)
    set Product = $($3)
    OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) IE_KeyNetcards
    Ifstr $(IE_KeyNetcards) == $(KeyNull)
       set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
       goto IE_Return
    endif
    EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
    ForListDo  $(IE_KeyNameList)
        set IE_KeyName = *($($),1)
        OpenRegKey $(IE_KeyNetcards) "" $(IE_KeyName) $(MAXIMUM_ALLOWED) IE_Card
        Ifstr $(IE_Card) == $(KeyNull)
           set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
           goto IE_Return
        endif
        GetRegValue $(IE_Card),"Description", DescriptionInfo
        GetRegValue $(IE_Card),"ProductName", ProductNameInfo
        set CardDescription     = *($(DescriptionInfo), 4)
        set CardProductName     = *($(ProductNameInfo), 4)
        ifstr(i) $(CardDescription) == $(Description)
            ifstr(i) $(CardProductName) == $(Product)
                GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
                set ServiceName = *($(ServiceNameInfo), 4)
                OpenRegKey $(!REG_H_LOCAL) "" +
                   $(ServicesBaseName)"\"$(ServiceName)"\Parameters" +
                   $(MAXIMUM_ALLOWED) IE_KeyService
                Ifstr $(IE_KeyService) == $(KeyNull)
                   set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
                   goto IE_Return
                endif
                GetRegValue $(IE_KeyService), "BusNumber", BusInfo
                GetRegValue $(IE_KeyService), "DeviceFunctionNumber", DeviceFunctionNumberInfo
                set CardBusNum = *($(BusInfo), 4)
                set CardDeviceFunctionNum = *($(DeviceFunctionNumberInfo), 4)
                ifint $(CardBusNum) == $(BusNum)
                    ifint $(CardDeviceFunctionNum) == $(DeviceFunctionNumber)
                        set AlreadyExisted = "YES"
                    endif
                endif
            endif
        endif
    EndForListDo
IE_Return = +
    return $(RegistryErrorIndex) $(AlreadyExisted)
