⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oemsetup.inf

📁 一份很好的USB开发资料
💻 INF
📖 第 1 页 / 共 2 页
字号:
;-----------------------------------------------------------------------
; OPTION TYPE
; -----------
; This identifies the Option type we are dealing with.  The different
; possible types are:
;
; COMPUTER, VIDEO, POINTER, KEYBOARD, LAYOUT, SCSI, TAPE, PRINTER, ...
;-----------------------------------------------------------------------

[Identification]
    OptionType = SCSI

;-----------------------------------------------------------------------
; LANGUAGES SUPPORTED
; -------------------
;
; The languages supported by the INF, For every language supported
; we need to have a separate text section for every displayable text
; section.
;
;-----------------------------------------------------------------------

[LanguagesSupported]
    ENG


;-----------------------------------------------------------------------
; OPTION LIST
; -----------
; This section lists the Option key names.  These keys are locale
; independent and used to represent the option in a locale independent
; manner.
;
;*******************************IMPORTANT*************************************
;*                                                                           *
;* DO NOT CHANGE THE STRING "VIK_TIMEOUT" UNLESS YOU KNOW WHAT YOU ARE DOING *
;*                                                                           *
;*****************************************************************************
;-----------------------------------------------------------------------

[Options]
    "VIK_RAID"      = pcmatapi
    "VIK_TIMEOUT"   = pc_card
    "VIK_RESCAN"    = Atdisk

;-----------------------------------------------------------------------
; OPTION TEXT SECTION
; -------------------
; These are text strings used to identify the option to the user.  There
; are separate sections for each language supported.  The format of the
; section name is "OptionsText" concatenated with the Language represented
; by the section.
;
;-----------------------------------------------------------------------

[OptionsTextENG]

    "VIK_RAID"      = "Commuter PCMCIA ATA/ATAPI Adapter"

;-----------------------------------------------------------------------------------------
; SCSI MINIPORT DRIVERS:
;
; Order of the information:
;
; Class driver = Type, Group, ErrorControl, Tag, EventMessageFile, TypesSupported
;
;-----------------------------------------------------------------------------------------

[MiniportDrivers]
    pcmatapi = !SERVICE_KERNEL_DRIVER, "SCSI Miniport", !SERVICE_ERROR_NORMAL,  17, %SystemRoot%\System32\IoLogMsg.dll , 7

    pc_card = !SERVICE_KERNEL_DRIVER, "Filter", !SERVICE_ERROR_NORMAL,  1, %SystemRoot%\System32\IoLogMsg.dll , 7

    Atdisk = !SERVICE_KERNEL_DRIVER, "Primary Disk", !SERVICE_ERROR_NORMAL,  1, %SystemRoot%\System32\IoLogMsg.dll , 7


;---------------------------------------------------------------------------
; 1. Identify
;
; DESCRIPTION:   To verify that this INF deals with the same type of options
;                 as we are choosing currently.
;
; INPUT:         None
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
;                $($R1): Option Type (COMPUTER ...)
;                $($R2): Diskette description
;---------------------------------------------------------------------------

[Identify]
    ;
    ;
    read-syms Identification

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

    Return $(Status) $(Identifier) $(Media)


;------------------------------------------------------------------------
; 2. ReturnOptions:
;
; DESCRIPTION:   To return the option list supported by this INF and the
;                localised text list representing the options.
;
;
; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
;                                STATUS_NOLANGUAGE
;                                STATUS_FAILED
;
;                $($R1): Option List
;                $($R2): Option Text List
;------------------------------------------------------------------------

[ReturnOptions]
    ;
    ;
    set Status        = STATUS_FAILED
    set OptionList     = {}
    set OptionTextList = {}

    ;
    ; Check if the language requested is supported
    ;
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
	goto returnoptions
    else
	set Status = STATUS_NOLANGUAGE
	goto finish_ReturnOptions
    endif

    ;
    ; form a list of all the options and another of the text representing
    ;

returnoptions = +
    set OptionList     = ^(Options, 0)
    set OptionTextList = ^(OptionsText$($0), 1)
    set Status         = STATUS_SUCCESSFUL

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


;
; 3. InstallOption:
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update the registry for the installed option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;            $($2):  SourceDirectory
;            $($3):  AddCopy  (YES | NO)
;            $($4):  DoCopy   (YES | NO)
;            $($5):  DoConfig (YES | NO)
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;

[InstallOption]
    
    ;
    ; Set default values for
    ;
    set Status = STATUS_FAILED
    set DrivesToFree = {}

    ;
    ; extract parameters
    ;
    set Option   = $($1)
    set Option1  = "VIK_RESCAN"
    set Option2  = "VIK_TIMEOUT"
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)

    ;
    ; Check if the language requested is supported
    ;
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
    else
	set Status = STATUS_NOLANGUAGE
	goto finish_InstallOption
    endif
    read-syms Strings$($0)

    ;
    ; check to see if Option is supported.
    ;

    set OptionList = ^(Options, 0)
    ifcontains $(Option) in $(OptionList)
    else
	Debug-Output "SCSI.INF: SCSI option is not supported."
	goto finish_InstallOption
    endif
    set OptionList = ""

    ;
    ; Option has been defined already
    ;

    set MiniportDriver   =   #(Options,         $(Option),         1)
    set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
    set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
    set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
    set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
    set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
    set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)

    set Start            =   $(!SERVICE_BOOT_START)
    set MiniStart        =   $(!SERVICE_SYSTEM_START)

    set FilterDriver   =     #(Options,         $(Option2),         1) 
    set FdType             = $(#(MiniportDrivers, $(FilterDriver), 1))
    set FdGroup            =   #(MiniportDrivers, $(FilterDriver), 2)
    set FdErrorControl     = $(#(MiniportDrivers, $(FilterDriver), 3))
    set FdTag              =   #(MiniportDrivers, $(FilterDriver), 4)
    set FdEventMessageFile =   #(MiniportDrivers, $(FilterDriver), 5)
    set FdTypesSupported   =   #(MiniportDrivers, $(FilterDriver), 6)

    set FdStart            =   $(!SERVICE_BOOT_START)

    set FilterDriver1      = #(Options,         $(Option1),         1) 
    set FdType1             = $(#(MiniportDrivers, $(FilterDriver1), 1))
    set FdGroup1            =   #(MiniportDrivers, $(FilterDriver1), 2)
    set FdErrorControl1     = $(#(MiniportDrivers, $(FilterDriver1), 3))
    set FdTag1              =   #(MiniportDrivers, $(FilterDriver1), 4)
    set FdEventMessageFile1 =   #(MiniportDrivers, $(FilterDriver1), 5)
    set FdTypesSupported1   =   #(MiniportDrivers, $(FilterDriver1), 6)

    set FdStart1            =   $(!SERVICE_BOOT_START)


installtheoption = +

    ;
    ; Code to add files to copy list
    ;

    ifstr(i) $(AddCopy) == "YES"
	set DoActualCopy = NO
	set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
	LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
	ifstr(i) $(STATUS) == NO
	    set DoActualCopy = YES
	endif

	ifstr(i) $(DoActualCopy) == NO
	    shell "subroutn.inf" DriversExist $($0) $(String1)
	    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "SCSI.INF: shelling DriversExist failed"
		goto finish_InstallOption
	    endif

	    ifstr(i) $($R0) == STATUS_CURRENT
	    else-ifstr(i) $($R0) == STATUS_NEW
		set DoActualCopy = YES
	    else-ifstr(i) $($R0) == STATUS_USERCANCEL
		Debug-Output "SCSI.INF: User cancelled SCSI installation"
		goto finish_InstallOption
	    else
		Debug-Output "SCSI.INF: Error reported in DriversExist routine in SUBROUTN.INF"
		goto finish_InstallOption
	    endif
	endif

	ifstr(i) $(DoActualCopy) == YES

	    shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
	    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "SCSI.INF: shelling DoAskSourceEx failed"
		goto finish_InstallOption
	    endif

	    ifstr(i) $($R0) == STATUS_SUCCESSFUL
		set SrcDir = $($R1)
		ifstr(i) $($R2) != ""
		    set DrivesToFree = >($(DrivesToFree), $($R2))
		endif
	    else
		Debug-Output "SCSI.INF: User cancelled asking source."
		goto finish_InstallOption
	    endif

	    install Install-AddCopyOption
	    ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
		Debug-Output "Adding SCSI files to copy list failed"
		goto finish_InstallOption
	    endif
	else
	    set DoCopy = NO
	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"
	;
	; first run a privilege check on modifying the setup node
	;

	shell "registry.inf" CheckSetupModify
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto finish_InstallOption
	endif

	ifstr(i) $($R0) != STATUS_SUCCESSFUL
	    goto finish_InstallOption
	endif

	;
	; then make a new SCSI entry, the entry is created automatically
	; enabled
	;

	set ServiceNode   = $(MiniportDriver)
	set ServiceBinary = System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)

	set ServicesValues   = { +
		{Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
		{Start,          0, $(!REG_VT_DWORD),     $(MiniStart)                 }, +
		{Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
		{ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
		{Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
		{BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
		}
	set ParametersValues = ""
	set DeviceValues     = {}
	set EventLogValues   = { +
		{EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
		{TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
		}

	shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
						$(ServicesValues)   +
						$(ParametersValues) +
						$(DeviceValues)     +
						$(EventLogValues)   +
						Parameters


	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
	    goto finish_InstallOption
	endif

	ifstr(i) $($R0) != STATUS_SUCCESSFUL
	    Debug-Output "MakeServicesEntry failed for SCSI"
	    goto finish_InstallOption
	endif
;
; Registry setup for timeout driver.
;
	set ServiceNode   = $(FilterDriver)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -