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

📄 oemsetup.inf

📁 SCSI 的虚拟磁盘驱动 需要 windows DDK 很易懂的 DDK 文件结构
💻 INF
📖 第 1 页 / 共 2 页
字号:
		; 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),     $(Start)                 }, +
				{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)         }  +
				}

		;***********************************************************
		;       Can add other things to ScsiParm value if needed...
		;***********************************************************

		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

	endif

	set Status = STATUS_SUCCESSFUL
finish_InstallOption = +
	ForListDo $(DrivesToFree)
		LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
	EndForListDo

	Return $(Status)


[Install-AddCopyOption]

	;
	; Add the files to the copy list
	;
	AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
								  $(MiniportDriver)                 +
								  $(SrcDir)                      +
								  $(!STF_WINDOWSSYSPATH)\drivers

	exit


[Install-DoCopyOption]

	;
	; Copy files in the copy list
	;
	CopyFilesInCopyList
	exit

;-------------------------------------------------------------------------
; 4. DeInstallOption:
;
; FUNCTION:  To remove files representing Option
;            To remove the registry entry corresponding to the Option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;-------------------------------------------------------------------------
[DeInstallOption]
	;
	; Set default values for
	;
	set Status   = STATUS_FAILED
	;
	; extract parameters
	;
	set Option   = $($1)

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

	;
	; check to see if Option is supported.
	;

	set OptionList = ^(Options, 0)
	ifcontains $(Option) in $(OptionList)
	else
		goto finish_DeInstallOption
	endif
	set OptionList = ""

	;
	; fetch details about option
	;

	set MiniportDriver = #(Options, $(Option), 1)
	set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
	set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)

	;
	; check to see if file is installed
	; if not give success
	;

	LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
	ifstr(i) $(STATUS) == "NO"
		set Status = STATUS_SUCCESSFUL
		goto finish_DeInstallOption
	endif

	shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
	ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
		; this could happen if there is no start value or there is no
		; key, in which case the option is not installed
		set Status = STATUS_SUCCESSFUL
		goto finish_DeInstallOption
	endif

	ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
		shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
		ifstr(i) $($R0) != STATUS_SUCCESSFUL
			goto do_removal
		endif
		ifstr(i) $($R1) == "CANCEL"
			goto finish_DeInstallOption
		endif
	endif

do_removal =+
	;
	; disable the registry entry
	;

	shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "SCSI.INF: Failed to shell RemoveServicesEntry"
		goto finish_DeInstallOption
	endif

	ifstr(i) $($R0) != STATUS_SUCCESSFUL
		Debug-Output "SCSI.INF: Failed to disable services entry"
		goto finish_DeInstallOption
	endif

	;
	; we won't remove the file because we can only do so during the next boot.
	; if the user chooses to reinstall the same driver during this boot
	; he will still end up deleting the driver on next boot. if the file
	; should be deleted a warning should be put up saying that the user should
	; not try to reinstall the driver during this boot
	;
	;    AddFileToDeleteList $(FilePath)

	set Status = STATUS_SUCCESSFUL

finish_DeInstallOption =+
	return $(Status)


;-------------------------------------------------------------------------
; 5. GetInstalledOptions:
;
; FUNCTION:  To find out the list of options which are installed
;
; INPUT:     $($0): Language to Use
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_FAILED
;
;            $($R1): List of options installed
;            $($R2): Option installed Text List
;-------------------------------------------------------------------------
[GetInstalledOptions]
	set Status = STATUS_FAILED
	set InstalledOptions = {}
	set InstalledOptionsText = {}

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

	set OptionList = ^(Options, 0)
	ForListDo $(OptionList)
		set MiniportDriver = #(Options, $($), 1)
		set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
		set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
		LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
		ifstr(i) $(STATUS) == "YES"
			shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
			ifint $($ShellCode) == $(!SHELL_CODE_OK)
				ifstr(i) $($R0) == STATUS_SUCCESS
					ifstr(i) $($R1) != $(!SERVICE_DISABLED)

						set OptionText = #(OptionsText$($0), $($), 1)
						set InstalledOptions     = >($(InstalledOptions), $($))
						set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))

					endif
				endif
			endif
		endif
	EndForListDo
	set Status = STATUS_SUCCESSFUL
finish_GetInstalledOptions =+
	Return $(Status) $(InstalledOptions) $(InstalledOptionsText)


;**************************************************************************
; PROGRESS GUAGE VARIABLES
;**************************************************************************

[ProgressCopyENG]
	ProCaption   = "Windows NT Setup"
	ProCancel    = "Cancel"
	ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
				   "to cancel copying files?"
	ProCancelCap = "Setup Message"
	ProText1     = "Copying:"
	ProText2     = "To:"

[StringsENG]
	String1 = "SCSI Adapter"
	String2 = "Please enter the full path to the OEM SCSI "+
			  "Adapter files.  Then choose Continue."
	String3 = "The SCSI Adapter has been marked as a boot device.  Removing "+
			  "it may cause the system not to boot."$(!LF)$(!LF)"Are you sure "+
			  "you want to remove the Adapter."



[Source Media Descriptions]
	1  = "StorageCraft Virtual Disk"  , TAGFILE = VDISKMP.TAG

[Files-ScsiMiniportDrivers]
VDISKMP = 1,VDISKMP.SYS , SIZE=26000

⌨️ 快捷键说明

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