阅读:1003回复:1
softice观察到“page fault”
我启动用户模式调用CreateFile()时MajorFunction的 RP_MJ_CREATE 被触发,我直接返回 STATUS_SUCCESS ,但总是死机,用softice调试,系统打印 \" page fault\",我该怎么办???
NTSTATUS Dispatch( IN PDEVICE_OBJECT DeviceObject, IN PIRP pIrp ) { PDEVICE_EXTENSION pLDI; PIO_STACK_LOCATION pIrpStack; NTSTATUS Status; PAGED_CODE(); pIrp->IoStatus.Information = 0; pLDI = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; // Get local info struct DbgPrint (\"Ucard: Dispatch begin\\n\"); Status = IoAcquireRemoveLock (&pLDI->RemoveLock, pIrp); if (!NT_SUCCESS (Status)) { pIrp->IoStatus.Information = 0; pIrp->IoStatus.Status = Status; IoCompleteRequest (pIrp, IO_NO_INCREMENT); return Status; } if (!pLDI->Started) { pIrp->IoStatus.Status = Status = STATUS_DEVICE_NOT_READY; IoCompleteRequest(pIrp, IO_NO_INCREMENT ); IoReleaseRemoveLock(&pLDI->RemoveLock, pIrp); return Status; } pIrpStack = IoGetCurrentIrpStackLocation(pIrp); // Dispatch based on major fcn code. switch (pIrpStack->MajorFunction) { case IRP_MJ_CREATE: DbgPrint(\"IRP_MJ_CREATE\\n\"); Status = STATUS_SUCCESS; break; case IRP_MJ_CLOSE: DbgPrint(\"IRP_MJ_CLOSE\\n\"); Status = STATUS_SUCCESS; break; case IRP_MJ_DEVICE_CONTROL: break; default: Status = STATUS_NOT_IMPLEMENTED; break; } pIrp->IoStatus.Status = Status; IoCompleteRequest(pIrp, IO_NO_INCREMENT ); IoReleaseRemoveLock(&pLDI->RemoveLock, pIrp); DbgPrint (\"UcardDispatch end\\n\"); DbgPrint (\"Status = %x\\n\",Status); return Status; } [编辑 - 10/28/02 by iso2000] |
|
沙发#
发布于:2002-10-29 10:28
你需要调用IoCompleteRequest完成这个irp
|
|
|