oemsetup.inf Driver File Contents (996_cd_v20.exe)

;*******************************************************************************
; The information contained in this file is confidential and proprietary to
; Broadcom Corporation.  No part of this file may be reproduced or
; distributed, in any form or by any means for any purpose, without the
; express written permission of Broadcom Corporation.
;
; (c) COPYRIGHT 2000 Broadcom Corporation, ALL RIGHTS RESERVED.
;
;
; Module Description:
;
;
; History:
;    09/15/00 Hao-Yang feng    Ver: 1.1.6
;    04/17/00 Hav Khauv        Initial version.
;*******************************************************************************



[Identification]
    OptionType = NetTransport


[Options]
    Blf


[DebugControl]
    !DebugOutputControl = 0


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


[LanguagesSupported]
    ENG, English


[OptionsTextENG]
    Blf = "Broadcom Advanced Server Program Driver"


[FileConstants]
    MAXIMUM_ALLOWED                 = 33554432
    NoTitle                         = 0
    EthernetMediaType               = 1

    UtilityInf                      = "UTILITY.INF"
    SubroutineInf                   = "SUBROUTN.INF"

    Manufacturer                    = "Broadcom"
    ProductMajorVersion             = "3"
    ProductMinorVersion             = "0"
    ProductBuildVersion             = "1"
    ProductVersion           = $(ProductMajorVersion)"."$(ProductMinorVersion)"."$(ProductBuildVersion)

    NetEventDll     = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\drivers\baspnt4.sys"
    BlfDriverPath   = "\SystemRoot\System32\drivers\baspnt4.sys"
    BlfDll          = "baspnt4.dll"
    B57dtectDll     = "b57dtect.dll"

    TransportProductDescription      = $(Manufacturer)" Intermediate Driver"
    TransportProductName             = "Blfp"
    TransportProductKeyName          = $(!NTN_SoftwareBase)"\"$(Manufacturer)+
                                       "\"$(TransportProductName)+
                                       "\CurrentVersion"
    TransportSoftwareType            = "transport"

    TransportNetRuleSoftwareType     = "bcmBlfp blfpTransport"
    TransportNetRuleSoftwareUse      = $(TransportSoftwareType)" yes none"
    TransportNetRuleSoftwareBindForm = """bcmBlfp"" yes yes container"
    TransportNetRuleSoftwareClass    = {"blfpTransport basic"}
    TransportNetRuleSoftwareBindable = {"blfpTransport ndisDriver non non 100"}

    MiniportProductDescription       = $(Manufacturer)" Ndis Miniport Driver"
    MiniportProductName              = "Blfm"
    MiniportProductKeyName           = $(!NTN_SoftwareBase)"\"$(Manufacturer)+
                                       "\"$(MiniportProductName)+
                                       "\CurrentVersion"
    MiniportSoftwareType             = "driver"

    MiniportNetRuleSoftwareUse       = $(MiniportSoftwareType)
    MiniportNetRuleSoftwareClass     = {"blfmDriver basic"}
    MiniportNetRuleSoftwareType      = "blfmSys ndisDriver blfmDriver"
    MiniportNetRuleSoftwareBindForm  = """blfmSys"" yes no container"
    MiniportNetRuleSoftwareBindable  = {"blfmDriver blfmAdapter non "+
                                        "exclusive 100"}

    MiniportNetRuleHardwareType      = "blfm blfmAdapter"
    MiniportNetRuleHardwareBindForm  = " yes yes container"
    MiniportNetRuleHardwareClass     = {"blfmAdapter basic"}
    MiniportNetRuleHardwareBlock     = {"blfpTransport blfmAdapter"}

    RegistryNetCardKey = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\"+
                         "NetworkCards\"
    RegistryServicesKey = "SYSTEM\CurrentControlSet\Services\"
    RegistryProductOptionsKey = "SYSTEM\CurrentControlSet\Control\ProductOptions"


[FileConstantsENG]
    FunctionBlfTitle = "Broadcom Advanced Server Program Driver"

    TransportProductSoftwareTitle = $(FunctionBlfTitle)

    TransportProductSoftwareDisplayName = $(FunctionBlfTitle)+" "+
        "load balances inbound and outbound network traffic.  It will also "+
        "redirect all traffic to a standby adapter in an event of network "+
        "failure."

    MiniportProductSoftwareTitle       = "BASP Virtual Adapter Driver"
    MiniportProductSoftwareDisplayName = "BASP Virtual Adapter Driver"

    MiniportProductHardwareTitle = "BASP Virtual Adapter"

    MsgShellErrorTitle = "Error: "$(FunctionBlfTitle)
    MsgShellErrorText  = "Shell Code Error."

    MsgProductAlreadyInstalled = "Previous version has already installed.  "+
                                 "To reinstall, remove the previous version "+
                                 "first."
    MsgPlatformNotSupported = "This version of Windows is not supported."
    MsgCannotFindBlfDll = "Cannot find baspnt4.dll file."
    MsgNeedMoreAdapters = "Broadcom Advanced Server Program driver requires "+
                          "at least one Ethernet adapters."
    MsgRegistryKeyDoesNotExist = "Open registry key failed."
    MsgMessageBoxTitle = $(TransportProductSoftwareTitle)
    MsgInvalidSetting = "An invalid configuration has been detected. "+
        "Please go back in the Network Control Panel and reconfigure the "+
        $(TransportProductSoftwareTitle)".  Current settings make cause the "+
        "system to behave erratically."
    MsgDowngrade = "Cannot downgrade to an older driver.  To downgrade, "+
        "you must uninstall first and then re-install the older driver."
    MsgCannotFindB57dtectDll = "Cannot load B57dtect.dll file."

[Source Media Descriptions]
    1 = "Broadcom Advanced Server Program Driver Diskette"


[Files-Blf]
    1, baspnt4.sys, SIZE=999

[Files-Dll]
    1, baspnt4.dll, SIZE=999

[Files-Other]
    1, b57dtect.dll, SIZE=65

[Files-Inf]
    1, oemsetup.inf, SIZE=1000, RENAME=$(!UG_Filename)



;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    None.
;*******************************************************************************
[ShowShellErrorMessage]
    read-syms DebugControl
    debug-output "### ShowShellErrorMessage"

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

    set DlgType      = "MessageBox"
    set STF_MB_TITLE = $(MsgShellErrorTitle)
    set STF_MB_TEXT  = $(MsgShellErrorText)
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 3
    set STF_MB_DEF   = 1

    ui start "Error Message"

    return



;*******************************************************************************
; Description:
;    
; Input:
;    $($0) = "WARNING", "FATAL", "NONFATAL", or "STATUS"
;    $($1) = Registery fatal text code.
;
; Output:
;    STATUS_FAILED
;    STATUS_SUCCESSFUL
;*******************************************************************************
[ShowRegistryErrorMessage]
    read-syms DebugControl
    debug-output "### ShowRegistryErrorMessage"

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

    set Severity = $($0)
    set RegStrCode = $($1)

    shell $(UtilityInf) RegistryErrorString $(RegStrCode)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        shell "" ShowShellErrorMessage
        return STATUS_FAILED
    endif

    set RegText = $($R0)

    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) $(Severity) $(RegText)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    Displays shell error message.
;    
; Input:
;    $($0) = "WARNING", "FATAL", "NONFATAL", or "STATUS"
;    $($1) = Fatal text string.
;
; Output:
;    None.
;*******************************************************************************
[ShowErrorMessage]
    read-syms DebugControl
    debug-output "### ShowErrorMessage"

    read-syms FileConstants

    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) $($0) $($1)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        shell "" ShowShellErrorMessage
    endif

    return



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionID to install
;
; Output:
;   STATUS_FAILED
;   STATUS_SUCCESSFUL
;*******************************************************************************
[InstallTransport]
    read-syms DebugControl
    debug-output "### InstallTransport"

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

    set OptionId = $($0)
    debug-output "OptionId : "$(OptionId)

    ; Store current date in $(Now).
    detect CurrentDate

    ; Create registry keys for the transport driver.
    shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
        $(TransportProductName), $(TransportProductName), +
        $(TransportProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
        $(BlfDriverPath), "transport", "TDI", {}, "", $(NetEventDll)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "AddSoftwareComponent failed: Transport protocol."

        closeregkey $($R1)
        closeregkey $($R2)
        closeregkey $($R3)
        closeregkey $($R4)
        closeregkey $($R5)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    ; $R1 contains handle to "SOFTWARE\Broadcom\CurrentVersion".
    ; $R2 contains handle to "SOFTWARE\Broadcom\CurrentVersion\NetRules".
    ; $R3 contains handle to "SYSTEM\CurrentControlSet\Blfp".
    ; $R4 contains handle to "SYSTEM\CurrentControlSet\Blfp\Parameters".
    ; $R5 contains handle to "SYSTEM\CurrentControlSet\Blfp\Linkage".

    set ProductKey = $($R1)
    set NetRuleKey = $($R2)
    set ServiceKey = $($R3)
    set ParameterKey = $($R4)
    set LinkageKey = $($R5)

    ; Initialize "SOFTWARE\Broadcom\CurrentVersion" hive.
    set NewValueList = { +
        { SoftwareType, $(NoTitle), $(!REG_VT_SZ),          +
            $(TransportSoftwareType) },                     +
        { MajorVersion, $(NoTitle), $(!REG_VT_DWORD),       +
            $(ProductMajorVersion) },                       +
        { MinorVersion, $(NoTitle), $(!REG_VT_DWORD),       +
            $(ProductMinorVersion) },                       +
        { BuildVersion, $(NoTitle), $(!REG_VT_DWORD),       +
            $(ProductBuildVersion) },                       +
        { Title,        $(NoTitle), $(!REG_VT_SZ),          +
            $(TransportProductSoftwareTitle) },             +
        { Description,  $(NoTitle), $(!REG_VT_SZ),          +
            $(TransportProductDescription) },               +
        { ServiceName,  $(NoTitle), $(!REG_VT_SZ),          +
            $(TransportProductName)},                       +
        { Review,       $(NoTitle), $(!REG_VT_DWORD), 1 },  +
        { InstallDate,  $(NoTitle), $(!REG_VT_DWORD),       +
            *($(Now),1) } }
    shell $(UtilityInf), AddValueList, $(ProductKey), $(NewValueList)
    ifstr $($R0) != NO_ERROR
        debug-output "Initialize Broadcom\CurrentVersion hive failed."

        closeRegKey $(ProductKey)
        closeRegKey $(NetRuleKey)
        closeRegKey $(ServiceKey)
        closeRegKey $(LinkageKey)
        closeRegKey $(ParameterKey)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    ; Initialize the "SOFTWARE\Broadcom\CurrentVersion\NetRules" hive.
    set NewValueList = { +
        { type,         $(NoTitle), $(!REG_VT_SZ),          +
            $(TransportNetRuleSoftwareType) },              +
        { use,          $(NoTitle), $(!REG_VT_SZ),          +
            $(TransportNetRuleSoftwareUse) },               +
        { class,        $(NoTitle), $(!REG_VT_MULTI_SZ),    +
            $(TransportNetRuleSoftwareClass) },             +
        { bindform,     $(NoTitle), $(!REG_VT_SZ),          +
            $(TransportNetRuleSoftwareBindForm) },          +
        { bindable,     $(NoTitle), $(!REG_VT_MULTI_SZ),    +
            $(TransportNetRuleSoftwareBindable) },          +
        { InfOption,    $(NoTitle), $(!REG_VT_SZ),          +
            $(OptionId)} }
    shell $(UtilityInf), AddValueList, $(NetRuleKey), $(NewValueList)
    ifstr $($R0) != NO_ERROR
        debug-output "Initialize CurrentVersion\NetRules hive failed."

        closeregkey $(ProductKey)
        closeregkey $(NetRuleKey)
        closeregkey $(ServiceKey)
        closeregkey $(LinkageKey)
        closeregkey $(ParameterKey)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    ; Initialize the "SYSTEM\CurrentControlSet\Blfp\Parameters" hive.
    Set NewValueList = { +
        { BlfParams,    $(NoTitle),     $(!REG_VT_SZ),      +
            "nothing here yet"} }
    shell $(UtilityInf), AddValueList, $(ParameterKey), $(NewValueList)
    ifstr $($R0) != NO_ERROR
        debug-output "Initialize \Blfp\Parameters hive failed."

        closeregkey $(ProductKey)
        closeregkey $(NetRuleKey)
        closeregkey $(ServiceKey)
        closeregkey $(LinkageKey)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    closeregkey $(ProductKey)
    closeregkey $(NetRuleKey)
    closeregkey $(ServiceKey)
    closeregkey $(LinkageKey)
    closeregkey $(ParameterKey)

    debug-output "Transport protocol installed."

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0)      Physical or virtual adapter info.
;    $($1)      Virtual adapter list. (for updating physical adapter upperbind
;               key)
;
; Output:
;    $($R0)     STATUS_FAILED or STATUS_SUCCESSFUL
;*******************************************************************************
[UpdateMiniport]
    read-syms DebugControl
    debug-output "### UpdateMiniport"

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

    set AdapterInfo = $($0)

    set ProductName = *($(AdapterInfo), 3)
    set ServiceName = *($(AdapterInfo), 4)
    set AdapterNum = *($(AdapterInfo), 6)
    set MemberType = *($(AdapterInfo), 7)
    set TeamId = *($(AdapterInfo), 8)
    set TeamName = *($(AdapterInfo), 9)
    set VlanID = *($(AdapterInfo), 11)
    set VlanName = *($(AdapterInfo), 12)
    set TeamType = *($(AdapterInfo), 13)
    set MACAddr = *($(AdapterInfo), 14)
    set AdvancedFailover = *($(AdapterInfo), 15)
    set NICType = *($(AdapterInfo), 16)
    set NicCat = *($(AdapterInfo), 17)
    set VID = *($(AdapterInfo), 18)
    set DID = *($(AdapterInfo), 19)
    set SVID = *($(AdapterInfo), 20)
    set SID = *($(AdapterInfo), 21)

    debug-output "========== UpdateMiniport"
    debug-output "ProductName: "$(ProductName)
    debug-output "ServiceName: "$(ServiceName)
    debug-output "AdapterNum: "$(AdapterNum)
    debug-output "MemberType: "$(MemberType)
    debug-output "TeamName: "$(TeamName)
    debug-output "TeamId: "$(TeamId)
    debug-output "VlanID: "$(VlanID)
    debug-output "VlanName: "$(VlanName)
    debug-output "TeamType: "$(TeamType)
    debug-output "MACAddr: "$(MACAddr)
    debug-output "AdvancedFailover: "$(AdvancedFailover)
    debug-output "NICType: "$(NICType)
    debug-output "NicCat: "$(NicCat)
    debug-output "VID: "$(VID)
    debug-output "DID: "$(DID)
    debug-output "SVID: "$(SVID)
    debug-output "SID: "$(SID)

    ; Physical or virtual adapter.
    ifstr(i) $(ProductName) == $(MiniportProductName)
        ; Update "Services\Blfm[n]\Parameters" key.
        debug-output "Updating Services\Blfm[n]\Parameters key."

        openregkey $(!REG_H_LOCAL) "" $(RegistryServicesKey)+
            $(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
        ifstr(i) $(ParamKey) == ""
            debug-output "Update virtual adapter param key failed."
            shell "" ShowErrorMessage "FATAL" $(MsgRegistryKeyDoesNotExist)
            return STATUS_FAILED
        endif

        ; Update TeamId and TeamName.
        Set NewValueList = {                                               +
            { TeamId,       $(NoTitle), $(!REG_VT_DWORD), $(AdapterNum) }, +
            { TeamName,     $(NoTitle), $(!REG_VT_SZ), $(TeamName) },      +
            { VlanID,       $(NoTitle), $(!REG_VT_DWORD), $(VlanID) },     +
            { VlanName,     $(NoTitle), $(!REG_VT_SZ), $(VlanName) },      +
            { TeamType,     $(NoTitle), $(!REG_VT_DWORD), $(TeamType) },   +
            { VAName,       $(NoTitle), $(!REG_VT_SZ), "\Device\"$(ServiceName) } }
        shell $(UtilityInf), AddValueList, $(ParamKey), $(NewValueList)
        ifstr $($R0) != NO_ERROR
            debug-output "Initialize Services\Blfm[x]\Parameters hive failed."
            shell "" ShowErrorMessage "FATAL" $($R0)
            return STATUS_FAILED
        endif

        closeregkey $(ParamKey)
    else
        ; Physical adapter.

        ifstr(i) $(TeamName) == ""
            ; This physical adapter is not part of a team.
            debug-output "Physical adapter does not belong to a team."

            ; Remove "Services\[RealNicx]\Parameters\Blfp" key if there is any.
            openregkey $(!REG_H_LOCAL) "" $(RegistryServicesKey)+
                $(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
            ifstr(i) $(ParamKey) != ""
                deleteregtree $(ParamKey) $(TransportProductName)
                DeleteRegValue $(ParamKey) "NetworkAddress"
                DeleteRegValue $(ParamKey) "VlanEnable"
                DeleteRegValue $(ParamKey) "AdvancedFailover"
                flushregkey $(ParamKey)
                closeregkey $(ParamKey)
            endif
        else
            ; This adapter is part of a team.
            debug-output "Physical adapter is part of "$(TeamName)" team."

            ; Create "Services\[RealNicx]\Parameters\Blfp" key if it does not
            ; exist yet.
            set TransportParamKeyName = $(RegistryServicesKey)$(ServiceName)+
                "\Parameters\"$(TransportProductName)
            createregkey $(!REG_H_LOCAL) { $(TransportParamKeyName), +
                $(NoTitle), GenericClass } "" $(MAXIMUM_ALLOWED) ""  +
                TransportParamKey
            ifstr(i) $(TransportParamKey) == ""
                ; Key already existed, just open for reading.
                openregkey $(!REG_H_LOCAL) "" $(TransportParamKeyName) +
                    $(MAXIMUM_ALLOWED) TransportParamKey
            endif

            ifstr(i) $(TransportParamKey) != ""
                ; Update "Services\[RealNicx]\Parameters\Blfp" key.
                debug-output "Updating Services\"$(ServiceName)+
                    "\Parameters\Blfp."

                Set UpperBindings = { }
                Set VirtualAdapterList = $($1)
                forlistdo $(VirtualAdapterList)
                    set VirtualAdapter = $($)
                    ifstr(i) *($(VirtualAdapter), 9) == $(TeamName)
                        Set BindServiceName = *($(VirtualAdapter), 4)
                        Set BindDevice = $(BindServiceName)
                        Set UpperBindings = >($(UpperBindings), $(BindDevice))
                    endif
                endforlistdo

                Set NewValueList = {                                          +
                    { TeamId,       $(NoTitle), $(!REG_VT_DWORD),             +
                        $(TeamId) },                                          +
                    { MemberType,   $(NoTitle), $(!REG_VT_DWORD),             +
                        $(MemberType) },                                      +
                    { TeamName,     $(NoTitle), $(!REG_VT_SZ), $(TeamName) }, +
                    { TeamType,     $(NoTitle), $(!REG_VT_DWORD),             +
                        $(TeamType) },                                        +
                    { UpperBindings,$(NoTitle), $(!REG_VT_MULTI_SZ),          +
                    $(UpperBindings) },                                       +
                    { AdvancedFailover, $(NoTitle), $(!REG_VT_DWORD),         +
                    $(AdvancedFailover) } }

                shell $(UtilityInf), AddValueList, $(TransportParamKey), +
                    $(NewValueList)
                ifstr $($R0) != NO_ERROR
                    debug-output "Initialize \Blfm[x]\Parameters hive failed."
                    shell "" ShowErrorMessage "FATAL" $($R0)
                    return STATUS_FAILED
                endif
            else
                debug-output "Cannot open "$(TransportParamKeyName)"."
            endif

            closeregkey $(TransportParamKey)

            ; Put in team attributes.
            openregkey $(!REG_H_LOCAL) "" $(RegistryServicesKey)+
                $(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
            ifstr(i) $(ParamKey) != ""
                ifint $(TeamType) == 1
                    Set NewValueList = {                                      +
                        { NetworkAddress, $(NoTitle), $(!REG_VT_SZ),          +
                            $(MACAddr) } }
                    shell $(UtilityInf), AddValueList, $(ParamKey),           +
                        $(NewValueList)
                else
                    DeleteRegValue $(ParamKey) "NetworkAddress"
                endif

                Set HasVlan = "0"
                Set VirtualAdapterList = $($1)
                forlistdo $(VirtualAdapterList)
                    set VirtualAdapter = $($)
                    ifstr(i) *($(VirtualAdapter), 9) == $(TeamName)
                        ifstr(i) *($(VirtualAdapter), 12) != ""
                            Set HasVlan = "1"
                        endif
                    endif
                endforlistdo

                ifint $(HasVlan) == 1
                    Set NewValueList = {                                  +
                        { VlanEnable, $(NoTitle), $(!REG_VT_DWORD),       +
                            "1" } }
                    shell $(UtilityInf), AddValueList, $(ParamKey),       +
                        $(NewValueList)
                else
                    DeleteRegValue $(ParamKey) "VlanEnable"
                endif

                flushregkey $(ParamKey)
                closeregkey $(ParamKey)
            endif
        endif
    endif

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):     Virtual adapter info.
;    $($1):     OptionID to install
;
; Output:
;    $($R0)     STATUS_FAILED or STATUS_SUCCESSFUL
;    $($R1)     Virtual adapter with update info.
;*******************************************************************************
[InstallVirtualMiniport]
    read-syms DebugControl
    debug-output "### InstallVirtualMiniport"

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

    Detect CurrentDate

    set VirtualAdapter = $($0)
    set OptionId = $($1)

    debug-output "OptionId : "$(OptionId)

    debug-output "Install a new virtual miniport: "$(VirtualAdapter)

    ; Check to see if the software component is installed.  If not, install
    ; it.
    openregkey $(!REG_H_LOCAL) "" $(MiniportProductKeyName) $(MAXIMUM_ALLOWED) +
        ProductKey
    ifstr(i) $(ProductKey) == ""
        debug-output "Create the software component."

        shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
            $(MiniportProductName), $(MiniportProductName), +
            $(MiniportProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
            $(BlfDriverPath), "kernel", "NDIS", {}, "", $(NetEventDll)
        ifstr(i) $($R0) != NO_ERROR
            debug-output "Add miniport software component failed."

		    closeregkey $($R1)
		    closeregkey $($R2)
		    closeregkey $($R3)
		    closeregkey $($R4)
		    closeregkey $($R5)

            shell "" ShowRegistryErrorMessage "FATAL" $($R0)

            return STATUS_FAILED
        endif

        ; $R1 contains handle to "SOFTWARE\Broadcom\CurrentVersion".
        ; $R2 contains handle to "SOFTWARE\Broadcom\CurrentVersion\NetRules".
        ; $R3 contains handle to "SYSTEM\CurrentControlSet\Blfp".
        ; $R4 contains handle to "SYSTEM\CurrentControlSet\Blfp\Parameters".
        ; $R5 contains handle to "SYSTEM\CurrentControlSet\Blfp\Linkage".

        set ProductKey   = $($R1)
        set NetRuleKey   = $($R2)
        set ServiceKey   = $($R3)
        set ParameterKey = $($R4)
        set LinkageKey   = $($R5)

        set NewValueList = {                                +
            { SoftwareType, $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportSoftwareType) },                  +
            { MajorVersion, $(NoTitle), $(!REG_VT_DWORD),   +
                $(ProductMajorVersion) },                   +
            { MinorVersion, $(NoTitle), $(!REG_VT_DWORD),   +
                $(ProductMinorVersion) },                   +
            { BuildVersion, $(NoTitle), $(!REG_VT_DWORD),   +
                $(ProductBuildVersion) },                   +
            { Title,        $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportProductSoftwareTitle) },          +
            { Description,  $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportProductDescription) },            +
            { ServiceName,  $(NoTitle), $(!REG_VT_SZ),      +
                $(MiniportProductName) },                   +
            { InstallDate,  $(NoTitle), $(!REG_VT_DWORD),   +
                *($(Now),1) } }

        shell $(UtilityInf), AddValueList, $(ProductKey), $(NewValueList)
        ifstr(i) $($R0) != NO_ERROR
            debug-output "Cannot create miniport software key."

            closeregkey $(ProductKey)
            closeregkey $(NetRuleKey)
            closeregkey $(ServiceKey)
            closeregkey $(ParameterKey)
            closeregkey $(LinkageKey)

            shell "" ShowRegistryErrorMessage "FATAL" $($R0)

            return STATUS_FAILED
        endif

        set NewValueList = {                                    +
            { type,         $(NoTitle), $(!REG_VT_SZ),          +
                $(MiniportNetRuleSoftwareType) },               +
            { use,          $(NoTitle), $(!REG_VT_SZ),          +
                $(MiniportNetRuleSoftwareUse) },                +
            { bindform,     $(NoTitle), $(!REG_VT_SZ),          +
                $(MiniportNetRuleSoftwareBindForm) },           +
            { class,        $(NoTitle), $(!REG_VT_MULTI_SZ),    +
                $(MiniportNetRuleSoftwareClass) },              +
            { bindable,     $(NoTitle), $(!REG_VT_MULTI_SZ),    +
                $(MiniportNetRuleSoftwareBindable) },           +
            { InfOption,    $(NoTitle), $(!REG_VT_SZ),          +
                $(OptionId) } }

        shell $(UtilityInf), AddValueList, $(NetRuleKey), $(NewValueList)
        ifstr(i) $($R0) != NO_ERROR
            debug-output "### Cannot create the miniport netrules."

            closeregkey $(ProductKey)
            closeregkey $(NetRuleKey)
            closeregkey $(ServiceKey)
            closeregkey $(ParameterKey)
            closeregkey $(LinkageKey)

            shell "" ShowRegistryErrorMessage "FATAL" $($R0)

            return STATUS_FAILED
        endif

        closeregkey $(NetRuleKey)
        closeregkey $(ServiceKey)
        closeregkey $(ParameterKey)
        closeregkey $(LinkageKey)
    endif

    closeregkey $(ProductKey)

    debug-output "Create the hardware component."

    ; Create "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\".
    shell $(UtilityInf), AddHardwareComponent, $(MiniportProductName), +
        $(STF_CONTEXTINFNAME), $(MiniportProductKeyName)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "### Add hardware component error."

        closeregkey $($R1)
        closeregkey $($R2)
        closeregkey $($R3)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    set HardNetCardKey      = $($R1)
    set HardNetRuleKey      = $($R2)
    set HardParameterKey    = $($R3)
    set AdapterNumber       = $($R4)
    set AdapterServiceName  = $($R5)

    ; Fill in the info.
    ifstr(i) *($(VirtualAdapter), 12) == ""
        set NetCardTitle = $(MiniportProductHardwareTitle)" ("+
            *($(VirtualAdapter), 9)")"
    else
        set NetCardTitle = $(MiniportProductHardwareTitle)" ("+
            *($(VirtualAdapter), 9)"/"*($(VirtualAdapter), 12)")"
    endif

    set VirtualAdapter = { $(MiniportProductDescription), $(Manufacturer),  +
        $(MiniportProductName), $(AdapterServiceName),                      +
        $(MiniportProductHardwareTitle), $(AdapterNumber), "0",             +
        $(AdapterNumber), *($(VirtualAdapter), 9), "0",                     +
        *($(VirtualAdapter), 11), *($(VirtualAdapter), 12),                 +
        *($(VirtualAdapter), 13), *($(VirtualAdapter), 14),                 +
        *($(VirtualAdapter), 15), *($(VirtualAdapter), 16) }

    set NewValueList = {                                                +
        { Manufacturer, $(NoTitle), $(!REG_VT_SZ),                      +
            $(Manufacturer) },                                          +
        { Title,        $(NoTitle), $(!REG_VT_SZ),                      +
            "["$(AdapterNumber)"] "$(NetCardTitle) },                   +
        { Description,  $(NoTitle), $(!REG_VT_SZ),                      +
            $(MiniportProductDescription) },                            +
        { ProductName,  $(NoTitle), $(!REG_VT_SZ),                      +
            $(MiniportProductName) },                                   +
        { ServiceName,  $(NoTitle), $(!REG_VT_SZ),                      +
            $(AdapterServiceName) },                                    +
        { Hidden,       $(NoTitle), $(!REG_VT_DWORD), 1 },              +
        { InstallDate,  $(NoTitle), $(!REG_VT_DWORD), *($(Now), 1) } }

    shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "### Add netrule shell error."

        closeregkey $(HardNetCardKey)
        closeregkey $(HardNetRuleKey)
        closeregkey $(HardParameterKey)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    set NewValueList = {                                            +
        { MediaType,        $(NoTitle), $(!REG_VT_DWORD),           +
            $(EthernetMediaType) },                                 +
        { TeamId,           $(NoTitle), $(!REG_VT_DWORD),           +
            $(AdapterNumber) },                                     +
        { TeamName,         $(NoTitle), $(!REG_VT_SZ),              +
            *($(VirtualAdapter), 9) },                              +
        { VlanID,           $(NoTitle), $(!REG_VT_DWORD),           +
            *($(VirtualAdapter), 11) },                             +
        { VlanName,         $(NoTitle), $(!REG_VT_SZ),              +
            *($(VirtualAdapter), 12) },                             +
        { TeamType,         $(NoTitle), $(!REG_VT_DWORD),           +
            *($(VirtualAdapter), 13) },                             +
        { VAName,           $(NoTitle), $(!REG_VT_SZ),              +
            "\Device\"*($(VirtualAdapter), 4) } }

    shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "### Add parameter shell error."

        closeregkey $(HardNetCardKey)
        closeregkey $(HardNetRuleKey)
        closeregkey $(HardParameterKey)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    set TempProdName = """"$(MiniportProductName)$(AdapterNumber)""""
    set TempBindForm = $(TempProdName)$(MiniportNetRuleHardwareBindForm)

    set NewValueList = { +
        { type,         $(NoTitle), $(!REG_VT_SZ),          +
            $(MiniportNetRuleHardwareType) },               +
        { bindform,     $(NoTitle), $(!REG_VT_SZ),          +
            $(TempBindForm) },                              +
        { block,        $(NoTitle), $(!REG_VT_MULTI_SZ),    +
            $(MiniportNetRuleHardwareBlock) },              +
        { class,        $(NoTitle), $(!REG_VT_MULTI_SZ),    +
            $(MiniportNetRuleHardwareClass) },              +
        { InfOption,    $(NoTitle), $(!REG_VT_SZ),          +
            $(OptionId)} }

    shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "### Add hardware component error."

        closeregkey $(HardNetCardKey)
        closeregkey $(HardNetRuleKey)
        closeregkey $(HardParameterKey)

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)

        return STATUS_FAILED
    endif

    closeregkey $(HardNetCardKey)
    closeregkey $(HardNetRuleKey)
    closeregkey $(HardParameterKey)

    debug-output "Updated virtual adapter info: "$(VirtualAdapter)

    return STATUS_SUCCESSFUL $(VirtualAdapter)



;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    None.
;*******************************************************************************
[Install-Option]
    debug-output "### Install-Option"

    ; Copy files.
    set STF_VITAL = ""
    ifstr(i) $(AddCopy) == "YES"
        AddSectionFilesToCopyList Files-Blf $(SrcDir) +
            $(!STF_WINDOWSSYSPATH)\drivers
        AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
        AddSectionFilesToCopyList Files-Other $(SrcDir) $(!STF_WINDOWSSYSPATH)
    endif

    ifstr(i) $(DoCopy) == "YES"
       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       CopyFilesInCopyList
    endif

    exit



;*******************************************************************************
; Description:
;    
; Input:
;
; Output:
;*******************************************************************************
[Install-Update]
    debug-output "### Install-Update"


    debug-output "### SrcDir="$(SrcDir)

    set STF_VITAL = ""
    set STF_OVERWRITE = "VERIFYSOURCEOLDER"


    debug-output "### UG_Filename="$(!UG_Filename)

    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
    AddSectionFilesToCopyList Files-Other $(SrcDir) $(!STF_WINDOWSSYSPATH)
    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
    AddSectionFilesToCopyList Files-Blf $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers

    set !STF_NCPA_FLUSH_COPYLIST = TRUE

    CopyFilesInCopyList

    exit
    


;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    $($R0)     Physical adapter list.
;    $($R1)     Virtual adapter list.
;*******************************************************************************
[BuildAdapterList]
    read-syms DebugControl
    debug-output "### BuildAdapterList"

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

    ; Get adapter info from the registry.
    openregkey $(!REG_H_LOCAL) "" $(RegistryNetCardKey) $(MAXIMUM_ALLOWED) +
        NetCardKey
    ifstr $(NetCardKey) == ""
        return {} {}
    endif

    set NetCardValueList = { }
    enumregkey $(NetCardKey) NetCardValueList

    ; Physical and virtual adapter list.  Each entry in the list consists of:
    ; 
    ; Information from NetworkCards hive.
    ;    1: Adapter description
    ;    2: Adapter manufacturer
    ;    3: Adapter product name
    ;    4: Adapter service name
    ;    5: Adapter title
    ;    6: Adapter number
    ;
    ; Information from "Services\[ServiceName]\Parameters\Blfp" hive.
    ;    7: Member type: 0 = unassigned, 1 = standby
    ;
    ; Information from "Services\Blfm[n]\Parameters" or
    ; "Services\[ServiceName]\Parameters\Blfp" hive.
    ;    8: Virtual adapter team id or 0 == unassigned
    ;
    ; Information from "Services\Blfm[n]\Parameters".
    ;    9: Team name.
    ;
    ; Return code from the DLL.  Valid only if this is a virtual adapter.
    ;   10: 0-Unchanged, 1-New, 2-Modified, or 3-Deleted
    ;
    ; Information from "Services\Blfm[n]\Parameters" hive.
    ;   11: VLAN id or 0 == unassigned, 11-bit unsigned value
    ;
    ; Information from "Services\Blfm[n]\Parameters" hive.
    ;   12: VLAN name or "" == unassigned
    ;
    ; Information from "Services\Blfm[n]\Parameters" hive.
    ;   13: Team type or 0 == Broadcom LBFO, 1 = 802.3ad, 2 = FEC/GEC
    ;
    ; Information from "Services\Blfm[n]\Parameters" hive.
    ;   14: If TeamType == 1, read "NetworkAddress" value
    ;
    ; Information from "Services\[ServiceName]\Parameters\Blfp" hive.
    ;   15: AdvancedFailover (0 = Disabled, 1 = Enabled)
    ;
    ;
    ;
    ; Virtual NIC
    ; ===========
    ;
    ; Blfm[n]
    ;   |
    ;   +----Parameters
    ;            |
    ;            |----TeamId (0 = unassigned or n)
    ;            |
    ;            |----TeamName
    ;            |
    ;            |----VlanID (11-bit unsigned value)
    ;            |
    ;            |----VlanName
    ;            |
    ;            |----TeamType (0 = Broadcom LBFO, 2 = 802.3ad, 1= FEC/GEC)
    ;            |
    ;            |----NetworkAddress
    ;            |
    ;            |----Other parameters
    ;            |
    ;            +----tcpip
    ;                   |
    ;                   Tcpip parameters
    ;
    ;
    ; Miniport instance
    ; =================
    ; 
    ; RealNic[n]
    ;    |
    ;    +----Parameters
    ;             |
    ;             |----NetworkAddress
    ;             |
    ;             +----tcpip
    ;             |
    ;             +----Blfp
    ;                   |
    ;                   |----TeamId (0 = unassigned or Virtual NIC instance #)
    ;                   |
    ;                   |----MemberType (0 = unassigned, 1 = standby, 2 = Virt)
    ;                   |
    ;                   |----TeamName
    ;                   |
    ;                   |----TeamType (0 = Broadcom LBFO, 2 = 802.3ad, 1= FEC/GEC)
    ;                   |
    ;                   |----UpperBindings (which virtual adapters to bind to)
    ;                   |
    ;                   |----AdvancedFailover (0 = Disabled, 1 = Enabled)
    ;                   |
    ;                   |----Other parameters

    LoadLibrary $(MsgCannotFindB57dtectDll) $(!STF_WINDOWSSYSPATH)"\"+
        $(B57dtectDll) HwdtectDll

    set PhysicalAdapterList = {}
    set VirtualAdapterList = {}

    ; loop through the keys in "NetworkCards" hive.
    forlistdo $(NetCardValueList)
        set AdapterNumber = *($($), 1)
        set AdapterProductName = ""
        set AdapterServiceName = ""
        set AdapterDescription = ""
        set AdapterManufacturer = ""
        set AdapterTitle = ""

        ; Get the information from the "NetworkCards\[x]" hive.
        openregkey $(!REG_H_LOCAL) "" $(RegistryNetCardKey)$(AdapterNumber) +
            $(MAXIMUM_ALLOWED) AdapterKey
        ifstr $(AdapterKey) == ""
            debug-output "Cannot open "$(RegistryNetCardKey)$(AdapterNumber)"."
        else
            set ValueList = { }
            enumregvalue $(AdapterKey) ValueList

            forlistdo $(ValueList)
                set ValueName = *($($), 1)
                set ValueData = *($($), 4)

                ifstr(i) $(ValueName) == "Description"
                    set AdapterDescription = $(ValueData)
                else-ifstr(i) $(ValueName) == "Manufacturer"
                    set AdapterManufacturer = $(ValueData)
                else-ifstr(i) $(ValueName) == "ProductName"
                    set AdapterProductName = $(ValueData)
                else-ifstr(i) $(ValueName) == "ServiceName"
                    set AdapterServiceName = $(ValueData)
                else-ifstr(i) $(ValueName) == "Title"
                    set AdapterTitle = $(ValueData)
                endif
            endforlistdo
        endif
        closeregkey $(AdapterKey)

        debug-output "================="
        debug-output "Description: "$(AdapterDescription)
        debug-output "ProductName: "$(AdapterProductName)
        debug-output "ServiceName: "$(AdapterServiceName)
        debug-output "Title: "$(AdapterTitle)

        set AdapterMemberType = 0
        set AdapterTeamId = 0
        set AdapterTeamName = ""
        set MediaType = 0
        set AdapterVlanID = 0
        set AdapterVlanName = ""
        set AdapterTeamType = 0
        set AdvancedFailover = 0
        set NICType = 0
        set NicCat = 0
        set VID = 0
        set DID = 0
        set SVID = 0
        set SID = 0

        ifstr(i) $(AdapterProductName) == $(MiniportProductName)
            debug-output "Virtual adapter."

            ; Get the information from "Services\[ServiceName]\Parameters" hive.
            openregkey $(!REG_H_LOCAL) "" $(RegistryServicesKey)+
                $(AdapterServiceName)"\Parameters" $(MAXIMUM_ALLOWED) +
                ServicesKey
            ifstr $(ServicesKey) == ""
                debug-output "Cannot open "$(RegistryServicesKey)+
                    $(AdapterServiceName)"\Parameters."
            else
                set ValueList = { }
                enumregvalue $(ServicesKey) ValueList

                forlistdo $(ValueList)
                    set ValueName = *($($), 1)
                    set ValueData = *($($), 4)

                    ifstr(i) $(ValueName) == "TeamId"
                        set AdapterTeamId = $(ValueData)
                    else-ifstr(i) $(ValueName) == "TeamName"
                        set AdapterTeamName = $(ValueData)
                    else-ifstr(i) $(ValueName) == "VlanID"
                        set AdapterVlanID = $(ValueData)
                    else-ifstr(i) $(ValueName) == "VlanName"
                        set AdapterVlanName = $(ValueData)
                    else-ifstr(i) $(ValueName) == "TeamType"
                        set AdapterTeamType = $(ValueData)
                    endif
                endforlistdo
                closeregkey $(ServicesKey)

            endif
        else
            debug-output "Physical adapter."

            ; Get the information from "Services\[ServiceName]\Parameters\Blfp"
            ; hive.
            openregkey $(!REG_H_LOCAL) "" $(RegistryServicesKey)+
                $(AdapterServiceName)"\Parameters\"$(TransportProductName) +
                $(MAXIMUM_ALLOWED) ServicesKey
            ifstr $(ServicesKey) == ""
                debug-output "Cannot open "$(RegistryServicesKey)+
                    $(AdapterServiceName)"\Parameters\"+
                    $(TransportProductName)"."
            else
                set ValueList = { }
                enumregvalue $(ServicesKey) ValueList

                forlistdo $(ValueList)
                    set ValueName = *($($), 1)
                    set ValueData = *($($), 4)

                    ifstr(i) $(ValueName) == "MemberType"
                        set AdapterMemberType = $(ValueData)
                    else-ifstr(i) $(ValueName) == "TeamName"
                        set AdapterTeamName = $(ValueData)
                    else-ifstr(i) $(ValueName) == "TeamId"
                        set AdapterTeamId = $(ValueData)
                    else-ifstr(i) $(ValueName) == "TeamType"
                        set AdapterTeamType = $(ValueData)
                    else-ifstr(i) $(ValueName) == "AdvancedFailover"
                        set AdvancedFailover = $(ValueData)
                    endif
                endforlistdo
                closeregkey $(ServicesKey)
            endif

            ; Get the media type.  Only accept ethernet adapter.
            openregkey $(!REG_H_LOCAL) "" $(RegistryServicesKey)+
                $(AdapterServiceName)"\Parameters" $(MAXIMUM_ALLOWED) +
                ServicesKey
            ifstr $(ServicesKey) == ""
                debug-output "Cannot open the adapter service key."
            else
                set ValueList = { }
                getregvalue $(ServicesKey) "MediaType" ValueList
                set MediaType = *($(ValueList), 4)

                set ValueList = { }
                getregvalue $(ServicesKey) "NetworkAddress" ValueList
                set AdapterMACAddr = *($(ValueList), 4)

                set ValueList = { }
                getregvalue $(ServicesKey) "BusNumber" ValueList
                set BusNum = 255
                ifstr *($(ValueList), 4) != ""
                    set BusNum = *($(ValueList), 4)
                endif

                set ValueList = { }
                getregvalue $(ServicesKey) "SlotNumber" ValueList
                set DeviceNum = 255
                ifstr *($(ValueList), 4) != ""
                    set DeviceNum = *($(ValueList), 4)
                endif

                set ValueList = { }
                set FunctionNum = 255
                getregvalue $(ServicesKey) "FunctionNumber" ValueList
                ifstr *($(ValueList), 4) != ""
                    set FunctionNum = *($(ValueList), 4)
                endif

                debug-output "AdapterMACAddr: "$(AdapterMACAddr)
                debug-output "BusNum: "$(BusNum)
                debug-output "DeviceNum: "$(DeviceNum)
                debug-output "FunctionNum: "$(FunctionNum)

                set VID = "0xFFFF"
                set DID = "0xFFFF"
                set SVID = "0xFFFF"
                set SID = "0xFFFF"
                ifint $(BusNum) != 255
                    ifint $(DeviceNum) != 255
                        ifint $(FunctionNum) != 255
                            ; Get vendor ID.
                            LibraryProcedure VID $(HwdtectDll) B57dtectPortIo +
                                "PciRd16" $(BusNum) $(DeviceNum) +
                                $(FunctionNum) "0x00"
                            debug-output "VID: "$(VID)

                            ; Get device id.
                            LibraryProcedure DID $(HwdtectDll) B57dtectPortIo +
                                "PciRd16" $(BusNum) $(DeviceNum) +
                                $(FunctionNum) "0x02"
                            debug-output "DID: "$(DID)

                            ; Get subvendor ID.
                            LibraryProcedure SVID $(HwdtectDll) B57dtectPortIo +
                                "PciRd16" $(BusNum) $(DeviceNum) +
                                $(FunctionNum) "0x2c"
                            debug-output "SVID: "$(SVID)

                            ; Get subsystem id.
                            LibraryProcedure SID $(HwdtectDll) B57dtectPortIo +
                                "PciRd16" $(BusNum) $(DeviceNum) +
                                $(FunctionNum) "0x2e"
                            debug-output "SID: "$(SID)

                            ; Get three bytes class code.
                            ; It has to be '0x020000' as ethernet class.
                            LibraryProcedure CCode1 $(HwdtectDll) +
                                B57dtectPortIo "PciRd8" $(BusNum) +
                                $(DeviceNum) $(FunctionNum) "0x09"
                            debug-output "CCode1: "$(CCode1)

                            LibraryProcedure CCode2 $(HwdtectDll) +
                                B57dtectPortIo "PciRd16" $(BusNum) +
                                $(DeviceNum) $(FunctionNum) "0x0A"
                            debug-output "CCode2: "$(CCode2)

                            ; If this is not enthernet card, don't use the IDs.
                            ifstr(i) $(CCode1) != "0x00"
                                set VID = "0xFFFF"
                                set DID = "0xFFFF"
                                set SVID = "0xFFFF"
                                set SID = "0xFFFF"
                            endif

                            ifstr(i) $(CCode2) != "0x0200"
                                set VID = "0xFFFF"
                                set DID = "0xFFFF"
                                set SVID = "0xFFFF"
                                set SID = "0xFFFF"
                            endif
                        endif
                    endif
                endif


                closeregkey $(ServicesKey)
            endif
        endif

        debug-output "MemberType: "$(AdapterMemberType)
        debug-output "TeamId: "$(AdapterTeamId)
        debug-output "TeamName: "$(AdapterTeamName)

        set AdapterInfo = { $(AdapterDescription), $(AdapterManufacturer), +
            $(AdapterProductName), $(AdapterServiceName), $(AdapterTitle), +
            $(AdapterNumber), $(AdapterMemberType), $(AdapterTeamId),      +
            $(AdapterTeamName), 0, $(AdapterVlanID), $(AdapterVlanName),   +
            $(AdapterTeamType), $(AdapterMACAddr), $(AdvancedFailover),    +
            $(NICType), $(NICType), $(VID), $(DID), $(SVID), $(SID) }
        ifstr(i) $(AdapterProductName) == $(MiniportProductName)
            set VirtualAdapterList = >($(VirtualAdapterList), $(AdapterInfo))
        else
            ; Reject non-ethernet adapters.
            ifstr(i) $(MediaType) == 1
                set PhysicalAdapterList = >($(PhysicalAdapterList), +
                    $(AdapterInfo))
            endif
        endif
    endforlistdo

    FreeLibrary $(HwdtectDll)
    closeregkey $(NetCardKey)

    debug-output "========== Physical adapter list."
    forlistdo $(PhysicalAdapterList)
        debug-output $($)
        debug-output "=="
    endforlistdo

    debug-output "========== Virtual adapter list."
    forlistdo $(VirtualAdapterList)
        debug-output $($)
        debug-output "=="
    endforlistdo

    return $(PhysicalAdapterList) $(VirtualAdapterList)



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionID to install
;
; Output:
;   STATUS_FAILED
;   STATUS_SUCCESSFUL
;*******************************************************************************
[RunGuiSetup]
    read-syms DebugControl
    debug-output "### RunGuiSetup"

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

    set OptionId = $($0)
    debug-output "OptionId : "$(OptionId)

    ; Build the virtual and physical adapter list.
    shell "" BuildAdapterList
    set PhysicalAdapterList = $($R0)
    set VirtualAdapterList = $($R1)

    ; Make sure we have at least one physical adapters.
    QueryListSize PhysicalAdapterCount $(PhysicalAdapterList)
    ifint $(PhysicalAdapterCount) < 1
        shell "" ShowErrorMessage "NONFATAL" $(MsgNeedMoreAdapters)
        return STATUS_SUCCESSFUL
    endif

    ; Load the configuration dll.
    LoadLibrary $(MsgCannotFindBlfDll) $(BlfDll) DllHandle

    ; Display the dialog box.
    LibraryProcedure ReturnCode $(DllHandle) BLF_ShowDialog +
        $(PhysicalAdapterList) $(VirtualAdapterList)
    ifstr(i) $(ReturnCode) != STATUS_LIST_MODIFIED
        FreeLibrary $(DllHandle)
        return STATUS_USERCANCEL
    endif

    ; Get the new physical adapter list.
    LibraryProcedure PhysicalAdapterList $(DllHandle) BLF_GetAdapterList +
        PHYSICAL_ADAPTER_LIST
    debug-output "New physical adapter list: "$(PhysicalAdapterList)

    ; Get the new virtual adapter list.
    LibraryProcedure VirtualAdapterList $(DllHandle) BLF_GetAdapterList +
        VIRTUAL_ADAPTER_LIST
    debug-output "New virtual adapter list: "$(VirtualAdapterList)

    ; Install new virtual adapters.
    set NewVirtualAdapterList = { }
    forlistdo $(VirtualAdapterList)
        set VirtualAdapter = $($)

        ; Determine if the virtual adapter was 1-new, 2-modified, 3-removed.
        ifint *($(VirtualAdapter), 10) == 1
            debug-output "New virtual adapter, team name = "+
                *($(VirtualAdapter), 9);
            
            shell "" InstallVirtualMiniport $(VirtualAdapter) $(OptionId)
            ifstr(i) $($R0) == STATUS_SUCCESSFUL
                set VirtualAdapter = $($R1)
            else
                debug-output "Create Virtual miniport failed."
            endif 
        endif

        ifstr(i) $(VirtualAdapter) != ""
            set NewVirtualAdapterList = >($(NewVirtualAdapterList), +
                $(VirtualAdapter))
        endif
    endforlistdo

    set VirtualAdapterList = $(NewVirtualAdapterList)

    ; Remove and update virtual adapters.
    set NewVirtualAdapterList = { }
    forlistdo $(VirtualAdapterList)
        set VirtualAdapter = $($)

        ; Determine if the virtual adapter was 1-new, 2-modified, 3-removed.
        ifint *($(VirtualAdapter), 10) == 3
            debug-output "Remove virtual adapter, team name = "+
                *($(VirtualAdapter), 9);
            
            shell "" RemoveVirtualMiniport $(VirtualAdapter)

            set VirtualAdapter = ""
        else-ifint *($(VirtualAdapter), 10) != 1
            debug-output "Update virtual adapter, team name = "+
                *($(VirtualAdapter), 9);

            shell "" UpdateMiniport $(VirtualAdapter) $(VirtualAdapterList)
        else
            debug-output "New virtual adapter, team name = "+
                *($(VirtualAdapter), 9);
        endif

        ifstr(i) $(VirtualAdapter) != ""
            set VirtualAdapter = { *($(VirtualAdapter), 1),             +
                *($(VirtualAdapter), 2), *($(VirtualAdapter), 3),       +
                *($(VirtualAdapter), 4), *($(VirtualAdapter), 5),       +
                *($(VirtualAdapter), 6), *($(VirtualAdapter), 7),       +
                *($(VirtualAdapter), 8), *($(VirtualAdapter), 9), "0",  +
                *($(VirtualAdapter), 11), *($(VirtualAdapter), 12),     +
                *($(VirtualAdapter), 13), *($(VirtualAdapter), 14),     +
                *($(VirtualAdapter), 15), *($(VirtualAdapter), 16) } 

            set NewVirtualAdapterList = >($(NewVirtualAdapterList), +
                $(VirtualAdapter))
        endif
    endforlistdo

    set VirtualAdapterList = $(NewVirtualAdapterList)

    ; All virtual adapters got 'pAdapterNum'. We need to adjust the Team ID
    ; of VLAN virtual adapter to the correct Team ID.
    set NewVirtualAdapterList = { }
    forlistdo $(VirtualAdapterList)
        set VirtualAdapter = $($)
        set AdapterNum = *($(VirtualAdapter), 6)
        forlistdo $(VirtualAdapterList)
            set VlanAdapter = $($)
            ifstr(i) *($(VirtualAdapter), 9) == *($(VlanAdapter), 9)
                ifint $(AdapterNum) > *($(VlanAdapter), 6)
                    set AdapterNum = *($(VlanAdapter), 6)
                endif
            endif
        endforlistdo

        set VirtualAdapter = { *($(VirtualAdapter), 1),             +
            *($(VirtualAdapter), 2), *($(VirtualAdapter), 3),       +
            *($(VirtualAdapter), 4), *($(VirtualAdapter), 5),       +
            $(AdapterNum), *($(VirtualAdapter), 7),                 +
            $(AdapterNum), *($(VirtualAdapter), 9), "0",            +
            *($(VirtualAdapter), 11), *($(VirtualAdapter), 12),     +
            *($(VirtualAdapter), 13), *($(VirtualAdapter), 14),     +
            *($(VirtualAdapter), 15), *($(VirtualAdapter), 16) } 

        set NewVirtualAdapterList = >($(NewVirtualAdapterList), +
            $(VirtualAdapter))
    endforlistdo

    set VirtualAdapterList = $(NewVirtualAdapterList)

    forlistdo $(VirtualAdapterList)
        set VirtualAdapter = $($)
        shell "" UpdateMiniport $(VirtualAdapter) $(VirtualAdapterList)
    endforlistdo

    ; If a team was deleted, remove all references to the team.
    set NewPhysicalAdapterList = { }
    forlistdo $(PhysicalAdapterList)
        set HasTeam = "0"
        set AdapterInfo = $($)
        forlistdo $(VirtualAdapterList)
            set VirtualAdapter = $($)
            ifstr(i) *($(AdapterInfo), 9) == *($(VirtualAdapter), 9)
                set HasTeam = "1"
            endif
        endforlistdo

        ifint $(HasTeam) != 1
            ; set TeamId field to 0 and TeamName = "".
            set AdapterInfo = { *($(AdapterInfo), 1), *($(AdapterInfo), 2), +
                *($(AdapterInfo), 3), *($(AdapterInfo), 4),                 +
                *($(AdapterInfo), 5), *($(AdapterInfo), 6),                 +
                *($(AdapterInfo), 7), 0, "", *($(AdapterInfo), 10),         +
                *($(AdapterInfo), 11), *($(AdapterInfo), 12),               +
                *($(AdapterInfo), 13), *($(AdapterInfo), 14),               +
                *($(AdapterInfo), 15), *($(AdapterInfo), 16) }
        endif

        set NewPhysicalAdapterList = >($(NewPhysicalAdapterList), +
            $(AdapterInfo))
    endforlistdo

    set PhysicalAdapterList = $(NewPhysicalAdapterList)

    ; Assign team Ids.
    debug-output "Assigning team id to all the physical adapters."
    set NewPhysicalAdapterList = { }

    forlistdo $(PhysicalAdapterList)
        set PhysicalAdapter = $($)
        set PhysicalAdapterTeamId = *($(PhysicalAdapter), 8)

        forlistdo $(VirtualAdapterList)
            set VirtualAdapter = $($)
            debug-output "Virtual adapter: "$(VirtualAdapter)

            ifstr(i) *($(PhysicalAdapter), 9) == *($(VirtualAdapter), 9)
                set PhysicalAdapterTeamId = *($(VirtualAdapter), 8)
                debug-output "New team id: "$(PhysicalAdapterTeamId)
            endif

        endforlistdo

        set PhysicalAdapter = { *($(PhysicalAdapter), 1),         +
            *($(PhysicalAdapter), 2), *($(PhysicalAdapter), 3),   +
            *($(PhysicalAdapter), 4), *($(PhysicalAdapter), 5),   +
            *($(PhysicalAdapter), 6), *($(PhysicalAdapter), 7),   +
            $(PhysicalAdapterTeamId), *($(PhysicalAdapter), 9),   +
            *($(PhysicalAdapter), 10), *($(PhysicalAdapter), 11), +
            *($(PhysicalAdapter), 12), *($(PhysicalAdapter), 13), +
            *($(PhysicalAdapter), 14), *($(PhysicalAdapter), 15), +
            *($(PhysicalAdapter), 16) }

        debug-output "Physical adapter: "$(PhysicalAdapter)

        set NewPhysicalAdapterList = >($(NewPhysicalAdapterList), +
            $(PhysicalAdapter))
    endforlistdo

    set PhysicalAdapterList = $(NewPhysicalAdapterList)

    debug-output "The new physical adapter list after assigning ids. "+
        $(PhysicalAdapterList)

    ; Update all the physical adapters.
    forlistdo $(PhysicalAdapterList)
        shell "" UpdateMiniport $($) $(VirtualAdapterList)
    endforlistdo

    FreeLibrary $(DllHandle)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0)      Virtual adapter to remove
;
; Output:
;    $($R0)     STATUS_FAILED or STATUS_SUCCESSFUL
;*******************************************************************************
[RemoveVirtualMiniport]
    read-syms DebugControl
    debug-output "### RemoveVirtualMiniport"

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

    set VirtualAdapter = $($0)
    debug-output "Virtual adapter to remove: "$(VirtualAdapter)

    ; Get the adapter instance.
    set AdapterInstance = *($(VirtualAdapter), 6)

    ; Remove the virtual adapter.
    shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
        $(MiniportProductName), $(RegistryNetCardKey)$(AdapterInstance)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "Cannot remove the virtual adapter."
        shell "" ShowShellErrorMessage
        return STATUS_FAILED
    endif

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0)  Physical adapter list.
;    $($1)  virtual adapter list.
;
; Output:
;    $($R0) STATUS_FAILED or STATUS_SUCCESSFUL.
;*******************************************************************************
[ModifyBindings]
    read-syms DebugControl
    debug-output "### ModifyBindings"

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

    set PhysicalAdapterList = $($0)
    set VirtualAdapterList = $($1)

    ; Load the configuration dll.
    LoadLibrary $(MsgCannotFindBlfDll) $(BlfDll) DllHandle

    LibraryProcedure ReturnCode $(DllHandle) BLF_ConfigBinding +
            $(PhysicalAdapterList) $(VirtualAdapterList)
    ifstr(i) $(ReturnCode) != STATUS_SUCCESSFUL
        FreeLibrary $(DllHandle)
        return STATUS_FAILED
    endif

    FreeLibrary $(DllHandle)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    None.
;
; Output:
;    $($R0): STATUS: STATUS_SUCCESSFUL
;    $($R1): Option Type (COMPUTER ...)
;    $($R2): Diskette description
;*******************************************************************************
[Identify]
    read-syms DebugControl
    debug-output "### Identify"

    read-syms Identification

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

    return $(Status) $(Identifier) $(Media)



;*******************************************************************************
; Description:
;
; 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]
    read-syms DebugControl
    debug-output "### ReturnOptions"

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

    ifcontains(i) $($0) in $(LanguageList)
        set Status         = STATUS_SUCCESSFUL
        set OptionList     = ^(Options, 1)
        set OptionTextList = ^(OptionsText$($0), 1)
    else
        debug-output "Language not supported."
        set Status = STATUS_NOLANGUAGE
    endif

    return $(Status) $(OptionList) $(OptionTextList)



;*******************************************************************************
; Description:
;    This section performs the following tasks:
;       Copy files representing Options.
;       Configure the installed option.
;       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]
    read-syms DebugControl
    debug-output "### InstallOption"
    set OptionId = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)

    debug-output "OptionId : "$(OptionId)
    debug-output "SrcDir : "$(SrcDir)
    debug-output "AddCopy : "$(AddCopy)
    debug-output "DoCopy : "$(DoCopy)
    debug-output "DoConfig : "$(DoConfig)

    Set LanguageList = ^(LanguagesSupported, 1)
    ifcontains(i) $($0) not-in $(LanguageList)
        return STATUS_NOLANGUAGE
    endif

    set-title $(Function$(OptionId)Title)

    ifstr(i) $(!NTN_InstallMode) == Deinstall
        shell "" RemoveSection $(OptionId)
        set Status = $($R0)
    else-ifstr(i) $(!NTN_InstallMode) == Update
        shell "" UpdateSection  $(OptionId) $(SrcDir)
        set Status = $($R0)
    else-ifstr(i) $(!NTN_InstallMode) == Bind
        shell "" BindSection $(OptionId)
        set Status = $($R0)
    else-ifstr(i) $(!NTN_InstallMode) == Configure
        shell "" ConfigureSection $(OptionId)
        set Status = $($R0)
    else
        startwait
        shell "" InstallSection $($1) $($2) $($3) $($4) $($5)
        endwait

        set Status = $($R0)
        ifstr(i) $(Status) != STATUS_SUCCESSFUL
            ifstr(i) $(Status) != STATUS_WAS_INSTALLED
                ifstr(i) $(Status) != STATUS_UNSUPPORTED
                    shell "" RemoveSection $(OptionId)
                endif
            endif
        endif
    endif

    return $(Status)



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionID to install
;
; Output:
;    $($R0) Status
;*******************************************************************************
[RemoveSection]
    read-syms DebugControl
    debug-output "### RemoveSection"

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

    set OptionId = $($0)

    openregkey $(!REG_H_LOCAL) "" $(TransportProductKeyName) +
        $(MAXIMUM_ALLOWED) KeyProduct

    ifstr $(KeyProduct) == ""
        debug-output "Cannot get registry key."
        shell "" ShowErrorMessage "FATAL" $(MsgRegistryKeyDoesNotExist)
        return STATUS_FAILED
    endif

    shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        Debug-Output "Cannot get inf name from the registry."
        shell "" ShowShellErrorMessage
        return STATUS_FAILED
    endif

    set !UG_Filename = $($R0)
    debug-output "### UG_Filename="$(!UG_Filename)

    ; Build the physical and virtual adapter list.
    shell "" BuildAdapterList
    set PhysicalAdapterList = $($R0)
    set VirtualAdapterList = $($R1)

    ; remove all the virtual adapters.
    forlistdo $(VirtualAdapterList)
        set VirtualAdapter = $($)

        shell "" RemoveVirtualMiniport $(VirtualAdapter)
        ifstr(i) $($R0) != STATUS_SUCCESSFUL
            debug-output "Cannot remove virtual miniport: "$(VirtualAdapter)
        endif
    endforlistdo

    ; Remove all references to teams.
    set NewPhysicalAdapterList = { }
    forlistdo $(PhysicalAdapterList)
        set AdapterInfo = $($)

        ; set TeamId field to 0 and TeamName = "".
        set AdapterInfo = { *($(AdapterInfo), 1), *($(AdapterInfo), 2), +
            *($(AdapterInfo), 3), *($(AdapterInfo), 4),                 +
            *($(AdapterInfo), 5), *($(AdapterInfo), 6),                 +
            *($(AdapterInfo), 7), 0, "", *($(AdapterInfo), 10),         +
            *($(AdapterInfo), 11), *($(AdapterInfo), 12),               +
            *($(AdapterInfo), 13), *($(AdapterInfo), 14),               +
            *($(AdapterInfo), 15), *($(AdapterInfo), 16) }

        set NewPhysicalAdapterList = >($(NewPhysicalAdapterList), +
            $(AdapterInfo))
    endforlistdo

    set PhysicalAdapterList = $(NewPhysicalAdapterList)

    ; Update the physical adapter settings.  All the physical adapter should
    ; already have the TeamName removed.
    debug-output "Updated physical adapters: "$(PhysicalAdapterList)
    forlistdo $(PhysicalAdapterList)
        shell "" UpdateMiniport $($) $(VirtualAdapterList)
    endforlistdo

    shell "" BindSection $(OptionId)

    ; Remove the transport.
    debug-output "Removing the transport protocol."
    shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
        $(TransportProductName)
    ifstr(i) $($R0) != NO_ERROR
        debug-output "Remove transport failed."

        shell "" ShowRegistryErrorMessage "FATAL" $($R0)
    endif

    AddfileToDeleteList $(!STF_WINDOWSSYSPATH)"\drivers\basfnt4.sys"
    AddfileToDeleteList $(!STF_WINDOWSSYSPATH)"\basfnt4.dll"
    AddfileToDeleteList $(!STF_WINDOWSSYSPATH)"\drivers\baspnt4.sys"
    AddfileToDeleteList $(!STF_WINDOWSSYSPATH)"\baspnt4.dll"
    AddfileToDeleteList $(!STF_WINDOWSSYSPATH)"\"$(!UG_Filename)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionID to install
;    $($1):  SourceDirectory
;
; Output:
;    $($R0) Status
;*******************************************************************************
[UpdateSection]
    read-syms DebugControl
    debug-output "### UpdateSection"

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

    set OptionId = $($0)
    set SrcDir   = $($1)

    ; Check to see if the is server machine.
    openregkey $(!REG_H_LOCAL) "" $(RegistryProductOptionsKey) +
        $(MAXIMUM_ALLOWED) ProductOptionsKey
    ifstr $(ProductOptionsKey) != ""
        set ValueList = { }
        getregvalue $(ProductOptionsKey) "ProductType" ValueList
        set ProductType = *($(ValueList), 4)
        ifstr(i) $(ProductType) == "WinNT"
            closeregkey $(ProductOptionsKey)
            shell "" ShowErrorMessage "FATAL" $(MsgPlatformNotSupported)
            return STATUS_FAILED
        endif
    endif

    closeregkey $(ProductOptionsKey)

    openregkey $(!REG_H_LOCAL) "" $(TransportProductKeyName) +
        $(MAXIMUM_ALLOWED) KeyProduct

    ifstr $(KeyProduct) == ""
        debug-output "Cannot get registry key."
        shell "" ShowErrorMessage "FATAL" $(MsgRegistryKeyDoesNotExist)
        return STATUS_FAILED
    endif

    debug-output "TransportProductKeyName: "$(TransportProductKeyName)
    getregvalue $(ProductKey), "MajorVersion", VersionInfo
    set MajorVersion = *($(VersionInfo), 4)
    debug-output "VersionInfo: "$(VersionInfo)
    debug-output "Major version: "$(MajorVersion)
    getregvalue $(ProductKey), "MinorVersion", VersionInfo
    set MinorVersion = *($(VersionInfo), 4)
    debug-output "VersionInfo: "$(VersionInfo)
    debug-output "Minor version: "$(MinorVersion)
    getregvalue $(ProductKey), "BuildVersion", VersionInfo
    set BuildVersion = *($(VersionInfo), 4)
    debug-output "VersionInfo: "$(VersionInfo)
    debug-output "Build version: "$(BuildVersion)

    set-mul OldVersion = $(MajorVersion), 1000
    set-add OldVersion = $(OldVersion), $(MinorVersion)
    set-mul OldVersion = $(OldVersion), 1000
    set-add OldVersion = $(OldVersion), $(BuildVersion)
    debug-output "OldVersion: "$(OldVersion)

    set-mul NewVersion = $(ProductMajorVersion), 1000
    set-add NewVersion = $(NewVersion), $(ProductMinorVersion)
    set-mul NewVersion = $(NewVersion), 1000
    set-add NewVersion = $(NewVersion), $(ProductBuildVersion)
    debug-output "NewVersion: "$(NewVersion)

    ifint $(OldVersion) > $(NewVersion)
        debug-output "Oldversion: "$(OldVersion)",   NewVersion: "$(NewVersion)
        shell "" ShowErrorMessage "FATAL" $(MsgDowngrade)
        return STATUS_USERCANCEL
    endif


    shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        Debug-Output "Cannot get inf name from the registry."
        shell "" ShowShellErrorMessage
        return STATUS_FAILED
    endif

    set !UG_Filename = $($R0)
    ifstr(i) $(!UG_Filename) != ""
        install "Install-Update"
    endif

    setregvalue $(KeyProduct) { MajorVersion, $(NoTitle), $(!REG_VT_SZ), +
        $(ProductMajorVersion) }
    setregvalue $(KeyProduct) { MinorVersion, $(NoTitle), $(!REG_VT_SZ), +
        $(ProductMinorVersion) }
    setregvalue $(KeyProduct) { BuildVersion, $(NoTitle), $(!REG_VT_SZ), +
        $(ProductBuildVersion) }

    closeregkey $(KeyProduct)

    return STATUS_SUCCESSFUL



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionID to install
;
; Output:
;    $($R0) Status
;*******************************************************************************
[BindSection]
    read-syms DebugControl
    debug-output "### BindSection"

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

    set OptionId = $($0)

    ; Build the virtual and physical adapter list.
    shell "" BuildAdapterList
    set PhysicalAdapterList = $($R0)
    set VirtualAdapterList = $($R1)
    debug-output "PhysicalAdapterList = "$(PhysicalAdapterList)

    shell "" ModifyBindings $(PhysicalAdapterList) $(VirtualAdapterList)

    set Status = $($R0)

    return $(Status)



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionID to install
;
; Output:
;    $($R0)  STATUS_FAILED or STATUS_SUCCESSFUL
;*******************************************************************************
[ConfigureSection]
    read-syms DebugControl
    debug-output "### ConfigureSection"

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

    set OptionId = $($0)

    shell "" RunGuiSetup $(OptionId)

    return $($R0)



;*******************************************************************************
; Description:
;    
; Input:
;    $($0):  OptionID to install
;    $($1):  SourceDirectory
;    $($2):  AddCopy  (YES | NO)
;    $($3):  DoCopy   (YES | NO)
;    $($4):  DoConfig (YES | NO)
;
; Output:
;    $($R0)  STATUS_FAILED, STATUS_SUCCESSFUL, STATUS_WAS_INSTALLED,
;            STATUS_UNSUPPORTED or STATUS_USERCANCEL
;*******************************************************************************
[InstallSection]
    read-syms DebugControl
    debug-output "### InstallSection"

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

    set OptionId = $($0)
    set SrcDir   = $($1)
    set AddCopy  = $($2)
    set DoCopy   = $($3)
    set DoConfig = $($4)

    debug-output "OptionId : "$(OptionId)
    debug-output "SrcDir : "$(SrcDir)
    debug-output "AddCopy : "$(AddCopy)
    debug-output "DoCopy : "$(DoCopy)
    debug-output "DoConfig : "$(DoConfig)

    ; Check to see if the transport is already installed.
    openregkey $(!REG_H_LOCAL) "" $(TransportProductKeyName) +
        $(MAXIMUM_ALLOWED) TransportProductKey
    ifstr $(TransportProductKey) != ""
        closeregkey $(TransportProductKey)
        shell "" ShowErrorMessage "FATAL" $(MsgProductAlreadyInstalled)
        return STATUS_WAS_INSTALLED
    endif
    closeregkey $(TransportProductKey)

    ; Check to see if the is server machine.
    openregkey $(!REG_H_LOCAL) "" $(RegistryProductOptionsKey) +
        $(MAXIMUM_ALLOWED) ProductOptionsKey
    ifstr $(ProductOptionsKey) != ""
        set ValueList = { }
        getregvalue $(ProductOptionsKey) "ProductType" ValueList
        set ProductType = *($(ValueList), 4)
        ifstr(i) $(ProductType) == "WinNT"
            closeregkey $(ProductOptionsKey)
            shell "" ShowErrorMessage "FATAL" $(MsgPlatformNotSupported)
            return STATUS_UNSUPPORTED
        endif
    endif

    closeregkey $(ProductOptionsKey)

    ifstr(i) $(DoCopy) == "YES"
        debug-output "DoCopy"

        shell $(UtilityInf) DoAskSource $(!STF_CWDDIR) $(SrcDir) YES
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            shell "" ShowShellErrorMessage
            return STATUS_FAILED
        else-ifstr(i) $($R0) == STATUS_FAILED
            shell "" ShowRegistryErrorMessage "FATAL" ASK_SOURCE_FAIL
            return STATUS_FAILED
        else-ifstr(i) $($R0) == STATUS_USERCANCEL
            debug-output "User cancelled."
            return STATUS_USERCANCEL
        endif

        set SrcDir = $($R1)
    endif

    ; Copy the files
    install "Install-Option"
    ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
        debug-output "Copy file failed."

        shell "" ShowRegistryErrorMessage "FATAL" UNABLE_COPY_FILE

        return STATUS_FAILED
    endif

    ; Install the protocol driver.
    shell "" InstallTransport $(OptionId)
    ifstr(i) $($R0) != STATUS_SUCCESSFUL
        return STATUS_FAILED
    endif

    ; Gui setup.
    shell "" RunGuiSetup $(OptionId)

    ifstr(i) $($R0) != STATUS_SUCCESSFUL
        ifstr(i) $($R0) != STATUS_USERCANCEL
            return STATUS_FAILED
        endif
    endif

    return STATUS_SUCCESSFUL

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: web3, load: 2.28