;***********************************************************************
;
;  NCRTOK.INF
;
;       NCR StarLAN network card and driver SETUP INF file.
;
;
;  Copyright (c) 1993  DWB Associates Inc.  All Rights Reserved
;
;***********************************************************************


[Identification]
    OptionType = NetAdapter

[PlatformsSupported]
    ISA
    EISA
    MCA

[LanguagesSupported]
    ENG

[Options]
    NCRTOK

[OptionsTextENG]
    NCRTOK     = "NCR StarLAN 16/4 Token-Ring Adapter"

[Source Media Descriptions]
    1   = "NCRTOK Install Diskette"
    2   = "Windows NT Setup CD-ROM Disk"

[Files-NCRTOK]
    1,ncrtok.sys, SIZE=40000
    1,macblk.dat, SIZE=40000

[Files-NCRTOK-Upd]
    1,ncrtok.sys, SIZE=40000,OVERWRITE=ALWAYS
    1,macblk.dat, SIZE=40000,OVERWRITE=ALWAYS

[Files-Dlg]
    1,ncrtok.dll, SIZE=40000
    1,ncrtok.hlp, SIZE=40000

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

[Files-ncrncdet]
    1,ncrncdet.dll, SIZE=40000

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

[FileConstants]
    UtilityInf      = "UTILITY.INF"
    ParamInf        = "NCPARAM.INF"
    SubroutnInf     = "SUBROUTN.INF"
    NetEventDLL     = $(!STF_WINDOWSSYSPATH)\netevent.dll

[RegistryConstants]
    SoftwareType                     = "driver"
    Manufacturer                     = "NCR"
    ProductMajorVersion              = "3"
    ProductMinorVersion              = "1"
    ProductVersion                   = $(ProductMajorVersion)"."$(ProductMinorVersion)
    ProductSoftwareName              = "NcrTok"
    ProductSoftwareTitle             = "NcrTok Adapter Driver"
    ProductSoftwareImagePath         = "\SystemRoot\System32\drivers\ncrtok.sys"
    NetRuleSoftwareType              = "ncrtokSys ndisDriver ncrtokDriver"
    NetRuleSoftwareUse               = $(SoftwareType)
    NetRuleSoftwareBindForm          = """NcrTokSys"" yes no container"
    NetRuleSoftwareClass             = {"ncrtokDriver basic"}
    NetRuleSoftwareBindable          = {"ncrtokDriver ncrtokAdapter non exclusive 100"}
    ProductHardwareName              = "NcrTok"
    ProductHardwareNCRTOKTitle       = "NCR StarLAN 16/4 Token-Ring Adapter"
    NetRuleHardwareType              = "ncrtok ncrtokAdapter"
    NetRuleHardwareBindForm          = " yes yes container"
    NetRuleHardwareClass             = {"ncrtokAdapter basic"}
    ProductKeyName                   = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
    ParamKeyName                     = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
    ProductSoftwareDescription       = "NCR StarLAN 16/4 Token-Ring Adapter Driver"
    ProductHardwareNCRTOKDescription = "NCR StarLAN 16/4 Token-Ring Adapter"

[GeneralConstants]
    KeyNull            = ""
    MAXIMUM_ALLOWED    = 33554432
    KeyProduct         = ""
    KeyParameters      = ""
    TRUE               = 1
    FALSE              = 0
    NoTitle            = 0
    DriverPath         = $(!STF_WINDOWSSYSPATH)\drivers

[FileConstantsENG]
    ProCaption    = "Windows NT Setup"
    ProCancel     = "&Cancel"
    ProCancelMsg  = "Windows NT Networking is not correctly installed.  "+
		    "Are you sure you want to cancel copying files?"

    ProCancelCap  = "Network Setup Message"
    ProText1      = "Copying:"
    ProText2      = "To:"
    FunctionTitle = "NCR StarLAN 16/4 Token-Ring Adapter Setup"

[DownLoadInfo]
    DownFile = "macblk.dat"

[NcrSlot]
    SLOT1 = "1",1
    SLOT2 = "2",2
    SLOT8 = "3",3
    SLOT4 = "4",4
    SLOT5 = "5",5
    SLOT6 = "6",6
    SLOT7 = "7",7

[NcrIrqs]
    IRQ2 = "9",09
    IRQ0 = "3",03
    IRQ1 = "7",07
    IRQ4 = "10",10
    IRQ5 = "11",11
    IRQ6 = "12",12
    IRQ7 = "14",14
    IRQ8 = "15",15

[NcrDmaChan]
    DMA0 = "7",7
    DMA1 = "3",3
    DMA2 = "5",5
    DMA3 = "6",6

[NcrIoBase]
    Base0 = "0A20",0x0A20
    Base1 = "1A20",0x1A20
    Base2 = "2A20",0x2A20
    Base3 = "3A20",0x3A20

[HexDigits]
    Hex0 = 0
    Hex1 = 1
    Hex2 = 2
    Hex3 = 3
    Hex4 = 4
    Hex5 = 5
    Hex6 = 6
    Hex7 = 7
    Hex8 = 8
    Hex9 = 9
    HexA = A
    HexB = B
    HexC = C
    HexD = D
    HexE = E
    HexF = F

[DialogConstantsENG]
    Help         = "&Help"
    Exit         = "C&ancel"
    OK           = "&OK"
    Continue     = "&Continue"
    Cancel       = "Ca&ncel"
    BadMaxFrame1 = "Max Frame must be at least 256"
    BadMaxFrame2 = "Max Frame must be no greater than 4472 for 4Mbps"
    BadMaxFrame3 = "Max Frame must be no greater than 17800 for 16Mbps"
    BadProdId1   = "Product Id must be 36 hexadecimal digits"
    BadProdId2   = "Product Id contains invalid hexadecimal digit: "
    BadAddr1     = "Network Address must be 12 hexadecimal digits"
    BadAddr2     = "Network Address contains invalid hexadecimal digit: "
    BadAddr3     = "Network Address invalid, must be between 4000 0000 0000 and 4000 7fff ffff"
    CardError1   = "NcrTok card not installed in system"
    CardError2   = "NcrTok card(s) are already installed"
    ModeError    = "DMA Channel is not used in DIO Mode"

[FileDependentDlgISA]
    DlgTemplate = "NCRISA"
    HelpContext = "30000"

[FileDependentDlgMCA]
    DlgTemplate = "NCRMCA"
    HelpContext = "30001"

[FileDependentDlgENG]
    DlgType           = "RadioCombination"
    Caption           = "NCR StarLAN 16/4 Token-Ring Adapter Setup"
    Label1            = "&IRQ Level"
    Label2            = "IO &Base Address"
    Label3            = "&DMA Channel"
    Label4            = "&Slot Number"
    Label5            = "Ma&x Frame"
    Label6            = "&Product Id"
    Label9            = "D&MA 32 Bit Addresses"
    Label10           = "Net&work Address"
    Group1            = "Ring &Speed"
    Group2            = "Access &Mode"
    Radio1            = "16 Mbps"
    Radio2            = "4 Mbps"
    Radio3            = "DMA"
    Radio4            = "DIO"
    IrqList           = ^(NcrIrqs, 1)
    IoBaseList        = ^(NcrIoBase, 1)
    DmaList           = ^(NcrDmaChan, 1)
    SlotList          = ^(NcrSlot, 1)
    SpeedValue        = 0
    DmaModeValue      = "dma"
    Combo1List        = $(IrqList)
    Combo1Out         = $(InterruptNumber)
    Combo2List        = $(IoBaseList)
    Combo2Out         = $(IoBaseAddress)
    Combo3List        = $(DmaList)
    Combo3Out         = $(DmaChan)
    Combo4List        = $(SlotList)
    Combo4Out         = $(SlotValue)
    ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List}
    ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out}
    CBOptionsGreyed   = {}
    NotifyFields      = {NO, NO, YES}
    EditTextLim       = {5, 36, 12}
    EditFocusOn       = ""
    RCCtlFocusOn      = 403

[Identify]
    read-syms Identification
    set Status     = STATUS_SUCCESSFUL
    set Identifier = $(OptionType)
    set Media      = #("Source Media Descriptions", 1, 1)
    Return $(Status) $(Identifier) $(Media)

[ReturnOptions]
set !DebugOutputControl = 1
    set OptionList     = ^(Options, 1)
    set OptionTextList = ^(OptionsText$($0), 1)
    set Status         = STATUS_SUCCESSFUL

    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
      ifstr(i) $($0) == ""
	set Status = STATUS_NOLANGUAGE
	goto ExitReturnOptions
      endif
    else
      set Status = STATUS_NOLANGUAGE
      goto ExitReturnOptions
    endif

ExitReturnOptions = +
    Return $(Status) $(OptionList) $(OptionTextList)

[InstallOption]
    StartWait

    set !DebugOutputControl = 1

    set Option   = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)

    set LanguageList = ^(LanguagesSupported, 1)

    read-syms GeneralConstants
    read-syms FileConstants
    read-syms RegistryConstants
    read-syms FileDependentDlg$(!STF_LANGUAGE)
    read-syms DialogConstants$(!STF_LANGUAGE)
    read-syms FileConstants$(!STF_LANGUAGE)

    ifstr(i) $(!STF_BUSTYPE) == MCA
	read-syms FileDependentDlgMCA
    else
	read-syms FileDependentDlgISA
    endif

    set NoArg = $(TRUE)
    Ifstr(i) $(!NTN_InstallMode) == deinstall
	set SubFunction = RemoveAdapter
    else-Ifstr(i) $(!NTN_InstallMode) == update
	set SubFunction = UpgradeSoftware
    else-Ifstr(i) $(!NTN_InstallMode) == configure
	set NoArg = $(FALSE)
	set SubFunction = ConfigureAdapter
    else-Ifstr(i) $(!NTN_InstallMode) == install
	set NoArg = $(FALSE)
	set SubFunction = InstallAdapter
    else
	set SubFunction = NoWay
    endif

    ifint $(NoArg) == $(TRUE)
	Shell "" $(SubFunction)
    else
	Shell "" $(SubFunction) $(Option) $(DoCopy) $(AddCopy) $(SrcDir)
    endif

    EndWait
    return $($R0)

[InstallAdapter]
; we start from here
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms RegistryConstants
    read-syms DialogConstants$(!STF_LANGUAGE)

    set Option  = $($0)
    set DoCopy  = $($1)
    set AddCopy = $($2)
    set SrcDir  = $($3)

    detect date
    set CurrentTime = *($(Now),1)

    set KeyProduct = $(KeyNull)
    set DoSetup    = $(TRUE)

    Set DetectedCard = $(FALSE)
    Ifstr(i) $(!STF_NCDETECT) == YES
	Ifstr(i) $(!STF_NCOPTION) == $(Option)
	   Set DetectedCard = $(TRUE)
	Endif
    Endif
; assume everu one is EISA or ISA
    set EisaIsa = "YES"
    ifstr(i) $(!STF_BUSTYPE) == MCA
	set EisaIsa = "NO"
    endif
;deal with eisa    
    ifstr(i) $(EisaIsa) == "YES"
	Set BusNumber = 0
	ifint $(DetectedCard) == $(TRUE)
	    Set TypeList = {{IRQ,IRQ_List,IRQLevel},+
			    {IOADDR, IOBaseAddressDecList, IOBaseValue},+
			    {DMACHANNEL, DMAChannelList, DMAChannel}}
    
	    Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
	    Set Status = $($R0)
	    ifstr(i) $(Status) != STATUS_SUCCESSFUL
		Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
		Shell "" FatalError $($R0)
		Return STATUS_FAILED
	    Endif

	    Shell $(ParamInf) Param_SetDefaults {}
	    set BusNumber = *($(!STF_NCDETINFO), 6)
	Endif
    Else  ; deal with MCA
	Shell $(UtilityInf) MCAFindBus 0 1
	set CardList = $($R1)
	set SlotList = {}
	ifstr(i) $(CardList) == {}
	    Shell "" FatalError $(CardError1)
	    return STATUS_FAILED
	endif

	ForListDo $(CardList)
	    set BusNumber  = *($($),1)
	    set SlotNumber = *($($),2)
	    Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNumber), +
		$(SlotNumber), $(ProductHardwareNCRTOKDescription), $(ProductHardwareName)

	    ifstr(i) $($R1) == "YES"
		Debug-Output "Card already installed"
	    else
		Set SlotList = >($(SlotList),$(SlotNumber))
	    endif

	EndForListDo

	ifstr(i) $(SlotList) == {}
	    Shell "" FatalError $(CardError2)
	    return STATUS_FAILED
	endif

    Endif
; check previous install
    set OldVersionExisted = $(FALSE)
    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct

    Ifstr $(KeyProduct) != $(KeyNull)
	CloseRegKey $(KeyProduct)

	ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
	    Shell $(UtilityInf) VerExistedDlg $(ProductSoftwareTitle) $(ProductVersion)
	    ifstr(i) $($R1) != "OK"
		Return STATUS_FAILED
	    endif
	else
	    Shell $(UtilityInf) CardExistedDlg
	    ifstr(i) $($R1) != "OK"
		Return STATUS_FAILED
	    endif
	    set OldVersionExisted = $(TRUE)
	endif
    endif
; deal with EISA ord ISA
    ifstr(i) $(EisaIsa) == "YES"
	ifint $(DetectedCard) == $(TRUE)
	    shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
	    ifstr(i) $($R0) == STATUS_SUCCESSFUL
		set DetectedParams = $($R1)
		shell $(ParamInf) Param_SetDefaults $(DetectedParams)
	    endif
	endif
    endif

    ifint $(DoSetup) == $(TRUE)
	set TempList = ^(NcrIrqs, 1)
	set InterruptNumber = *($(TempList), 1)
	set TempList = ^(NcrDmaChan, 1)
	set DmaChanValue    = *($(TempList), 1)
	set TempList        = ^(NcrIoBase, 1)
	set IoBaseAddrValue = *($(TempList), 1)
	set TempList        = ^(NcrSlot, 1)
	set MaxFrame        = 4096
	set ProductId       = "0910F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0"
	set EarlyRelease    = 0
	set SetAddress      = 0
	set Dma32           = 1
	set NetAddress      = "000000000000"

	ifint $(DetectedCard) == $(TRUE)
	    set InterruptNumber          = $(IRQLevel)
	    set-dectohex IoBaseAddrValue = $(IOBaseValue)
	    set DmaChanValue             = $(DMAChannel)
	    split-string $(IoBaseAddrValue), "x", TempList
	    set IoBaseAddrValue          = *($(TempList), 3)
	endif

	set DLLPATH = ""
	ifstr(i) $(DoCopy) == "YES"
	    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct

	    Ifstr $(KeyProduct) != $(KeyNull)
		CloseRegKey $(KeyProduct)
		set DLLPATH = $(!STF_CWDDIR)
	    else
		set BuiltIn = "YES"
		ifstr(i) $(!NTN_Origination) == "NCPA"
		    Set BuiltIn = "NO"
		endif
		Shell $(UtilityInf) DoAskSource $(!STF_CWDDIR) $(SrcDir) $(BuiltIn)
		set DLLPATH = $($R1)
		set SrcDir  = $($R1)
	    endif
	endif

dowind =+
	set SlotValue      = $(SlotList)
	set SpeedValue     = 16
	set DmaModeValue   = "dma"
; the problem is at after here
	Shell "" AdapterSetup
	ifint $($R0) != $(TRUE)
	    Return STATUS_USERCANCEL
	endif

	set IRQLevel    = $(NewIrq)
	set IOBaseValue = $(NewBase)
	set DMAChannel  = $(NewDma)

	ifstr(i) $(EisaIsa) == "YES"
	    Shell $(ParamInf) Param_SaveValues
	    Set NewParamSettings = $($R0)

	    Shell $(ParamInf) Param_VerifyResources $(NewParamSettings)
	    Ifstr(i) $($R0) != STATUS_SUCCESSFUL
		Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
		Shell "" VerifyError $($R0)
		ifstr(i) $($R0) != "OK"
		    goto dowind
		endif
	    endif
	endif

	ifint $(OldVersionExisted) == $(FALSE)
	    Shell "" SetCopy $(DoCopy) $(AddCopy) $(SrcDir)
	    ifint $($R0) == $(TRUE)
		Shell "" SetSoftware $(CurrentTime)
		ifint $($R0) != $(TRUE)
		    Return STATUS_FAILED
		endif
	    endif
	endif

	Shell "" SetHardware $(CurrentTime)

	ifint $($R0) == $(TRUE)
	    Shell "" WriteParameters
	endif
    endif

    ifint $($R0) == $(TRUE)
	Return STATUS_SUCCESSFUL
    else
	Return STATUS_FAILED
    endif

[ConfigureAdapter]
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms RegistryConstants
    read-syms FileDependentDlg$(!STF_LANGUAGE)
    set Option = $($0)

    ifstr(i) $(!STF_BUSTYPE) == MCA
	read-syms FileDependentDlgMCA
    else
	read-syms FileDependentDlgISA
    endif

    ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
	Shell $(UtilityInf) RegistryErrorString CANNOT_CONFIGURE_SOFTWARE
	Shell "" FatalError $($R0)
	Return STATUS_FAILED
    endif

    set EisaIsa = "YES"
    ifstr(i) $(!STF_BUSTYPE) == MCA
	set EisaIsa = "NO"
    endif
    
    Set DetectedCard = $(FALSE)
    Ifstr(i) $(!STF_NCDETECT) == YES
	Ifstr(i) $(!STF_NCOPTION) == $(Option)
	   Set DetectedCard = $(TRUE)
	Endif
    Endif

    ifstr(i) $(EisaIsa) == "YES"
	ifint $(DetectedCard) == $(TRUE)
	    Set TypeList = {{IRQ,IRQ_List,IRQLevel},+
			{IOADDR, IOBaseAddressDecList, IOBaseValue},+
			{DMACHANNEL, DMAChannelList, DMAChannel}}
    
	    Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
	    Set Status = $($R0)
	    ifstr(i) $(Status) != STATUS_SUCCESSFUL
		Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
		Shell "" FatalError $($R0)
		Return STATUS_FAILED
	    Endif
    
	    Shell $(ParamInf) Param_SetDefaults {}
	Endif
    Endif

    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct

    Ifstr $(KeyProduct) == $(KeyNull)
	Shell $(UtilityInf) RegistryErrorString CANNOT_FIND_COMPONENT_SERVICE
	Shell "" FatalError $($R0)
	Return STATUS_FAILED
    endif

    Shell $(UtilityInf) FindService, $(KeyProduct)

    Ifstr(i) $($R0) != NO_ERROR
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return STATUS_FAILED
    endif

    Set !KeyParameters = $($R2)
    CloseRegKey $($R1)

    Ifstr $(!KeyParameters) == $(KeyNull)
	Shell $(UtilityInf) RegistryErrorString CANNOT_FIND_COMPONENT_SERVICE
	Shell "" FatalError $($R0)
	Return STATUS_FAILED
    endif

    set ValueName = ""
    set ValueData = ""
    set ValueStr  = ""
    set ValueList = {}

    EnumRegValue $(!KeyParameters) ValueList

    ForListDo $(ValueList)
	set ValueItem = $($)
	set ValueName = *($(ValueItem),1)
	set ValueData = *($(ValueItem),4)
	Ifstr(i) $(ValueName) == "Ring_Speed"
	    set SpeedValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "BusNumber"
	    set BusNumber = $(ValueData)
	else-ifstr(i) $(ValueName) == "Dma32"
	    set Dma32 = $(ValueData)
	else-ifstr(i) $(ValueName) == "Bus_Mode"
	    set DmaModeValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "Interrupt"
	    set InterruptNumber = $(ValueData)
	else-ifstr(i) $(ValueName) == "Port_Address"
	    set IoBaseAddrValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "Dma_Level"
	    set DmaChanValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "Max_Frame_Size"
	    set MaxFrame = $(ValueData)
	else-ifstr(i) $(ValueName) == "SlotNumber"
	    set SlotValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "Product_Id"
	    set ProductId = $(ValueData)
	else-ifstr(i) $(ValueName) == "EarlyRelease"
	    set EarlyRelease = $(ValueData)
	else-ifstr(i) $(ValueName) == "SetAddress"
	    set SetAddress = $(ValueData)
	else-ifstr(i) $(ValueName) == "NetworkAddress"
	    set NetworkAddress = $(ValueData)
	endif
    EndForListDo

    set-dectohex IoBaseAddrValue = $(IoBaseAddrValue)
    split-string $(IoBaseAddrValue), "x", TempList
    set IoBaseAddrValue          = *($(TempList), 3)

winagn =+
    set DLLPATH = $(!STF_CWDDIR)
    Shell "" AdapterSetup

    ifint $($R0) != $(TRUE)
	Return STATUS_USERCANCEL
    endif

    set IRQLevel    = $(NewIrq)
    set IOBaseValue = $(NewBase)
    set DMAChannel  = $(NewDma)

    ifstr(i) $(EisaIsa) == "YES"
	Shell $(ParamInf) Param_SaveValues
	Set NewParamSettings = $($R0)
	Shell $(ParamInf) Param_VerifyResources $(NewParamSettings)
	Ifstr(i) $($R0) != STATUS_SUCCESSFUL
	    Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
	    Shell "" VerifyError $($R0)
	    ifstr(i) $($R0) != "OK"
		goto winagn
	    endif
	endif
    endif

    Shell "" WriteParameters

    ifint $($R0) == $(TRUE)
	Return STATUS_SUCCESSFUL
    else
	Return STATUS_FAILED
    endif

[NoWay]
    read-syms GeneralConstants
    Shell "" FatalError "NoWay"
    Return STATUS_FAILED

[RemoveAdapter]
    read-syms RegistryConstants
    read-syms GeneralConstants
    read-syms FileConstants

	Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName), $(!NTN_RegBase)

	ifstr(i) $($R0) != NO_ERROR
	    Shell $(UtilityInf) RegistryErrorString $($R0)
	    Shell "" FatalError $($R0)
	    Return STATUS_FAILURE
	endif

	Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName)

	ifstr(i) $($R0) == REF_COUNT_NOT_ZERO
	    Return STATUS_SUCCESSFUL
	endif

	ifstr(i) $($R0) != NO_ERROR
	    Shell $(UtilityInf) RegistryErrorString $($R0)
	    Shell "" FatalError $($R0)
	    Return STATUS_FAILURE
	endif

    Return STATUS_SUCCESSFUL


[UpgradeSoftware]

    read-syms GeneralConstants
    read-syms RegistryConstants

	OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
 
	Ifstr $(KeyProduct) == $(KeyNull)
	    Return STATUS_FAILED
	endif

	GetRegValue $(KeyProduct),"MinorVersion", MinVersionInfo
	GetRegValue $(KeyProduct),"MajorVersion", MajVersionInfo

	OpenRegKey $(KeyProduct) "" NetRules $(MAXIMUM_ALLOWED) IS_KeyNetRule
	GetRegValue $(IS_KeyNetRule),"InfName", TempVar
	set !OldInfName = *($(TempVar),4)

	install "Install-Update"

	ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
	    CloseRegKey $(KeyProduct)
	    Return STATUS_FAILED
	endif

	SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
	SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}

	CloseRegKey $(KeyProduct)

	Return STATUS_SUCCESSFUL

[AdapterSetup]
    read-syms FileDependentDlg$(!STF_LANGUAGE)
    read-syms DialogConstants$(!STF_LANGUAGE)
    read-syms FileConstants$(!STF_LANGUAGE)
    read-syms FileConstants
    read-syms GeneralConstants

    ifstr(i) $(!STF_BUSTYPE) == MCA
	read-syms FileDependentDlgMCA
    else
	read-syms FileDependentDlgISA
    endif

    set DLLPATH        = $(!p:DLLPATH)
    set Combo1Out      = $(!p:InterruptNumber)
    set Combo2Out      = $(!p:IoBaseAddrValue)
    set SpeedValue     = $(!p:SpeedValue)
    set Combo3Out      = $(!p:DmaChanValue)
    set DmaModeValue   = $(!p:DmaModeValue)
    set SlotList       = $(!p:SlotValue)
    set MaxFrame       = $(!p:MaxFrame)
    set ProductId      = $(!p:ProductId)
    set SetAddress     = $(!p:SetAddress)
    set Dma32          = $(!p:Dma32)

    ifint $(SetAddress) == 1
	set NetworkAddress = $(!p:NetworkAddress)
    else
	set NetworkAddress = ""
    endif

    ifint $(Dma32) == 1
	set CheckItemsIn = { "ON" }
    else
	set CheckItemsOut = { "OFF" }
    endif

    set Combo4List = $(SlotList)
    set Combo4Out  = *($(SlotList), 1)

    SetHelpFile $(DLLPATH)\"ncrtok.hlp" 30000 30002

    set AdapterStatus = $(FALSE)

    ifint $(SpeedValue) == 16
	set FirstButton = 1
    else
	set FirstButton = 2
    endif

    ifstr(i) $(DmaModeValue) == "dma"
	set SecondButton = 3
    else
	set SecondButton = 4
    endif

    set RadioIn = {$(FirstButton), $(SecondButton)}

    set EditTextIn = {$(MaxFrame), $(ProductId), $(NetworkAddress)}

    loadlibrary "NcrTok Install Diskette" $(DLLPATH)\ncrtok.dll DllHandle

RetryDialog =+
    EndWait
    ui start "InputDlg" $(DllHandle)
    StartWait

    ifstr(i) $(DLGEVENT) == "NOTIFY"
	IfContains "4" IN $(RadioOut)
	    Shell "" WarnError $(ModeError)
	endif
	goto RetryDialog
    endif

    set NewMaxFrame        = *($(EditTextOut), 1)
    set NewProductId       = *($(EditTextOut), 2)
    set TempNetworkAddress = *($(EditTextOut), 3)

    ifstr(i) *($(CheckItemsOut), 1) == "ON"
	set Dma32 = 1
    else
	set Dma32 = 0
    endif

    ifstr(i) $(DLGEVENT) == "CONTINUE"
	IfContains "1" IN $(RadioOut)
	    set RingSpeed = 16
	else-IfContains "2" IN $(RadioOut)
	    set RingSpeed = 4
	endif
	IfContains "3" IN $(RadioOut)
	    set DmaModeType = "dma"
	else-IfContains "4" IN $(RadioOut)
	    set DmaModeType = "dio"
	endif

	set-hextodec Base = "0x"$(Combo2Out)

	ifint $(NewMaxFrame) < 256
	    Shell "" WarnError $(BadMaxFrame1)
	    goto RetryDialog
	else-ifint $(NewMaxFrame) > 4472
	    ifint $(RingSpeed) == 1
		Shell "" WarnError $(BadMaxFrame2)
		goto RetryDialog
	    else-ifint $(NewMaxFrame) > 17800
		Shell "" WarnError $(BadMaxFrame3)
		goto RetryDialog
	    endif
	endif
	Split-String $(NewProductId), "0123456789ABCDEFabcdef", TempList
	set HexList = ^(HexDigits, 1)
	QueryListSize ListSize $(TempList)
	ifint $(ListSize) == 36
	    set Index1 = 1
	    set Loop   = 1
	else
	    Shell "" WarnError $(BadProdId1)
	    goto RetryDialog
	endif

ProdIdLoop =+
	set Temp1 = *($(TempList), $(Index1))
	ifcontains(i) $(Temp1) not-in $(HexList)
	    Shell "" WarnError $(BadProdId2)$(Temp1)
	    goto RetryDialog
	endif

	set-add Index1 = $(Index1), 1
	set-add Loop  = $(Loop), 1
	ifint $(Loop) < 37
	    goto ProdIdLoop
	endif

	ifstr(i) $(TempNetworkAddress) == ""
	    set SetAddress = 0
	    set AdapterStatus = $(TRUE)
	    goto DoneDialog
	endif
	set NewNetworkAddress = $(TempNetworkAddress)
	Split-String $(NewNetworkAddress), "0123456789ABCDEFabcdef", TempList
	set HexList = ^(HexDigits, 1)
	QueryListSize ListSize $(TempList)
	ifint $(ListSize) == 12
	    set Index1 = 1
	    set Loop   = 1
	else
	    Shell "" WarnError $(BadAddr1)
	    goto RetryDialog
	endif

NetAddrLoop =+
	set Temp1 = *($(TempList), $(Index1))
	ifcontains(i) $(Temp1) not-in $(HexList)
	    Shell "" WarnError $(BadAddr2)$(Temp1)
	    goto RetryDialog
	endif
	ifint $(Index1) == 1
	    ifint $(Temp1) != 4
		Shell "" WarnError $(BadAddr3)
		goto RetryDialog
	    endif
	else-ifint $(Index1) == 2
	    ifint $(Temp1) != 0
		Shell "" WarnError $(BadAddr3)
		goto RetryDialog
	    endif
	else-ifint $(Index1) == 3
	    ifint $(Temp1) != 0
		Shell "" WarnError $(BadAddr3)
		goto RetryDialog
	    endif
	else-ifint $(Index1) == 4
	    ifint $(Temp1) != 0
		Shell "" WarnError $(BadAddr3)
		goto RetryDialog
	    endif
	else-ifint $(Index1) == 5
	    ifint $(Temp1) > 7
		Shell "" WarnError $(BadAddr3)
		goto RetryDialog
	    endif
	endif
    
	set-add Index1 = $(Index1), 1
	set-add Loop  = $(Loop), 1
	ifint $(Loop) < 13
	    goto NetAddrLoop
	endif
	set SetAddress = 1
	set AdapterStatus = $(TRUE)
    endif


DoneDialog =+
    ui pop 1
    FreeLibrary $(DllHandle)

    set !p:NewBase              = $(Base)
    set !p:NewIrq               = $(Combo1Out)
    set !p:NewSpeed             = $(RingSpeed)
    set !p:NewDma               = $(Combo3Out)
    set !p:NewDmaMode           = $(DmaModeType)
    set !p:NewSlot              = $(Combo4Out)
    set !p:NewMaxFrame          = $(NewMaxFrame)
    set !p:NewProductId         = $(NewProductId)
    set !p:SetAddress           = $(SetAddress)
    set !p:NetworkAddress       = $(NewNetworkAddress)
    set !p:Dma32                = $(Dma32)

    return $(AdapterStatus)


[SetCopy]
    read-syms GeneralConstants
    read-syms FileConstants

    set DoCopy = $($0)
    set AddCopy = $($1)
    set SrcDir  = $($2)
    set Needcopy = $(FALSE)

    Ifstr(i) $(DoCopy) == "YES"
	set NeedCopy = $(TRUE)
    else-ifstr(i) $(AddCopy) == "YES"
	set NeedCopy = $(TRUE)
    else
	Return $(TRUE)
    endif

    set BuiltIn = "YES"
    ifstr(i) $(!NTN_Origination) == "NCPA"
	Set BuiltIn = "NO"
    endif

    Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) $(BuiltIn)

    Ifstr(i) $($R0) == STATUS_FAILED
	Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
	Shell "" FatalError $($R0)
	Return $(FALSE)
    Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
	Return $(FALSE)
    Endif

    Set SrcDir = $($R1)

    install "Install-Option"

    ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
	Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif
    Shell "" PrepareDetectionDll "NCRNCDET.DLL"
    Return $(TRUE)

[SetSoftware]
    read-syms RegistryConstants
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms date


    Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
	  $(ProductSoftwareName), +
	  $(ProductSoftwareName), +
	  $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
	  $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
	  $(NetEventDLL)

    Ifstr(i) $($R0) != NO_ERROR
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif

	;
	;   At this point:
	;     $R1 contains the product version key handle;
	;     $R2 contains the NetRules subkey handle;
	;     $R3 contains the new Services key handle; and
	;     $R4 contains the Parameters key
	;     $R5 contains the Linkage Key
	;
    set KeyProduct      = $($R1)
    Set SoftNetRulesKey = $($R2)
    CloseRegKey $($R3)
    CloseRegKey $($R4)
    CloseRegKey $($R5)

    Ifstr(i) $($R0) != NO_ERROR
	CloseRegKey $(KeyProduct)
	CloseRegKey $(SoftNetRulesKey)
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif

    set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
			{MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
			{MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
			{Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
			{Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
			{ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
			{InstallDate,$(NoTitle),$(!REG_VT_DWORD),$($0)}}

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

    Ifstr(i) $($R0) != NO_ERROR
	CloseRegKey $(KeyProduct)
	CloseRegKey $(SoftNetRulesKey)
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    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),"NCRTOK"}}

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

    CloseRegKey $(KeyProduct)
    CloseRegKey $(SoftNetRulesKey)

    Ifstr(i) $($R0) != NO_ERROR
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif
    return $(TRUE)

[SetHardware]
    read-syms RegistryConstants
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms date


    Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)

    Ifstr(i) $($R0) != NO_ERROR
	CloseRegKey $($R1)
	CloseRegKey $($R2)
	CloseRegKey $($R3)
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif

;
;   At this point:
;     $R1  Registry key variable for HARDWARE\Netcard\(n)
;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
;     $R3  Registry key handle for <service>\Parameters key
;     $R4  Adapter number assigned to adapter
;     $R5  Service name generated by combining svc name with adapter number
;
    set !KeyParameters   = $($R3)
    set KeyAdapterRules = $($R2)
    set AdapterNumber   = $($R4)
    set Option          = "NCRTOK"

    set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
		       {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
		       {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
		       {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
		       {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
		       {InstallDate,$(NoTitle),$(!REG_VT_DWORD),$($0)}}

    Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
    Ifstr(i) $($R0) != NO_ERROR
	CloseRegKey $($R1)
	CloseRegKey $($R2)
	CloseRegKey $($R3)
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif

    CloseRegKey $($R1)

    set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
    set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)

    set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
			{bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
			{class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
			{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}

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

    Ifstr(i) $($R0) != NO_ERROR
	CloseRegKey $(!KeyParameters)
	CloseRegKey $(KeyAdapterRules)
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif

    CloseRegKey $(KeyAdapterRules)
    return $(TRUE)

[WriteParameters]
    read-syms RegistryConstants
    read-syms FileConstants
    read-syms GeneralConstants
    read-syms DownLoadInfo

    set Base           = $(!p:NewBase)
    set Irq            = $(!p:NewIrq)
    set Speed          = $(!p:NewSpeed)
    set Dma            = $(!p:NewDma)
    set DmaMode        = $(!p:NewDmaMode)
    set Slot           = $(!p:NewSlot)
    set MaxFrame       = $(!p:NewMaxFrame)
    set ProductId      = $(!p:NewProductId)
    set EarlyRelease   = $(!p:EarlyRelease)
    set SetAddress     = $(!p:SetAddress)
    set NetworkAddress = $(!p:NetworkAddress)
    set EisaIsa        = $(!p:EisaIsa)
    set Dma32          = $(!p:Dma32)
    set BusNumber      = $(!p:BusNumber)

    Shell $(UtilityInf), GetBusTypeNum
    set BusTypeNum = $($R1)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Shell "" FatalError "Cannot get bus number"
	Return $(FALSE)
    endif

    ifstr(i) $(EisaIsa) == "YES"
	Set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
	       {MediaType,$(NoTitle),$(!REG_VT_DWORD),2},+
			   {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
			   {Ring_Speed,$(NoTitle),$(!REG_VT_DWORD),$(Speed)},+
			   {Bus_Mode,$(NoTitle),$(!REG_VT_SZ),$(DmaMode)},+
			   {Interrupt,$(NoTitle),$(!REG_VT_DWORD),$(Irq)},+
			   {Dma_Level,$(NoTitle),$(!REG_VT_DWORD),$(Dma)},+
			   {EarlyRelease,$(NoTitle),$(!REG_VT_DWORD),$(EarlyRelease)},+
			   {MacCode,$(NoTitle),$(!REG_VT_SZ),$(DownFile)},+
			   {Max_Frame_Size,$(NoTitle),$(!REG_VT_DWORD),$(MaxFrame)},+
			   {Product_Id,$(NoTitle),$(!REG_VT_SZ),$(ProductId)},+
			   {Port_Address,$(NoTitle),$(!REG_VT_DWORD),$(Base)},+
			   {SetAddress,$(NoTitle),$(!REG_VT_DWORD),$(SetAddress)},+
			   {NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)}}

    else-ifstr(i) $(!STF_BUSTYPE) == MCA
	Set BusNumber = $(!p:BusNumber)
	Set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
	       {MediaType,$(NoTitle),$(!REG_VT_DWORD),2},+
			   {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
			   {Dma32,$(NoTitle),$(!REG_VT_DWORD),$(Dma32)},+
			   {MacCode,$(NoTitle),$(!REG_VT_SZ),$(DownFile)},+
			   {EarlyRelease,$(NoTitle),$(!REG_VT_DWORD),$(EarlyRelease)},+
			   {Max_Frame_Size,$(NoTitle),$(!REG_VT_DWORD),$(MaxFrame)},+
			   {Product_Id,$(NoTitle),$(!REG_VT_SZ),$(ProductId)},+
			   {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(Slot)},+
			   {SetAddress,$(NoTitle),$(!REG_VT_DWORD),$(SetAddress)},+
			   {NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)}}
    endif

    Shell  $(UtilityInf), AddValueList, $(!KeyParameters), $(NewValueList)

    CloseRegKey $(!KeyParameters)

    Ifstr(i) $($R0) != NO_ERROR
	Shell $(UtilityInf) RegistryErrorString $($R0)
	Shell "" FatalError $($R0)
	Return $(FALSE)
    endif

    Return $(TRUE)


[FatalError]
    read-syms FileConstants

    ifstr(i) $($0) == ""
	set Message = "Unknown Error"
    else
	set Message = $($0)
    endif

    Shell $(SubroutnInf) SetupMessage $(!STF_LANGUAGE) FATAL $(Message)

    Return

[WarnError]
    read-syms FileConstants

    ifstr(i) $($0) == ""
	set Message = "Unknown Error"
    else
	set Message = $($0)
    endif

    Shell $(SubroutnInf) SetupMessage $(!STF_LANGUAGE) NONFATAL $(Message)
    Return

[VerifyError]
    read-syms FileConstants

    ifstr(i) $($0) == ""
	set Message = "Unknown Error"
    else
	set Message = $($0)
    endif

    Return $($R1)

[Install-Option]
    set STF_VITAL = ""
    
    ifstr(i) $(AddCopy) == "YES"
	AddSectionFilesToCopyList Files-ncrncdet $(SrcDir) $(!STF_WINDOWSSYSPATH)
	AddSectionFilesToCopyList Files-NCRTOK $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
	AddSectionFilesToCopyList Files-Dlg $(SrcDir) $(!STF_WINDOWSSYSPATH)
    endif

    ifstr(i) $(DoCopy) == "YES"
       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       CopyFilesInCopyList
    else
        LibraryProcedure STATUS,$(!LIBHANDLE), CopySingleFile $(SrcDir)\ncrtok.dll $(!STF_WINDOWSSYSPATH)\ncrtok.dll
        LibraryProcedure STATUS,$(!LIBHANDLE), CopySingleFile $(SrcDir)\ncrtok.hlp $(!STF_WINDOWSSYSPATH)\ncrtok.hlp
        LibraryProcedure STATUS,$(!LIBHANDLE), CopySingleFile $(SrcDir)\ncrncdet.hlp $(!STF_WINDOWSSYSPATH)\ncrncdet.hlp
    endif
    Exit

[Install-Update]
   set STF_VITAL        = ""

   ClearCopyList

   AddSectionFilesToCopyList Files-ncrncdet $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)
   AddSectionFilesToCopyList Files-NCRTOK-Upd $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)\drivers
   AddSectionFilesToCopyList Files-Inf $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)
   AddSectionFilesToCopyList Files-Dlg $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)

   set !STF_NCPA_FLUSH_COPYLIST = TRUE

   CopyFilesInCopyList

   exit

[PrepareDetectionDll]
    Set NewDllName = $($0)
    Set Status = STATUS_FAILED
    read-syms GeneralConstants
    Set DllValueName = "NetcardDlls"
    OpenRegKey $(!REG_H_LOCAL) "" "System\Setup" $(MAXIMUM_ALLOWED) KeySetup
    Ifstr(i) $(KeySetup) == $(KeyNull)
	Goto PDD_Return
    Endif
    Set DllFound = 0
    GetRegValue $(KeySetup) $(DllValueName) DllNamesValue
    Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
	Goto PDD_Return
    Endif

    Set DllNames = *($(DllNamesValue),4)
    ForListDo $(DllNames)
	Ifstr(i) $($) == $(NewDllName)
	    Set DllFound = 1
	Endif
    EndForListDo
    Ifint $(DllFound) == 0
	Set DllNames = >($(DllNames),$(NewDllName))
	Set ValueInfo = {$(DllValueName), $(NoTitle), $(!REG_VT_MULTI_SZ), $(DllNames)}
	SetRegValue $(KeySetup) $(ValueInfo)
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
	    Set Status = STATUS_SUCCESSFUL
	Endif
    Else
	Set Status = STATUS_USERCANCEL
    Endif
    CloseRegKey $(KeySetup)
PDD_Return = +
    Return $(Status)

