reactos操作系统实现(117)

前端之家收集整理的这篇文章主要介绍了reactos操作系统实现(117)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在@H_403_4@Reactos@H_403_4@里,磁盘类的驱动程序是由@H_403_4@disk.sys@H_403_4@实现的。从文件系统上输出和读取的调用,就是需要通过这个驱动程序来实现,在这个驱动程序下面就是@H_403_4@PCIIDE@H_403_4@和@H_403_4@ATAPI@H_403_4@的驱动程序了,后面这些驱动程序,在前面已经分析过,现在来学习@H_403_4@disk@H_403_4@类驱动程序。@H_403_4@@H_403_4@

@H_403_4@

10.4.1@H_403_4@ @H_403_4@DriverEntry@H_403_4@入口函数@H_403_4@@H_403_4@

分析这个程序还是从这个驱动程序的入口函数开始,这个函数是初始化@H_403_4@SCSI@H_403_4@的硬盘类驱动程序,具体实现代码如下:@H_403_4@@H_403_4@

#001 @H_403_4@NTSTATUS@H_403_4@

#002 @H_403_4@NTAPI@H_403_4@

#003 @H_403_4@DriverEntry(@H_403_4@

#004 @H_403_4@IN PDRIVER_OBJECT DriverObject,@H_403_4@

#005 @H_403_4@IN PUNICODE_STRING RegistryPath@H_403_4@

#006 @H_403_4@)@H_403_4@

#007 @H_403_4@@H_403_4@

#008 @H_403_4@/*++@H_403_4@

#009 @H_403_4@@H_403_4@

#010 @H_403_4@Routine Description:@H_403_4@

#011 @H_403_4@@H_403_4@

#012 @H_403_4@This routine initializes the SCSI hard disk class driver.@H_403_4@

#013 @H_403_4@@H_403_4@

#014 @H_403_4@Arguments:@H_403_4@

#015 @H_403_4@@H_403_4@

#016 @H_403_4@DriverObject - Pointer to driver object created by system.@H_403_4@

#017 @H_403_4@@H_403_4@

#018 @H_403_4@RegistryPath - Pointer to the name of the services node for this driver.@H_403_4@

#019 @H_403_4@@H_403_4@

#020 @H_403_4@Return Value:@H_403_4@

#021 @H_403_4@@H_403_4@

#022 @H_403_4@The function value is the final status from the initialization operation.@H_403_4@

#023 @H_403_4@@H_403_4@

#024 @H_403_4@--*/@H_403_4@

#025 @H_403_4@@H_403_4@

#026 @H_403_4@{@H_403_4@

#027 @H_403_4@CLASS_INIT_DATA InitializationData;@H_403_4@

#028 @H_403_4@@H_403_4@

#029 @H_403_4@//@H_403_4@

#030 @H_403_4@// Zero InitData@H_403_4@

#031 @H_403_4@//@H_403_4@

#032 @H_403_4@@H_403_4@

@H_403_4@

清空初始化结构。@H_403_4@@H_403_4@

#033 @H_403_4@RtlZeroMemory (&InitializationData,sizeof(CLASS_INIT_DATA));@H_403_4@

#034 @H_403_4@@H_403_4@

#035 @H_403_4@//@H_403_4@

#036 @H_403_4@// Set sizes@H_403_4@

#037 @H_403_4@//@H_403_4@

#038 @H_403_4@@H_403_4@

@H_403_4@

设置结构的大小。@H_403_4@@H_403_4@

#039 @H_403_4@InitializationData.InitializationDataSize = sizeof(CLASS_INIT_DATA);@H_403_4@

@H_403_4@

设置驱动程序使用空间的大小。@H_403_4@@H_403_4@

#040 @H_403_4@InitializationData.DeviceExtensionSize = DEVICE_EXTENSION_SIZE;@H_403_4@

#041 @H_403_4@@H_403_4@

@H_403_4@

指明这个驱动程序对象是磁盘驱动程序。@H_403_4@@H_403_4@

#042 @H_403_4@InitializationData.DeviceType = FILE_DEVICE_DISK;@H_403_4@

#043 @H_403_4@InitializationData.DeviceCharacteristics = 0;@H_403_4@

#044 @H_403_4@@H_403_4@

#045 @H_403_4@//@H_403_4@

#046 @H_403_4@// Set entry points@H_403_4@

#047 @H_403_4@//@H_403_4@

#048 @H_403_4@@H_403_4@

@H_403_4@

设置类调用的回调函数@H_403_4@@H_403_4@

#049 @H_403_4@InitializationData.ClassError = ScsiDiskProcessError;@H_403_4@

#050 @H_403_4@InitializationData.ClassReadWriteVerification = ScsiDiskReadWriteVerification;@H_403_4@

#051 @H_403_4@InitializationData.ClassFindDevices = FindScsiDisks;@H_403_4@

#052 @H_403_4@InitializationData.ClassFindDeviceCallBack = ScsiDiskDeviceVerification;@H_403_4@

#053 @H_403_4@InitializationData.ClassDeviceControl = ScsiDiskDeviceControl;@H_403_4@

#054 @H_403_4@InitializationData.ClassShutdownFlush = ScsiDiskShutdownFlush;@H_403_4@

#055 @H_403_4@@H_403_4@InitializationData.ClassCreateClose = NULL;@H_403_4@

#056 @H_403_4@@H_403_4@

#057 @H_403_4@//@H_403_4@

#058 @H_403_4@// Call the class init routine@H_403_4@

#059 @H_403_4@//@H_403_4@

#060 @H_403_4@@H_403_4@

@H_403_4@

调用ScsiClassInitialize@H_403_4@函数初始化驱动程序对象。@H_403_4@@H_403_4@

#061 @H_403_4@return ScsiClassInitialize( DriverObject,RegistryPath,&InitializationData);@H_403_4@

#062 @H_403_4@@H_403_4@

#063} // end DriverEntry()@H_403_4@

原文链接:https://www.f2er.com/react/308409.html

猜你在找的React相关文章