MONITOR.INF Driver File Contents (dd1284.exe)

;*******************************************************************************
;**
;**     File Name:   OEMSETUP.INF
;**
;**     Author:      Dan Updegraff, based on Sidewinder INF.
;**
;**     Version:     1.0
;**
;**     Copyright 1999 by Eastman Kodak Company, Inc, all rights reserved.
;**
;**
;*******************************************************************************
;**                          D E S C R I P T I O N 
;*******************************************************************************
;**
;**      This INF program is written to facilitate adding the Kodak 8660/8650 port
;**      monitor.  This INF program will be called during the "Add Port" selection 
;**      of the Printer's properties dialog box.
;**
;*******************************************************************************
;**                      R E V I S I O N   H I S T O R Y
;*******************************************************************************
;**
;**    Date      Author  Description
;**  --------    ------  ---------------------------------------------
;**  11/04/99    dju     Original version
;**
;*******************************************************************************


;-------------------------------------------------------------------------
;  Header format to be used at the front of all INF sections
;  is as follows:
;-------------------------------------------------------------------------

;*************************************************************************
;
;     SECTION:   sectionname
;
;     PURPOSE:   <describe purpose of section>
;
;*************************************************************************
;[sectionname]
;   <INF language statements used to support this section go here....>
;
;*************************************************************************
;  end of section sectionname
;*************************************************************************


;*************************************************************************
;
;     SECTION:   DebugVars
;
;     PURPOSE:   This section controls the output of Debug Strings
;
;*************************************************************************
[DebugVars]
STF_DISPLAYDEBUGCONTROL = 0
;*************************************************************************
;  end of section DebugVars
;*************************************************************************


;*************************************************************************
;
;     SECTION:   InitBaseVars
;
;     PURPOSE:   This section Initializes general constants
;
;*************************************************************************
[InitBaseVars]

KeyNull            = ""
MAXIMUM_ALLOWED    = 33554432
KeyInfo            = {}
RegistryErrorIndex = NO_ERROR
NoTitle            = 0

CurrentControlSet  = "SYSTEM\CurrentControlSet"
ServicesBaseName   = $(CurrentControlSet)"\Services"

!RegLastError      = NO_ERROR

[RegistryErrorSetup]
RegistryErrorIndex = ^(RegistryErrors$(!STF_LANGUAGE),1)
RegistryErrorList = ^(RegistryErrors$(!STF_LANGUAGE),2)
;*************************************************************************
;  end of section InitBaseVars
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Identification
;
;     PURPOSE:   This section defines which element is being installed
;
;*************************************************************************
[Identification]
OptionType = MONITOR
;*************************************************************************
;  end of section Identification
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Options
;
;     PURPOSE:   This section defines the string to be used
;
;*************************************************************************
[Options]
"Kodak SCSI Port"                    = EKPSCS2A
;*************************************************************************
;  end of section Options
;*************************************************************************


;*************************************************************************
;
;     SECTION:   FileConstants
;
;     PURPOSE:   This section provides defined constants
;
;*************************************************************************
[FileConstants]
;
;  Utility INF file used to support added software services
;
subroutineinf   = "SUBROUTN.INF"
Exit_Code       = 0

;
;
; Software services definitions
;
;;;    ProductSoftwareName		= "EKSWDR03"
;;;    ProductSoftwareImagePath	= "\SystemRoot\System32\EKSWDR03.sys"
;;;    ProductErrorControl		= 1
;;;    ProductStart		= 2
;;;    ProductType			= 1
;;;    ParmLPT1Value		= 3
;;;    ParmLPT2Value		= 3
;;;    ParmLPT3Value		= ""
;;;    SecurityValue               = ""
;
; Registry Keys definitions
;
;;;    ProductKeyName		= $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\DisplayName"
;;;    ParamKeyName		= $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Parameters"
;;;    SecurityKeyName		= $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Security"
;*************************************************************************
;  end of section FileConstants
;*************************************************************************


;*************************************************************************
;
;     SECTION:   GeneralConstants
;
;     PURPOSE:   This section defines additional constants used for
;                comparisons
;
;*************************************************************************
[GeneralConstants]
    KeyNull            = ""
    MAXIMUM_ALLOWED    = 33554432
    RegistryErrorIndex = NO_ERROR
    KeyProduct         = ""
    KeyParameters      = ""

    TRUE            = 1
    FALSE           = 0
    NoTitle         = 0
;*************************************************************************
;  end of section GeneralConstants
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Identify
;
;     PURPOSE:   This section returns identification information used for
;                identifying what elements are being installed
;
;*************************************************************************
[Identify]
    read-syms Identification
    set Status     = STATUS_SUCCESSFUL
    set Identifier = $(OptionType)
    set Media      = #("Source Media Descriptions", 1, 1)
    Return $(Status) $(Identifier) $(Media)
;*************************************************************************
;  end of section Identify
;*************************************************************************


;*************************************************************************
;
;     SECTION:   ReturnOptions
;
;     PURPOSE:   This section provides the return status of the installation
;
;*************************************************************************
[ReturnOptions]
    set Status        = STATUS_FAILED
    set OptionList     = {}
    set OptionTextList = {}
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
        goto returnoptions
    else
        set Status = STATUS_NOLANGUAGE
        goto finish_ReturnOptions
    endif
returnoptions = +
    set OptionList     = ^(Options, 0)
    set OptionTextList = ^(OptionsText$($0), 1)
    set Status         = STATUS_SUCCESSFUL
finish_ReturnOptions = +
    Return $(Status) $(OptionList) $(OptionTextList)
;*************************************************************************
;  end of section ReturnOptions
;*************************************************************************

;*************************************************************************
;
;     SECTION:   InstallOption
;
;     PURPOSE:   This section starts the installation process
;
;*************************************************************************
[InstallOption]
    set Status   = STATUS_FAILED
    set Option   = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)
    set LanguageList = ^(LanguagesSupported, 1)
    Debug-Output "Install option"
;-----------------------------
    read-syms FileConstants
    read-syms GeneralConstants

;    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(SrcDir)

;-----------------------------
;
;   Make sure that the Language used is supported
;
    Ifcontains(i) $($0) in $(LanguageList)
    else
;
;   Language is not supported - return to caller
;
        set Status = STATUS_NOLANGUAGE
        goto finish_InstallOption
    endif

    read-syms Strings$($0)
    set OptionList = ^(Options, 0)
;
;   Make sure that the Option selected is supported
;
    ifcontains $(Option) in $(OptionList)
    else
;
;   Option is not supported - return to caller
;
        goto finish_InstallOption
    endif

    set OptionList = ""
    set MonitorOption = #(Options, $(Option), 1)

;
; Now install the option selected
;
installtheoption = +
    ifstr(i) $(AddCopy) == "YES"
        install Install-AddCopyOption
        ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
            Debug-Output "Adding video files to copy list failed"
            goto finish_InstallOption
        endif
    endif
    ifstr(i) $(DoCopy) == "YES"
        read-syms ProgressCopy$($0)
        install Install-DoCopyOption
        ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
            Debug-Output "Copying files failed"
            goto finish_InstallOption
        else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
            set Status = STATUS_USERCANCEL
            goto finish_InstallOption
        endif
    endif

    ifstr(i) $(DoConfig) == "YES"
        set MonitorPath      = $(!STF_PRNMONITORPATH)"\"#(Files-PrinterMonitor, $(MonitorOption), 2)
        LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(MonitorPath)
        ifstr(i) $(STATUS) == NO
            set OptionText = #(OptionsText$($0), $(Option), 1)
            shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String4)$(OptionText)$(String5)
            Debug-Output "Copying printer files failed"
            goto finish_InstallOption
        endif
        install Install-Configure
        ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
            Debug-Output "Installing printer monitor failed"
            goto finish_InstallOption
        else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
            set Status = STATUS_USERCANCEL
            goto finish_InstallOption
        endif

        ifstr(i) $(STATUS) != "ADDED"
            set OptionText = #(OptionsText$($0), $(Option), 1)
            ifstr(i) $(STATUS) == "PRESENT"
                shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String1)$(OptionText)$(String2)
                set Status = STATUS_SUCCESSFUL
            else-ifstr(i) $(STATUS) == "DENIED"
                shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String6)
            else
                shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String1)$(OptionText)$(String7)
            endif
            goto finish_InstallOption
        endif
    endif
    set Status = STATUS_SUCCESSFUL

;
;   Setup Software Services Registry keys
;

    read-syms GeneralConstants
    read-syms FileConstants
    Shell "", AddSoftwareServices, +
          $(ProductSoftwareName), +
          $(ProductSoftwareName), +
          $(ProductSoftwareImagePath), +
          $(ProductErrorControl), +
          $(ProductStart), +
          $(ProductType), +
          $(ParmLPT1Value), +
          $(ParmLPT2Value), +
          $(ParmLPT3Value), +
          $(SecurityValue)

;;;    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(String8)

finish_InstallOption = +
    Return $(Status)
;*************************************************************************
;  end of section InstallOption
;*************************************************************************

;*************************************************************************
;
;     SECTION:   Install-AddCopyOption
;
;     PURPOSE:   This section copies the Options Software to the
;                Windows system32 sub-directory
;
;*************************************************************************
[Install-AddCopyOption]
    set STF_VITAL = ""
    set STF_OVERWRITE   = "ALWAYS"

    AddSectionKeyFileToCopyList   Files-PrinterMonitor          +
                                  $(MonitorOption)              +
                                  $(SrcDir)                    +
                                  $(!STF_PRNMONITORPATH)
    set KeyList = ^( PrinterMonitorsWithHelp, 1 )
    ifcontains(i) $(MonitorOption) in $(KeyList)
        AddSectionKeyFileToCopyList   Files-PrinterMonitorHelp      +
                                      $(MonitorOption)              +
                                      $(SrcDir)                    +
                                      $(!STF_PRNMONITORPATH)
    endif
    ifstr(i) $(MonitorOption) == "lexmon"
        AddSectionFilesToCopyList Files-$(MonitorOption) $(SrcDir) $(!STF_PRNMONITORPATH)
    endif
    ifstr(i) $(MonitorOption) == "EKPSCS2A"
        AddSectionFilesToCopyList Files-$(MonitorOption) $(SrcDir) $(!STF_PRNMONITORPATH)
    endif
    ifstr(i) $(MonitorOption) == "lexlmpm"
        AddSectionFilesToCopyList Files-$(MonitorOption) $(SrcDir) $(!STF_PRNMONITORPATH)
        LoadLibrary "" $(SrcDir)mvntinst.dll !LIBMVINSTHANDLE
        LibraryProcedure Directory $(!LIBMVINSTHANDLE), GetMarkVisionDirectory
        set !MVDirectory = $(Directory)
        AddSectionFilesToCopyList Files-MarkVision $(SrcDir) $(!MVDirectory)
    endif
    exit
;*************************************************************************
;  end of section Install-AddCopyOption
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Install-DoCopyOption
;
;     PURPOSE:   This section calls copy files in copy list
;
;*************************************************************************
[Install-DoCopyOption]
    CopyFilesInCopyList
    exit
;*************************************************************************
;  end of section Install-DoCopyOption
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Install-Configure
;
;     PURPOSE:   This section provides a call to configure the 
;                monitor port
;
;*************************************************************************
[Install-Configure]
    ifstr(i) $(MonitorOption) == "lexmon"
        LoadLibrary "" $(!STF_CWDDIR)lexcfg.cpl !LIBCFGHANDLE
        LibraryProcedure STATUS  $(!LIBCFGHANDLE), CreateInteractShortcut
        LibraryProcedure STATUS, $(!LIBCFGHANDLE), LexCfgInf
        FreeLibrary $(!LIBCFGHANDLE)
    endif
    set Model       = $(Option)
    set Monitor      = #(Files-PrinterMonitor, $(MonitorOption), 2)

    LibraryProcedure STATUS,$(!LIBHANDLE), SetupAddPrinterMonitor   +
                                               $(Model)            +
                                               $(!STF_PRNENVIRONM) +
                                               $(Monitor)           +
                                               $(!STF_PRINTSERVER)

    ifstr(i) $(MonitorOption) == "lexlmpm"
       LibraryProcedure Result, $(!LIBMVINSTHANDLE), CreateMVRegistryEntries
    endif
    ifstr(i) $(MonitorOption) == "lexlmpm"
       LibraryProcedure Result, $(!LIBMVINSTHANDLE), CreateMVShortcut
    endif
    ifstr(i) $(MonitorOption) == "lexlmpm"
       FreeLibrary $(!LIBMVINSTHANDLE)
    endif
    exit
;*************************************************************************
;  end of section Install-Configure
;*************************************************************************

;*************************************************************************
;
;     SECTION:   ExternalInstallOption
;
;     PURPOSE:   This section updates the Registry keys for control
;                print environment
;
;*************************************************************************
[ExternalInstallOption]
    Set !G:DebugOutputControl = 0
    set Exit_Code    = $(!SETUP_ERROR_GENERAL)
    set DrivesToFree = {}
    install LoadSetupLibrary
    ifstr(i)      $(STF_LANGUAGE)  == ""
        goto end
    else-ifstr(i) $(OPTION)        == ""
        goto end
    else-ifstr(i) $(ADDCOPY)       == ""
        goto end
    else-ifstr(i) $(DOCOPY)        == ""
        goto end
    else-ifstr(i) $(DOCONFIG)      == ""
        goto end
    endif
    read-syms PlatformID
    read-syms ProductType
    ifstr(i) $(STF_PLATFORM) == $(PlatformID_I386)
        set STF_PRNPLATFORM = "w32x86"
        set STF_PRNENVIRONM = "Windows NT x86"
    else-ifstr(i) $(STF_PLATFORM) == $(PlatformID_Mips)
        set STF_PRNPLATFORM = "w32mips"
        set STF_PRNENVIRONM = "Windows NT R4000"
    else-ifstr(i) $(STF_PLATFORM) == $(PlatformID_PPC)
        set STF_PRNPLATFORM = "w32ppc"
        set STF_PRNENVIRONM = "Windows NT PowerPC"
    else-ifstr(i) $(STF_PLATFORM) == $(PlatformID_Alpha)
        set STF_PRNPLATFORM = "w32alpha"
        set STF_PRNENVIRONM = "Windows NT Alpha_AXP"
    else
        goto end
    endif
    read-syms UiVars
    detect    UiVars
    read-syms Strings$(STF_LANGUAGE)

    ifstr(i) $(STF_SRCDIR) != $(STF_CWDDIR)
        goto skip_asksource
    endif
    set STF_SRCDIR = A:\

    shell "registry.inf" GetNTSource
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
    else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
    else
        set STF_SRCDIR = $($R1)
    endif
    read-syms LexmarkVars
    debug-output $(OPTION)
    Split-String $(STF_SRCDIR) "\" SrcDirList
    set TestItem = *( $(SrcDirList), 3 )
    ifstr(i) $(TestItem) == $(STF_PLATFORM)
       set STF_SRCDIR = *( $(SrcDirList), 1 )"\"
    endif
    set TempSrcDir = $(STF_SRCDIR)"LexmarkBackSlashTest"
    Split-String $(TempSrcDir) "\" SrcDirList
    QueryListSize ListSize $(SrcDirList)
    set TestItem = *( $(SrcDirList), $(ListSize) )
    ifstr(i) $(TestItem) != "LexmarkBackSlashTest"
       set STF_SRCDIR = $(STF_SRCDIR)"\"
    endif
    ifstr(i) $(OPTION) == $(LexDLCOption)
       ifstr(i) $(STF_PLATFORM) == $(PlatformID_I386)
          set STF_SRCDIR = $(STF_SRCDIR)$(LexSrcDir)"\x86\"
       else
          set STF_SRCDIR = $(STF_SRCDIR)$(LexSrcDir)"\"$(STF_PLATFORM)"\"
       endif
       set LexmarkFile = $(STF_SRCDIR)$(LexDLCFile)
       debug-output $(STF_SRCDIR)
       debug-output $(LexmarkFile)
       LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(LexmarkFile)
       ifstr(i) $(STATUS) == YES
          debug-output $(LexmarkFile)" exists"
          goto skip_asksource
       else
          debug-output $(LexmarkFile)" does not exist"
       endif
    else-ifstr(i) $(OPTION) == $(LexIPOption)
       ifstr(i) $(STF_PLATFORM) == $(PlatformID_I386)
          set STF_SRCDIR = $(STF_SRCDIR)$(LexSrcDir)"\x86\"
       else
          set STF_SRCDIR = $(STF_SRCDIR)$(LexSrcDir)"\"$(STF_PLATFORM)"\"
       endif
       set LexmarkFile = $(STF_SRCDIR)$(LexIPFile)
       debug-output $(STF_SRCDIR)
       debug-output $(LexmarkFile)
       LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(LexmarkFile)
       ifstr(i) $(STATUS) == YES
          debug-output $(LexmarkFile)" exists"
          goto skip_asksource
       else
          debug-output $(LexmarkFile)" does not exist"
       endif
    endif
    shell "subroutn.inf" DoAskSource $(STF_SRCDIR)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        Debug-Output "shelling DoAskSource failed"
        goto end
    endif
    ifstr(i) $($R0) == STATUS_SUCCESSFUL
        set STF_SRCDIR  = $($R1)
        ifstr(i) $($R2) != ""
            set DrivesToFree = >($(DrivesToFree), $($R2))
        endif
    else
        goto end
    endif
skip_asksource = +
    LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(STF_PRNMONITORPATH)
    ifstr(i) $(IsFullPath) == "NO"
        LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(STF_PRNMONITORPATH)
        ifstr(i) $(STATUS) == "ERROR"
            shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
            goto end
        else-ifstr(i) $(STATUS) == "NOT-UNC"
            shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
            goto end
        else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT"
            shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
            goto end
        else
            set STF_PRNMONITORPATH = $(STATUS)
        endif
    endif

    shell "" InstallOption $(STF_LANGUAGE) $(OPTION) $(STF_SRCDIR) $(ADDCOPY) $(DOCOPY) $(DOCONFIG)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        Debug-Output "Execing InstallOption failed"
        goto end
    endif
    ifstr(i) $($R0) == STATUS_SUCCESSFUL
        set Exit_Code = $(!SETUP_ERROR_SUCCESS)
    else-ifstr(i) $($R0) == STATUS_USERCANCEL
        set Exit_Code = $(!SETUP_ERROR_USERCANCEL)
    endif
end =+
    ForListDo $(DrivesToFree)
        LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
    EndForListDo
    install   FreeSetupLibrary
    exit
;*************************************************************************
;  end of section ExternalInstallOption
;*************************************************************************


;*************************************************************************
;
;     SECTION:   LoadSetupLibrary
;
;     PURPOSE:   This section loads the setup library
;
;*************************************************************************
[LoadSetupLibrary]
    LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
    exit
;*************************************************************************
;  end of section LoadSetupLibrary
;*************************************************************************


;*************************************************************************
;
;     SECTION:   FreeSetupLibrary
;
;     PURPOSE:   This section frees the setup library
;
;*************************************************************************
[FreeSetupLibrary]
    FreeLibrary $(!LIBHANDLE)
    exit
;*************************************************************************
;  end of section FreeSetupLibrary
;*************************************************************************


;*************************************************************************
;
;     SECTION:   PlatformID
;
;     PURPOSE:   This section provides the list of supported CPU
;                chip sets
;
;*************************************************************************
[PlatformID]
    PlatformID_PPC = ppc
    PlatformID_I386 = I386
    PlatformID_Mips = Mips
    PlatformID_Alpha  = Alpha
;*************************************************************************
;  end of section PlatformID
;*************************************************************************


;*************************************************************************
;
;     SECTION:   UiVars
;
;     PURPOSE:   This section provides system environment based variables
;
;*************************************************************************
[UiVars]
    STF_CONTROLSET     = CurrentControlSet
    STF_WINDOWSPATH    = "" ? $(!LIBHANDLE) GetWindowsNtDir
    STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
    STF_PRNMONITORPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
;*************************************************************************
;  end of section UiVars
;*************************************************************************


;*************************************************************************
;
;     SECTION:   LexmarkVars
;
;     PURPOSE:   This section provides an example of how to setup
;                product unique variables
;
;*************************************************************************
[LexmarkVars]
   LexDLCOption = "Lexmark DLC Network Port"
   LexDLCFile   = "lexmon.dll"
   LexIPOption  = "Lexmark TCP/IP Network Port"
   LexIPFile    = "lexlmpm.dll"
   LexSrcDir    = "drvlib\print\lexmark"
;*************************************************************************
;  end of section LexmarkVars
;*************************************************************************


;*************************************************************************
;
;     SECTION:   PrinterMonitorsWithHelp
;
;     PURPOSE:   This section provides an example of how to setup
;                product that supplies help files
;
;*************************************************************************
[PrinterMonitorsWithHelp]
   decpsmon
   lexmon
;*************************************************************************
;  end of section PrinterMonitorsWithHelp
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Source Media Descriptions
;
;     PURPOSE:   This section defines where to find source media software
;                1 is for the workstation CD-ROM
;                2 is for the Setup diskette
;
;*************************************************************************
[Source Media Descriptions]
    1 = "Windows NT Workstation CD-ROM" , TAGFILE = cdrom_w.40
    2 = "Setup Diskette" , TAGFILE = \*.*
;*************************************************************************
;  end of section Source Media Descriptions
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Signature
;
;     PURPOSE:   This section provides file type
;
;*************************************************************************
[Signature]
    FileType = MICROSOFT_FILE
;*************************************************************************
;  end of section Signature
;*************************************************************************


;*************************************************************************
;
;     SECTION:   GetSignature
;
;     PURPOSE:   This section returns the file type to the caller
;
;*************************************************************************
[GetSignature]
    read-syms Signature
    return $(FileType)
;*************************************************************************
;  end of section GetSignature
;*************************************************************************


;*************************************************************************
;
;     SECTION:   ProductType
;
;     PURPOSE:   This section product type definitions
;
;*************************************************************************
[ProductType]
STF_PRODUCT  = Winnt
STF_PLATFORM = I386
;*************************************************************************
;  end of section ProductType
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Files-EKPSCS2A
;
;     PURPOSE:   This section provides the definition for the Service
;                software to be installed to support the printer monitor
;
;*************************************************************************
[Files-EKPSCS2A]
;;;EKSWDR03 =  2,EKSWDR03.SYS , SIZE=999
;*************************************************************************
;  end of section Files-EKPSCS2A
;*************************************************************************


;*************************************************************************
;
;     SECTION:   Files-lexlmpm
;
;     PURPOSE:   This section provides an example of listing software
;                located on the Windows NT workstation CD-ROM
;
;*************************************************************************
[Files-lexlmpm]
1,LEXBCE.DLL , SIZE=999
1,LEXBCELM.DLL , SIZE=999
1,LEXIP32.DLL , SIZE=999
1,LEXLL32.DLL , SIZE=999
1,LEXNETUI.CNT , SIZE=999
1,LEXNETUI.DLL , SIZE=999
1,LEXNETUI.HLP , SIZE=999
1,LEXSTART.EXE , SIZE=999
1,MVFILES.LST , SIZE=999
1,MVNTINST.DLL , SIZE=999
1,MVUNINST.EXE , SIZE=999
;*************************************************************************
;  end of section Files-lexlmpm
;*************************************************************************

;*************************************************************************
;
;     SECTION:   Files-lexmon
;
;     PURPOSE:   This section provides an additional example of listing
;                software located on the Windows NT workstation CD-ROM
;
;*************************************************************************
[Files-lexmon]
1,INTERACT.DLL , SIZE=999
1,INTERACT.EXE , SIZE=999
1,INTERACT.HLP , SIZE=999
1,LEXCFG.CPL , SIZE=999
1,LEXCFG.HLP , SIZE=999
1,LEXLANG.DLL , SIZE=999
;*************************************************************************
;  end of section Files-lexmon
;*************************************************************************

;*************************************************************************
;
;     SECTION:   Files-MarkVision
;
;     PURPOSE:   This section provides an additional example of listing
;                software located on the Windows NT workstation CD-ROM
;
;*************************************************************************
[Files-MarkVision]
1,AGGUIDLL.DLL , SIZE=999
1,AGPRTGUI.DLL , SIZE=999
1,CDCF.WAV     , SIZE=999
1,COMMON.DLL   , SIZE=999
1,CPEF.WAV     , SIZE=999
1,CPF.WAV      , SIZE=999
1,CPJF.WAV     , SIZE=999
1,DEFAULTS.PSF , SIZE=999
1,DFF.WAV      , SIZE=999
1,FFF.WAV      , SIZE=999
1,LEXMV95.HLP  , SIZE=999
1,LPEF.WAV     , SIZE=999
1,MARKVIS.CNT  , SIZE=999
1,MARKVIS.EXE  , SIZE=999
1,MARKVIS.HLP  , SIZE=999
1,MFF.WAV      , SIZE=999
1,MVGUIDLL.DLL , SIZE=999
1,MVPO_SUN.DLL , SIZE=999
1,MVPO_WRI.DLL , SIZE=999
1,MVPRM.DLL    , SIZE=999
1,MVPRTGUI.DLL , SIZE=999
1,MVPRTMGR.DLL , SIZE=999
1,MVPRTOBJ.DLL , SIZE=999
1,MVRESDLL.DLL , SIZE=999
1,OBFF.WAV     , SIZE=999
1,OPTRADEF.PSF , SIZE=999
1,OPTRAE.HLP   , SIZE=999
1,OPTRCDEF.PSF , SIZE=999
1,OPTRPDEF.PSF , SIZE=999
1,PNUIF.WAV    , SIZE=999
1,PRINTREE.DLL , SIZE=999
1,RESOURCE.HLP , SIZE=999
1,RPSF.WAV     , SIZE=999
1,RTCF.WAV     , SIZE=999
1,SFGUIDLL.DLL , SIZE=999
1,SFPRTGUI.DLL , SIZE=999
1,SPF.WAV      , SIZE=999
1,TCOF.WAV     , SIZE=999
1,TYF.WAV      , SIZE=999
1,VERIFY.TXT   , SIZE=999
;*************************************************************************
;  end of section Files-MarkVision
;*************************************************************************

;*************************************************************************
;
;     SECTION:   Files-PrinterMonitor
;
;     PURPOSE:   This section describes where to find the printer monitor
;                software which will be installed
;
;*************************************************************************
[Files-PrinterMonitor]
decpsmon = 1,DECPSMON.DLL , SIZE=999
hpmon = 1,HPMON.DLL , SIZE=999
lexlmpm = 1,LEXLMPM.DLL , SIZE=999
lexmon = 1,LEXMON.DLL , SIZE=999
localmon = 1,LOCALMON.DLL , SIZE=999
scsimon = 1,SCSIMON.DLL , SIZE=999
bitmon = 1,BITMON.DLL , SIZE=999
EKPSCS2A = 2,EKPSCS2A.DLL , SIZE=999
;*************************************************************************
;  end of section Files-PrinterMonitor
;*************************************************************************

;*************************************************************************
;
;     SECTION:   Files-PrinterMonitorHelp
;
;     PURPOSE:   This section describes where to find monitor help files 
;                to be installed
;
;*************************************************************************
[Files-PrinterMonitorHelp]
decpsmon = 1,DECPSMON.HLP , SIZE=441716
hpmon = 1,HPMON.HLP , SIZE=999
lexmon = 1,LEXMON.HLP , SIZE=999
;*************************************************************************
;  end of section Files-PrinterMonitorHelp
;*************************************************************************

;*************************************************************************
;
;     SECTION:   LanguagesSupported
;
;     PURPOSE:   This section lists the languages supported by the monitor
;                which is being installed
;
;*************************************************************************
[LanguagesSupported]
    ENG
;*************************************************************************
;  end of section LanguagesSupported
;*************************************************************************

;*************************************************************************
;
;     SECTION:   OptionsTextENG
;
;     PURPOSE:   This section provides the strings used for english 
;                translations.  Each language supported must provide
;                an OptionText<language>
;
;     Comment:   This section maybe localized
;
;*************************************************************************
[OptionsTextENG]
"Local Port"                    = "Local Port"
"Digital Network Port"          = "Digital Network Port"
"Lexmark DLC Network Port"     	= "Lexmark DLC Network Port"
"Lexmark TCP/IP Network Port"  	= "Lexmark TCP/IP Network Port"
"SCSI Port"                    	= "SCSI Port"
"Kodak ECP1 Port"               = "Kodak ECP1 Port"
"BitBucket Port"                = "Bitbucket Port"
;*************************************************************************
;  end of section OptionsTextENG
;*************************************************************************

;*************************************************************************
;
;     SECTION:   StringsENG
;
;     PURPOSE:   This section provides the strings used for english 
;                based dialog boxes.  Each language supported must provide
;                a Strings<language>
;
;     Comment:   This section maybe localized
;
;*************************************************************************
[StringsENG]
    String1 = "The monitor "
    String2 = " is already installed."
    String3 = "Failed to connect to the print server."
    String4 = "The monitor files for the selected monitor "
    String5 = " couldn't be copied.  Failed to install the monitor."
    String6 = "Access is denied. You must be logged on as a member of the Administrators "+
              "group to carry out this operation."
    String7 = " could not be installed."
;*************************************************************************
;  end of section StringsENG
;*************************************************************************

;*************************************************************************
;
;     SECTION:   ProgressCopyENG
;
;     PURPOSE:   This section provides the strings used for english 
;                based dialog boxes.  Each language supported must provide
;                a ProgressCopy<language>
;
;     Comment:   This section maybe localized
;
;*************************************************************************
[ProgressCopyENG]
    ProCaption   = "Windows NT Setup"
    ProCancel    = "Cancel"
    ProCancelMsg = "Windows NT is not correctly installed.  "+
                   "Are you sure you want to cancel copying files?"
    ProCancelCap = "Setup Message"
    ProText1     = "Copying:"
    ProText2     = "To:"
;*************************************************************************
;  end of section ProgressCopyENG
;*************************************************************************

;*************************************************************************
;
;     SECTION:   RegistryErrorString
;
;     PURPOSE:   Translate a numeric registry error code into a string
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0     Registry error code
;
;     RETURNS:   $R0    String containing displayable text in language
;
;  REFERENCES:   !STF_LANGUAGE  -- global "user's language"  variable;
;                               see [RegistryErrorSetup]
;
;    MODIFIES:   Nothing
;
;
;*************************************************************************
[RegistryErrorString]

     read-syms RegistryErrorSetup
     read-syms RegistryErrorUnknown$(!STF_LANGUAGE)

     set RE_String = *($(RegistryErrorList),~($(RegistryErrorIndex),$($0)))

     Ifstr $(RE_String) == ""
        set RE_String = $(Error_Bogus)
     endif

     return $(RE_String)

;*************************************************************************
;  end of section RegistryErrorString
;*************************************************************************

;*************************************************************************
;
;     SECTION:   BaseServiceKey
;
;     PURPOSE:   Return an open key handle to the top of the services tree
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   none
;
;     RETURNS:   $R0    Registry error code
;                $R1    Registry key variable for SERVICES0
;
;  REFERENCES:   Nothing
;
;    MODIFIES:   Nothing
;
;*************************************************************************
[BaseServiceKey]
    read-syms InitBaseVars
    set BS_KeyServices = ""

    OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName) $(MAXIMUM_ALLOWED) BS_KeyServices

    Ifstr $(BS_KeyServices) == $(KeyNull)
       Debug-Output " could not open Services base key"
       set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
    endif

B_S_Return = +
    return $(RegistryErrorIndex), $(BS_KeyServices)

;*************************************************************************
;
;     SECTION:   ReduceInfPath
;
;     PURPOSE:   Process the path\name string to an INF file.  If
;                its path points to STF_WINDOWSSYSPATH, remove the path prefix.
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0     Path\name to INF file
;
;     RETURNS:   $R0    Resulting string
;
;  REFERENCES:   Nothing
;
;    MODIFIES:   Nothing
;
;*************************************************************************
[ReduceInfPath]
    Set RIP_Result = $($0)

    Split-String $(RIP_Result) "\" InList
    Set BasePath = $(!STF_WINDOWSSYSPATH)"\"
    Split-String $(BasePath) "\" BaseList

    ;
    ;   See how many of the path elements match
    ;

    Set Indx = 0
    Set Matched = 0
    QueryListSize InListSize, $(InList)
    ForListDo $(BaseList)
        Set-add Indx = $(Indx),1
        Ifint $(Indx) <= $(InListSize)
            Set Instr = *($(InList),$(Indx))
            Ifstr(i) $($) == $(Instr)
                Set-add Matched = $(Matched),1
            Endif
        Endif
    EndForListDo

    ;
    ;   If all the path elements of the input path matched
    ;   those of STF_WINDOWSSYSPATH, strip them off of the result.
    ;

    Ifint $(Indx) == $(Matched)
        Set RIP_Result = ""
        Set Indx2 = 0
        ForListDo $(InList)
            Set-add Indx2 = $(Indx2),1
            Ifint $(Indx2) > $(Indx)
                Set RIP_Result = $(RIP_Result)$($)
            Endif
        EndForListDo
    Endif

    Return $(RIP_Result)

;*************************************************************************
;  end of section ReduceInfPath
;*************************************************************************

;*************************************************************************
;
;     SECTION:  InstallSoftwareProduct
;
;     PURPOSE:  Add a new component into the Registry
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:  $0   name of Manufacturer
;               $1   name of Product
;               $2   full INF path and name
;
;    RETURNS:   $R0  error code or zero if no error
;               $R1  Registry key variable for
;                      SOFTWARE\Manufacturer\Product\Version key
;               $R2  Registry key variable for
;                      ...\NetRules
;
;  REFERENCES:  none
;
;    MODIFIES:  none
;
;*************************************************************************

[InstallSoftwareProduct]
    read-syms InitBaseVars

    set IS_MfgName  = $($0)
    set IS_ProdName = $($1)
    set IS_Infname  = $($2)
    set IS_KeySoftware = ""
    set IS_KeyMfg = ""
    set IS_KeyProduct = ""
    set IS_KeyVersion = ""
    set IS_KeyNetRules = ""
    set IS_MfgCreated = 1
    set IS_ProductCreated = 1
;
;   Validate the arguments passed in
;
    set RegistryErrorIndex = INVALID_DATA_PASSED

    Ifstr(i) $(IS_MfgName) == ""
       goto I_S_Return
    endif
    Ifstr(i) $(IS_ProdName) == ""
       goto I_S_Return
    endif

    set RegistryErrorIndex = NO_ERROR
;
;   Open the HKEY_LOCAL_MACHINE\SOFTWARE key
;
    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase) $(MAXIMUM_ALLOWED) IS_KeySoftware

    Ifstr $(IS_KeySoftware) == $(KeyNull)
       set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
       goto I_S_Return
    endif
;
;   Create the Manufacturer's key if necessary
;
    CreateRegKey $(IS_KeySoftware) {$(IS_MfgName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyMfg
    Ifstr $(IS_KeyMfg) == $(KeyNull)
       set IS_MfgCreated = 0
       OpenRegKey $(IS_KeySoftware) "" $(IS_MfgName) $(MAXIMUM_ALLOWED) IS_KeyMfg
       Ifstr $(IS_KeyMfg) == $(KeyNull)
          set RegistryErrorIndex = UNABLE_OPEN_MICROSOFT_KEY
          goto I_S_Return
       endif
    endif
;
;   Create the Software Product key if necessary
;
    CreateRegKey $(IS_KeyMfg) {$(IS_ProdName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyProduct
    Ifstr $(IS_KeyProduct) == $(KeyNull)
       set IS_ProductCreated = 0
       OpenRegKey $(IS_KeyMfg) "" $(IS_ProdName) $(MAXIMUM_ALLOWED) IS_KeyProduct
       Ifstr $(IS_KeyProduct) == $(KeyNull)
          set RegistryErrorIndex = UNABLE_CREATE_PRODUCT_KEY
          goto I_S_Return
       endif
    endif
;
;   Create the software product version key.
;
    CreateRegKey $(IS_KeyProduct) {"CurrentVersion",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyVersion
    Ifstr $(IS_KeyVersion) == $(KeyNull)
       OpenRegKey $(IS_KeyProduct) "" "CurrentVersion" $(MAXIMUM_ALLOWED) IS_KeyVersion
       Ifstr $(IS_KeyVersion) == $(KeyNull)
          set RegistryErrorIndex = UNABLE_CREATE_PRODUCT_VERSION
          goto I_S_Return
       endif
    endif

    set RegistryErrorIndex = NO_ERROR
;
;   Create the NetRules key
;
    CreateRegKey $(IS_KeyVersion) {NetRules,$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" IS_KeyNetRules
    Ifstr $(IS_KeyNetRules) == $(KeyNull)
       OpenRegKey $(IS_KeyVersion) "" NetRules $(MAXIMUM_ALLOWED) IS_KeyNetRules
       Ifstr $(IS_KeyNetRules) == $(KeyNull)
          set RegistryErrorIndex = UNABLE_CREATE_NETRULES_KEY
          goto I_S_Return
       endif
    endif
;
;   Set the "Infname" value if non-null; reduce it if it's in %SystemRoot%
;
    Ifstr $(IS_Infname) != ""
       Shell "", ReduceInfPath, $(IS_Infname)
       SetRegValue $(IS_KeyNetRules) {InfName,$(NoTitle),$(!REG_VT_SZ),$($R0)}
    endif

;
;  Exit, leaving $(IS_KeyVersion) and $(IS_KeyNetRules) open for the caller...
;
I_S_Return = +
    Ifstr $(IS_KeyProduct) != ""
        Ifint $(IS_ProductCreated) == 1
           Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
              Debug-Output " DeleteRegTree Product Key"
              ;DeleteRegTree $(IS_KeyProduct) ""
              set IS_KeyProduct = ""
           endif
        endif
        Ifstr $(IS_KeyProduct) != ""
           CloseRegKey $(IS_KeyProduct)
        endif
    endif
    Ifstr $(IS_KeyMfg) != ""
        Ifint $(IS_MfgCreated) == 1
           Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
              ;DeleteRegTree $(IS_KeyMfg) ""
              Debug-Output " DeleteRegTree Manufacturer Key"
              set IS_KeyMfg = ""
           endif
        endif
        Ifstr $(IS_KeyMfg) != ""
           CloseRegKey $(IS_KeyMfg)
        endif
    endif
    Ifstr $(IS_KeySoftware) != ""
        CloseRegKey $(IS_KeySoftware)
    endif
    return $(RegistryErrorIndex), $(IS_KeyVersion), $(IS_KeyNetRules)

;*************************************************************************
;  end of section InstallSoftwareProduct
;*************************************************************************

;*************************************************************************
;
;     SECTION:   AddValueList
;
;     PURPOSE:   Given a nested list of value items, add each to the given
;                key.   Key is left open.
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0    Registry key handle
;                $1    List of value items; for example:
;                          { {ValueName1,0,$(!REG_VT_SZ),$(ValueData1)}, +
;                            {ValueName2,0,$(!REG_VT_SZ),$(ValueData2)} }
;
;     RETURNS:   $R0   Registry error code.
;
;
;  REFERENCES:   Nothing
;
;    MODIFIES:   Nothing
;
;*************************************************************************
[AddValueList]
   set RegistryErrorIndex = NO_ERROR

   ForListDo $($1)
       SetRegValue $($0) $($)
       ifint $(RegLastError) != 0
          Debug-Output " Value write fail data: "$($)
          Debug-Output " Value write fail key: "$($0)
          return UNABLE_WRITE_REGISTRY
       endif
   EndForListDo

   return $(RegistryErrorIndex)

;*************************************************************************
;  end of section AddValueList
;*************************************************************************

;*************************************************************************
;
;     SECTION:   DeleteSoftwareProduct
;
;     PURPOSE:   Delete the given product from the Registry entirely
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0     Product Key Handle
;
;     RETURNS:   $R0    Registry error code
;                $R1
;
;  REFERENCES:   Nothing
;
;    MODIFIES:   Nothing
;
;*************************************************************************
[DeleteSoftwareProduct]

   set RegistryErrorIndex = NO_ERROR

   Debug-Output " DeleteRegTree Software Product"
   DeleteRegTree $($0) ""

   return $(RegistryErrorIndex)

;*************************************************************************
;  end of section DeleteSoftwareProduct
;*************************************************************************

;*************************************************************************
;
;     SECTION:   CreatePrinterService
;
;     PURPOSE:   Create the Printer Services area entry for 
;                a new printer interface
;
;   ARGUMENTS:   $0     Name of the service (no imbedded blanks, etc.)
;                $1     Display Name of service
;                $2     image path string
;                $3     error control [Optional]
;                $4     start value [Optional]
;                $5     product type [Optional]
;                $6     LPT1 DMA Value [Optional]
;                $7     LPT2 DMA Value [Optional]
;                $8     LPT3 DMA Value [Optional]
;                $9     Security Parameters [Optional]
;
;
;     RETURNS:   $R0    Registry error code
;                $R1    Service area key handle
;                $R2    Parameters key handle
;                $R2    Security key handle
;
;  REFERENCES:   None
;
;    MODIFIES:   None
;
;       NOTES:   The Registry is automatically used.
;
;                The image path format varies for drivers and other
;                services.  For drivers of any kind, it's an NT name space
;                name.  For services, it's a REG_EXPAND_SZ format Win32 name.
;
;*************************************************************************
[CreatePrinterService]
    read-syms InitBaseVars

    set CS_NameOfService = $($0)
    set CS_DisplayName   = $($1)
    set CS_ImagePath     = $($2)
    set CS_ErrorControl  = $($3)
    ifstr(i) $(CS_ErrorControl) == ""
        set CS_ErrorControl = 1
    endif
    set CS_StartValue    = $($4)
    ifstr(i) $(CS_StartValue) == ""
        set CS_StartValue = 2
    endif
    set CS_TypeOfProduct = $($5)
    ifstr(i) $(CS_TypeOfProduct) == ""
        set CS_TypeOfProduct = 1
    endif
    set CS_LPT1Value     = $($6)
    ifstr(i) $(CS_LPT1Value) == ""
        set CS_LPT1Value = 3
    endif
    set CS_LPT2Value     = $($7)
    ifstr(i) $(CS_LPT2Value) == ""
        set CS_LPT1Value = 3
    endif
    set CS_LPT3Value     = $($8)
    ifstr(i) $(CS_LPT3Value) == ""
        set CS_LPT1Value = 3
    endif
    set CS_SecurityParameters = $($9)

    set CS_KeyServices   = ""
    set CS_KeyService    = ""
    set CS_KeyTempSvc    = ""
    set CS_KeySvcManager = ""
    set CS_KeyParameters = ""
    set CS_KeySecurity   = ""
    set CS_UseRegistry = "YES"     ; Always use the Registry for Printer Services

    Debug-Output " [CreatePrinterService] entered for "$(CS_NameOfService)

    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", "CreatePrinterService"

;
;  Get the base key handle for the services area if not passed in
;
    Ifstr(i) $(CS_KeyServices) == ""
        Shell "", BaseServiceKey
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
           set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
           goto C_S_Return
        endif

        set CS_KeyServices = $($R1)
        set CS_KeyServicesOpened = $($R1)
    Endif

;
;  Try to open the Printer service
;
    OpenRegKey $(CS_KeyServices) "" $(CS_NameOfService) $(MAXIMUM_ALLOWED) +
        CS_KeyTempSvc

    ifstr(i) $(CS_UseRegistry) == "YES"
        ;
        ; We take this path when we use the Registry for Service support
        ;
        Debug-Output " [CreatePrinterService] "$(CS_NameOfService)" using Registry"
        ;
        ; Create our own service
        ;
        ifstr(i) $(CS_KeyTempSvc) == $(KeyNull)
           CreateRegKey $(CS_KeyServices) {$(CS_NameOfService),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyTempSvc
        else
           Debug-Output " service key "$(CS_NameOfService)" already existed"
           Set RegistryErrorIndex = UNABLE_CREATE_CONFIGURE_SERVICE
           CloseRegKey $(CS_KeyTempSvc)
           Goto C_S_Return
        endif

        Ifstr(i) $(CS_KeyTempSvc) == $(KeyNull)

           Debug-Output " could not create service key "$(CS_NameOfService)
           Set RegistryErrorIndex = UNABLE_CREATE_CONFIGURE_SERVICE
           CloseRegKey $(CS_KeyTempSvc)
           Goto C_S_Return
        else
            set NewValueList = {+
                               {DisplayName,$(NoTitle),$(!REG_VT_SZ),$(CS_DisplayName)},+
                               {ErrorControl,$(NoTitle),$(!REG_VT_DWORD),$(CS_ErrorControl)},+
                               {ImagePath,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(CS_ImagePath)},+
                               {Start,$(NoTitle),$(!REG_VT_DWORD),$(CS_StartValue)},+
                               {Type,$(NoTitle),$(!REG_VT_DWORD),$(CS_TypeOfProduct)},+
                               }
            Shell "", AddValueList, $(CS_KeyTempSvc), $(NewValueList)

    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", "AddValueList"
        endif
    else
        ;
        ; We take this path if we are not using the Registry for Service support
        ; This branch is left for future use
        ;
        Debug-Output " [CreatePrinterService] "$(CS_NameOfService)" using CreatePrinterService() wrapper"
    endif

;
;   Open or Create the Parameters subkey
;
    CreateRegKey $(CS_KeyTempSvc) {"Parameters",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyParameters
    ifstr $(CS_KeyParameters) == $(KeyNull)
        ;
        ;Parameters already exist - So open it instead
        ;
        OpenRegKey $(CS_KeyTempSvc) "" "Parameters" $(MAXIMUM_ALLOWED) + CS_KeyParameters
    endif

    Ifstr $(CS_KeyParameters) == $(KeyNull)
        ;
        ; Failed to open or create Parameters
        ;
        set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
        CloseRegKey $(CS_KeyTempSvc)
        goto C_S_Return
    else
        ;
        ; Created or Opened Parameters
        ;
       Ifstr(i) $(CS_LPT1Value) != ""
          ;
          ;Process LPT1 DMA value which was supplied
          ;
          ; Open or Create the LPT1 subkey
          ;
          CreateRegKey $(CS_KeyParameters) {"LPT1",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyService
          ifstr $(CS_KeyService) == $(KeyNull)
              OpenRegKey $(CS_KeyTempSvc) "" "LPT1" $(MAXIMUM_ALLOWED) "" CS_KeyService
          endif

          Ifstr $(CS_KeyService) == $(KeyNull)
             set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
             CloseRegKey $(CS_KeyParameters)
             CloseRegKey $(CS_KeyTempSvc)
             goto C_S_Return
          else
             ;
             ; Store DMA value
             ;
             SetRegValue $(CS_KeyService) {DMA,$(NoTitle),$(!REG_VT_DWORD),$(CS_LPT1Value)}
          endif
       endif

       Ifstr(i) $(CS_LPT2Value) != ""
          ;
          ;Process LPT2 DMA value which was supplied
          ;
          ; Open or Create the LPT2 subkey
          ;
          CreateRegKey $(CS_KeyParameters) {"LPT2",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyService
          ifstr $(CS_KeyService) == $(KeyNull)
              OpenRegKey $(CS_KeyTempSvc) "" "LPT2" $(MAXIMUM_ALLOWED) "" CS_KeyService
          endif

          Ifstr $(CS_KeyService) == $(KeyNull)
             set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
             CloseRegKey $(CS_KeyParameters)
             CloseRegKey $(CS_KeyTempSvc)
             goto C_S_Return
          else
             ;
             ; Store DMA value
             ;
             SetRegValue $(CS_KeyService) {DMA,$(NoTitle),$(!REG_VT_DWORD),$(CS_LPT2Value)}
          endif
       endif

       Ifstr(i) $(CS_LPT3Value) != ""
          ;
          ;Process LPT3 DMA value which was supplied
          ;
          ; Open or Create the LPT3 subkey
          ;
          CreateRegKey $(CS_KeyParameters) {"LPT3",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyService
          ifstr $(CS_KeyService) == $(KeyNull)
              OpenRegKey $(CS_KeyTempSvc) "" "LPT3" $(MAXIMUM_ALLOWED) "" CS_KeyService
          endif

          Ifstr $(CS_KeyService) == $(KeyNull)
             set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
             CloseRegKey $(CS_KeyParameters)
             CloseRegKey $(CS_KeyTempSvc)
             goto C_S_Return
          else
             ;
             ; Store DMA value
             ;
             SetRegValue $(CS_KeyService) {DMA,$(NoTitle),$(!REG_VT_DWORD),$(CS_LPT3Value)}
          endif
       endif
    endif
;
;   Open or Create the Security subkey
;
    CreateRegKey $(CS_KeyTempSvc) {"Security",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeySecurity
    Ifstr $(CS_KeySecurity) == $(KeyNull)
        ;
        ;Security already exist - So open it instead
        ;
        OpenRegKey $(CS_KeyTempSvc) "" "Security" $(MAXIMUM_ALLOWED) CS_KeySecurity
    Endif

    Ifstr $(CS_KeySecurity) == $(KeyNull)
        ;
        ; Failed to open or create Security key
        ;
       set RegistryErrorIndex = UNABLE_CREATE_SERVICE_SUBKEY
       CloseRegKey $(CS_KeyTempSvc)
       goto C_S_Return
    else
       Ifstr(i) $(CS_SecurityParameters) != ""
          ;
          ;Process Security Parameter values which was supplied
          ;
          SetRegValue $(CS_KeySecurity) {Security,$(NoTitle),$(!REG_VT_BIN),$(CS_SecurityParameters)}
       endif
    endif

    set RegistryErrorIndex = NO_ERROR
;
; Return the keys and error codes
;
C_S_Return = +
    ; Only close the services key if it was opened in this routine.
    Ifstr $(CS_KeyServicesOpened) != $(KeyNull)
        CloseRegKey $(CS_KeyServices)
    endif
    return $(RegistryErrorIndex), $(CS_KeyTempSvc), $(CS_KeyParameters), $(CS_KeySecurity)

;*************************************************************************
;  end of section CreatePrinterService
;*************************************************************************

;*************************************************************************
;
;     SECTION:   FindService
;
;     PURPOSE:   Given a hardware or software component key handle,
;                return a key handle to the corresponding Service entry
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0   Registry key handle to primary component
;                $1   type of component (adapter, etc.)
;
;     RETURNS:   $R0  Registry error code
;                $R1  Registry key handle for Service area
;                $R2  Registry key handle for Parameters subkey
;
;  REFERENCES:   Nothing
;
;    MODIFIES:   Nothing
;
;
;*************************************************************************
[FindService]
    read-syms InitBaseVars

    set FS_KeyThisService = ""
    set FS_KeyParameters  = ""
    set FS_KeyComponent   = $($0)
    set FS_TypeComponent  = $($1)

    Shell "", BaseServiceKey

    set FS_KeyServices = $($R1)
    set RegistryErrorIndex = $($R0)

    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
       goto F_S_Return
    endif
;
;  Obtain the all the values for the component key.
;
    EnumRegValue $(FS_KeyComponent) FS_ValueList

; BUGBUG:  Check RegLastError

    set FS_SvcName = ""

    ForListDo $(FS_ValueList)
        set FS_ValueName = *($($),1)
        Ifstr(i) $(FS_ValueName) == ServiceName
            set FS_SvcName = *($($),4)
            goto F_S_Break1
        endif
    EndForListDo
F_S_Break1 = +

    Ifstr $(FS_SvcName) == $(KeyNull)
       set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
       goto F_S_Return
    endif

    OpenRegKey $(FS_KeyServices) "" $(FS_SvcName) $(MAXIMUM_ALLOWED) FS_KeyThisService
    Ifstr $(FS_KeyThisService) == $(KeyNull)
       set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
       goto F_S_Return
    endif

    OpenRegKey $(FS_KeyThisService) "" "Parameters" $(MAXIMUM_ALLOWED) FS_KeyParameters
    Ifstr $(FS_KeyParameters) == $(KeyNull)
       set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
       goto F_S_Return
    endif

F_S_Return = +
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
        Ifstr $(FS_KeyParameters) != $(KeyNull)
            CloseRegKey $(FS_KeyParameters)
        endif
        Ifstr $(FS_KeyThisService) != $(KeyNull)
           CloseRegKey $(FS_KeyThisService)
        endif
    endif
    return $(RegistryErrorIndex), $(FS_KeyThisService) $(FS_KeyParameters)

;*************************************************************************
;  end of section FindService
;*************************************************************************
;*************************************************************************
;
;     SECTION:   GetServiceParameters
;
;     PURPOSE:   Given a component key and type, return a list of
;                all its current parameters
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0   Registry key handle to primary component
;                $1   type of component (adapter, etc.)
;
;     RETURNS:   $R0  Registry error code
;                $R1  Registry key handle for Service area
;                $R2  Registry key handle for Parameters subkey
;                $R3  Value list of all values under Parameters subkey
;
;  REFERENCES:   Nothing
;
;    MODIFIES:   Nothing
;
;*************************************************************************
[GetServiceParameters]
    read-syms InitBaseVars
    set GP_KeyComponent = $($0)
    set GP_KeyService = ""
    set GP_KeyParameters = ""
    set GP_ValueList  = {}

    FindService $(GP_KeyComponent) $($1)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
        goto G_P_Return
    endif

    set GP_KeyService = $($R1)
    set GP_KeyParameters = $($R2)

    EnumRegValue $(GP_KeyParameters) GP_ValueList

G_P_Return = +
    return $(RegistryErrorIndex) $(GP_KeyService) $(GP_KeyParameters) $(GP_ValueList)

;*************************************************************************
;  end of section sectionname
;*************************************************************************

;*************************************************************************
;
;     SECTION:   AddSoftwareServices
;
;     PURPOSE:   Adds all the Registry information necessary for
;                a new software component.  This involves creating
;                the SERVICE area.
;
;   ARGUMENTS:   $0   service name to use (no imbedded blanks, etc.)
;                $1   Display Name for service
;                $2   ImagePath
;                $3   error control value
;                $4   start value
;                $5   product type
;                $6   LPT1 DMA value
;                $7   LPT2 DMA value
;                $8   LPT3 DMA value
;                $9   Security parameter list
;
;    RETURNS:   $R0  error code or zero if no error
;               $R1  Registry key handle for Services key
;               $R2  "Parameters" key handle for Services area
;
;  REFERENCES:  Nothing
;
;    MODIFIES:  Nothing
;
;*************************************************************************
[AddSoftwareServices]
    read-syms InitBaseVars

    set AS_SvcName       = $($0)
    set AS_DisplayName   = $($1)
    set AS_ImagePath     = $($2)
    set AS_ErrorControl  = $($3)
    set AS_StartValue    = $($4)
    set AS_ProductType   = $($5)
    set AS_LPT1Value     = $($6)
    set AS_LPT2Value     = $($7)
    set AS_LPT3Value     = $($8)
    set AS_SecurityParameters = $($9)
    set AS_KeyVersion    = ""
    set AS_KeyNetRules   = ""
    set AS_KeyService    = ""
    set AS_KeyParameters = ""
    set AS_KeyLinkage    = ""

    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", "AddSoftwareServices"

;
;   Create the Service entry for this product
;
    Shell "", CreatePrinterService,$(AS_SvcName),$(AS_DisplayName),$(AS_ImagePath),+
          $(AS_ErrorControl),$(AS_StartValue),$(AS_ProductType),$(AS_LPT1Value),+
          $(AS_LPT2Value),$(AS_LPT3Value),$(AS_SecurityParameters)

    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
       goto A_S_Return
    endif

    set AS_KeyService    = $($R1)
    set AS_KeyParameters = $($R2)
    set AS_KeySecurity   = $($R3)

A_S_Return = +
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
       Ifstr $(AS_KeyParameters) != $(KeyNull)
          CloseRegKey $(AS_KeyParameters)
       endif
       Ifstr $(AS_KeySecurity) != $(KeyNull)
          CloseRegKey $(AS_KeySecurity)
       endif
       Ifstr $(AS_KeyService) != $(KeyNull)
          CloseRegKey $(AS_KeyService)
       endif

       set AS_KeyVersion = ""
       set AS_KeyNetRules = ""
       set AS_KeyService = ""
       set AS_KeyParameters = ""
       set AS_KeyLinkage = ""

    endif
    return $(RegistryErrorIndex), $(AS_KeyService), $(AS_KeyParameters), $(AS_KeySecurity)

;*************************************************************************
;  end of section  AddSoftwareServices
;*************************************************************************

;*************************************************************************
;
;     SECTION:   AddServiceProvider
;
;     PURPOSE:   Add a Service provider entry into the registry
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0   Service provider id. i.e., tcpip
;                $1   Service provder location. i.e, c:\nt\windows\system\ntlanman.dll
;                $2   English name of the provider. i.e, NT Lan Manager
;                $3   Class number
;
;
;    RETURNS:    $R0  Registry error code or zero if no error
;
;  REFERENCES:  Nothing
;
;    MODIFIES:  Nothing
;
;*************************************************************************

[AddServiceProvider]
    read-syms InitBaseVars

    set RegistryErrorIndex = NO_ERROR

    set ClassNum = $($3)
    ifstr(i) $(ClassNum) == ""
        set ClassNum = 8
    endif

    OpenRegKey $(!REG_H_LOCAL) "" $(CurrentControlSet)"\control\ServiceProvider\order" $(MAXIMUM_ALLOWED) OrderKey
    ifstr(i) $(OrderKey) == $(KeyNull)
        CreateRegKey $(!REG_H_LOCAL) {$(CurrentControlSet)"\control\ServiceProvider\Order",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" OrderKey
        SetRegValue $(OrderKey) {ExcludedProviders,$(NoTitle),$(!REG_VT_MULTI_SZ),{}}
    endif

    GetRegValue $(OrderKey) "ProviderOrder" OrderValue
    set Order = *($(OrderValue), 4 )
    ifstr(i) $(OrderValue) == $(KeyNull)
                goto AddFirstProvider
    else-ifstr(i) $(Order) == $(KeyNull)
                goto AddFirstProvider
    else
                goto AddProvider
    endif

AddFirstProvider = +
    SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_MULTI_SZ),{$($0)}}
    goto WriteProviderInfo

AddProvider = +
    ifContains(i) $($0) in $(Order)
        ; Enable if we cannot have the same provider
        ;
        ;set RegistryErrorIndex = PROVIDER_ALREADY_EXISTED
        ;goto AddProvider_return
    else
        set Order = >($(Order),$($0))
        SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_MULTI_SZ),$(Order)}
    endif

    goto WriteProviderInfo

WriteProviderInfo = +

    CloseRegKey $(OrderKey)

    OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\"$($0)"\Serviceprovider" $(MAXIMUM_ALLOWED) ProviderKey

    Ifstr(i) $(ProviderKey) == $(KeyNull)
        CreateRegKey $(!REG_H_LOCAL) {$(ServicesBaseName)"\"$($0)"\Serviceprovider",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ProviderKey
    endif

    set NewValueList = {{Class,$(NoTitle),$(!REG_VT_DWORD),$(ClassNum)},+
                        {ProviderPath, $(NoTitle), $(!REG_VT_EXPAND_SZ), $($1)},+
                        {Name, $(NoTitle), $(!REG_VT_SZ), $($2)}}

    Shell "" AddValueList $(ProviderKey) $(NewValueList)

    CloseRegKey $(ProviderKey)

AddProvider_return = +

    return $(RegistryErrorIndex)

;*************************************************************************
;  end of section  AddServiceProvider
;*************************************************************************

;*************************************************************************
;
;     SECTION:   RemoveServiceProvider
;
;     PURPOSE:   Remove Service provider entry
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0   provider name
;
;    RETURNS:    $R0  Registry error code or zero if no error
;
;  REFERENCES:  Nothing
;
;    MODIFIES:  Nothing
;
;*************************************************************************

[RemoveServiceProvider]
    read-syms InitBaseVars

    set RegistryErrorIndex = NO_ERROR

    OpenRegKey $(!REG_H_LOCAL) "" $(CurrentControlSet)"\control\ServiceProvider\order" $(MAXIMUM_ALLOWED) OrderKey
    ifstr(i) $(OrderKey) == $(KeyNull)
        set RegistryErrorIndex = PROVIDER_ORDER_DOES_NOT_EXIST
        goto RemoveProvider_return
    endif

    GetRegValue $(OrderKey) "ProviderOrder" OrderValue
    set Order = *($(OrderValue), 4 )

    set NewOrderList = {}
    set FirstTime = TRUE
    set Found = FALSE
    ForListDo $(Order)
        ifstr(i) $($) != $($0)
            ifstr(i) $(FirstTime) == TRUE
                set FirstTime = FALSE
                set NewOrderList = {$($)}
            else
                set NewOrderList = >($(NewOrderList),$($))
            endif
        else
            set Found = TRUE
        endif
    EndForListDo

    ifstr(i) $(Found) == FALSE
        ; set RegistryErrorIndex = PROVIDER_ORDER_DOES_NOT_EXIST
        ; goto RemoveProvider_return
    else
        ifstr(i) $(NewOrderList) == {}
            set NewOrderList = ""
        endif
        SetRegValue $(OrderKey) {ProviderOrder,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NewOrderList)}
    endif

    OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)\$($0) $(MAXIMUM_ALLOWED) ProviderKey

    ifstr $(ProviderKey) != $(KeyNull)
        DeleteRegTree $(ProviderKey) "ServiceProvider"
    endif

RemoveProvider_return = +
    return $(RegistryErrorIndex)

;*************************************************************************
;
;     SECTION:   PrepareToCopy
;
;     PURPOSE:   Establish the variables required to perform
;                "CopyFilesInCopyList"
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   none
;
;     RETURNS:   $R0    STATUS_SUCCESSFUL
;
;  REFERENCES:   nothing
;
;    MODIFIES:   see [ProgressCopyEng] above for list of variables
;                modified/created in parent context.
;
;       NOTES:   Read NOTES commentary for section [DoAskSource]
;
;*************************************************************************
[PrepareToCopy]
;
; Read the progress copy symbols.
;
    Read-syms ProgressCopy$(!STF_LANGUAGE)

    Return STATUS_SUCCESSFUL

;*************************************************************************
;  end of section PrepareToCopy
;*************************************************************************

;*************************************************************************
;
;     SECTION:   RemoveSoftwareComponent
;
;     PURPOSE:   Remove the specified software component from the
;                registry. It will remove the entry in the software
;                section of the registry first. Then it will remove
;                the entry in the service section of the registry.
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0   Manufacturer Name
;                $1   Product Name
;                $2   Boolean flag for zero reference count checking
;                     ( optional. If it is defined, skip checking )
;
;
;    RETURNS:    $R0  Registry error code or zero if no error
;
;  REFERENCES:  Nothing
;
;    MODIFIES:  Nothing
;
;*************************************************************************

[RemoveSoftwareComponent]
    Debug-Output "Remove Software Component..."

    read-syms InitBaseVars

    set RS_Manufacturer = $($0)
    set RS_ProductName  = $($1)
    set RS_CheckRefCount = $($2)
    set RS_VersionNum   = "CurrentVersion"
    set RS_ManufacturerKey = $(!NTN_SoftwareBase)"\"$(RS_Manufacturer)
    set RS_ProductKey   = $(!NTN_SoftwareBase)"\"$(RS_Manufacturer)"\"$(RS_ProductName)
    set RS_ProductVerKey        = $(!NTN_SoftwareBase)"\"$(RS_Manufacturer)"\"$(RS_ProductName)"\"$(RS_VersionNum)

    set RegistryErrorIndex      = NO_ERROR

    ;
    ; Check the reference counter first
    ;
    ifstr(i) $(RS_CheckRefCount) != FALSE

        Shell "", IsRefCountEqualZero, $(RS_ProductVerKey)

        Ifstr(i) $($R0) != NO_ERROR
            Debug-Output " [RemoveSoftwareComponent] IsRefCountEqualZero returned "$($R0)
            goto RemoveSoftwareComponent_Return
        endif

        Ifint $($R1) == 0
            set RegistryErrorIndex = REF_COUNT_NOT_ZERO
            goto RemoveSoftwareComponent_Return
        endif

    endif

    ;
    ; Remove the software first
    ;

    OpenRegKey $(!REG_H_LOCAL) "" $(RS_ManufacturerKey) $(MAXIMUM_ALLOWED) ProductKey

    Ifstr $(ProductKey) == $(KeyNull)
       Debug-Output " could not open Software product key"
       set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
       goto RemoveSoftwareComponent_Return
    endif

    DeleteRegTree $(ProductKey) $(RS_ProductName)

    CloseRegKey $(ProductKey)

    ;
    ; Remove the service
    ;
    Shell "" RemoveService, $(RS_ProductName), "YES"

    Set RS_RemoveError = $($R0)
    Ifint $(RS_RemoveError) != 0
         Debug-Output " RemoveService wrapper failed, error: "$(RS_RemoveResult)
         Set RegistryErrorIndex = UNABLE_REMOVE_CONFIGURE_SERVICE
         Goto RemoveSoftwareComponent_Return
    Endif

RemoveSoftwareComponent_Return = +

    Return $(RegistryErrorIndex)

;*************************************************************************
;  end of section  RemoveSoftwareComponent
;*************************************************************************

;*************************************************************************
;
;     SECTION:   RemoveService
;
;     PURPOSE:   Remove a specified service from the registry. It is
;                called by RemoveSoftwareComponent and
;                RemoveHardwareComponent. Or, if the service is
;                created by calling "CreateService", we will
;                need to use this subroutine to remove it.
;                <unchanged from Microsoft's NDIS.INF example>
;
;   ARGUMENTS:   $0   Service Name
;                $1   "YES" - we use DeleteService to remove the service
;                     "NO"  - we use DeleteRegTree to remove the
;                             registry tree
;
;    RETURNS:    $R0  Registry error code or zero if no error
;
;  REFERENCES:  Nothing
;
;    MODIFIES:  Nothing
;
;*************************************************************************

[RemoveService]
    read-syms InitBaseVars
    Set RS_SvcName = $($0)
    Set RS_UseDelSvc = $($1)

    ; Make sure the service key exists first.

    OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\"$(RS_SvcName) +
        $(MAXIMUM_ALLOWED) ServiceKey

    Ifstr $(ServiceKey) == $(KeyNull)
        Debug-Output " could not open SYSTEM Service key "$(RS_SvcName)
        goto RemoveService_Return
    endif

    ; Remove the NbProvider value if it exists

    OpenRegKey $(ServiceKey) "" "Parameters" $(MAXIMUM_ALLOWED) ParameterKey

    Ifstr $(ParameterKey) != $(KeyNull)
         DeleteRegValue $(ParameterKey) "NbProvider"
         CloseRegKey $(ParameterKey)
    Endif

    CloseRegKey $(ServiceKey)

    ifstr(i) $(RS_UseDelSvc) == "YES"

        ; Remove the service

        Set FLibraryErrCtl = 1
        LibraryProcedure RS_RemoveResult $(!NCPA_HANDLE), CPlSetup, +
          $(!STF_HWND), DELETESVC, $(RS_SvcName)
        Set FLibraryErrCtl = 0

        ; Check the return code

        Set RS_RemoveError = *($(RS_RemoveResult),1)
        Ifint $(RS_RemoveError) != 0
             Debug-Output " RemoveService wrapper failed, error: "$(RS_RemoveResult)
             Set RegistryErrorIndex = UNABLE_REMOVE_CONFIGURE_SERVICE
             Goto RemoveService_Return
        Endif

    else

        OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services" +
        $(MAXIMUM_ALLOWED) ServiceKey

        Ifstr $(ServiceKey) == $(KeyNull)
           Debug-Output " could not open SYSTEM Service key "$(RS_SvcName)
           set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
           goto RemoveService_Return
        endif

        DeleteRegTree $(ServiceKey) $(RS_SvcName)

        CloseRegKey $(ServiceKey)

    endif

RemoveService_Return = +
    return $(RegistryErrorIndex)

;*************************************************************************
;  end of section  RemoveService
;*************************************************************************

;-------------------------------------------------------------------------
;
; ROUTINE:      SortListIndex
;
; DESCRIPTION:  Sort a list into sequence, returning an "index" list, which
;               indicates the sort position of each of the original list
;               elements.
;                <unchanged from Microsoft's NDIS.INF example>
;
; INPUTS:       $0: List to be sorted
;               $1: TRUE for ascending sort (FALSE otherwise)
;               $2: TRUE for case-insensitive sort (FALSE otherwise)
;
; OUTPUTS:      $R0:  Index list
;
; NOTES:        Lists of displayable numeric values will automatically
;               be sorted numerically if they are all decimal or hex
;               and the sort is case-insensitive (param $2 FALSE).
;
;----------------------------------------------------------------------------
[SortListIndex]
    Set List = $($0)
    Set BoolAscend = $($1)
    Set BoolCaseSens = $($2)

    LibraryProcedure IndexList, $(!LIBHANDLE), GenerateSortedIndexList, $(List), $(BoolAscend), $(BoolCaseSens)

    Return $(IndexList)

;-------------------------------------------------------------------------
;
; ROUTINE:      SortByIndex
;
; DESCRIPTION:  Sort a list into the sequence given by an "index list".
;                <unchanged from Microsoft's NDIS.INF example>
;
; INPUTS:       $0: List to be sorted
;               $1: Index list
;
; OUTPUTS:      $R0: Index list
;
;----------------------------------------------------------------------------
[SortByIndex]
   Set List = $($0)
   Set IndexList = $($1)
   Set NewList = {}

   ForListDo $(IndexList)
      Set Index = $($)
      Set Item = *($(List),$(Index))
      Set NewList = >($(NewList),$(Item))
   EndForListDo

   Return $(NewList)

;-------------------------------------------------------------------------
;
; ROUTINE:      SortList
;
; DESCRIPTION:  Sort a list into sequence, returning a sorted list.
;                <unchanged from Microsoft's NDIS.INF example>
;
; INPUTS:       $0: List to be sorted
;               $1: TRUE for ascending sort (FALSE otherwise)
;               $2: TRUE for case-sensitive sort (FALSE for case-ins)
;
; OUTPUTS:      $R0:  Sorted list
;
; NOTES:        Lists of displayable numeric values will automatically
;               be sorted numerically if they are all decimal or hex
;               and the sort is case-insensitive (param $2 FALSE).
;
;----------------------------------------------------------------------------
[SortList]
    Set List = $($0)
    Shell "" SortListIndex $(List) $($1) $($2)
    Set IndexList = $($R0)
    Shell "" SortByIndex $(List) $(IndexList)
    Set ResultList = $($R0)

    return $(ResultList)

;*************************************************************************
;  end of file   MONITOR.INF
;*************************************************************************
Download Driver Pack

How To Update Drivers Manually

After your driver has been downloaded, follow these simple steps to install it.

  • Expand the archive file (if the download file is in zip or rar format).

  • If the expanded file has an .exe extension, double click it and follow the installation instructions.

  • Otherwise, open Device Manager by right-clicking the Start menu and selecting Device Manager.

  • Find the device and model you want to update in the device list.

  • Double-click on it to open the Properties dialog box.

  • From the Properties dialog box, select the Driver tab.

  • Click the Update Driver button, then follow the instructions.

Very important: You must reboot your system to ensure that any driver updates have taken effect.

For more help, visit our Driver Support section for step-by-step videos on how to install drivers for every file type.

server: web4, load: 0.93