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

📄 oemsetup.inf

📁 ndis windows网络驱动程序的范例
💻 INF
📖 第 1 页 / 共 2 页
字号:
[Identification]
    OptionType = NetTransport

[LanguagesSupported]
    ENG

[Options]
    ImSamp

[OptionsTextENG]
    ImSamp     = "Ndis Intermediate Driver Sample"

[FileConstants]
UtilityInf      			= "UTILITY.INF"
subroutineinf   			= "SUBROUTN.INF"
TransportSoftwareType			= "transport"
AdapterSoftwareType   			= "driver"
Exit_Code       			= 0
NetEventDLL     			= "%SystemRoot%\System32\netevent.dll"

Manufacturer    			= "Microsoft"
ProductMajorVersion     		= "1"
ProductMinorVersion     		= "0"
ProductVersion  			= $(ProductMajorVersion)"."$(ProductMinorVersion)

TransportProductSoftwareName   		= "ImSamp"
AdapterProductSoftwareName		= "ImSampMP"
AdapterProductHardwareName		= "ImSampMP"

ProductSoftwareImagePath 		= "\SystemRoot\System32\drivers\ImSamp.sys"

TransportNetRuleSoftwareType    	= "ImSamp ImSamp"
TransportNetRuleSoftwareClass   	= {"ImSamp basic"}
TransportNetRuleSoftwareUse     	= $(TransportSoftwareType)" none none"
TransportNetRuleSoftwareBindForm	= """ImSamp"" yes yes container"
TransportNetRuleSoftwareBindable 	= {"ImSamp ndisDriver non non 100"}

AdapterNetRuleSoftwareType    		= "ImSys ndisDriver ImDriver"
AdapterNetRuleSoftwareUse     		= $(AdapterSoftwareType)
AdapterNetRuleSoftwareBindForm		= """ImSys"" yes no container"
AdapterNetRuleSoftwareClass   		= {"ImDriver basic"}
AdapterNetRuleSoftwareBindable 		= {"ImDriver ImAdapter non exclusive 100"}

AdapterNetRuleHardwareType		= "Im ImAdapter"
AdapterNetRuleHardwareBindForm 		= " yes yes container"
AdapterNetRuleHardwareClass    		= {"ImAdapter basic"}

TransportProductKeyName	= $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(TransportProductSoftwareName)"\CurrentVersion"
TransportParamKeyName	= $(!NTN_ServiceBase)"\"$(TransportProductSoftwareName)"\Parameters"
TransportServiceKeyName	= $(!NTN_ServiceBase)"\"$(TransportProductSoftwareName)
TransportLinkageKeyName	= $(!NTN_ServiceBase)"\"$(TransportProductSoftwareName)"\Linkage"

AdapterProductKeyName	= $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(AdapterProductSoftwareName)"\CurrentVersion"
AdapterParamKeyName		= $(!NTN_ServiceBase)"\"$(AdapterProductSoftwareName)"\Parameters"
AdapterServiceKeyName	= $(!NTN_ServiceBase)"\"$(AdapterProductSoftwareName)
AdapterLinkageKeyName	= $(!NTN_ServiceBase)"\"$(AdapterProductSoftwareName)"\Linkage"

[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   			= "Intermediate Sample Miniport Driver"
TransportProductSoftwareDescription	= "Intermediate Sample Miniport Driver Transport"
TransportProductSoftwareDisplayName	= "Intermediate Sample Miniport Driver Transport"
TransportProductSoftwareTitle    	= "Intermediate Sample Miniport Driver Transport"
AdapterProductSoftwareDescription	= "Intermediate Sample Miniport Driver Adapter"
AdapterProductSoftwareDisplayName	= "Intermediate Sample Miniport Driver Adapter"
AdapterProductSoftwareTitle    		= "Intermediate Sample Miniport Driver Adapter"
ProductHardwareDescription		= "Intermediateu Sample Miniport Driver Virtual Adapter"
ProductHardwareDisplayName		= "Intermediate Sample Miniport Driver Virtual Adapter"
ProductHardwareTitle			= "Intermediate Sample Miniport Driver Virtual Adapter"
ShellCodeErrorTitle     		= "Error: "$(FunctionTitle)
ShellCodeErrorText      		= "Shell Code Error."

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

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

[platform]
    STF_PLATFORM = "" ? $(!LIBHANDLE) GetPlatform

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

[ReturnOptions]
    set Status        = STATUS_FAILED
    set OptionList     = {}
    set OptionTextList = {}
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
        goto returnoptions
    else
        set Status = STATUS_NOLANGUAGE
        goto finish_ReturnOptions
    endif
returnoptions = +
    set OptionList     = ^(Options, 1)
    set OptionTextList = ^(OptionsText$($0), 1)
    set Status         = STATUS_SUCCESSFUL
finish_ReturnOptions = +
    Return $(Status) $(OptionList) $(OptionTextList)

[InstallOption]

    set !DebugOutputControl = 1
    
    set Option   = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) NOT-IN $(LanguageList)
        Return STATUS_NOLANGUAGE
    endif
    set-subst LF = "\n"
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms DialogConstants$(!STF_LANGUAGE)
    ifstr(i) $(!NTN_Origination) == "NCPA"
        set Continue = $(OK)
    endif
    read-syms FileConstants$(!STF_LANGUAGE)
    detect date
    detect platform
    set-title  $(FunctionTitle)
    set to   = Begin
    set from = Begin
    set CommonStatus = STATUS_SUCCESSFUL
    EndWait
    
Begin = +
    Ifstr(i) $(!NTN_InstallMode) == deinstall
        set StartLabel = deinstall
    else-Ifstr(i) $(!NTN_InstallMode) == update
        set StartLabel = update
    else-Ifstr(i) $(!NTN_InstallMode) == bind
        set StartLabel = bind
    else-Ifstr(i) $(!NTN_InstallMode) == configure
        set StartLabel = configure
    else
        set StartLabel = install
    endif
    set RadioDefault = 2
    set RadioIn = {$(RadioDefault)}
    set from = $(fatal)
    set to = $(fatal)
    goto $(StartLabel)

install = +
    OpenRegKey $(!REG_H_LOCAL) "" $(TransportProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
    Ifstr $(KeyProduct) != $(KeyNull)
        CloseRegKey $(KeyProduct)
        Shell $(UtilityInf), VerExistedDlg, $(TransportProductSoftwareTitle),+
            $(ProductVersion)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        goto end
    endif
    CloseRegKey $(KeyProduct)
    goto installproduct

installproduct = +
    StartWait
    ifint $(OldVersionExisted) == $(FALSE)
        Ifstr(i) $(DoCopy) == "YES"
           Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
           Ifint $($ShellCode) != $(!SHELL_CODE_OK)
               Goto ShellCodeError
           Else-Ifstr(i) $($R0) == STATUS_FAILED
               Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
               ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   goto ShellCodeError
               endif
               Goto fatal
           Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
               Goto successful
           Endif
           Set SrcDir = $($R1)
        Endif
        Shell "" StripTrailSlash $(SrcDir)
        set PlatformDir  = $($R0)"\"$(STF_PLATFORM)
        set InfDir  = $($R0)"\"
        install "Install-Option"
        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
           Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
           ifint $($ShellCode) != $(!SHELL_CODE_OK)
               goto ShellCodeError
           endif
           set Error = $($R0)
           goto fatal
        endif
        set OEM_ABANDON_ON = TRUE

		Debug-Output "ImSamp: Adding Transport Software Component to Registry"

		Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
            $(TransportProductSoftwareName), +
            $(TransportProductSoftwareName), +
            $(TransportProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
            $(ProductSoftwareImagePath), "transport", "NDIS", {}, "",+
            $(NetEventDLL)
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) !=  NO_ERROR
            EndWait
            CloseRegKey $($R1)
            CloseRegKey $($R2)
            CloseRegKey $($R3)
            CloseRegKey $($R4)
            CloseRegKey $($R5)
            goto fatalRegistry
        endif
        Set SoftProductKey      = $($R1)
        Set SoftNetRuleKey      = $($R2)
        Set SoftServiceKey      = $($R3)
        Set SoftParameterKey    = $($R4)
        Set SoftLinkageKey      = $($R5)
        set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(TransportSoftwareType)},+
                           {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
                           {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
                           {Title,$(NoTitle),$(!REG_VT_SZ),$(TransportProductSoftwareTitle)},+
                           {Description,$(NoTitle),$(!REG_VT_SZ),$(TransportProductSoftwareDescription)},+
                           {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(TransportProductSoftwareName)},+
                           {Review,$(NoTitle),$(!REG_VT_DWORD),1},+
                           {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
        Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
        set RegistryErrorIndex = $($R0)
        Ifstr $(RegistryErrorIndex) != NO_ERROR
            CloseRegKey $(SoftProductKey)
            CloseRegKey $(SoftNetRuleKey)
            CloseRegKey $(SoftServiceKey)
            CloseRegKey $(SoftParameterKey)
            CloseRegKey $(SoftLinkageKey)
            goto fatalRegistry
        endif
        set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(TransportNetRuleSoftwareType)}, +
                            {use,$(NoTitle),$(!REG_VT_SZ),$(TransportNetRuleSoftwareUse)}, +
                            {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TransportNetRuleSoftwareClass)}, +
                            {bindform,$(NoTitle),$(!REG_VT_SZ),$(TransportNetRuleSoftwareBindForm)}, +
                            {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TransportNetRuleSoftwareBindable)}, +
                            {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
        Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
        set RegistryErrorIndex = $($R0)
        Ifstr $(RegistryErrorIndex) != NO_ERROR
            CloseRegKey $(SoftProductKey)
            CloseRegKey $(SoftNetRuleKey)
            CloseRegKey $(SoftServiceKey)
            CloseRegKey $(SoftParameterKey)
            CloseRegKey $(SoftLinkageKey)
            goto fatalRegistry
        endif

       


        set NewValueList = {{DebugLevel,$(NoTitle),$(!REG_VT_DWORD),0}, +
                            {DebugMask,$(NoTitle),$(!REG_VT_DWORD), 0}}
        Shell  $(UtilityInf), AddValueList, $(SoftParameterKey), $(NewValueList)
        set RegistryErrorIndex = $($R0)
        Ifstr $(RegistryErrorIndex) != NO_ERROR
            CloseRegKey $(SoftProductKey)
            CloseRegKey $(SoftNetRuleKey)
            CloseRegKey $(SoftServiceKey)
            CloseRegKey $(SoftParameterKey)
            CloseRegKey $(SoftLinkageKey)
            goto fatalRegistry
        endif

	
        CloseRegKey $(SoftProductKey)
        CloseRegKey $(SoftNetRuleKey)
        CloseRegKey $(SoftServiceKey)
        CloseRegKey $(SoftParameterKey)
        CloseRegKey $(SoftLinkageKey)

		Debug-Output "ImSamp: Adding Adapter Software Component to Registry"

        Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
            $(AdapterProductSoftwareName), +
            $(AdapterProductSoftwareName), +
            $(AdapterProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
            $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
            $(NetEventDLL)
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) !=  NO_ERROR
            EndWait
            CloseRegKey $($R1)
            CloseRegKey $($R2)
            CloseRegKey $($R3)
            CloseRegKey $($R4)
            CloseRegKey $($R5)
            goto fatalRegistry
        endif
        Set SoftProductKey      = $($R1)
        Set SoftNetRuleKey      = $($R2)
        Set SoftServiceKey      = $($R3)
        Set SoftParameterKey    = $($R4)
        Set SoftLinkageKey      = $($R5)

        set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(AdapterSoftwareType)},+
                           {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
                           {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
                           {Title,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductSoftwareTitle)},+
                           {Description,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductSoftwareDescription)},+
                           {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductSoftwareName)},+
                           {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
        Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
        set RegistryErrorIndex = $($R0)
        Ifstr $(RegistryErrorIndex) != NO_ERROR
            CloseRegKey $(SoftProductKey)
            CloseRegKey $(SoftNetRuleKey)
            CloseRegKey $(SoftServiceKey)
            CloseRegKey $(SoftParameterKey)
            CloseRegKey $(SoftLinkageKey)
            goto fatalRegistry
        endif
        set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(AdapterNetRuleSoftwareType)}, +
                            {use,$(NoTitle),$(!REG_VT_SZ),$(AdapterNetRuleSoftwareUse)}, +
                            {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(AdapterNetRuleSoftwareClass)}, +
                            {bindform,$(NoTitle),$(!REG_VT_SZ),$(AdapterNetRuleSoftwareBindForm)}, +
                            {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(AdapterNetRuleSoftwareBindable)}, +
                            {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
        Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
        set RegistryErrorIndex = $($R0)
        Ifstr $(RegistryErrorIndex) != NO_ERROR
            CloseRegKey $(SoftProductKey)
            CloseRegKey $(SoftNetRuleKey)
            CloseRegKey $(SoftServiceKey)
            CloseRegKey $(SoftParameterKey)
            CloseRegKey $(SoftLinkageKey)
            goto fatalRegistry
        endif
        
        CloseRegKey $(SoftProductKey)
        CloseRegKey $(SoftNetRuleKey)
        CloseRegKey $(SoftServiceKey)
        CloseRegKey $(SoftParameterKey)
        CloseRegKey $(SoftLinkageKey)

	endif

    EndWait
    goto successful

bind =+

	;
	;	If this is the binding review for the Transport Driver...
	;
   	ifstr(i) $(!NTN_RegBase) == $(TransportProductKeyName)
		;
		;	Open the Linkage Key and get the Bind Value
		;
		Debug-Output "ImSamp: Reviewing bindings in "$(TransportLinkageKeyName)
		OpenRegKey $(!REG_H_LOCAL) "" $(TransportLinkageKeyName) $(MAXIMUM_ALLOWED) TransportLinkageKey
		ifstr(i) $(TransportLinkageKey) != ""
			GetRegValue $(TransportLinkageKey) "Bind" BindList
			Debug-Output "ImSamp: BindList: "$(BindList)
			Set Binding = *($(BindList),4)
			Debug-Output "ImSamp: Binding:  "$(Binding)
			CloseRegKey $(TransportLinkageKey)
		else
			Debug-Output "ImSamp: failed to open Linkage Key for "$(TransportServiceKeyName)
			goto fatalregistry
		endif
		;
		;	Parse the Bindings to create a list of Adapter cards
		;
		set CardList = {}
		set CreateCardList = {}
		ForListDo $(Binding)
			Split-String $($), "\", BindInfo
			QueryListSize BindListSize $(BindInfo)
			set CardName = *($(BindInfo),$(BindListSize))
			Debug-Output "ImSamp: Cardname: "$(CardName)
			ifstr(i) $(CardList) == {}
				set CardList = {$(CardName)}
			else
				set CardList = >($(CardList),$(CardName))
			endif
		EndForListDo
	
		Debug-Output "ImSamp: Cardlist: "$(CardList)

⌨️ 快捷键说明

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