SCSI派遣函数是这么写的
#pragma LOCKEDCODE
NTSTATUS DispatchForSCSI(IN PDEVICE_OBJECT fido, IN PIRP Irp)
{
KdPrint((DRIVERNAME " - Enter DispatchForSCSI \n"));
//获得设备扩展
PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fido->DeviceExtension;
//获得I/O堆栈
//PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp);
ULONG DeviceType = 0;
DeviceType = GetDeviceTypeToUse(pdx->Pdo);
if (FILE_DEVICE_DISK == DeviceType)
{
return STATUS_SUCCESS;
}
else if (FILE_DEVICE_MASS_STORAGE == DeviceType)
{
IoCompleteRequest(Irp,IO_NO_INCREMENT);
return STATUS_ACCESS_DENIED;
}
} |