-
-
[求助]请教一个关于toaster问题
-
发表于: 2008-6-8 13:47 4667
-
我修改了DDK下的toaster\filter,以claslower编译生成claslower.sys,安装后,挂在{36FC9E60-C465-11CF-8056-444553540000}下lowerfilters = "claslower.sys"
接入U盘后能够成功,但是拦到的SCSI的操作码全是0x00为什么啊??搞了几天了,没搞定
DriverObject->MajorFunction[IRP_MJ_SCSI] = FilterScsi;
NTSTATUS
FilterScsi (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
NTSTATUS status;
PDEVICE_EXTENSION deviceExtension;
PIO_STACK_LOCATION irpStack;
PSCSI_REQUEST_BLOCK CurSrb;
PCDB pCdb;
KEVENT event;
deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
irpStack = IoGetCurrentIrpStackLocation(Irp);
status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
if (!NT_SUCCESS (status)) {
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return status;
}
CurSrb = irpStack->Parameters.Scsi.Srb;
pCdb = (PCDB)CurSrb->Cdb;
switch(pCdb->CDB6READWRITE.OperationCode)
{
case SCSIOP_READ_DATA_BUFF:
{
dprintf("%s FilterScsi, SCSIOP_READ_DATA_BUFF, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_MODE_SENSE10:
{
dprintf("%s FilterScsi, SCSIOP_MODE_SENSE10, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_SET_READ_AHEAD:
{
dprintf("%s FilterScsi, SCSIOP_SET_READ_AHEAD, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_MODE_SENSE:
{
dprintf("%s FilterScsi, SCSIOP_MODE_SENSE, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_WRITE:
{
dprintf("%s FilterScsi, SCSIOP_WRITE, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_WRITE6:
{
dprintf("%s FilterScsi, SCSIOP_WRITE6, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_READ6:
{
dprintf("%s FilterScsi, SCSIOP_READ6, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_READ:
{
dprintf("%s FilterScsi, SCSIOP_READ, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
default:
{
dprintf("%s FilterScsi, UnKnow = 0x%02X, Type=%d.\n",
DRIVERNAME,
pCdb->CDB6READWRITE.OperationCode,
deviceExtension->Type);
}
break;
}
IoSkipCurrentIrpStackLocation (Irp);
status = IoCallDriver (deviceExtension->NextLowerDriver, Irp);
IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
return status;
}
SCSIOP_READ和SCSIOP_READ6一个都没有拦到,不知道为什么,请高人帮忙。
接入U盘后能够成功,但是拦到的SCSI的操作码全是0x00为什么啊??搞了几天了,没搞定
DriverObject->MajorFunction[IRP_MJ_SCSI] = FilterScsi;
NTSTATUS
FilterScsi (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
NTSTATUS status;
PDEVICE_EXTENSION deviceExtension;
PIO_STACK_LOCATION irpStack;
PSCSI_REQUEST_BLOCK CurSrb;
PCDB pCdb;
KEVENT event;
deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
irpStack = IoGetCurrentIrpStackLocation(Irp);
status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
if (!NT_SUCCESS (status)) {
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return status;
}
CurSrb = irpStack->Parameters.Scsi.Srb;
pCdb = (PCDB)CurSrb->Cdb;
switch(pCdb->CDB6READWRITE.OperationCode)
{
case SCSIOP_READ_DATA_BUFF:
{
dprintf("%s FilterScsi, SCSIOP_READ_DATA_BUFF, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_MODE_SENSE10:
{
dprintf("%s FilterScsi, SCSIOP_MODE_SENSE10, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_SET_READ_AHEAD:
{
dprintf("%s FilterScsi, SCSIOP_SET_READ_AHEAD, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_MODE_SENSE:
{
dprintf("%s FilterScsi, SCSIOP_MODE_SENSE, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_WRITE:
{
dprintf("%s FilterScsi, SCSIOP_WRITE, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_WRITE6:
{
dprintf("%s FilterScsi, SCSIOP_WRITE6, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_READ6:
{
dprintf("%s FilterScsi, SCSIOP_READ6, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
case SCSIOP_READ:
{
dprintf("%s FilterScsi, SCSIOP_READ, Type=%d.\n",
DRIVERNAME,
deviceExtension->Type);
}
break;
default:
{
dprintf("%s FilterScsi, UnKnow = 0x%02X, Type=%d.\n",
DRIVERNAME,
pCdb->CDB6READWRITE.OperationCode,
deviceExtension->Type);
}
break;
}
IoSkipCurrentIrpStackLocation (Irp);
status = IoCallDriver (deviceExtension->NextLowerDriver, Irp);
IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
return status;
}
SCSIOP_READ和SCSIOP_READ6一个都没有拦到,不知道为什么,请高人帮忙。
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
他的文章
看原图
赞赏
雪币:
留言: