; The naming convention used by NT for repective types of installation
; done using INF script files, is as follows:
;   oemNAD**.inf network adapter card and  driver
;   oemnxp**.inf network transport
;
; Thus ATI's OSI LAN INF file will be called oemnxptp4.inf in NT machine
; But on the distribution media it is called oemsetup.inf file
;
; 4 sections in INF file are a must. They are called "detect Sections"
; Namely: Identify, ReturnOptions, InstallOption, Source Media Description
; Begin INF QUERYING SECTION
;
; For INF file to be discovered automatically by NCPA/SETUP program
; it must have following 2 sections: Identify and ReturnOptions
;
; Identify section has
;   Input: none,
;   Output:STATUS_SUCCESS,Option(NetAdapter etc.),Distribution media
;
;
[Source Media Descriptions]
; TAGFILE name presence indicates to Setup that correct disk is inserted
; Thus in the distribution diskette, ATI must have a file called "disk1"
   1 = "ISO TP4/CLNP Driver Disk #1", TAGFILE = disk1
[Identify]
   set OptionType = NetTransport    ; This definition is a must
   set Status     = STATUS_SUCCESSFUL
   set Media      = #("Source Media Descriptions",1,1)
   Return $(Status) $(OptionType) $(Media)
;
[LanguagesSupported]
   ENG
[Options]
   ISOTP
[OptionsTextENG]
   ISOTP = "ISO TP4/CLNP Stack"
; ReturnOptions Sections has
;   Input: Language Used (ENG|FRN|..)
;   Output: STATUS,OptionsList(Names of options),OptionTextList(display_names)
[ReturnOptions]
  set Status         = STATUS_FAILED
  set OptionList     = {}
  set OptionTextList = {}
;
  set LanguageList   = ^(LanguagesSupported,1)
  Ifcontains(i) $($0) in $(LanguageList)
     goto Set_ReturnOptions
  else
     Status = STATUS_NOLANGUAGE
     goto Finish_ReturnOptions
  endif
;
Set_ReturnOptions = +
     set OptionList = ^(Options,1)
     set OptionTextList = ^(OptionsText$($0),1) ;get list from OptionTextENG
     set Status = STATUS_SUCCESSFUL
     ;
Finish_ReturnOptions = +
     Return $(Status) $(OptionList) $(OptionTextList)
;
;  END INF QUERYING SECTION
;
;  BEGINE INF Invocations
;
; Constants used throughout
;
[GenericConstants]
   UtilityInf     = "UTILITY.INF"
   SubroutinInf   = "SUBROUTN.INF"
   SoftwareType   = transport
   ExitCode       = 0
   BillboardVisible = 0
   from = ""
   to   = ""
   ExitCodeOK     = 0
   ExitCodeCancel = 1
   ExitCodeFatal  = 2

   ExitState   =  "Active"

   KeyNull            = ""
   KeyProduct         = ""
   KeyParameters      = ""
   NoTitle            = 0

   TRUE           = 1
   FALSE          = 0

   RegistryErrorIndex = NO_ERROR
   MAXIMUM_ALLOWED    = 33554432
   SERVICE_NO_CHANGE  = 4294967295

   OldVersionExisted  = $(FALSE)
   DriverPath         = $(!STF_NTPATH)\drivers
;
; OSI Transport Stack Specific
;
[SpecificConstants]
   Manufacturer = "Microsoft"
   ProductMajorVersion = "3"
   ProductMinorVersion = "00"
   ProductVersion    = $(ProductMajorVersion)"."$(ProductMinorVersion)
;
; ATI may have to write it's own dll program to capture events and log
;
;   NetEventDLL = "%SystemRoot%\System32\tpnetevent.dll"
;   loLogMsgDLL = "%SystemRoot%\system32\tpLogMsg.dll"
;
; Registration Database specific section
; 2 sections for info about product must be created
;       1) Software
;       2) Services : This area is recoverable "last known good config"
;
; For Network Software components's Registry area, values are under both
;       1a) mainRegistryKey(CurrentVersion) and
;       1b) NetRules Key for network components
; The presence of a NetRules key indicates that the component is a part
; of network software
;
;
; Following are values to keys in Software\Miscrosoft\IsoTp\CurrentVersion
;
   ProductISOTPImagePath  = "%SystemRoot%\system32\plumbing.exe"
   ProductISOTPName  = "IsoTp" ; Must be same as CurrentControlSet\Services
   ProductISOTPSvcType = "serviceauto"  ; Since OWN_WIN32_PROCESS
;
; Following are defines for Key Services\tp4sys\Parameters\WinSock
;
   ProductISOTPWshDllPath      = "%SystemRoot%\System32\wshisotp.dll"
   Sockmaxlength         = 72
   Sockminlength         = 72

;  Mapping Parameter value is calculated by making a calll to Wshisotp dll
;  It returns a binary string which is the value of subkey "Mapping"
;
; Following are NetRule key specific defines
; BindForm ObjectName, yes|no, yes|no, {container|simple|streams}
;                     read page 4-20 of pgm guide DDK
   NetRuleISOTPBindForm = """IsoTp"" yes yes container"
; UniquClass Name, Any parent
   NetRuleISOTPClass    = "IsoTpTransport basic yes"
; Service classname lowerclass
   NetRuleISOTPType     = "IsoTp IsoTpTransport streamsStack"
   NetRuleISOTPUse      = $(SoftwareType)" yes yes"

;
; Following are defines for entry into Services\IsoTpsys
;
   ProductISOTPSYSName     = "IsoTpsys"
   ProductISOTPSYSImagePath    = "\SystemRoot\System32\drivers\IsoTp.sys"
   ProductISOTPSYSSvcType = "kernel"
;
;
   ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(Product$(Option)Name)"\CurrentVersion"
   LinkageKeyName = $(!NTN_ServiceBase)"\IsoTp\Linkage"
   ServiceISOTPKeyName = $(!NTN_ServiceBase)"\IsoTp"
   ServiceKeyName = $(!NTN_ServiceBase)


;
[date]
   Now = {} ? $(!LIBHANDLE) GetSystemDate
;
; Installoption section is invoked as follows:
;    Input: Language, Option Name to install, Source dir path,
;            AddCopy(Y|N), DoCopy(Y|N), DoConfig(Y|N)
;    Output: STATUS_SUCCESS|FAILED etc.
;
;*** DoConfig value is not used by network INF files ********
;
[InstallOption]
;
; Turn on the debug option for now. But before it goes to the customer
; tun it if off by setting it to 0 or commenting it out
   set !DebugOutputControl = 1
;
; Read in the calling parameters for InstallOption as described above
   set Language = $($0)
   set Option   = $($1)
   set SrcDir   = $($2)
   set AddCopy  = $($3)
   set DoCopy   = $($4)
   set DoConfig = $($5)
;
; Check if the chosen Lanaguage is supported or not
   set LangList = ^(LanguagesSupported,1)
   ifcontains(i) $(Language) not-in $(LangList)
      Return STATUS_NOLANGUAGE
   endif
;
; Debug-Output some standard SETUP information varibales
;
   Debug-Output "Executing InstallOptions Section"
   Debug-Output "OEMNXPTP.INF"
   Debug-Output "       Path to media:"$(!STF_SRCDIR)
   Debug-Output "       SYSTEM32 Dir :"$(!STF_WINDOWSSYSPATH) ;\winnt\system32
   Debug-Output "       SYSTEM32 Dir :"$(!STF_NTPATH)         ;\winnt\system32
   Debug-Output "       Install Mode :"$(!STF_INSTALL_MODE)   ;CUSTOM
   Debug-Output "       Option       :"$(Option)              ;ISOTP
;
; Get the local variables
;
   Debug-Output "Reading GenenicConstants Section"
   read-syms GenericConstants
   Debug-Output "Reading SpecificConstants Section"
   read-syms SpecificConstants
   Debug-Output "Reading DialogueConstantsENG Section"
   read-syms DialogueConstants$(!STF_LANGUAGE)
   ifstr(i) $(!NTN_Origination) == "NCPA"
       set continue = $(OK)
   endif
   Debug-Output "Reading FileConstantsENG"
   read-syms FileConstants$(!STF_LANGUAGE)
   detect date
   set-title $(FunctionTitle)
   set to = Begin
   set from = Begin
   set CommonStatus = STATUS_SUCCESSFUL
   EndWait ; show Mouse ptr instead of hourglass

Begin = +
   Debug-Output "Executing Begin Label"
   ifstr(i) $(!NTN_InstallMode) == deinstall
      set StartLabel = DeInstallSW
      set OEM_ABANDON_OPTIONS = { $(ProductISOTPSYSName)}
      set OEM_ABANDON_SOFTWARE = { $(ProductISOTPName),"Streams"}

   else-ifstr(i) $(!NTN_InstallMode) == Update
      set StartLabel =  UpdateSW

   else-ifstr(i) $(!NTN_InstallMode) == Bind
      set StartLabel = BindSWtoAdapter

   else-ifstr(i) $(!NTN_InstallMode) == Configure
      set StartLabel = ConfigureSW

   else
      Debug-Output "Option from NCPA to SETUP script is Install"
      set StartLabel = InstallSW
      set OEM_ABANDON_SOFTWARE = {}
      set OEM_ABANDON_OPTIONS = {}
   endif
   set from = $(fatal)
   set to   = $(fatal)
   goto $(StartLabel)
;
;
DeInstallSW = +
   Debug-Output "Executing DeInstall SW Label"
    ForListDo  $(OEM_ABANDON_SOFTWARE)
        Debug-Output "Remove component: "$($)
        ifstr(i) $($) == "Streams"
            Shell $(UtilityInf), RemoveStreams
        else
            Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $($)
        endif
        ifstr(i) $($) == "IsoTp"
            debug-output "RemoveWinsockInfo "$(ProductISOTPName)
            Shell $(UtilityInf), RemoveWinsockInfo, $(ProductISOTPName)
            set RegistryErrorIndex = $($R0)
            Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                Debug-Output "OEMNXPTP.INF: Registry error: remove Winsock Info."
            Endif
        endif
    EndForListDo

    ForListDo  $(OEM_ABANDON_OPTIONS)
        debug-output "Remove component: "$($)
        Set UseSvcctrl = "YES"
        Shell $(UtilityInf), RemoveService, $($), $(UseSvcctrl)
    EndForListDo
    goto end
;
;
UpdateSW = +
   Debug-Output "Executing Update SW Label"
        OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
        Ifstr $(KeyProduct) != $(KeyNull)
            GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
            set Version = *($(VersionInfo), 4)
            Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                Debug-Output "ShellCode error"
                goto ShellCodeError
            endif
            set !UG_Filename = $($R0)
            ifstr(i) $(!UG_Filename) != ""
                install "Install-Update"
                ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
                    goto fatal
                endif
            endif
            SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
            SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
            ifint $(Version) != $(ProductVersion)
            endif
            CloseRegKey $(KeyProduct)
        else
            goto fatalregistry
        endif
    goto end
;
;  Configure the software
;
ConfigureSW = +
   Debug-Output "Executing Configure SW Label"
   set FLibraryErrCtl = 1
   LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\TP4CFG.DLL TP4CFGLIB_HANDLE
   LibraryProcedure ResultList, $(TP4CFGLIB_HANDLE) ISOTPDlgBox
   FreeLibrary $(TP4CFGLIB_HANDLE)
   set FLibraryErrCtl = 0
   set Result = *($(ResultList),1)
   ifstr(i) $(Result) == "CHANGE"
     set CommonStatus = STATUS_REBOOT
   else
     set CommonStatus = STATUS_USERCANCEL
   endif
   goto end
;
;
;
BindSWtoAdapter = +
   Debug-Output "Executing Bind SW to an Adapter Label"
   ifstr(i) $(Option) == "ISOTP"
      OpenRegKey $(!REG_H_LOCAL) "" $(LinkageKeyName) $(MAXIMUM_ALLOWED) LinkageKey
      GetRegValue $(LinkageKey) "Bind" BindList

      ifstr(i) $(BindList) == {}
         Set BindList = ""
      endif

      CloseRegKey $(LinkageKey)

      ifstr(i) $(BindList) == ""
         debug-output "OEMNXPTP.INF: no binding info; warning user"
         read-syms InfoDlgCantConfigure
         goto infomsg
      endif

      set oldVersionExisted = $(TRUE)
      set CardList = ""
      set CardCount = 0

      ForListDo *($(BindList),4)
        Split-String $($), "\", BindInfo
        Set CardName = *($(BindInfo),6)
        OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"*($(BindInfo),6) $(MAXIMUM_ALLOWED) CardServiceKey

        ifstr(i) $(CardServiceKey) != ""
           Debug-output "ConfigureSW, CardName= "$(CardName)
           CloseRegKey $(CardServiceKey)
           Set-add CardCount = $(CardCount),1

           ifstr $(CardList) == ""
              Set CardList = $(CardName)
           else
              Set CardList = $(CardList)"@"$(CardName)
           endif

           OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\"$(CardName)"\Parameters" $(MAXIMUM_ALLOWED) ServiceParamKey

           ifstr(i) $(ServiceParamKey) != ""
              debug-output "ConfigureSW: Opened ServiceParamKey"
              CloseRegKey $(ServiceParamkey)
              OpenRegKey $(ServiceParamKey) "" "IsoTp" $(MAXIMUM_ALLOWED) +
                                            ISOTPKey
              ifstr(i) $(ISOTPKey) == ""
                  CreateRegKey $(ServiceParamKey) {"IsoTp",$(NoTitle), +
                                GenericClass} "" +
                                $(MAXIMUM_ALLOWED) "" ISOTPKey
              endif
              CloseRegKey $(ISOTPKey)
           endif

       endif
SkipSetDefault = +
       Debug-Output "At SkipSetDefaults"
     EndForListDo
     goto ConfigureSW
;
;
; Installtion of the Software Begin
InstallSW = +
   Debug-Output "Executing Install SW Label"
    ifstr(i) $(!NTN_InstallMode) == "install"
        Ifstr(i) $(DoCopy) == "YES"
           Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
           Ifint $($ShellCode) != $(!SHELL_CODE_OK)
               Goto ShellCodeError
           Else-Ifstr(i) $($R0) == STATUS_FAILED
               Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
               ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   goto ShellCodeError
               endif
               set Error = $($R0)
               Goto fatal
           Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
               Goto successful
           Endif
           Set SrcDir = $($R1)
        Endif

        Debug-Output "OEMNXPTP.INF: installadapter: installing [Install-Option]"
        install "Install-Option"
        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
           Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
           ifint $($ShellCode) != $(!SHELL_CODE_OK)
               goto ShellCodeError
           endif
           set Error = $($R0)
           goto fatal
        endif

    endif


    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
    Ifstr $(KeyProduct) != $(KeyNull)
        CloseRegKey $(KeyProduct)
        Shell $(UtilityInf), VerExistedDlg, $(Product$(Option)Title),+
            $(ProductVersion)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            Debug-Output "OEMNXPTP.INF: ShellCode error: cannot get an error string."
            goto ShellCodeError
        endif
        goto end
    endif
    set OEM_ABANDON_ON  = TRUE
    read-syms Billboard1$(!STF_LANGUAGE)
    Shell "subroutn.inf" PushBillboard NETSTATUSDLG $(Status)
    Set BillboardVisible = 1
    Set DoIsoTp      = FALSE
    Set DoIsoTpSys   = FALSE
    Set DoIsoTpSvc   = FALSE
    Ifstr(i) $(Option) == ISOTP
        Set DoIsoTp    = TRUE
        Set DoIsoTpSys = TRUE
        Set DoIsoTpSvc = TRUE
        Set DoStreams  = TRUE
    Else
        Debug-Output "OEMNXPTP.INF: Unrecognized option"
    Endif
    StartWait
    ifstr(i) $(DoIsoTp) == TRUE
        Set ThisOption = ISOTP
        Set OEM_ABANDON_SOFTWARE = >($(OEM_ABANDON_SOFTWARE), $(Product$(ThisOption)Name))
        Debug-Output "OEMNXPTP.INF: installing TP4/CLNP."
        Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer),+
            $(Product$(ThisOption)Name), $(Product$(ThisOption)Name),+
            $(Product$(ThisOption)DisplayName), $(STF_CONTEXTINFNAME),+
            $(Product$(ThisOption)ImagePath),+
            $(Product$(ThisOption)SvcType),+
            "", {"Streams"}, ""

        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            Debug-Output "OEMNXPTP.INF: ShellCode error, add software component"
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            EndWait
            Debug-Output "OEMNXPTP.INF: Registry error: add software components"
            CloseRegKey $($R1)
            CloseRegKey $($R2)
            CloseRegKey $($R3)
            CloseRegKey $($R4)
            CloseRegKey $($R5)
            goto fatalregistry
        endif
        Set Tp4VersKeyHandle  = $($R1)
        Set Tp4RulesKeyHandle = $($R2)
        Set Tp4SvcKeyHandle   = $($R3)
        Set Tp4ParmKeyHandle  = $($R4)
        Set Tp4LinkageHandle  = $($R5)
        set NewValueList = { +
          {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
          {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
          {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
          {Title,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Title)},+
          {Description,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+
          {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Name)},+
          {Review,$(NoTitle),$(!REG_VT_DWORD),1},+
          {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
        Shell  $(UtilityInf), AddValueList, $(Tp4VersKeyHandle), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            Debug-Output "OEMNXPTP.INF: ShellCode error, add value list"
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            EndWait
            Debug-Output "OEMNXPTP.INF: Registry error: add value list."
            CloseRegKey $(Tp4VersKeyHandle)
            CloseRegKey $(Tp4RulesKeyHandle)
            CloseRegKey $(Tp4SvcKeyHandle)
            CloseRegKey $(Tp4ParmKeyHandle)
            CloseRegkey $(Tp4LinkageHandle)
            goto fatalregistry
        Endif
        set NewValueList = { +
          {type,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Type)},+
          {use,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Use)},+
          {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)BindForm)},+
          {class,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Class)},+
          {InfOption,$(NoTitle),$(!REG_VT_SZ),$(ThisOption)}}
        Shell  $(UtilityInf), AddValueList, $(Tp4RulesKeyHandle), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            Debug-Output "OEMNXPTP.INF: ShellCode error."
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        CloseRegKey $(Tp4VersKeyHandle)
        CloseRegKey $(Tp4RulesKeyHandle)
        Set NewValueList = { +
           {OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),{"IsoTpsys"}}}
        Shell  $(UtilityInf), AddValueList, $(Tp4LinkageHandle), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            CloseRegKey $(Tp4LinkageHandle)
            CloseRegKey $(Tp4SvcKeyHandle)
            Debug-Output "OEMNXPTP.INF: ShellCode error."
            goto ShellCodeError
        endif
        CloseRegKey $(Tp4LinkageHandle)
;
;       Which cards to run OSI on
;
        set NewValueList = { +
         {Bind,             $(NoTitle),$(REG_VT_SZ),"\Device\Elnk31"}}

        Shell  $(UtilityInf), AddValueList, $(Tp4ParmKeyHandle), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            Debug-Output "OEMNXP0.INF: Bind value add ShellCode error."
            CloseRegKey $(Tp4ParmKeyHandle)
            CloseRegKey $(Tp4SvcKeyHandle)
            goto ShellCodeError
        endif
        Set RegistryErrorIndex = $($R0)
;
;       TP4, CLNP, ES-IS(ES or IS) Layer specific parmaters
;
;
;       CLNP related parameter
;
        CreateRegKey $(Tp4ParmKeyHandle) {"CLNP", $(NoTitle), GenericClass} +
                "" $(MAXIMUM_ALLOWED) "" KeyCLNP
        ifstr(i) $(KeyCLNP) != ""
           set NewValueList = { +
             {LocalMachineName, $(NoTitle),$(!REG_VT_SZ),$(!STF_COMPUTERNAME)},+
             {LocalMachineNSAP, $(NoTitle),$(!REG_VT_SZ),$(!STF_COMPUTERNAME)},+
             {MaxSNSDUSize,     $(NoTitle),$(!REG_VT_DWORD), 1496},+
             {TimerReassembly,  $(NoTitle),$(!REG_VT_DWORD), 10  },+
             {ChecksumUse,      $(NoTitle),$(!REG_VT_DWORD), 0   },+
             {Lifetime,         $(NoTitle),$(!REG_VT_DWORD), 20  }}

           Shell  $(UtilityInf), AddValueList, $(KeyCLNP), $(NewValueList)
           CloseRegKey $(KeyCLNP)
           ifint $($ShellCode) != $(!SHELL_CODE_OK)
              Debug-Output "OEMNXP0.INF: CLNP value add ShellCode error."
              CloseRegKey $(Tp4ParmKeyHandle)
              CloseRegKey $(Tp4SvcKeyHandle)
              goto ShellCodeError
           endif
           Set RegistryErrorIndex = $($R0)
        endif
;
;      ES-IS related parameters
;
        CreateRegKey $(Tp4ParmKeyHandle) {"ESIS", $(NoTitle), GenericClass} +
                "" $(MAXIMUM_ALLOWED) "" KeyESIS
        ifstr(i) $(KeyESIS) != ""
           set NewValueList = { +
              {NodeType,            $(NoTitle),$(!REG_VT_SZ),    ES},+
              {ConfigNotify,        $(NoTitle),$(!REG_VT_DWORD), 0 },+
              {GenerateChksum,      $(NoTitle),$(!REG_VT_DWORD), 0 }}


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

           ifint $($ShellCode) != $(!SHELL_CODE_OK)
              Debug-Output "OEMNXP0.INF: ESIS value add ShellCode error."
              CloseRegKey $(Tp4ParmKeyHandle)
              CloseRegKey $(Tp4SvcKeyHandle)
              goto ShellCodeError
           endif
           Set RegistryErrorIndex = $($R0)
        endif
;
;      IF the Node is configured as an ES
;
        CreateRegKey $(KeyESIS) {"ES", $(NoTitle), GenericClass} +
                "" $(MAXIMUM_ALLOWED) "" KeyES
        ifstr(i) $(KeyES) != ""
           set NewValueList = { +
               {TimerConfig,         $(NoTitle),$(!REG_VT_DWORD), 600},+
               {TimerHolding,        $(NoTitle),$(!REG_VT_DWORD), 1800},+
               {RDRefresh,           $(NoTitle),$(!REG_VT_DWORD), 0 },+
               {TimerRDHolding,      $(NoTitle),$(!REG_VT_DWORD), 1800}}

           Shell  $(UtilityInf), AddValueList, $(KeyES), $(NewValueList)
           CloseRegKey $(KeyES)
           ifint $($ShellCode) != $(!SHELL_CODE_OK)
              Debug-Output "OEMNXP0.INF: ES value add ShellCode error."
              CloseRegKey $(KeyESIS)
              CloseRegKey $(Tp4ParmKeyHandle)
              CloseRegKey $(Tp4SvcKeyHandle)
              goto ShellCodeError
           endif
           Set RegistryErrorIndex = $($R0)
        endif
;
;       If the Node is configured as an IS.
;
        CreateRegKey $(KeyESIS) {"IS", $(NoTitle), GenericClass} +
                "" $(MAXIMUM_ALLOWED) "" KeyIS
        ifstr(i) $(KeyIS) != ""
           set NewValueList = { +
              {TimerConfig,         $(NoTitle),$(!REG_VT_DWORD), 600},+
              {TimerHolding,        $(NoTitle),$(!REG_VT_DWORD), 1800},+
              {TimerSugESCT,        $(NoTitle),$(!REG_VT_DWORD), 1800}}

           Shell  $(UtilityInf), AddValueList, $(KeyIS), $(NewValueList)
           CloseRegKey $(KeyIS)
           ifint $($ShellCode) != $(!SHELL_CODE_OK)
              Debug-Output "OEMNXP0.INF: IS value add ShellCode error."
              CloseRegKey $(KeyESIS)
              CloseRegKey $(Tp4ParmKeyHandle)
              CloseRegKey $(Tp4SvcKeyHandle)
              goto ShellCodeError
           endif
           Set RegistryErrorIndex = $($R0)
        endif
        CloseRegKey $($KeyESIS)

;
;       TP4 related parameters
;
        CreateRegKey $(Tp4ParmKeyHandle) {"TP4", $(NoTitle), GenericClass} +
                "" $(MAXIMUM_ALLOWED) "" KeyTP4
        ifstr(i) $(KeyTP4) != ""
           set NewValueList = { +
              {TransmissionCount,   $(NoTitle),$(!REG_VT_DWORD), 6   },+
              {TimerRetransmission, $(NoTitle),$(!REG_VT_DWORD), 20  },+
              {TimerKeepAlive,      $(NoTitle),$(!REG_VT_DWORD), 60  },+
              {TimerInact,          $(NoTitle),$(!REG_VT_DWORD), 180 },+
              {TimerFrozenRef,      $(NoTitle),$(!REG_VT_DWORD), 50  },+
;
; TimerTS2 deleted per Sri 5/31
;             {TimerTS2,            $(NoTitle),$(!REG_VT_DWORD), 20  },+
;
              {MaxTpStreams,        $(NoTitle),$(!REG_VT_DWORD), 254 },+
              {MaxTSDUSize,         $(NoTitle),$(!REG_VT_DWORD), 4294967295 },+
              {MaxTIDUSize,         $(NoTitle),$(!REG_VT_DWORD), 10240},+
; MaxNSDUSize added per Sri 5/31
              {MaxNSDUSize,         $(NoTitle),$(!REG_VT_DWORD), 1024},+
;
; MaxNWEntities is hardcoded to 1 in Userlib\twtp4.c, not used per Sri
;            {MaxNWEntities,       $(NoTitle),$(!REG_VT_DWORD), 1   },+
;
              {WindowRecvMax,       $(NoTitle),$(!REG_VT_DWORD), 6   },+
              {WindowSendMax,       $(NoTitle),$(!REG_VT_DWORD), 10  },+
              {WindowRecvResHiWat,  $(NoTitle),$(!REG_VT_DWORD), 256 },+
              {WindowRecvResLoWat,  $(NoTitle),$(!REG_VT_DWORD), 10  },+
;
; WindowInitCredit deleted per Sri 5/31
;             {WindowInitCredit,    $(NoTitle),$(!REG_VT_DWORD), 6   },+
;
              {PropFormat,          $(NoTitle),$(!REG_VT_DWORD), 1   },+
              {SelFormat,           $(NoTitle),$(!REG_VT_DWORD), 1   },+
              {PropTPDUSize,        $(NoTitle),$(!REG_VT_DWORD), 10  },+
              {SelTPDUSizeLimit,    $(NoTitle),$(!REG_VT_DWORD), 10  },+
              {PropNoChksum,        $(NoTitle),$(!REG_VT_DWORD), 0   },+
              {SelNoChksum,         $(NoTitle),$(!REG_VT_DWORD), 0   },+
;
; Error Handling behaviour for Transport configurable per NIST/ENV profile
              {ErrorHandling,       $(NoTitle),$(!REG_VT_DWORD), 1   },+
              {ErrorCRHandling,     $(NoTitle),$(!REG_VT_DWORD), 0   },+
              {ErrorInvParamVal,    $(NoTitle),$(!REG_VT_DWORD), 0   }}


           Shell  $(UtilityInf), AddValueList, $(KeyTP4), $(NewValueList)
           CloseRegKey $(KeyTP4)
           ifint $($ShellCode) != $(!SHELL_CODE_OK)
              Debug-Output "OEMNXP0.INF: TP4 add value ShellCode error."
              CloseRegKey $(Tp4ParmKeyHandle)
              CloseRegKey $(Tp4SvcKeyHandle)
              goto ShellCodeError
           endif
           Set RegistryErrorIndex = $($R0)
        endif
        CloseRegKey $(Tp4ParmKeyHandle)
        CloseRegKey $(Tp4SvcKeyHandle)
;
;
;       Shell "" CreateEventLog, "IsoTpSvc", $(NetEventDLL), 7
;
;
        Shell $(UtilityInf), AddWinsockInfo, +
             $(Product$(ThisOption)Name), +
             $(Product$(ThisOption)WshDllPath), +
             $(Sockmaxlength),$(Sockminlength)
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            Debug-Output "OEMNXPTP.INF: Registry error: Add Winsock Info."
            CloseRegKey $($R1)
        Endif
        CloseRegKey $($R1)
    Endif
;
;
    Ifstr(i) $(DoIsoTpSys) == TRUE
        Set ThisOption = ISOTPSYS
        Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(Product$(ThisOption)Name))
        Debug-Output "OEMNXPTP.INF: installing ISOTPSVC..."
        Shell $(UtilityInf), CreateService, $(Product$(ThisOption)Name),+
            $(Product$(ThisOption)DisplayName),+
            $(Product$(ThisOption)ImagePath),+
            $(Product$(ThisOption)SvcType), "",+
            {"Streams"}, ""
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            Debug-Output "OEMNXPTP.INF: ShellCode error"
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        CloseRegKey $($R2)
        CloseRegKey $($R3)
        CloseRegKey $($R1)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
            EndWait
            CloseRegKey $($R1)
            CloseRegKey $($R2)
            CloseRegKey $($R3)
            Debug-Output "OEMNXPTP.INF: Registry error: add software components"
            goto fatalregistry
        endif
    Endif
;
;
    Ifint $(BillboardVisible) != 0
        Shell "subroutn.inf" PopBillboard
        Set BillboardVisible = 0
    Endif
    EndWait
    ifstr(i) $(DoStreams) == TRUE
        Set ThisOption = STREAMS
        Debug-Output "OEMNXPTP Installing STREAMS..."
        Shell $(UtilityInf) AddStreams
        Set OEM_ABANDON_SOFWARE = >($(OEM_ABANDON_SOFWARE), Streams)
   endif
   goto Successful
;
;
successful = +
    goto end
infomsg =+
   read-syms InfoDlg
   ui start "Warning"
   set CommonStatus = STATUS_USERCANCEL
   goto end
warning = +
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
    ifstr(i) $($R1) == "OK"
        goto $(to)
    else-ifstr(i) $($R1) == "CANCEL"
        goto $(from)
    else
        goto "end"
    endif
nonfatalinfo = +
    Set CommonStatus = STATUS_USERCANCEL
    Set Severity = STATUS
    goto nonfatalmsg
nonfatal = +
    Set Severity = NONFATAL
    goto nonfatalmsg
nonfatalmsg = +
    ifstr(i) $(Error) == ""
        Set Severity = NONFATAL
        Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set Error = $($R0)
    endif
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
    ifstr(i) $($R1) == "OK"
        goto $(from)
    else
        goto "end"
    endif
fatalregistry = +
    Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
    set Error = $($R0)
    goto fatal
fatal = +
    ifstr(i) $(Error) == ""
        Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set Error = $($R0)
    endif
    Ifint $(BillboardVisible) != 0
        Shell "subroutn.inf" PopBillboard
        Set BillboardVisible = 0
    Endif
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto ShellCodeError
    endif
   goto setfailed
ShellCodeError = +
    set DlgType      = "MessageBox"
    set STF_MB_TITLE = $(ShellCodeErrorTitle)
    set STF_MB_TEXT  = $(ShellCodeErrorText)
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 3
    set STF_MB_DEF   = 1
    ui start "Error Message"
    goto setfailed
setfailed = +
    set CommonStatus = STATUS_FAILED
    ifstr(i) $(OEM_ABANDON_ON) == TRUE
        set OEM_ABANDON_ON = FALSE
        goto DeInstallSW
    endif
    goto end
end = +
    goto term
term = +
    Return $(CommonStatus)
;
;
[Install-Option]
    set STF_VITAL = ""
    ifstr(i) $(AddCopy) == "YES"
        AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
        AddSectionFilesToCopyList Files-ISOTPEXE $(SrcDir) $(!STF_WINDOWSSYSPATH)
        AddSectionFilesToCopyList Files-ETC $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers\etc
    endif

    ifstr(i) $(DoCopy) == "YES"
       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       Debug-Output "OEMNXPTP.INF: *** CopyFilesInCopyList [2]"
       CopyFilesInCopyList
    endif
    ifstr(i) $(DoConfig) == "YES"
    endif
    Exit
;
;
;
[Install-Update]
   set STF_VITAL        = ""
   set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
   AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
   AddSectionFilesToCopyList Files-ISOTPEXE $(SrcDir) $(!STF_WINDOWSSYSPATH)
   AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)

   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   Debug-Output "OEMNXPTP.INF: *** CopyFilesInCopyList [3]"
   CopyFilesInCopyList
   Exit
;
;
;
[ProductType]
STF_PRODUCT     = Winnt
STF_PLATFORM    = I386
;
;
[Files-Inf]
1,oemsetup.inf, SIZE=1000,      RENAME=$(!UG_Filename)
;
;
[Files-ETC]
1,osirte, SIZE=2615
;
;
[Files-ISOTP]
1,ISOTP.SYS, SIZE=171520
;
;
[Files-ISOTPEXE]
1, WSHISOTP.DLL, SIZE=27648
1, PLUMBING.EXE, SIZE=114176
1, TP4CFG.DLL, SIZE=28160
;
;
[FileConstantsENG]
   ProCaption   = "WINDOWS NT SETUP"
   ProCancel    = Cancel
   ProCancelMsg = "Windows NT Networking currently Not installed. "+
                  "Are You Sure, you want to cancel Copying the files?"
   ProCancelCap = "Network Setup Message"
   ProText1     = "Copying:"
   ProText2     = "To:"
   FunctionTitle= "ISO TP4/CLNP Setup"
;
   ProductISOTPDescription      = "ISO TP4/CLNP System Drivers"
   ProductISOTPDisplayName      = "TP4/CLNP Protocol"
   ProductISOTPTitle            = "TP4/CLNP Protocol"
   ProductISOTPSYSDisplayName   = "IsoTpsys"
   ProductISOTPSYSTitle         = "TP4/CLNP Network Transport drivers"
;
   ShellCodeErrorTitle  = "Error: "$(FunctionTitle)
   ShellCodeErrorText   = "Shell Code Error."
;
;
[DialogueConstantsENG]
   Help         = "&Help"
   Exit         = "Cancel"
   OK           = "OK"
   HelpContext  = ""
   Continue     = "Continue"
   Cancel       = "Cancel"
;
;
[InfoDlg]
STF_MB_TITLE    = "Information Message"
DlgType         = "MessageBox"
STF_MB_TEXT     = $(InfoMsgText)
STF_MB_TYPE     = 1
STF_MB_ICON     = 5
STF_MB_DEF      = 1
;
;
[InfoDlgCantConfigure]
InfoMsgText = "The TP4/CLNP Service is not currently configured to use any"+
        " Adapter. If you have just Installed it, return to the Network Dialog"+
        " and Click OK. You will then have an opportunity to configure"
;
;
[WarningDlgENG]
STF_MB_TITLE    = "TP4/CLNP Setup Warning"
DlgType         = "MessageBox"
STF_MB_TEXT     = $(ERROR)
STF_MB_TYPE     = 1
STF_MB_ICON     = 5
STF_MB_DEF      = 1
;
;
[BillBoard1ENG]
Status = "Installing TP4/CLNP and related services..."
;
;
