OEMSETNT.INF Driver File Contents (Xpeed400.exe)

;******************************************************************************
; PPP over Ethernet Protocol
; Windows NT 4.0 NDIS Intermediate Driver INF
; written by Robert Schlabbach (normanb@cs.TU-Berlin.DE)
; Copyright (C) 2000-2002 by Robert Schlabbach
;******************************************************************************

[Identification]
 OptionType = NetTransport

[LanguagesSupported]
 ENG

[Options]
 RASPPPOE

[OptionsTextENG]
 RASPPPOE = "PPP over Ethernet Protocol"

[FileConstants]
 ; manufacturer and product constants
 Manufacturer            = "Robert Schlabbach"
 ProductMajorVersion     = "0"
 ProductMinorVersion     = "98"
 ProductVersion          = $(ProductMajorVersion)"."$(ProductMinorVersion)
 ProductImagePath        = "\SystemRoot\System32\Drivers\RMSPPPOE.SYS"
 EventMessageFile        = "%SystemRoot%\System32\RASPPPOE.DLL"

 ; protocol default properties
 EventLogging            = 7
 LimitTCPMSS             = 1
 LinkSpeed               = 0
 OverrideMTU             = 0
 WanEndPoints            = 1

 ; protocol portion constants
 ProtocolName            = "RMSPPPOE"
 ProtocolType            = "transport"
 ProtocolNetRuleType     = "rmspppoe rmspppoe"
 ProtocolNetRuleUse      = $(ProtocolType)" none none"
 ProtocolNetRuleBindForm = """rmspppoe"" yes yes container"
 ProtocolNetRuleClass    = {"rmspppoe basic"}
 ProtocolNetRuleBindable = {"rmspppoe ndisDriver non non 100"}

 ; protocol portion registry subkey names
 ProtocolProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProtocolName)"\CurrentVersion"
 ProtocolServiceKeyName  = $(!NTN_ServiceBase)"\"$(ProtocolName)
 ProtocolLinkageKeyName  = $(!NTN_ServiceBase)"\"$(ProtocolName)"\Linkage"
 ProtocolParamsKeyName   = $(!NTN_ServiceBase)"\"$(ProtocolName)"\Parameters"

 ; miniport portion constants
 MiniportName            = "RASPPPOE"
 MiniportType            = "driver"
 MiniportNetRuleType     = "raspppoeSys raspppoeDriver"
 MiniportNetRuleUse      = $(MiniportType)
 MiniportNetRuleBindForm = """raspppoeSys"" yes no container"
 MiniportNetRuleClass    = {"raspppoeDriver basic"}
 MiniportNetRuleBindable = {"raspppoeDriver raspppoeAdapter non exclusive 100"}

 ; miniport portion registry subkey names
 MiniportProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(MiniportName)"\CurrentVersion"
 MiniportServiceKeyName  = $(!NTN_ServiceBase)"\"$(MiniportName)
 MiniportLinkageKeyName  = $(!NTN_ServiceBase)"\"$(MiniportName)"\Linkage"
 MiniportParamsKeyName   = $(!NTN_ServiceBase)"\"$(MiniportName)"\Parameters"

 ; virtual adapter constants
 HardwareNetRuleType     = "raspppoe raspppoeAdapter"
 HardwareNetRuleClass    = {"raspppoeAdapter basic"}
 HardwareNetRuleBindForm = " yes yes container"

 ; TAPI devices registry subkey names and TAPI media type
 MicrosoftRasKeyName     = $(!NTN_SoftwareBase)"\Microsoft\RAS"
 DeviceMapKeyName        = "HARDWARE\DEVICEMAP"
 TapiDevicesKeyName      = "TAPI DEVICES"
 TapiMediaType           = "PPPoE"

 ; NDISWAN parameters registry subkey name, IPMTU value name and limits
 NdisWanParamsKeyName    = $(!NTN_ServiceBase)"\NdisWan\Parameters"
 NdisWanIPMTUValueName   = "IPMTU"
 MINPPPOEMTU             = 576
 MAXPPPOEMTU             = 1492

 ; NetworkCards registry subkey name
 NetworkCardsKeyName     = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"

 ; uninstall registry subkey name
 UninstallKeyName        = $(!NTN_SoftwareBase)"\Microsoft\Windows\CurrentVersion\Uninstall\RASPPPOE"

 ; general constants
 UtilityINF              = "UTILITY.INF"
 SubroutineINF           = "SUBROUTN.INF"

[FileConstantsENG]
 ; display names
 ProtocolDisplayName     = "PPP over Ethernet Protocol"
 MiniportDisplayName     = "PPP over Ethernet Miniport"

 ; protocol description
 ProtocolDescription     = "Allows making PPP connections through Ethernet adapters according to RFC 2516. Required for connections with many broadband service providers."

 ; dialog string constants
 FunctionTitle           = "PPP over Ethernet Protocol"
 ShellCodeErrorTitle     = "Error: "$(FunctionTitle)
 ShellCodeErrorText      = "Shell Code Error."

 ; progress gauge strings
 ProCaption              = "PPP over Ethernet Protocol Setup"
 ProText1                = "Copying:"
 ProText2                = "To:"
 ProCancel               = "Cancel"
 ProCancelCap            = "PPP over Ethernet Protocol Setup Message"
 ProCancelMsg            = "The protocol is not correctly installed. Are you sure you want to cancel copying files?"

[DialogConstantsENG]
 ; dialog box strings
 Cancel                  = "Cancel"
 Continue                = "Continue"
 Exit                    = "Cancel"
 Help                    = "&Help"
 HelpContext             = ""
 OK                      = "OK"

 ; Remote Access Service (RAS) install message
 InstallRasMsg           = "The Remote Access Service (Dial-Up Networking) "+
                           "must now be installed."$(!LF)$(!LF)+
                           "When prompted for Windows NT files, you should "+
                           "specify the location of the last SERVICE PACK "+
                           "you had applied. "$(!LF)+
                           "If you specify the location of the original "+
                           "Windows NT files, you will have to re-apply "+
                           "the Service Pack after installation. "$(!LF)$(!LF)+
                           "When the ""Remote Access Setup"" dialog box "+
                           "comes up, just click the ""Continue"" button "+
                           "to complete the installation."

 ; configuration control panel warning message
 NoAdaptersMsg           = "Could not find any network adapter the PPP over "+
                           "Ethernet Protocol is currently bound to."$(!LF)+
                           "There are no properties to configure. Review the "+
                           "protocol bindings on the Bindings tab."

[GeneralConstants]
 ExitCodeOk         = 0
 ExitCodeCancel     = 1
 ExitCodeFatal      = 2
 KeyNull            = ""
 MAXIMUM_ALLOWED    = 33554432
 RegistryErrorIndex = NO_ERROR
 KeyProduct         = ""
 KeyParameters      = ""
 TRUE               = 1
 FALSE              = 0
 NoTitle            = 0

[Source Media Descriptions]
 1 = "PPP over Ethernet Protocol Installation Diskette", TAGFILE = RMSPPPOE.SYS

[RASPPPOE.Files.DLL]
 1, RASPPPOE.DLL
 1, RASPPPOE.EXE

[RASPPPOE.Files.SYS]
 1, RMSPPPOE.SYS

[Date]
 ; retrieve the current system date
 Now = {} ? $(!LIBHANDLE) GetSystemDate

;------------------------------------------------------------------------------
; The Identify Section - Return the type of driver this INF file can install
;------------------------------------------------------------------------------

[Identify]
 ; read identification symbols
 Read-Syms Identification

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

 ; return results
 Return $(Status) $(Identifier) $(Media)

;------------------------------------------------------------------------------
; The ReturnOptions Section - Return the options this INF file can install
;------------------------------------------------------------------------------

[ReturnOptions]
 ; retrieve list of supported languages
 Set LanguageList = ^(LanguagesSupported, 1)

 ; check if the requested language is in the list
 IfContains(i) $($0) In $(LanguageList)
  ; set return values
  Set Status         = STATUS_SUCCESSFUL
  Set OptionList     = ^(Options, 1)
  Set OptionTextList = ^(OptionsText$($0), 1)
 Else
  ; requested language is not supported
  Set Status         = STATUS_NOLANGUAGE
  Set OptionList     = {}
  Set OptionTextList = {}
 EndIf

 ; return results
 Return $(Status) $(OptionList) $(OptionTextList)

;------------------------------------------------------------------------------
; The InstallOption Section - Install the user selected option
;------------------------------------------------------------------------------

[InstallOption]
 ; retrieve parameters
 Set Language = $($0)
 Set Option   = $($1)
 Set SrcDir   = $($2)
 Set AddCopy  = $($3)
 Set DoCopy   = $($4)
 Set DoConfig = $($5)

 ; retrieve list of supported languages
 Set LanguageList = ^(LanguagesSupported, 1)

 ; check if the requested language is in the list
 IfContains(i) $($0) Not-In $(LanguageList)
  ; requested language is not supported
  Set Status = STATUS_NOLANGUAGE
  GoTo InstallOptionEnd
 EndIf

 ; assume success
 Set Status = STATUS_SUCCESSFUL

 ; read symbol constants
 Read-Syms FileConstants
 Read-Syms FileConstants$(!STF_LANGUAGE)
 Read-Syms DialogConstants$(!STF_LANGUAGE)
 Read-Syms GeneralConstants

 ; change Continue dialog string if invoked from the NCPA
 IfStr(i) $(!NTN_Origination) == "NCPA"
  Set Continue = $(OK)
 EndIf

 ; get the current system date
 Detect Date

 ; initialize installer
 Set-Title $(FunctionTitle)
 EndWait

 ; determine the installer mode
 IfStr(i)      $(!NTN_InstallMode) == "Install"
  Set StartLabel = Install
 Else-IfStr(i) $(!NTN_InstallMode) == "Bind"
  Set StartLabel = Bind
 Else-IfStr(i) $(!NTN_InstallMode) == "Configure"
  Set StartLabel = Configure
 Else-IfStr(i) $(!NTN_InstallMode) == "DeInstall"
  Set StartLabel = DeInstall
 Else-IfStr(i) $(!NTN_InstallMode) == "Update"
  Set StartLabel = Update
 Else
  ; requested installer mode is not supported
  Set Status = STATUS_NOTSUPPORTED
  GoTo InstallOptionEnd
 Endif

 ; jump to the selected installer function
 GoTo $(StartLabel)

;------------------------------------------------------------------------------
; The InstallOption Install Subsection - Install the protocol
;------------------------------------------------------------------------------

Install = +
 ; check if the protocol is already installed
 OpenRegKey $(!REG_H_LOCAL) "" $(ProtocolProductKeyName) +
            $(MAXIMUM_ALLOWED) ProtocolProductKey
 IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
  ; registry subkey already exists, close it
  CloseRegKey $(ProtocolProductKey)

  ; display a message that the protocol is already installed
  Shell $(UtilityINF) VerExistedDlg $(ProtocolDisplayName) $(ProductVersion)
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf

  ; exit from the installer
  GoTo InstallOptionEnd
 EndIf

 ; install the protocol
 StartWait

 ; check if to copy the installation files
 IfStr(i) $(DoCopy) == "YES"
  ; ask for the source directory
  Shell $(UtilityINF) DoAskSource $(!STF_CWDDIR) $(SrcDir) "YES"
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf

  ; check if the result is failure
  IfStr(i) $($R0) == "STATUS_FAILED"
   Shell $(UtilityINF) RegistryErrorString "ASK_SOURCE_FAIL"
   IfInt $($ShellCode) != $(!SHELL_CODE_OK)
    GoTo ShellCodeError
   EndIf
   Set Error = $($R0)
   GoTo FatalError
  EndIf

  ; check if the user canceled the operation
  IfStr(i) $($R0) == "STATUS_USERCANCEL"
   GoTo InstallOptionEnd
  EndIf

  ; store the source directory
  Set SrcDir = $($R1)
 EndIf

 ; copy the installation files
 Install "InstallCopyFiles"

 ; check outcome of the operation
 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 FatalError
 EndIf

 ; flag that deinstall must be invoked in case of failure
 Set OEM_ABANDON_ON = "YES"

 ; add protocol portion to the registry
 Shell $(UtilityINF) AddSoftwareComponent $(Manufacturer) $(ProtocolName) +
       $(ProtocolName) $(ProtocolDisplayName) $(STF_CONTEXTINFNAME)       +
       $(ProductImagePath) "transport" "TDI" {} "" $(EventMessageFile)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  EndWait
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex    = $($R0)
 Set ProtocolProductKey    = $($R1)
 Set ProtocolNetRulesKey   = $($R2)
 Set ProtocolServiceKey    = $($R3)
 Set ProtocolParametersKey = $($R4)
 Set ProtocolLinkageKey    = $($R5)

 ; check if there was any error during registry entry creation
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  EndWait
  CloseRegKey $(ProtocolProductKey)
  CloseRegKey $(ProtocolNetRulesKey)
  CloseRegKey $(ProtocolServiceKey)
  CloseRegKey $(ProtocolParametersKey)
  CloseRegKey $(ProtocolLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; add protocol product registry values
 Set NewValueList = {                                                        +
  {SoftwareType,      $(NoTitle), $(!REG_VT_SZ),    $(ProtocolType)},        +
  {MajorVersion,      $(NoTitle), $(!REG_VT_DWORD), $(ProductMajorVersion)}, +
  {MinorVersion,      $(NoTitle), $(!REG_VT_DWORD), $(ProductMinorVersion)}, +
  {Title,             $(NoTitle), $(!REG_VT_SZ),    $(ProtocolDisplayName)}, +
  {Description,       $(NoTitle), $(!REG_VT_SZ),    $(ProtocolDescription)}, +
  {ServiceName,       $(NoTitle), $(!REG_VT_SZ),    $(ProtocolName)},        +
  {InstallDate,       $(NoTitle), $(!REG_VT_DWORD), *($(Now), 1)},           +
  {OperationsSupport, $(NoTitle), $(!REG_VT_DWORD), 134},                    +
  {Review,            $(NoTitle), $(!REG_VT_DWORD), 1}}
 Shell $(UtilityINF) AddValueList $(ProtocolProductKey) $(NewValueList)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  EndWait
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)

 ; check if there was any error adding the values
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  EndWait
  CloseRegKey $(ProtocolProductKey)
  CloseRegKey $(ProtocolNetRulesKey)
  CloseRegKey $(ProtocolServiceKey)
  CloseRegKey $(ProtocolParametersKey)
  CloseRegKey $(ProtocolLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; add protocol net rules registry values
 Set NewValueList = {                                                       +
  {type,      $(NoTitle), $(!REG_VT_SZ),       $(ProtocolNetRuleType)},     +
  {use,       $(NoTitle), $(!REG_VT_SZ),       $(ProtocolNetRuleUse)},      +
  {bindform,  $(NoTitle), $(!REG_VT_SZ),       $(ProtocolNetRuleBindForm)}, +
  {class,     $(NoTitle), $(!REG_VT_MULTI_SZ), $(ProtocolNetRuleClass)},    +
  {bindable,  $(NoTitle), $(!REG_VT_MULTI_SZ), $(ProtocolNetRuleBindable)}, +
  {InfOption, $(NoTitle), $(!REG_VT_SZ),       $(Option)}}
 Shell $(UtilityINF) AddValueList $(ProtocolNetRulesKey) $(NewValueList)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  EndWait
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)

 ; check if there was any error adding the values
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  EndWait
  CloseRegKey $(ProtocolProductKey)
  CloseRegKey $(ProtocolNetRulesKey)
  CloseRegKey $(ProtocolServiceKey)
  CloseRegKey $(ProtocolParametersKey)
  CloseRegKey $(ProtocolLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; close all protocol registry keys
 CloseRegKey $(ProtocolProductKey)
 CloseRegKey $(ProtocolNetRulesKey)
 CloseRegKey $(ProtocolServiceKey)
 CloseRegKey $(ProtocolParametersKey)
 CloseRegKey $(ProtocolLinkageKey)

 ; add miniport portion to the registry
 Shell $(UtilityINF) AddSoftwareComponent $(Manufacturer) $(MiniportName) +
       $(MiniportName) $(MiniportDisplayName) $(STF_CONTEXTINFNAME)       +
       $(ProductImagePath) "kernelautostart" "PNP_TDI" {} "" $(EventMessageFile)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  EndWait
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex    = $($R0)
 Set MiniportProductKey    = $($R1)
 Set MiniportNetRulesKey   = $($R2)
 Set MiniportServiceKey    = $($R3)
 Set MiniportParametersKey = $($R4)
 Set MiniportLinkageKey    = $($R5)

 ; check if there was any error during registry entry creation
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  EndWait
  CloseRegKey $(MiniportProductKey)
  CloseRegKey $(MiniportNetRulesKey)
  CloseRegKey $(MiniportServiceKey)
  CloseRegKey $(MiniportParametersKey)
  CloseRegKey $(MiniportLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; add miniport product registry values
 Set NewValueList = {                                                        +
  {SoftwareType,      $(NoTitle), $(!REG_VT_SZ),    $(MiniportType)},        +
  {MajorVersion,      $(NoTitle), $(!REG_VT_DWORD), $(ProductMajorVersion)}, +
  {MinorVersion,      $(NoTitle), $(!REG_VT_DWORD), $(ProductMinorVersion)}, +
  {Title,             $(NoTitle), $(!REG_VT_SZ),    $(MiniportDisplayName)}, +
  {Description,       $(NoTitle), $(!REG_VT_SZ),    $(MiniportDisplayName)}, +
  {ServiceName,       $(NoTitle), $(!REG_VT_SZ),    $(MiniportName)},        +
  {InstallDate,       $(NoTitle), $(!REG_VT_DWORD), *($(Now), 1)}}
 Shell $(UtilityINF) AddValueList $(MiniportProductKey) $(NewValueList)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  EndWait
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)

 ; check if there was any error adding the values
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  EndWait
  CloseRegKey $(MiniportProductKey)
  CloseRegKey $(MiniportNetRulesKey)
  CloseRegKey $(MiniportServiceKey)
  CloseRegKey $(MiniportParametersKey)
  CloseRegKey $(MiniportLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; add miniport net rules registry values
 Set NewValueList = {                                                       +
  {type,      $(NoTitle), $(!REG_VT_SZ),       $(MiniportNetRuleType)},     +
  {use,       $(NoTitle), $(!REG_VT_SZ),       $(MiniportNetRuleUse)},      +
  {bindform,  $(NoTitle), $(!REG_VT_SZ),       $(MiniportNetRuleBindForm)}, +
  {class,     $(NoTitle), $(!REG_VT_MULTI_SZ), $(MiniportNetRuleClass)},    +
  {bindable,  $(NoTitle), $(!REG_VT_MULTI_SZ), $(MiniportNetRuleBindable)}, +
  {InfOption, $(NoTitle), $(!REG_VT_SZ),       $(Option)}}
 Shell $(UtilityINF) AddValueList $(MiniportNetRulesKey) $(NewValueList)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)

 ; check if there was any error adding the values
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  EndWait
  CloseRegKey $(MiniportProductKey)
  CloseRegKey $(MiniportNetRulesKey)
  CloseRegKey $(MiniportServiceKey)
  CloseRegKey $(MiniportParametersKey)
  CloseRegKey $(MiniportLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; close all miniport registry keys
 CloseRegKey $(MiniportProductKey)
 CloseRegKey $(MiniportNetRulesKey)
 CloseRegKey $(MiniportServiceKey)
 CloseRegKey $(MiniportParametersKey)
 CloseRegKey $(MiniportLinkageKey)

 ; installation is finished
 EndWait
 GoTo InstallOptionEnd

;------------------------------------------------------------------------------
; The InstallOption Bind Subsection - Review the protocol bindings
;------------------------------------------------------------------------------

Bind = +
 ; only the binding review for the protocol portion needs attention
 IfStr(i) $(!NTN_RegBase) != $(ProtocolProductKeyName)
  GoTo InstallOptionEnd
 EndIf

 ; open the Linkage registry key
 OpenRegKey $(!REG_H_LOCAL) "" $(ProtocolLinkageKeyName) +
            $(MAXIMUM_ALLOWED) ProtocolLinkageKey
 IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
  GoTo FatalRegistryError
 EndIf

 ; get the Bind value from the registry
 GetRegValue $(ProtocolLinkageKey) "Bind" BindValue
 IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
  CloseRegKey $(ProtocolLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; extract the Bind list and initialize the pruned bind list
 Set BindList = *($(BindValue), 4)
 Set PrunedBindList = {}

 ; open the NetworkCards registry key
 OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) +
            $(MAXIMUM_ALLOWED) NetworkCardsKey
 IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
  CloseRegKey $(ProtocolLinkageKey)
  GoTo FatalRegistryError
 EndIf

 ; enumerate the network cards in the registry
 Set NetworkCardsList = {}
 EnumRegKey $(NetworkCardsKey) NetworkCardsList
 IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
  ; extract list of network card device instances
  Set InstancesList = {}
  ForListDo $(NetworkCardsList)
   IfStr(i) $(InstancesList) == {}
    Set InstancesList = {*($($), 1)}
   Else
    Set InstancesList = >($(InstancesList), *($($), 1))
   EndIf
  EndForListDo
 EndIf

 ; initialize the installed and used virtual adapters lists
 Set AdaptersList = {}
 Set AdaptersUsed = {}

 ; create a list of the service names of all installed virtual adapters
 ForListDo $(InstancesList)
  Set Instance = $($)
  ; open the device instance registry key
  OpenRegKey $(NetworkCardsKey) "" $(Instance) $(MAXIMUM_ALLOWED) InstanceKey
  IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
   ; retrieve the ProductName registry value
   GetRegValue $(InstanceKey) "ProductName" ProductNameValue
   IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
    Set ProductName = *($(ProductNameValue), 4)
    ; retrieve the ServiceName registry value
    GetRegValue $(InstanceKey) "ServiceName" ServiceNameValue
    IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
     Set ServiceName = *($(ServiceNameValue), 4)
     ; check if this is an instance of our virtual adapter
     IfStr(i) $(ProductName) == $(MiniportName)
      IfStr(i) $(AdaptersList) == {}
       Set AdaptersList = {$(ServiceName)}
      Else
       Set AdaptersList = >($(AdaptersList), $(ServiceName))
      EndIf
     EndIf
    EndIf
   EndIf
   ; close the device instance registry key
   CloseRegKey $(InstanceKey)
  EndIf
 EndForListDo

 ; no virtual adapter was added or removed yet
 Set VirtualAdaptersChanged = "NO"

 ; install virtual adapter instances as needed
 ForListDo $(InstancesList)
  Set Instance = $($)
  ; open the device instance registry key
  OpenRegKey $(NetworkCardsKey) "" $(Instance) $(MAXIMUM_ALLOWED) InstanceKey
  IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
   ; retrieve the ProductName registry value
   GetRegValue $(InstanceKey) "ProductName" ProductNameValue
   IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
    Set ProductName = *($(ProductNameValue), 4)
    ; skip our own virtual adapter instances
    IfStr(i) $(ProductName) != $(MiniportName)
     ; retrieve the ServiceName registry value
     GetRegValue $(InstanceKey) "ServiceName" ServiceNameValue
     IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
      Set ServiceName = *($(ServiceNameValue), 4)
      ; retrieve the Title registry value
      GetRegValue $(InstanceKey) "Title" TitleValue
      IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
       Set Title = *($(TitleValue), 4)
      Else
       Set Title = "Unnamed Network Adapter "$(ServiceName)
      EndIf
      ; generate the Bind name and the Parameters key name
      Set BindName = "\Device\"$(ServiceName)
      Set ParametersKeyName = $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters\"$(ProtocolName)
      ; check if this adapter is in the Bind list
      IfContains(i) $(BindName) Not-In $(BindList)
       ; adapter not in bind list, delete protocol-specific parameters
       DeleteRegKey $(!REG_H_LOCAL) $(ParametersKeyName)
      Else
       ; adapter is in bind list, try to retrieve its UpperBindings parameter
       Set UpperBindings = "noupper"
       OpenRegKey $(!REG_H_LOCAL) "" $(ParametersKeyName) +
                  $(MAXIMUM_ALLOWED) ParametersKey
       IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
        ; retrieve the UpperBindings registry value
        GetRegValue $(ParametersKey) "UpperBindings" UpperBindingsValue
        IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
         Set UpperBindings = *($(UpperBindingsValue), 4)
        EndIf
        ; close the parameters registry key
        CloseRegKey $(ParametersKey)
       EndIf
       ; check if there is no valid virtual adapter for this adapter
       IfContains(i) $(UpperBindings) Not-In $(AdaptersList)
        ; no valid virtual adapter, delete any protocol-specific parameters
        DeleteRegKey $(!REG_H_LOCAL) $(ParametersKeyName)
        ; create the protocol-specific key in the adapter's registry parameters
        CreateRegKey $(!REG_H_LOCAL) {$(ParametersKeyName), $(NoTitle), +
                     GenericClass} "" $(MAXIMUM_ALLOWED) "" ParametersKey
        IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
         ; install a virtual adapter instance
         Shell "" InstallVirtualAdapter $(Option)
         IfInt $($ShellCode) == $(!SHELL_CODE_OK)
          ; check if the installation was successful
          IfStr(i) $($R0) == "STATUS_SUCCESSFUL"
           ; retrieve the returned UpperBindings value
           Set UpperBindings = $($R1)
           ; flag that a virtual adapter was added
           Set VirtualAdaptersChanged = "YES"
           ; add protocol parameters registry values
           Set NewValueList = {                                             +
            {DriverDesc,    $(NoTitle), $(!REG_VT_SZ),    $(Title)},        +
            {EventLogging,  $(NoTitle), $(!REG_VT_DWORD), $(EventLogging)}, +
            {LimitTCPMSS,   $(NoTitle), $(!REG_VT_DWORD), $(LimitTCPMSS)},  +
            {LinkSpeed,     $(NoTitle), $(!REG_VT_DWORD), $(LinkSpeed)},    +
            {OverrideMTU,   $(NoTitle), $(!REG_VT_DWORD), $(OverrideMTU)},  +
            {UpperBindings, $(NoTitle), $(!REG_VT_SZ),    $(UpperBindings)}}
           Shell $(UtilityINF) AddValueList $(ParametersKey) $(NewValueList)
           IfInt $($ShellCode) == $(!SHELL_CODE_OK)
            ; retrieve result
            Set RegistryErrorIndex = $($R0)
            ; check if there was no error adding the values
            IfStr(i) $(RegistryErrorIndex) == "NO_ERROR"
             ; add installed virtual adapter to list of virtual adapters
             IfStr(i) $(AdaptersList) == {}
              Set AdaptersList = {$(UpperBindings)}
             Else
              Set AdaptersList = >($(AdaptersList), $(UpperBindings))
             EndIf
            EndIf
           EndIf
          EndIf
         EndIf
         ; close the parameters registry key
         CloseRegKey $(ParametersKey)
        EndIf
       EndIf

       ; check if there is a valid virtual adapter for this adapter now
       IfContains(i) $(UpperBindings) In $(AdaptersList)
        ; there is, add virtual adapter to list of used virtual adapters
        IfStr(i) $(AdaptersUsed) == {}
         Set AdaptersUsed = {$(UpperBindings)}
          Else
         Set AdaptersUsed = >($(AdaptersUsed), $(UpperBindings))
        EndIf
        ; add adapter's bind name to the pruned bind list
        IfStr(i) $(PrunedBindList) == {}
         Set PrunedBindList = {$(BindName)}
        Else
         Set PrunedBindList = >($(PrunedBindList), $(BindName))
        EndIf
       EndIf
      EndIf
     EndIf
    EndIf
   EndIf
   ; close the device instance registry key
   CloseRegKey $(InstanceKey)
  EndIf
 EndForListDo

 ; increment the miniport reference count to prevent driver removal
 Shell $(UtilityINF) IncrementRefCount $(MiniportProductKeyName)
 IfInt $($ShellCode) == $(!SHELL_CODE_OK)
  ; remove any unused virtual adapter instances
  ForListDo $(InstancesList)
   Set Instance = $($)
   ; open the device instance registry key
   OpenRegKey $(NetworkCardsKey) "" $(Instance) $(MAXIMUM_ALLOWED) InstanceKey
   IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
    ; retrieve the ProductName registry value
    GetRegValue $(InstanceKey) "ProductName" ProductNameValue
    IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
     Set ProductName = *($(ProductNameValue), 4)
     ; check if this is one of our own virtual adapter instances
     IfStr(i) $(ProductName) == $(MiniportName)
      ; retrieve the ServiceName registry value
      GetRegValue $(InstanceKey) "ServiceName" ServiceNameValue
      IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
       Set ServiceName = *($(ServiceNameValue), 4)
       ; check if this instance is not in the used instances list
       IfContains(i) $(ServiceName) Not-In $(AdaptersUsed)
        ; remove the virtual adapter instance
        Set NetCardName = $(NetworkCardsKeyName)\$(Instance)
        Shell $(UtilityINF) RemoveHardwareComponent $(Manufacturer) +
              $(MiniportName) $(NetCardName)
        IfInt $($ShellCode) == $(!SHELL_CODE_OK)
         ; retrieve result
         Set RegistryErrorIndex = $($R0)
         ; check if there was no error removing the instance
         IfStr(i) $(RegistryErrorIndex) == "NO_ERROR"
          ; flag that a virtual adapter was removed
          Set VirtualAdaptersChanged = "YES"
         EndIf
        EndIf
       EndIf
      EndIf
     EndIf
     ; close the device instance registry key
     CloseRegKey $(InstanceKey)
    EndIf
   EndIf
  EndForListDo
  ; decrement the miniport reference count back to the original count
  Shell $(UtilityINF) DecrementRefCount $(MiniportProductKeyName)
 EndIf

 ; write the pruned Bind list back to the registry
 SetRegValue $(ProtocolLinkageKey) {"Bind", $(NoTitle), +
             $(!REG_VT_MULTI_SZ), $(PrunedBindList)}

 ; close the Linkage registry key
 CloseRegKey $(ProtocolLinkageKey)

 ; check if any virtual adapters were added or removed
 IfStr(i) $(VirtualAdaptersChanged) == "YES"
  ; NCPA needs to review bindings again
  Set NcpaKeyName = $(!NTN_SoftwareBase)"\Microsoft\NCPA\CurrentVersion"
  OpenRegKey $(!REG_H_LOCAL) "" $(NcpaKeyName) $(MAXIMUM_ALLOWED) NcpaKey
  IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
   SetRegValue $(NcpaKey) {"BindRestart", $(NoTitle), $(!REG_VT_DWORD), 1}
   CloseRegKey $(NcpaKey)
  EndIf
  ; configure the Remote Access Service
  Shell "" ConfigureRAS
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf
  ; retrieve result
  Set Status = $($R0)
 EndIf

 ; bindings review complete
 GoTo InstallOptionEnd

;------------------------------------------------------------------------------
; The InstallOption Configure Subsection - Configure the protocol
;------------------------------------------------------------------------------

Configure = +
 ; load the control panel library and run the control panel
 LoadLibrary "" $(!STF_WINDOWSSYSPATH)"\RASPPPOE.DLL" LibraryHandle
 LibraryProcedure Result, $(LibraryHandle), WindowsNTControlPanel, $(!STF_HWND)
 FreeLibrary $(LibraryHandle)

 ; check the result from the control panel
 IfStr(i) $(Result) == "STATUS_FILENOTFOUND"
  ; could not find any network adapter the protocol is currently bound to
  Set Error = $(NoAdaptersMsg)
  GoTo NonFatal
 Else-IfStr(i) $(Result) == "STATUS_REBIND"
  ; WAN endpoints setting change, reconfigure the Remote Access Service
  Shell "" ConfigureRAS
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf
  ; retrieve result
  Set Status = $($R0)
 Else
  ; pass the result as the return status
  Set Status = $(Result)
 EndIf

 ; configuration complete
 GoTo InstallOptionEnd

;------------------------------------------------------------------------------
; InstallOption/DeInstall Section - Remove the protocol
;------------------------------------------------------------------------------

DeInstall = +
 ; open the NetworkCards registry key
 OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) +
            $(MAXIMUM_ALLOWED) NetworkCardsKey
 IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
  GoTo FatalRegistryError
 EndIf

 ; enumerate the network cards in the registry
 Set NetworkCardsList = {}
 EnumRegKey $(NetworkCardsKey) NetworkCardsList
 IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
  ; extract list of network card device instances
  Set InstancesList = {}
  ForListDo $(NetworkCardsList)
   IfStr(i) $(InstancesList) == {}
    Set InstancesList = {*($($), 1)}
   Else
    Set InstancesList = >($(InstancesList), *($($), 1))
   EndIf
  EndForListDo
 EndIf

 ; remove the TAPI Service Provider registry keys
 DeleteRegKey $(!REG_H_LOCAL) +
              $(DeviceMapKeyName)"\"$(TapiDevicesKeyName)"\"$(MiniportName)
 DeleteRegKey $(!REG_H_LOCAL) +
              $(MicrosoftRasKeyName)"\"$(TapiDevicesKeyName)"\"$(MiniportName)

 ; remove all installed virtual adapters
 ForListDo $(InstancesList)
  Set Instance = $($)
  ; open the device instance registry key
  OpenRegKey $(NetworkCardsKey) "" $(Instance) $(MAXIMUM_ALLOWED) InstanceKey
  IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
   ; retrieve the ProductName registry value
   GetRegValue $(InstanceKey) "ProductName" ProductNameValue
   IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
    Set ProductName = *($(ProductNameValue), 4)
    ; retrieve the ServiceName registry value
    GetRegValue $(InstanceKey) "ServiceName" ServiceNameValue
    IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
     Set ServiceName = *($(ServiceNameValue), 4)
     ; generate the Parameters key name
     Set ParametersKeyName = $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters\"$(ProtocolName)
     ; delete protocol-specific parameters
     DeleteRegKey $(!REG_H_LOCAL) $(ParametersKeyName)
     ; check if this is an instance of our virtual adapter
     IfStr(i) $(ProductName) == $(MiniportName)
      ; close the device instance registry key
      CloseRegKey $(InstanceKey)
      Set InstanceKey = ""
      ; remove the virtual adapter instance
      Set NetCardName = $(NetworkCardsKeyName)\$(Instance)
      Shell $(UtilityINF) RemoveHardwareComponent $(Manufacturer) +
            $(MiniportName) $(NetCardName)
     EndIf
    EndIf
   EndIf
   ; close the device instance registry key
   CloseRegKey $(InstanceKey)
  EndIf
 EndForListDo

 ; open the protocol NetRules registry key
 OpenRegKey $(!REG_H_LOCAL) "" $(ProtocolProductKeyName)"\NetRules" +
            $(MAXIMUM_ALLOWED) ProtocolNetRulesKey
 IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
  ; retrieve the InfName registry value
  GetRegValue $(ProtocolNetRulesKey) "InfName" InfNameValue
  IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
   Set InfName = *($(InfNameValue), 4)
  Else
   Set InfName = "NUL"
  EndIf
  ; close the protocol NetRules registry key
  CloseRegKey $(ProtocolNetRulesKey)
 EndIf

 ; remove the miniport portion
 Shell $(UtilityINF) RemoveSoftwareComponent $(Manufacturer) $(MiniportName)
 IfInt $($ShellCode) == $(!SHELL_CODE_OK)
  DeleteRegKey $(!REG_H_LOCAL) $(!NTN_ServiceBase)"\EventLog\System\"$(MiniportName)
  ; remove the protocol portion
  Shell $(UtilityINF) RemoveSoftwareComponent $(Manufacturer) $(ProtocolName)
  IfInt $($ShellCode) == $(!SHELL_CODE_OK)
   DeleteRegKey $(!REG_H_LOCAL) $(!NTN_ServiceBase)"\EventLog\System\"$(ProtocolName)
   ; retrieve result
   Set RegistryErrorIndex = $($R0)
   ; check if there was no error removing the protocol
   IfStr(i) $(RegistryErrorIndex) == "NO_ERROR"
    ; remove the manufacturer registry subkey
    DeleteRegKey $(!REG_H_LOCAL) $(!NTN_SoftwareBase)"\"$(Manufacturer)
    ; delete all installed files
    LibraryProcedure Result, $(!LIBHANDLE), DelFile $(!STF_WINDOWSSYSPATH)"\"$(InfName)
    LibraryProcedure Result, $(!LIBHANDLE), DelFile $(!STF_WINDOWSSYSPATH)"\RASPPPOE.DLL"
    LibraryProcedure Result, $(!LIBHANDLE), DelFile $(!STF_WINDOWSSYSPATH)"\RASPPPOE.EXE"
    LibraryProcedure Result, $(!LIBHANDLE), DelFile $(!STF_WINDOWSSYSPATH)"\Drivers\RMSPPPOE.SYS"
    ; delete the uninstall registry subkey
    DeleteRegKey $(!REG_H_LOCAL) $(UninstallKeyName)
   EndIf
  EndIf
 EndIf

 ; deinstallation is finished
 GoTo InstallOptionEnd

;------------------------------------------------------------------------------
; InstallOption/Update Section - Update the protocol
;------------------------------------------------------------------------------

Update = +
 ; updating is not implemented
 Set Error = "Update is not implemented, Remove and Reinstall."
 GoTo NonFatal

;------------------------------------------------------------------------------
; InstallOption exit points
;------------------------------------------------------------------------------

NonFatal = +
 ; show a non-fatal message and exit
 Set CommonStatus = STATUS_USERCANCEL
 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) "STATUS" $(Error)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf
 GoTo InstallOptionEnd

FatalRegistryError = +
 ; show a fatal registry error message and exit
 Shell $(UtilityINF) RegistryErrorString $(RegistryErrorIndex)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf
 Set Error = $($R0)
 Goto FatalError

FatalError = +
 ; show a fatal error message and exit
 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 InstallOptionFailed

ShellCodeError = +
 ; show a shell code error message box and exit
 Set DlgType      = "MessageBox"
 Set STF_MB_TITLE = $(ShellCodeErrorTitle)
 Set STF_MB_TEXT  = $(ShellCodeErrorText)
 Set STF_MB_TYPE  = 1 ; OK button
 Set STF_MB_ICON  = 3 ; STOP icon
 Set STF_MB_DEF   = 1 ; default button
 UI Start "ShellCodeError"
 GoTo InstallOptionFailed

InstallOptionFailed = +
 ; operation failed
 Set Status = STATUS_FAILED
 IfStr(i) $(OEM_ABANDON_ON) == "YES"
  Set OEM_ABANDON_ON = "NO"
  GoTo DeInstall
 EndIf
 GoTo InstallOptionEnd

InstallOptionEnd = +
 Return $(Status)

;------------------------------------------------------------------------------
; InstallCopyFiles - Copy the installation files
;------------------------------------------------------------------------------

[InstallCopyFiles]
 ; disable termination if copy operation fails
 Set STF_VITAL = ""

 ; add files to copy list if requested
 IfStr(i) $(AddCopy) == "YES"
  AddSectionFilesToCopyList $(Option).Files.DLL $(SrcDir) $(!STF_WINDOWSSYSPATH)
  AddSectionFilesToCopyList $(Option).Files.SYS $(SrcDir) $(!STF_WINDOWSSYSPATH)\Drivers
 EndIf

 ; copy files in copy list if requested
 IfStr(i) $(DoCopy) == "YES"
  Set !STF_NCPA_FLUSH_COPYLIST = "TRUE"
  CopyFilesInCopyList
 EndIf

 ; exit from this section
 Exit

;------------------------------------------------------------------------------
; InstallVirtualAdapter - Install an instance of the RASPPPOE virtual adapter
;------------------------------------------------------------------------------

[InstallVirtualAdapter]
 ; retrieve parameter
 Set Option = $($0)

 ; assume success
 Set Status = STATUS_SUCCESSFUL

 ; read symbol constants
 Read-Syms FileConstants
 Read-Syms FileConstants$(!STF_LANGUAGE)
 Read-Syms DialogConstants$(!STF_LANGUAGE)
 Read-Syms GeneralConstants

 ; change Continue dialog string if invoked from the NCPA
 IfStr(i) $(!NTN_Origination) == "NCPA"
  Set Continue = $(OK)
 EndIf

 ; get the current system date
 Detect Date

 ; add a virtual adapter instance
 Shell $(UtilityINF), AddHardwareComponent $(MiniportName) +
       $(STF_CONTEXTINFNAME) $(MiniportProductKeyName)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)
 Set HardProductKey     = $($R1)
 Set HardNetRuleKey     = $($R2)
 Set HardParametersKey  = $($R3)
 Set AdapterNumber      = $($R4)
 Set ServiceName        = $($R5)

 ; check if there was any error during registry entry creation
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  CloseRegKey $(HardProductKey)
  CloseRegKey $(HardNetRuleKey)
  CloseRegKey $(HardParametersKey)
  GoTo FatalRegistryError
 EndIf

 ; add virtual adapter product registry values
 Set NewValueList = {                                                        +
  {Manufacturer,      $(NoTitle), $(!REG_VT_SZ),    $(Manufacturer)},        +
  {Title,             $(NoTitle), $(!REG_VT_SZ), "["$(AdapterNumber)"] "$(MiniportDisplayName)}, +
  {Description,       $(NoTitle), $(!REG_VT_SZ),    $(MiniportDisplayName)}, +
  {ProductName,       $(NoTitle), $(!REG_VT_SZ),    $(MiniportName)},        +
  {ServiceName,       $(NoTitle), $(!REG_VT_SZ),    $(ServiceName)},         +
  {InstallDate,       $(NoTitle), $(!REG_VT_DWORD), *($(Now), 1)}            +
  {Hidden,            $(NoTitle), $(!REG_VT_DWORD), 1}}
 Shell $(UtilityINF) AddValueList $(HardProductKey) $(NewValueList)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)

 ; check if there was any error adding the values
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  CloseRegKey $(HardProductKey)
  CloseRegKey $(HardNetRuleKey)
  CloseRegKey $(HardParametersKey)
  GoTo FatalRegistryError
 EndIf

 ; close the product registry key
 CloseRegKey $(HardProductKey)

 ; add virtual adapter net rules registry values
 Set ObjectName = """"$(MiniportName)$(AdapterNumber)""""
 Set BindForm   = $(ObjectName)$(HardwareNetRuleBindForm)
 Set NewValueList = {                                                    +
  {type,      $(NoTitle), $(!REG_VT_SZ),       $(HardwareNetRuleType)},  +
  {class,     $(NoTitle), $(!REG_VT_MULTI_SZ), $(HardwareNetRuleClass)}, +
  {bindform,  $(NoTitle), $(!REG_VT_SZ),       $(BindForm)},             +
  {InfOption, $(NoTitle), $(!REG_VT_SZ),       $(Option)}}
 Shell $(UtilityINF) AddValueList $(HardNetRuleKey) $(NewValueList)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)

 ; check if there was any error adding the values
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  CloseRegKey $(HardNetRuleKey)
  CloseRegKey $(HardParametersKey)
  GoTo FatalRegistryError
 EndIf

 ; close the net rules registry key
 CloseRegKey $(HardNetRuleKey)

 ; add virtual adapter parameters registry values
 Set NewValueList = {                                             +
  {Instance,     $(NoTitle), $(!REG_VT_DWORD), $(AdapterNumber)}, +
  {WanEndPoints, $(NoTitle), $(!REG_VT_DWORD), $(WanEndPoints)}}
 Shell $(UtilityINF) AddValueList $(HardParametersKey) $(NewValueList)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf

 ; retrieve result
 Set RegistryErrorIndex = $($R0)

 ; check if there was any error adding the values
 IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
  CloseRegKey $(HardParametersKey)
  GoTo FatalRegistryError
 EndIf

 ; close the virtual adapter parameters registry key
 CloseRegKey $(HardParametersKey)

 ; return the last status and the virtual adapter instance service name
 Return $(Status) $(ServiceName)

FatalRegistryError = +
 ; show a fatal registry error message and exit
 Shell $(UtilityINF) RegistryErrorString $(RegistryErrorIndex)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf
 Set Error = $($R0)
 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
 Return STATUS_FAILED

ShellCodeError = +
 ; show a shell code error message box and exit
 Set DlgType      = "MessageBox"
 Set STF_MB_TITLE = $(ShellCodeErrorTitle)
 Set STF_MB_TEXT  = $(ShellCodeErrorText)
 Set STF_MB_TYPE  = 1 ; OK button
 Set STF_MB_ICON  = 3 ; STOP icon
 Set STF_MB_DEF   = 1 ; default button
 UI Start "ShellCodeError"
 Return STATUS_FAILED

;------------------------------------------------------------------------------
; ConfigureRAS - Configure the Remote Access Service
;------------------------------------------------------------------------------

[ConfigureRAS]
 ; assume success
 Set Status = STATUS_SUCCESSFUL

 ; read symbol constants
 Read-Syms FileConstants
 Read-Syms FileConstants$(!STF_LANGUAGE)
 Read-Syms DialogConstants$(!STF_LANGUAGE)
 Read-Syms GeneralConstants

 ; change Continue dialog string if invoked from the NCPA
 IfStr(i) $(!NTN_Origination) == "NCPA"
  Set Continue = $(OK)
 EndIf

 ; open the NetworkCards registry key
 OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) +
            $(MAXIMUM_ALLOWED) NetworkCardsKey
 IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
  GoTo FatalRegistryError
 EndIf

 ; enumerate the network cards in the registry
 Set NetworkCardsList = {}
 EnumRegKey $(NetworkCardsKey) NetworkCardsList
 IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
  ; extract list of network card device instances
  Set InstancesList = {}
  ForListDo $(NetworkCardsList)
   IfStr(i) $(InstancesList) == {}
    Set InstancesList = {*($($), 1)}
   Else
    Set InstancesList = >($(InstancesList), *($($), 1))
   EndIf
  EndForListDo
 EndIf

 ; initialize TAPI registry values and IPMTU to set
 Set PortIdentifier  = 1
 Set TapiAddressList = {}
 Set TapiNamesList   = {}
 Set TapiUsageList   = {}
 Set IPMTU = $(MAXPPPOEMTU)

 ; generate TAPI address list and determine IPMTU to set
 ForListDo $(InstancesList)
  Set Instance = $($)
  ; open the device instance registry key
  OpenRegKey $(NetworkCardsKey) "" $(Instance) $(MAXIMUM_ALLOWED) InstanceKey
  IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
   ; retrieve the ProductName registry value
   GetRegValue $(InstanceKey) "ProductName" ProductNameValue
   IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
    Set ProductName = *($(ProductNameValue), 4)
    ; retrieve the ServiceName registry value
    GetRegValue $(InstanceKey) "ServiceName" ServiceNameValue
    IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
     Set ServiceName = *($(ServiceNameValue), 4)
     ; check if this is an instance of our virtual adapter
     IfStr(i) $(ProductName) == $(MiniportName)
      ; open the virtual adapter's Parameters registry subkey
      Set ParametersKeyName = $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters"
      OpenRegKey $(!REG_H_LOCAL) "" $(ParametersKeyName) +
                 $(MAXIMUM_ALLOWED) ParametersKey
      IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
       ; retrieve the WanEndPoints registry value
       GetRegValue $(ParametersKey) "WanEndPoints" WanEndPointsValue
       IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
        Set WanEndPoints = *($(WanEndPointsValue), 4)
        ; add the TAPI addresses for this adapter to the TAPI adress list
        Set Line = 1
AddLine = +
        IfStr(i) $(TapiAddressList) == {}
         Set TapiAddressList = {$(Instance)" "$(Line)" 0"}
         Set TapiNamesList   = {$(TapiMediaType)$(PortIdentifier)}
         Set TapiUsageList   = {"Client"}
        Else
         Set TapiAddressList = >($(TapiAddressList), $(Instance)" "$(Line)" 0")
         Set TapiNamesList   = >($(TapiNamesList), $(TapiMediaType)$(PortIdentifier))
         Set TapiUsageList   = >($(TapiUsageList), "Client")
        EndIf
        Set-Add PortIdentifier = $(PortIdentifier), 1
        Set-Add Line = $(Line), 1
        IfInt $(Line) <= $(WanEndPoints)
         GoTo AddLine
        EndIf
       EndIf
       ; close the parameters registry key
       CloseRegKey $(ParametersKey)
      EndIf
     Else
      ; other adapter, try to open the protocol Parameters registry subkey
      Set ParametersKeyName = $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters\"$(ProtocolName)
      OpenRegKey $(!REG_H_LOCAL) "" $(ParametersKeyName) +
                 $(MAXIMUM_ALLOWED) ParametersKey
      IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
       ; retrieve the OverrideMTU registry value
       GetRegValue $(ParametersKey) "OverrideMTU" OverrideMTUValue
       IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
        Set OverrideMTU = *($(OverrideMTUValue), 4)
        ; check if the OverrideMTU value is valid
        IfInt $(OverrideMTU) >= $(MINPPPOEMTU)
         ; if the value is lower than the current IPMTU, use it
         IfInt $(OverrideMTU) < $(IPMTU)
          Set IPMTU = $(OverrideMTU)
         EndIf
        EndIf
       EndIf
       ; close the parameters registry key
       CloseRegKey $(ParametersKey)
      EndIf
     EndIf
    EndIf
   EndIf
   ; close the device instance registry key
   CloseRegKey $(InstanceKey)
  EndIf
 EndForListDo

 ; check if the TAPI address list is empty
 IfStr(i) $(TapiAddressList) == {}
  ; TAPI address list is empty, remove the TAPI Service Provider registry keys
  DeleteRegKey $(!REG_H_LOCAL) +
               $(DeviceMapKeyName)"\"$(TapiDevicesKeyName)"\"$(MiniportName)
  DeleteRegKey $(!REG_H_LOCAL) +
               $(MicrosoftRasKeyName)"\"$(TapiDevicesKeyName)"\"$(MiniportName)
 Else
  ; open the HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP registry key
  OpenRegKey $(!REG_H_LOCAL) "" $(DeviceMapKeyName) +
             $(MAXIMUM_ALLOWED) DeviceMapKey
  IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
   GoTo FatalRegistryError
  EndIf
  ; create the TAPI DEVICES registry subkey
  CreateRegKey $(DeviceMapKey) {$(TapiDevicesKeyName), $(NoTitle), +
               GenericClass} "" $(MAXIMUM_ALLOWED) "" TapiDevicesKey
  IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
   ; subkey creation failed; it may already exist
   OpenRegKey $(DeviceMapKey) "" $(TapiDevicesKeyName) +
              $(MAXIMUM_ALLOWED) TapiDevicesKey
   IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
    CloseRegKey $(DeviceMapKey)
    GoTo FatalRegistryError
   EndIf
  EndIf
  ; close the HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP registry key
  CloseRegKey $(DeviceMapKey)
  ; create the Service Provider registry subkey
  CreateRegKey $(TapiDevicesKey) {$(MiniportName), $(NoTitle), GenericClass} "" +
               $(MAXIMUM_ALLOWED) "" ServiceProviderKey
  IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
   ; subkey creation failed; it may already exist
   OpenRegKey $(TapiDevicesKey) "" $(MiniportName) +
              $(MAXIMUM_ALLOWED) ServiceProviderKey
   IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
    CloseRegKey $(TapiDevicesKey)
    GoTo FatalRegistryError
   EndIf
  EndIf
  ; close the TAPI DEVICES registry subkey
  CloseRegKey $(TapiDevicesKey)
  ; add TAPI Service Provider registry values
  Set NewValueList = {                                                  +
   {Address,      $(NoTitle), $(!REG_VT_MULTI_SZ), $(TapiAddressList)}, +
   {"Media Type", $(NoTitle), $(!REG_VT_SZ),       $(TapiMediaType)}}
  Shell $(UtilityINF) AddValueList $(ServiceProviderKey) $(NewValueList)
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf
  ; retrieve result
  Set RegistryErrorIndex = $($R0)
  ; check if there was any error adding the values
  IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
   CloseRegKey $(ServiceProviderKey)
   GoTo FatalRegistryError
  EndIf
  ; close the Service Provider registry subkey
  CloseRegKey $(ServiceProviderKey)
  ; create the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RAS registry subkey
  CreateRegKey $(!REG_H_LOCAL) {$(MicrosoftRasKeyName), $(NoTitle), +
               GenericClass} "" $(MAXIMUM_ALLOWED) "" MicrosoftRasKey
  IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
   ; subkey creation failed; it may already exist
   OpenRegKey $(!REG_H_LOCAL) "" $(MicrosoftRasKeyName) +
              $(MAXIMUM_ALLOWED) MicrosoftRasKey
   IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
    GoTo FatalRegistryError
   EndIf
  EndIf
  ; create the TAPI DEVICES registry subkey
  CreateRegKey $(MicrosoftRasKey) {$(TapiDevicesKeyName), $(NoTitle), +
               GenericClass} "" $(MAXIMUM_ALLOWED) "" TapiDevicesKey
  IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
   ; subkey creation failed; it may already exist
   OpenRegKey $(MicrosoftRasKey) "" $(TapiDevicesKeyName) +
              $(MAXIMUM_ALLOWED) TapiDevicesKey
   IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
    CloseRegKey $(MicrosoftRasKey)
    GoTo FatalRegistryError
   EndIf
  EndIf
  ; close the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RAS registry subkey
  CloseRegKey $(MicrosoftRasKey)
  ; create the Service Provider registry subkey
  CreateRegKey $(TapiDevicesKey) {$(MiniportName), $(NoTitle), GenericClass} "" +
               $(MAXIMUM_ALLOWED) "" ServiceProviderKey
  IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
   ; subkey creation failed; it may already exist
   OpenRegKey $(TapiDevicesKey) "" $(MiniportName) +
              $(MAXIMUM_ALLOWED) ServiceProviderKey
   IfInt $(RegLastError) != $(!REG_ERROR_SUCCESS)
    CloseRegKey $(TapiDevicesKey)
    GoTo FatalRegistryError
   EndIf
  EndIf
  ; close the TAPI DEVICES registry subkey
  CloseRegKey $(TapiDevicesKey)
  ; add TAPI Service Provider registry values
  Set NewValueList = {                                                     +
   {Address,         $(NoTitle), $(!REG_VT_MULTI_SZ), $(TapiAddressList)}, +
   {"Friendly Name", $(NoTitle), $(!REG_VT_MULTI_SZ), $(TapiNamesList)},   +
   {"Media Type",    $(NoTitle), $(!REG_VT_SZ),       $(TapiMediaType)},   +
   {Usage,           $(NoTitle), $(!REG_VT_MULTI_SZ), $(TapiUsageList)}}
  Shell $(UtilityINF) AddValueList $(ServiceProviderKey) $(NewValueList)
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf
  ; retrieve result
  Set RegistryErrorIndex = $($R0)
  ; check if there was any error adding the values
  IfStr(i) $(RegistryErrorIndex) != "NO_ERROR"
   CloseRegKey $(ServiceProviderKey)
   GoTo FatalRegistryError
  EndIf
  ; close the Service Provider registry subkey
  CloseRegKey $(ServiceProviderKey)
 EndIf

 ; check if RAS is already installed
 Shell "OEMNSVRA.INF" CheckRasInstalled
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf

 ; retrieve return value
 Set RasInstalled = $($R0)

 ; check if RAS has to be installed
 IfStr(i) $(RasInstalled) != "TRUE"
  ; display RAS install message
  Shell $(SubroutineINF) SetupMessage $(!STF_LANGUAGE) "STATUS" $(InstallRasMsg)
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf
  ; shell RAS installer
  Set SavedInstallMode = $(!NTN_InstallMode)
  Set !NTN_InstallMode = "Install"
  Set SavedSrcDir_Override = $(!STF_SRCDIR_OVERRIDE)
  Set !STF_SRCDIR_OVERRIDE = ""
  Shell "OEMNSVRA.INF" InstallOption $(!STF_LANGUAGE) +
        "RAS" $(!STF_SRCDIR) "YES" "YES" "YES"
  Set !STF_SRCDIR_OVERRIDE = $(SavedSrcDir_Override)
  Set !NTN_InstallMode = $(SavedInstallMode)
  IfInt $($ShellCode) != $(!SHELL_CODE_OK)
   GoTo ShellCodeError
  EndIf
  Set Status = $($R0)
  ; check if RAS was successfully installed
  ifStr(i) $(Status) == "STATUS_SUCCESSFUL"
   Set RasInstalled = "TRUE"
  EndIf
 EndIf

 ; check if RAS is installed now
 IfStr(i) $(RasInstalled) == "TRUE"
  ; if there is no RAS phonebook file yet, create an empty file
  Set RasPhonebook = $(!STF_WINDOWSSYSPATH)"\RAS\rasphone.pbk"
  LibraryProcedure Result, $(!LIBHANDLE), CheckFileExistance $(RasPhonebook)
  IfStr(i) $(Result) == "NO"
   LibraryProcedure Result, $(!LIBHANDLE), ConfigFileAppend $(RasPhonebook) ""
  EndIf
  ; open the NDISWAN parameters registry subkey
  OpenRegKey $(!REG_H_LOCAL) "" $(NdisWanParamsKeyName) +
             $(MAXIMUM_ALLOWED) NdisWanParamsKey
  IfInt $(RegLastError) == $(!REG_ERROR_SUCCESS)
   ; set the IPMTU registry value
   SetRegValue $(NdisWanParamsKey) {"IPMTU", $(NoTitle), $(!REG_VT_DWORD), $(IPMTU)}
   ; close the NDISWAN parameters registry subkey
   CloseRegKey $(NdisWanParamsKey)
  EndIf
 EndIf

 ; return the last status
 Return $(Status)

FatalRegistryError = +
 ; show a fatal registry error message and exit
 Shell $(UtilityINF) RegistryErrorString $(RegistryErrorIndex)
 IfInt $($ShellCode) != $(!SHELL_CODE_OK)
  GoTo ShellCodeError
 EndIf
 Set Error = $($R0)
 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
 Return STATUS_FAILED

ShellCodeError = +
 ; show a shell code error message box and exit
 Set DlgType      = "MessageBox"
 Set STF_MB_TITLE = $(ShellCodeErrorTitle)
 Set STF_MB_TEXT  = $(ShellCodeErrorText)
 Set STF_MB_TYPE  = 1 ; OK button
 Set STF_MB_ICON  = 3 ; STOP icon
 Set STF_MB_DEF   = 1 ; default button
 UI Start "ShellCodeError"
 Return STATUS_FAILED

; *EOF*
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: ftp, load: 2.48