[求助]IO栈单元的问题~~
问题一:'PIO_STACK_LOCATION' : illegal use of this type as an expression(非法使用此类型表达式吧?可是我不清楚我下面的代码错编译错在哪~~)NTSTATUS pnpdispatch(PDEVICE_OBJECT devobj,PIRP irp)
{
Ptyf_dev_ext devext;
NTSTATUS status=STATUS_SUCCESS;
devext=(Ptyf_dev_ext)devobj->DeviceExtension;
PIO_STACK_LOCATION irpstack;//主要问题是在这,问题一:
irpstack=IoGetCurrentIrpStackLocation(irp);
switch(irpstack->MinorFunction)
{
case IRP_MN_REMOVE_DEVICE:
{
IoSkipCurrentIrpStackLocation(irp);
IoCallDriver(devext->attachedo,irp);
KdPrint(("have device remove"));
IoDetachDevice(devext->attachedo);
IoDeleteDevice(devext->attachedo);
break;
}
default:
{
IoSkipCurrentIrpStackLocation(irp);
return IoCallDriver(devext->attachedo,irp);
}
}
return status;
}
还有个问题:在DriverEntry主函数中,里面的一个IRP_MJ_READ功能码居然说未声明~~~还有PDRIVER_OBJECT类型 的变量在指向DriverUnLoad说没有这个成员~~??
[ 本帖最后由 gpp6025 于 2010-8-19 08:30 编辑 ]