;
; Filename              : OEMSETUP.INF
; Operting Syste        : Windows NT v3.5
; Driver Type Supported : NDIS 3.0/3.1
; Driver Supported      : ENET.SYS v2.00
; Hardware Supported    : ENET16 P Series
;                         ENET16 VP Series
;                         ENET16 PNP Series
;

[FileConstants]
   Manufacturer             = "Compex"
   EnetBaseName             = "Enet"
   SoftwareMajorVersion     = "2"
   SoftwareMinorVersion     = "0"
   AdapterNumTextList       = ^(AdapterNumChoices, 1)
   AdapterNumValueList      = ^(AdapterNumChoices, 2)
   InterruptTextList        = ^(InterruptChoices, 1)
   InterruptValueList       = ^(InterruptChoices, 2)
   CableTextList            = ^(CableChoices, 1)
   CableValueList           = ^(CableChoices, 2)
   MemoryBaseTextList       = ^(MemoryBaseChoices, 1)
   MemoryBaseValueList      = ^(MemoryBaseChoices, 2)
   NetEventDLL              = "%SystemRoot%\System32\netevent.dll"
   IoLogMsgDLL              = "%SystemRoot%\System32\IoLogMsg.dll"
   UtilityInf               = "UTILITY.INF"
   SubroutineInf            = "SUBROUTN.INF"
   SoftwareType             = "driver"
   Exit_Code                = 0
   SoftwareVersion          = $(SoftwareMajorVersion)"."$(SoftwareMinorVersion)
   SoftwareImage            = "\SystemRoot\System32\drivers\"$(EnetBaseName)".sys"
   NetRuleSoftwareType      = $(EnetBaseName)"Sys ndisDriver "$(EnetBaseName)"Driver"
   NetRuleSoftwareBindForm  = """"$(EnetBaseName)"Sys"" yes no container"
   NetRuleSoftwareBindable  = {""$(EnetBaseName)"Driver "$(EnetBaseName)"Adapter non exclusive 100"}
   NetRuleSoftwareClass     = {""$(EnetBaseName)"Driver basic"}
   NetRuleSoftwareUse       = $(SoftwareType)
   NetRuleHardwareType      = $(EnetBaseName)" "$(EnetBaseName)"Adapter"
   NetRuleHardwareClass     = {""$(EnetBaseName)"Adapter basic"}
   NetRuleHardwareBindForm  = " yes yes container"
   KeyName_SoftwareRoot     = $(!NTN_SoftwareBase)"\"$(Manufacturer)
   KeyName_Software         = $(KeyName_SoftwareRoot)"\"$(EnetBaseName)"\CurrentVersion"

[AdapterNumChoices]
   AdapterNum_0 = "1",1
   AdapterNum_1 = "2",2
   AdapterNum_2 = "3",3
   AdapterNum_3 = "4",4
   AdapterNum_4 = "5",5
   AdapterNum_5 = "6",6
   AdapterNum_6 = "7",7
   AdapterNum_7 = "8",8
  
[InterruptChoices]
   IRQ_0 = "Current Setting",0
   IRQ_1 = "2",2
   IRQ_2 = "3",3
   IRQ_3 = "4",4
   IRQ_4 = "5",5
   IRQ_5 = "7",7
   IRQ_6 = "10",10
   IRQ_7 = "11",11
   IRQ_8 = "15",15

[MemoryBaseChoices]
   MemoryMap_0  = "Current Setting",0
   MemoryMap_1  = "0xC0000",786432
   MemoryMap_2  = "0xC2000",794624
   MemoryMap_3  = "0xC4000",802816
   MemoryMap_4  = "0xC6000",811008
   MemoryMap_5  = "0xC8000",819200
   MemoryMap_6  = "0xCA000",827392
   MemoryMap_7  = "0xCC000",835584
   MemoryMap_8  = "0xCE000",843776
   MemoryMap_9  = "0xD0000",851968
   MemoryMap_10 = "0xD2000",860160
   MemoryMap_11 = "0xD4000",868352
   MemoryMap_12 = "0xD6000",876544
   MemoryMap_13 = "0xD8000",884736
   MemoryMap_14 = "0xDA000",892928
   MemoryMap_15 = "0xDC000",901120
   MemoryMap_16 = "0xDE000",909312
   MemoryMap_17 = "0xE0000",917504
   MemoryMap_18 = "0xE2000",925696
   MemoryMap_19 = "0xE4000",933888
   MemoryMap_20 = "0xE6000",942080
   MemoryMap_21 = "0xE8000",950272
   MemoryMap_22 = "0xEA000",958464
   MemoryMap_23 = "0xEC000",966656
   MemoryMap_24 = "0xEE000",974848
   MemoryMap_25 = "0xB0000",720896
   MemoryMap_26 = "0xB2000",729088
   MemoryMap_27 = "0xB4000",737280
   MemoryMap_28 = "0xB6000",745472
   MemoryMap_29 = "0xB8000",753664
   MemoryMap_30 = "0xBA000",761856
   MemoryMap_31 = "0xBC000",770048
   MemoryMap_32 = "0xBE000",778240

[CableChoices]
   Cable_0 = "TPI",1
   Cable_1 = "BNC",2
   Cable_2 = "AUI",3
   Cable_3 = "Auto-Detect",5
   Cable_4 = "Current Setting",4

[CpxEnetIsaDlg]
   DlgType                 = "RadioCombination"
   Combo1Label             = $(CableLabel)
   Combo4Label             = $(AdapterNumLabel)
   Combo2Label             = $(InterruptLabel)
   Combo3Label             = $(MemoryLabel)
   DlgTemplate             = "EE_16"
   Caption                 = $(FunctionTitle)
   Combo1List              = $(CableTextList)
   Combo1Out               = $(CableTextDlgDefault)
   Combo4List              = $(AdapterNumTextList)
   Combo4Out               = $(AdapterNumTextDlgDefault)
   Combo2List              = $(InterruptTextList)
   Combo2Out               = $(InterruptTextDlgDefault)
   Combo3List              = $(MemoryBaseTextList)
   Combo3Out               = $(MemoryBaseTextDlgDefault)
   RadioIn                 = {}
   ComboListItemsIn        = {Combo1List,Combo2List,Combo3List,Combo4List}
   ComboListItemsOut       = {Combo1Out,Combo2Out,Combo3Out,Combo4Out}
   CBOptionsGreyed         = {}
   EditTextIn              = ""
   EditTextLim             = ""
   NotifyFields            = {NO, NO, NO}
   HelpContext             = ""

[Identify]
   set Status          = STATUS_SUCCESSFUL
   set Identifier      = NetAdapter
   set Media           = #("Source Media Descriptions", 1, 1)
   Return $(Status) $(Identifier) $(Media)

[ReturnOptions]
   set Status          = STATUS_FAILED
   set OptionList      = {}
   set OptionTextList  = {}
   set LanguageList    = ^(LanguagesSupported, 1)
   Ifcontains(i) $($0) in $(LanguageList)
      ifstr(i) $($1) == ""
         goto ReturnOptions_Set
      endif
      set PlatformList = ^(PlatformsSupported, 1)
      Ifcontains(i) $($1) in $(PlatformList)
         goto ReturnOptions_Set
      else
         set Status = STATUS_NOTSUPPORTED
         goto ReturnOptions_Exit
      endif
   else
      set Status = STATUS_NOLANGUAGE
      goto ReturnOptions_Exit
   endif
ReturnOptions_Set = +
    set OptionList      = ^(OptList$($0), 1)
    set OptionTextList  = ^(OptList$($0), 2)
    set Status          = STATUS_SUCCESSFUL
ReturnOptions_Exit = +
    Return $(Status) $(OptionList) $(OptionTextList)

[GeneralConstants]
   from                     = ""
   to                       = ""
   ExitCodeOk               = 0
   ExitCodeCancel           = 1
   ExitCodeFatal            = 2
   Key_Null                 = ""
   MAXIMUM_ALLOWED          = 33554432
   RegistryErrorIndex       = NO_ERROR
   Key_Product              = ""
   Key_HardwareParameters   = ""
   TRUE                     = 1
   FALSE                    = 0
   NoTitle                  = 0
   ExitState                = "Active"
   OldVersionExisted        = $(FALSE)
   DriverPath               = $(!STF_NTPATH)\drivers

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

[PlatformsSupported]
   ISA
   EISA
   PCI
   "Jazz-Internal Bus"

[Install-Option]
   Debug-Output "$(STF_CONTEXTINFNAME): Entering Install-Option"
   set STF_VITAL = ""
   ifstr(i) $(AddCopy) == "YES"
      set STF_VITAL = "YES"
      AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
   endif
   ifstr(i) $(DoCopy) == "YES"
      set STF_VITAL = "YES"
      set !STF_NCPA_FLUSH_COPYLIST = TRUE
      CopyFilesInCopyList
   endif
   ifstr(i) $(DoConfig) == "YES"
   endif
   exit

[Install-Update]
   Debug-Output "$(STF_CONTEXTINFNAME): Entering Install-Update"
   set STF_VITAL        = "YES"
   set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
   AddSectionFilesToCopyList Files-Driver  $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   CopyFilesInCopyList
   exit

[InstallOption]
   set EnetOption = $($1)
   set SrcDir    = $($2)
   set AddCopy   = $($3)
   set DoCopy    = $($4)
   set DoConfig  = $($5)
   Debug-Output "$(STF_CONTEXTINFNAME): Entering InstallOption"
   Debug-Output "$(STF_CONTEXTINFNAME): STF_CWDIR: .$(!STF_CWDIR)."
   Debug-Output "$(STF_CONTEXTINFNAME): STF_LANGUAGE: .$(!STF_LANGUAGE)."
   Debug-Output "$(STF_CONTEXTINFNAME): !NTN_RegBase .$(!NTN_RegBase)."
   Debug-Output "$(STF_CONTEXTINFNAME): !NTN_SoftwareBase .$(!NTN_SoftwareBase)."
   Debug-Output "$(STF_CONTEXTINFNAME): EnetOption: .$(EnetOption). SrcDir: .$(SrcDir)."
   Debug-Output "$(STF_CONTEXTINFNAME): AddCopy: .$(AddCopy). DoCopy: .$(DoCopy). DoConfig: .$(DoConfig)."
   set LanguageList = ^(LanguagesSupported, 1)
   Ifcontains(i) $($0) NOT-IN $(LanguageList)
      Return STATUS_NOLANGUAGE
   endif
   set-subst LF = "\n"
   read-syms GeneralConstants
   read-syms FileConstants
   set OptionNameList           = ^(OptList$(!STF_LANGUAGE), 1 )
   set OptionHdwrNameList       = ^(OptList$(!STF_LANGUAGE), 3 )
   set OptionHdwrTitleList      = ^(OptList$(!STF_LANGUAGE), 4 )
   set OptionHdwrDescList       = ^(OptList$(!STF_LANGUAGE), 5 )
   set ProductHdwrName          = *($(OptionHdwrNameList),+
                                  ~($(OptionNameList), $($1)))
   set ProductHdwrTitle         = *($(OptionHdwrTitleList),+
                                  ~($(OptionNameList), $($1)))
   set ProductHdwrDesc          = *($(OptionHdwrDescList),+
                                  ~($(OptionNameList), $($1)))
   Debug-Output "$(STF_CONTEXTINFNAME): ProductHdwrName .$(ProductHdwrName)."
   Debug-Output "$(STF_CONTEXTINFNAME): ProductHdwrTitle .$(ProductHdwrTitle)."
   Debug-Output "$(STF_CONTEXTINFNAME): ProductHdwrDesc .$(ProductHdwrDesc)."
   read-syms DialogConstants$(!STF_LANGUAGE)
   ifstr(i) $(!NTN_Origination) == "NCPA"
      set Continue = "OK"
   endif
   read-syms FileConstants$(!STF_LANGUAGE)
   detect date
   set-title $(FunctionTitle)
   set to   = InstallOptionDispatch
   set from = InstallOptionDispatch
   set CommonStatus = STATUS_SUCCESSFUL
   EndWait
InstallOptionDispatch = +
   Debug-Output "$(STF_CONTEXTINFNAME): Entering InstallOptionDispatch"
   Ifstr(i) $(!NTN_InstallMode) == deinstall
      set StartLabel = RemoveAdapterFromRegistry
   else-Ifstr(i) $(!NTN_InstallMode) == Update
      set StartLabel = UpgradeSoftware
   else-Ifstr(i) $(!NTN_InstallMode) == bind
      set StartLabel = CheckAdapterBinding
   else-Ifstr(i) $(!NTN_InstallMode) == configure
      set StartLabel = GetAdapterConfigFromRegistry
      Ifstr(i) $(KeyName_Software) == $(!NTN_RegBase)
         Debug-Output "$(STF_CONTEXTINFNAME): Cannot configure driver software."
         Shell $(UtilityInf), RegistryErrorString, CANNOT_CONFIGURE_SOFTWARE
         ifint $($ShellCode) != $(!SHELL_CODE_OK)
            set ShellErrorSection = UtilityInf:RegistryErrorString
            goto ShellCodeError
         endif
         set Error = $($R0)
         set from = InstallOptionExit
         set to = InstallOptionExit
         goto SetNonFatalInfo
      endif
   else
      set StartLabel = TestForExistingInstallation
      set OEM_ABANDON_OPTIONS = {}
      set OEM_ABANDON_SOFTWARE = FALSE
      set OEM_ABANDON_ON = TRUE
   endif
   set SendAllValue           = 0
   set NetAdapterTypeValue    = 4
   set EarlyMemDecodeValue    = 0
   set WriteDebugInfoValue    = 0
   set AdapterNumValue	      = 1
   set InterruptValue         = 0
   set MemoryBaseValue        = 0
   set CableValue             = 1
   set BusNumberValue         = 0
   set BusTypeValue           = 1
   set NdisInterfaceIsa       = 1
   set from                   = $(FatalError)
   set to                     = $(FatalError)
   goto $(StartLabel)
TestForExistingInstallation = +
   set OldVersionExisted = $(FALSE)
   Debug-Output "$(STF_CONTEXTINFNAME): Entering TestForExistingInstallation"
   OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_Software) $(MAXIMUM_ALLOWED) Key_Product
   Ifstr $(Key_Product) != $(Key_Null)
      CloseRegKey $(Key_Product)
      ifstr(i) $(!NTN_RegBase) == $(KeyName_Software)
         Shell $(UtilityInf), VerExistedDlg, $(SoftwareTitle), $(SoftwareVersion)
         ifint $($ShellCode) != $(!SHELL_CODE_OK)
            set ShellErrorSection = UtilityInf:VerExistedDlg
            goto ShellCodeError
         endif
         goto end
      else
         Shell $(UtilityInf), CardExistedDlg
         ifint $($ShellCode) != $(!SHELL_CODE_OK)
            set ShellErrorSection = UtilityInf:CardExistedDlg
            goto ShellCodeError
         endif
         ifstr(i) $($R1) == "OK"
            set OldVersionExisted = $(TRUE)
         else
            goto InstallOptionExit
         endif
      endif
   endif
CopyAdapterFiles = +
   Debug-Output "$(STF_CONTEXTINFNAME): Entering CopyAdapterFiles"
   ifint $(OldVersionExisted) == $(TRUE)
      ifstr(i) $(!NTN_InstallMode) == configure
         goto GetAdapterConfigFromUser
      endif
   endif
   StartWait
   ifint $(OldVersionExisted) == $(FALSE)
      ifstr(i) $(!NTN_InstallMode) == "install"
         Ifstr(i) $(DoCopy) == "YES"
            Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
            Ifint $($ShellCode) != $(!SHELL_CODE_OK)
               set ShellErrorSection = UtilityInf:DoAskSource
               Goto ShellCodeError
            Else-Ifstr(i) $($R0) == STATUS_FAILED
               Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
               ifint $($ShellCode) != $(!SHELL_CODE_OK)
                  set ShellErrorSection = UtilityInf:RegistryErrorString
                  goto ShellCodeError
               endif
               set Error = $($R0)
               Goto FatalError
            Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
               Goto ProcessSuccessExit
            Endif
            Set SrcDir = $($R1)
         Endif
         install "Install-Option"
         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
            Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
               set ShellErrorSection = UtilityInf:RegistryErrorString
               goto ShellCodeError
            endif
            set Error = $($R0)
            goto FatalError
         endif
      endif
   endif
GetAdapterConfigFromRegistry = +
   Debug-Output "$(STF_CONTEXTINFNAME): Entering GetAdapterConfigFromRegistry"
   ifstr(i) $(!NTN_InstallMode) == "install"
      goto GetAdapterConfigFromUser
   else
      Ifstr $(Key_Product) == $(Key_Null)
         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) Key_Product
         Ifstr $(Key_Product) == $(Key_Null)
            set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
            Debug-Output $(STF_CONTEXTINFNAME)": Cannot find component product key"
            goto FatalRegistryError
         Endif
      Endif
      Shell $(UtilityInf) FindService, $(Key_Product)
      Ifint $($ShellCode) != $(!SHELL_CODE_OK)
         set ShellErrorSection = UtilityInf:FindService
         Goto ShellCodeError
      Endif
      Ifstr(i) $($R0) != NO_ERROR
         Debug-Output "$(STF_CONTEXTINFNAME): Utility:FindService error: $($R0)"
         Goto FatalRegistryError
      endif
      set Key_HardwareParameters = $($R2)
      CloseRegKey $($R1)
      Ifstr $(Key_HardwareParameters) == $(Key_Null)
         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
         Debug-Output $(STF_CONTEXTINFNAME)": Cannot find component service"
         goto FatalRegistryError
      endif
      set OldVersionExisted = $(TRUE)
      set ValueName = ""
      set ValueData = ""
      set ValueStr  = ""
      set ValueList = {}
      EnumRegValue $(Key_HardwareParameters) ValueList
      ForListDo $(ValueList)
         set ValueItem = $($)
         set ValueName = *($(ValueItem),1)
         set ValueData = *($(ValueItem),4)
         Ifstr(i) $(ValueName) == "AdapterType"
            set AdapterTypeValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "BusNumber"
            set BusNumberValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "BusType"
            set BusTypeValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "AdapterNum"
            set AdapterNumValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "Irq"
            set InterruptValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "Cable"
            set CableValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "RamAddress"
            set MemoryBaseValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "SendAll"
            set SendAllValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "NetAdapterType"
            set NetAdapterTypeValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "EarlyMemDecode"
            set EarlyMemDecodeValue  = $(ValueData)
         else-Ifstr(i) $(ValueName) == "WriteDebugInfo"
            set WriteDebugInfoValue  = $(ValueData)
         endif
         Debug-Output "$(STF_CONTEXTINFNAME): $(ValueName) == .$(ValueData)."
      EndForListDo
   Endif
GetAdapterConfigFromUser = +
   Debug-Output "$(STF_CONTEXTINFNAME): Entering GetAdapterConfigFromUser"
   set from = GetAdapterConfigFromUser
   set InterruptTextDlgDefault      = *($(InterruptTextList),+
                                      ~($(InterruptValueList), +
                                       $(InterruptValue)))
   set AdapterNumTextDlgDefault     = *($(AdapterNumTextList),+
                                      ~($(AdapterNumValueList), +
                                       $(AdapterNumValue)))
   set MemoryBaseTextDlgDefault     = *($(MemoryBaseTextList),+
                                      ~($(MemoryBaseValueList), +
                                       $(MemoryBaseValue)))
   set CableTextDlgDefault          = *($(CableTextList),+
                                      ~($(CableValueList), +
                                       $(CableValue)))
   ifstr(i) $(EnetOption) == "$enet"
      read-syms CpxEnetIsaDlg
   else-ifstr(i) $(EnetOption) == "$enet"
      read-syms CpxEnetIsaDlg
   else
      read-syms CpxEnetIsaDlg
   endif
   ui start "InputDlg"
   ifstr(i) $(DLGEVENT) == "CONTINUE"
         set CableValue       = *($(CableValueList),+
                                ~($(CableTextList),+
                                 $(Combo1Out)))
         set InterruptValue   = *($(InterruptValueList),+
                                ~($(InterruptTextList),+
                                  $(Combo2Out)))
         set AdapterNumValue  = *($(AdapterNumValueList),+
                                ~($(AdapterNumTextList),+
                                  $(Combo4Out)))
         set MemoryBaseValue  = *($(MemoryBaseValueList),+
                                ~($(MemoryBaseTextList),+
                                 $(Combo3Out)))
      ui pop 1
      Debug-Output "$(STF_CONTEXTINFNAME): After Dialog..."
      Debug-Output "$(STF_CONTEXTINFNAME): InterruptValue  == .$(InterruptValue)."
      Debug-Output "$(STF_CONTEXTINFNAME): AdapterNumValue == .$(AdapterNumValue)."
      Debug-Output "$(STF_CONTEXTINFNAME): CableValue      == .$(CableValue)."
      Debug-Output "$(STF_CONTEXTINFNAME): MemoryBaseValue == .$(MemoryBaseValue)."
   else-ifstr(i) $(DLGEVENT) == "CANCEL"
      set CommonStatus = STATUS_USERCANCEL
      Debug-Output "$(STF_CONTEXTINFNAME): Dialog Action Exit. Bye."
      ui pop 1
      goto InstallOptionExit
   else
      set CommonStatus = STATUS_USERCANCEL
      ui pop 1
      Debug-Output "$(STF_CONTEXTINFNAME): Dialog Action Unknown.  Bye."
      goto InstallOptionExit
   endif
AddAdapterSoftwareToRegistry = +
   Ifstr(i) $(!NTN_InstallMode) == configure
      goto AddAdapterConfigurationToRegistry
   Endif
   ifint $(OldVersionExisted) == $(TRUE)
      goto AddAdapterHardwareToRegistry
   Endif
   Shell $(UtilityInf), +
         AddSoftwareComponent, +
         $(Manufacturer), +
         $(EnetBaseName), +
         $(EnetBaseName), +
         $(SoftwareTitle), +
         $(STF_CONTEXTINFNAME), +
         $(SoftwareImage), +
         "kernel", "NDIS", {}, "",+
         $(NetEventDLL)
   Set OEM_ABANDON_SOFTWARE = TRUE
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:AddSoftwareComponent
      goto ShellCodeError
   endif
   set RegistryErrorIndex = $($R0)
   Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
      EndWait
      Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterSoftware - add component error"
      CloseRegKey $($R1)
      CloseRegKey $($R2)
      CloseRegKey $($R3)
      CloseRegKey $($R4)
      CloseRegKey $($R5)
      goto FatalRegistryError
   endif
   Set Key_SoftwareProduct    = $($R1)
   Set Key_SoftwareNetRules   = $($R2)
   CloseRegKey $($R3)
   CloseRegKey $($R4)
   CloseRegKey $($R5)
   set NewValueList = {+
       {SoftwareType, $(NoTitle), $(!REG_VT_SZ),    $(SoftwareType)},+
       {MajorVersion, $(NoTitle), $(!REG_VT_DWORD), $(SoftwareMajorVersion)},+
       {MinorVersion, $(NoTitle), $(!REG_VT_DWORD), $(SoftwareMinorVersion)},+
       {Title,        $(NoTitle), $(!REG_VT_SZ),    $(SoftwareTitle)},+
       {Description,  $(NoTitle), $(!REG_VT_SZ),    $(SoftwareDescription)},+
       {ServiceName,  $(NoTitle), $(!REG_VT_SZ),    $(EnetBaseName)},+
       {InstallDate,  $(NoTitle), $(!REG_VT_DWORD), *($(Now),1)}+
       }
   Shell  $(UtilityInf), AddValueList, $(Key_SoftwareProduct), $(NewValueList)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:AddValueList
      goto ShellCodeError
   endif
   Set RegistryErrorIndex = $($R0)
   Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
      EndWait
      Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterSoftware - add value list error"
      CloseRegKey $(Key_SoftwareProduct)
      CloseRegKey $(Key_SoftwareNetRules)
      goto FatalRegistryError
   endif
   Set NewValueList = {+
       {type,      $(NoTitle), $(!REG_VT_SZ),       $(NetRuleSoftwareType)},+
       {use,       $(NoTitle), $(!REG_VT_SZ),       $(NetRuleSoftwareUse)}, +
       {bindform,  $(NoTitle), $(!REG_VT_SZ),       $(NetRuleSoftwareBindForm)}, +
       {class,     $(NoTitle), $(!REG_VT_MULTI_SZ), $(NetRuleSoftwareClass)}, +
       {bindable,  $(NoTitle), $(!REG_VT_MULTI_SZ), $(NetRuleSoftwareBindable)}, +
       {InfOption, $(NoTitle), $(!REG_VT_SZ),       $(EnetOption)}+
       }
   Shell  $(UtilityInf), AddValueList, $(Key_SoftwareNetRules), $(NewValueList)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:AddValueList
      goto ShellCodeError
   endif
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(Key_SoftwareProduct)
   CloseRegKey $(Key_SoftwareNetRules)
   Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
      EndWait
      Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterSoftware - add NetRule error"
      goto FatalRegistryError
   endif
AddAdapterHardwareToRegistry = +
   Shell $(UtilityInf), +
         AddHardwareComponent, +
         $(ProductHdwrName), +
         $(STF_CONTEXTINFNAME), +
         $(KeyName_Software)
   ifint $($R4) != -1
      Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
   endif
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:AddHardwareComponent
      goto ShellCodeError
   endif
   set RegistryErrorIndex = $($R0)
   Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
      EndWait
      Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterHardware - add component error"
      CloseRegKey $($R1)
      CloseRegKey $($R2)
      CloseRegKey $($R3)
      goto FatalRegistryError
   endif
   set Key_HardwareNetRules   = $($R2)
   set Key_HardwareParameters = $($R3)
   set AdapterNumber          = $($R4)
   set NewValueList = {+
       {Manufacturer, $(NoTitle), $(!REG_VT_SZ),    $(Manufacturer)},+
       {Title,        $(NoTitle), $(!REG_VT_SZ),    "["$($R4)"] "$(ProductHdwrTitle)},+
       {Description,  $(NoTitle), $(!REG_VT_SZ),    $(ProductHdwrDesc)},+
       {ProductName,  $(NoTitle), $(!REG_VT_SZ),    $(ProductHdwrName)},+
       {ServiceName,  $(NoTitle), $(!REG_VT_SZ),    $($R5)},+
       {InstallDate,  $(NoTitle), $(!REG_VT_DWORD), *($(Now),1)}+
       }
   Shell $(UtilityInf), AddValueList, $($R1),  $(NewValueList)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:AddValueList
      goto ShellCodeError
   endif
   CloseRegKey $($R1)
   set TempProdName = """"$(ProductHdwrName)$(AdapterNumber)""""
   set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
   set NewValueList = {+
       {type,      $(NoTitle), $(!REG_VT_SZ),       $(NetRuleHardwareType)},+
       {bindform,  $(NoTitle), $(!REG_VT_SZ),       $(TempBindForm)}, +
       {class,     $(NoTitle), $(!REG_VT_MULTI_SZ), $(NetRuleHardwareClass)}, +
       {InfOption, $(NoTitle), $(!REG_VT_SZ),       $(EnetOption)}+
       }
   Shell  $(UtilityInf), AddValueList, $(Key_HardwareNetRules), $(NewValueList)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:AddValueList
      goto ShellCodeError
   endif
   set RegistryErrorIndex = $($R0)
   Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
      EndWait
      Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterHardware - add NetRule error"
      CloseRegKey $(Key_HardwareParameters)
      CloseRegKey $(Key_HardwareNetRules)
      goto FatalRegistryError
   endif
   CloseRegKey $(Key_HardwareNetRules)
   goto AddAdapterConfigurationToRegistry
AddAdapterConfigurationToRegistry = +
   Debug-Output "$(STF_CONTEXTINFNAME): Entering AddAdapterConfigurationToRegistry"
   Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      Shell $(UtilityInf), GetBusTypeNum
      ifint $($ShellCode) != $(!SHELL_CODE_OK)
         set ShellErrorSection = UtilityInf:GetBusTypeNum
         goto ShellCodeError
      else
         set BusTypeValue = $($R1)
         set BusNumberValue = 0
      endif
   else
      set BusTypeValue = $($R1)
      set BusNumberValue = $($R2)
   endif
   ifstr(i) $(EnetOption) == "$enet"
      set NewValueList = {+
          {AdapterType,      $(NoTitle), $(!REG_VT_DWORD), $(NdisInterfaceIsa)},+
          {BusNumber,        $(NoTitle), $(!REG_VT_DWORD), $(BusNumberValue)},+
          {BusType,          $(NoTitle), $(!REG_VT_DWORD), $(BusTypeValue)},+
          {Irq,              $(NoTitle), $(!REG_VT_DWORD), $(InterruptValue)},+
          {Cable,            $(NoTitle), $(!REG_VT_DWORD), $(CableValue)},+
          {RamAddress,       $(NoTitle), $(!REG_VT_DWORD), $(MemoryBaseValue)},+
          {SendAll,          $(NoTitle), $(!REG_VT_DWORD), $(SendAllValue)},+
          {NetAdapterType,   $(NoTitle), $(!REG_VT_DWORD), $(NetAdapterTypeValue)},+
          {EarlyMemDecode,   $(NoTitle), $(!REG_VT_DWORD), $(EarlyMemDecodeValue)},+ 
          {WriteDebugInfo,   $(NoTitle), $(!REG_VT_DWORD), $(WriteDebugInfoValue)},+  
          {AdapterNum,       $(NoTitle), $(!REG_VT_DWORD), $(AdapterNumValue)},+
          }
   else-ifstr(i) $(EnetOption) == "$enet"
      set NewValueList = {+
          {AdapterType,      $(NoTitle), $(!REG_VT_DWORD), $(NdisInterfaceIsa)},+
          {BusNumber,        $(NoTitle), $(!REG_VT_DWORD), $(BusNumberValue)},+
          {BusType,          $(NoTitle), $(!REG_VT_DWORD), $(BusTypeValue)},+
          {Irq,              $(NoTitle), $(!REG_VT_DWORD), $(InterruptValue)},+
          {Cable,            $(NoTitle), $(!REG_VT_DWORD), $(CableValue)},+
          {RamAddress,       $(NoTitle), $(!REG_VT_DWORD), $(MemoryBaseValue)},+
          {SendAll,          $(NoTitle), $(!REG_VT_DWORD), $(SendAllValue)},+
          {NetAdapterType,   $(NoTitle), $(!REG_VT_DWORD), $(NetAdapterTypeValue)},+
          {EarlyMemDecode,   $(NoTitle), $(!REG_VT_DWORD), $(EarlyMemDecodeValue)},+ 
          {WriteDebugInfo,   $(NoTitle), $(!REG_VT_DWORD), $(WriteDebugInfoValue)},+  
          {AdapterNum,       $(NoTitle), $(!REG_VT_DWORD), $(AdapterNumValue)},+
          }
   else
      set NewValueList = {+
          {AdapterType,      $(NoTitle), $(!REG_VT_DWORD), $(NdisInterfaceIsa)},+
          {BusNumber,        $(NoTitle), $(!REG_VT_DWORD), $(BusNumberValue)},+
          {BusType,          $(NoTitle), $(!REG_VT_DWORD), $(BusTypeValue)},+
          {Irq,              $(NoTitle), $(!REG_VT_DWORD), $(InterruptValue)},+
          {Cable,            $(NoTitle), $(!REG_VT_DWORD), $(CableValue)},+
          {RamAddress,       $(NoTitle), $(!REG_VT_DWORD), $(MemoryBaseValue)},+
          {SendAll,          $(NoTitle), $(!REG_VT_DWORD), $(SendAllValue)},+
          {NetAdapterType,   $(NoTitle), $(!REG_VT_DWORD), $(NetAdapterTypeValue)},+
          {EarlyMemDecode,   $(NoTitle), $(!REG_VT_DWORD), $(EarlyMemDecodeValue)},+ 
          {WriteDebugInfo,   $(NoTitle), $(!REG_VT_DWORD), $(WriteDebugInfoValue)},+  
          {AdapterNum,       $(NoTitle), $(!REG_VT_DWORD), $(AdapterNumValue)},+
          }
   Endif
   Shell  $(UtilityInf), AddValueList, $(Key_HardwareParameters), $(NewValueList)
   CloseRegKey $(Key_HardwareParameters)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:AddValueList
      goto ShellCodeError
   endif
   set RegistryErrorIndex = $($R0)
   Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
      Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterConfiguration - add value list error"
      goto FatalRegistryError
   endif
   EndWait
   goto ProcessSuccessExit
CheckAdapterBinding =+
   Debug-Output "$(STF_CONTEXTINFNAME): Entering CheckAdapterBinding"
   set Error = "CheckAdapterBinding: not required for this adapter"
   goto FatalError
RemoveAdapterFromRegistry = +
   Debug-Output "$(STF_CONTEXTINFNAME): Entering RemoveAdapterFromRegistry"
   OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_Software) $(MAXIMUM_ALLOWED) KeyToReferenceCount
   Ifstr $(KeyToReferenceCount) == ""
      Debug-Output "$(STF_CONTEXTINFNAME): Could not open Software Base Key"
      set RefCountBeforeRemove = 2
      goto InstallOptionExit
   endif
   GetRegValue $(KeyToReferenceCount),"RefCount", RefCountInfo
   set RefCountBeforeRemove = *($(RefCountInfo), 4)
   CloseRegKey $(KeyToReferenceCount)
   Debug-Output "$(STF_CONTEXTINFNAME): Removing Hardware Component"
   Shell $(UtilityInf), +
         RemoveHardwareComponent, +
         $(Manufacturer), +
         $(EnetBaseName), +
         $(!NTN_RegBase)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:RemoveHardwareComponent
      goto ShellCodeError
   endif
   Ifstr(i) $($R0) != NO_ERROR
      Ifstr(i) $($R0) != REF_COUNT_NOT_ZERO
         goto FatalRegistryError
      endif
   endif
   ifint $(RefCountBeforeRemove) == 1
      OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_SoftwareRoot) $(MAXIMUM_ALLOWED) Key_SoftwareRoot
      EnumRegKey $(Key_SoftwareRoot) KeyList
      EnumRegValue $(Key_SoftwareRoot) ValueList
      CloseRegKey $(Key_SoftwareRoot)
      Debug-Output "$(STF_CONTEXTINFNAME): Reg Key .$(KeyName_SoftwareRoot). opened"
      Debug-Output "$(STF_CONTEXTINFNAME): KeyList == .$(KeyList)."
      Debug-Output "$(STF_CONTEXTINFNAME): ValueList == .$(ValueList)."
      ifstr $(KeyList) == "{}"
         ifstr $(ValueList) == "{}"
            OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase) $(MAXIMUM_ALLOWED) Key_SoftwareBase
            DeleteRegKey $(Key_SoftwareBase) $(Manufacturer)
            CloseRegKey $(Key_SoftwareBase)
         endif
      endif
   endif
   goto InstallOptionExit
UpgradeSoftware = +
   Debug-Output "$(STF_CONTEXTINFNAME): Entering UpgradeSoftware"
   ifstr(i) $(KeyName_Software) == $(!NTN_RegBase)
      OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_Software) $(MAXIMUM_ALLOWED) Key_Product
      Ifstr $(Key_Product) != $(Key_Null)
         GetRegValue $(Key_Product),"MajorVersion", VersionInfo
         set Version = *($(VersionInfo), 4)
         Shell $(UtilityInf), GetInfFileNameFromRegistry, $(Key_Product)
         ifint $($ShellCode) != $(!SHELL_CODE_OK)
            set ShellErrorSection = UtilityInf:GetFileNameFromRegistry
            goto ShellCodeError
         endif
         set !UG_Filename = $($R0)
         ifstr(i) $(!UG_Filename) != ""
            install "Install-Update"
            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
               goto FatalError
            endif
         endif
         SetRegValue $(Key_Product) {MajorVersion, $(NoTitle), $(!REG_VT_SZ), $(SoftwareMajorVersion)}
         SetRegValue $(Key_Product) {MinorVersion, $(NoTitle), $(!REG_VT_SZ), $(SoftwareMinorVersion)}
         ifint $(Version) != $(SoftwareVersion)
            Debug-Output "$(STF_CONTEXTINFNAME): Version .$(Version). != SoftwareVersion .$(SoftwareVersion)."
         endif
         CloseRegKey $(Key_Product)
      else
         goto FatalRegistryError
      endif
   else
      OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetworkCardKey
      Ifstr(i) $(NetworkCardKey) != $(Key_Null)
         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
         set ServiceName = *($(ServiceNameInfo), 4)
         OpenRegKey $(NetworkCardKey) "" "NetRules" $(MAXIMUM_ALLOWED) NetRuleKey
         Ifstr(i) $(NetRuleKey) != $(Key_Null)
            Debug-Output "$(STF_CONTEXTINFNAME): NetRuleKey .$(NetRuleKey). != Key_Null .$(Key_Null)."
         else
            goto FatalRegistryError
         endif
         CloseRegKey $(NetRules)
         CloseRegKey $(NetworkCardKey)
      else
         goto FatalRegistryError
      endif
      OpenRegKey $(!REG_H_LOCAL) +
                 "" $(!NTN_ServiceBase)"\"$(ServiceName) +
                 $(MAXIMUM_ALLOWED) +
                 ServiceKey
      Ifstr(i) $(ServiceKey) != $(Key_Null)
         CloseRegKey $(ServiceKey)
      else
         goto FatalRegistryError
      endif
   endif
   goto InstallOptionExit
ProcessSuccessExit = +
   goto InstallOptionExit
ProcessAbandonInstall = +
   ForListDo $(OEM_ABANDON_OPTIONS)
      Shell $(UtilityInf), +
            RemoveHardwareComponent, +
            $(Manufacturer), +
            $(EnetBaseName), +
            $($)
      ifint $($ShellCode) != $(!SHELL_CODE_OK)
         set ShellErrorSection = UtilityInf:RemoveHardwareComponent
         goto ShellCodeError
      endif
      set RegistryErrorIndex = $($R0)
      Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
         goto FatalRegistryError
      endif
   EndForListDo
   Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
      Shell $(UtilityInf), +
            RemoveSoftwareComponent, +
            $(Manufacturer), +
            $(EnetBaseName), +
            FALSE
      ifint $($ShellCode) != $(!SHELL_CODE_OK)
         set ShellErrorSection = UtilityInf:RemoveSoftwareComponent
         goto ShellCodeError
      endif
      set RegistryErrorIndex = $($R0)
      Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
         goto FatalRegistryError
      endif
   endif
   goto InstallOptionExit
ProcessWarningMessage = +
   Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = SubroutineInf:SetupMessage
      goto ShellCodeError
   endif
   ifstr(i) $($R1) == "OK"
      goto $(to)
   else-ifstr(i) $($R1) == "CANCEL"
      goto $(from)
   else
      goto "InstallOptionExit"
   endif
SetNonFatalInfo = +
   Set CommonStatus = STATUS_USERCANCEL
   Set Severity = STATUS
   goto ProcessNonFatalMessage
ProcessNonFatalMessage = +
   ifstr(i) $(Error) == ""
      Set Severity = NONFATAL
      Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
      ifint $($ShellCode) != $(!SHELL_CODE_OK)
         set ShellErrorSection = UtilityInf:RegistryErrorString
         goto ShellCodeError
      endif
      set Error = $($R0)
   endif
   Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = SubroutineInf:SetupMessage
      goto ShellCodeError
   endif
   ifstr(i) $($R1) == "OK"
      goto $(from)
   else
      goto "InstallOptionExit"
   endif
FatalRegistryError = +
   Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:RegistryErrorString
      goto ShellCodeError
   endif
   set Error = $($R0)
   goto FatalError
FatalError = +
   ifstr(i) $(Error) == ""
      Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
      ifint $($ShellCode) != $(!SHELL_CODE_OK)
         set ShellErrorSection = UtilityInf:RegistryErrorString
         goto ShellCodeError
      endif
      set Error = $($R0)
   endif
   Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
   ifint $($ShellCode) != $(!SHELL_CODE_OK)
      set ShellErrorSection = UtilityInf:SetupMessage
      goto ShellCodeError
   endif
   goto SetFailedStatusAndExit
ShellCodeError = +
   Debug-Output $(STF_CONTEXTINFNAME)": Shell error, $(ShellErrorSection)"
   set DlgType      = "MessageBox"
   set STF_MB_TITLE = "Error: "$(FunctionTitle)
   set STF_MB_TEXT  = "Shell Code Error"
   set STF_MB_TYPE  = 1
   set STF_MB_ICON  = 3
   set STF_MB_DEF   = 1
   ui start "Error Message"
   goto SetFailedStatusAndExit
SetFailedStatusAndExit = +
   set CommonStatus = STATUS_FAILED
   ifstr(i) $(OEM_ABANDON_ON) == TRUE
      set OEM_ABANDON_ON = FALSE
      goto ProcessAbandonInstall
   endif
   goto InstallOptionExit
InstallOptionExit = +
   Return $(CommonStatus)

[Source Media Descriptions]
     1 = "Compex ENET16 P/PNP Series Ethernet Adapter Disk" 

[Signature]
    FileType = MICROSOFT_FILE

[GetSignature]
    read-syms Signature
    return $(FileType)

[ProductType]
STF_PRODUCT  = Winnt
STF_PLATFORM = I386

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

[Files-Driver]
1,ENET.SYS , SIZE=12288

[OptListENG]
   OptList_1 = $enet "Compex ENET16 P/PNP Ethernet Adapter",     "enet", "Compex ENET16 P/PNP Ethernet Adapter", "Compex ENET16 P/PNP Ethernet Adapter"

[FileConstantsENG]
   ProCaption              = "Windows NT Setup"
   ProCancel               = "Cancel"
   ProCancelMsg            = "Your Windows NT Networking "+
                             "Adapter is not correctly installed.  Are "+
                             "you sure you want to cancel copying files?"
   ProCancelCap            = "Network Setup Message"
   ProText1                = "Copying:"
   ProText2                = "To:"
   SoftwareTitle           = "Compex ENET16 Ethernet Adapter Driver"
   SoftwareDescription     = "Compex ENET16 Ethernet Adapter Driver"

[DialogConstantsENG]
   Help                    = "&Help"
   Exit                    = "Cancel"
   OK                      = "OK"
   HelpContext             = ""
   Continue                = "Continue"
   Cancel                  = "Cancel"
   FunctionTitle           = "Compex ENET16 P/PNP Adapter Setup"
   InterruptLabel          = "&IRQ"
   AdapterNumLabel         = "&Adapter Number"
   CableLabel              = "&Cable Type"
   MemoryLabel             = "&Memory Address"

[LanguagesSupported]
   ENG
