Hi Everybody
I have written a driver for Windows 2K and is running perfectly under normal
conditions but when I’m trying to boot in Safe-Mode, that driver is getting
loaded but is performing all of its functionalities, its basically a disk
Upper-filter driver and performing some basic functions that I came to know
after inserting breakpoints like its taking out information regarding bitmap
and all but after some time it stops performing any further actions… Here
is a code snippet…
NTSTATUS
FilterPass (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
PDEVICE_EXTENSION deviceExtension;
NTSTATUS status;
deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
DbgPrint(“Testing Filter Pass1\n”);
if (!NT_SUCCESS (status)) {
DbgPrint(“Testing Filter Pass2\n”);
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return status;
}
DbgPrint(“Testing Filter Pass3\n”);
IoSkipCurrentIrpStackLocation (Irp);
status = IoCallDriver (deviceExtension->NextLowerDriver, Irp);
IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
DbgPrint(“Testing Filter Pass4\n”);
DbgPrint(“Status FilterPass=%x\n”,status);
return status;
}
Function FilterPass() is getting called from 2 places, one from
FilterCreate()
FilterCreate(…)
{…
…if(DeviceObject != ControlDeviceObject) {
//
// We will just the request down as we are not interested in handling
// requests that come on the PnP stack.
//
DbgPrint(“Testing 2\n”);
irpStack = IoGetCurrentIrpStackLocation (Irp);
deviceExtension2 = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
return FilterPass(DeviceObject, Irp);
}
DbgPrint(“Testing After Filter Pass1\n”);
deviceExtension = ControlDeviceObject->DeviceExtension;
DbgPrint(“Testing After Filter Pass2\n”);
if(!deviceExtension->Deleted) { //if not deleted
DbgPrint(“Testing 3\n”);
status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
irpStack = IoGetCurrentIrpStackLocation (Irp);
} else {
DbgPrint(“Testing 4\n”);
ASSERTMSG(FALSE, “Requests being sent to a dead device\n”);
status = STATUS_DEVICE_REMOVED;
}
DbgPrint(“Testing 5\n”);
*DbgPrint(“FilterCreate down called \n”);
*
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return status;
}
** And another from FilterDispatchIo(…)
{
if(DeviceObject != ControlDeviceObject) {
…
DbgPrint(“Safe Mode Testing Filter Dispatch 1\n”);
return FilterPass(DeviceObject, Irp);
}
deviceExtension = ControlDeviceObject->DeviceExtension;
…
}
And what I get via WinDbg is as follows during Normal Boot:
…
BitMap success returned for F Drive
…
Status FilterPass=0
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=0
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=80000005
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=0
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=c0000010
*Fips device driver loaded successfully
*Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=103
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=103
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=103
…
…
Testing After Filter Pass1
Testing After Filter Pass2
Testing 3
Testing 5
*FilterCreate down called
*Testing Filter Dispatch 2
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=103
And while during safe-boot,
BitMap success returned for F
…
Status FilterPass=0
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=c0000010
Testing 2
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=0
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=0
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=103
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=80000005
Testing Filter Dispatch 1
Testing Filter Pass1
Testing Filter Pass3
Testing Filter Pass4
Status FilterPass=0
And no such message came like -
*‘Fips device driver loaded successfully’ or 'FilterCreate down called '*
So Can anyone pls tell me where the driver is getting stuck or what could be
the problem in Sfae-Mode , may be some special care need to be taken for
safe-boot , So please throw some light on this …
Thanks.
Anuj Agarwal