Hi,
I have created the shadow device object as below with its dispatch routine.
//---------------------------------CREATING SHADOW DEVICE
OBJECT----------------------//
status =
IoCreateDevice(gFileSpyDriverObject, sizeof(MY_DEVICE_EXTENSION),
&nameString, FILE_DEVICE_UNKNOWN, 0, FALSE, &fdo);
ClearFlag(fdo->Flags, DO_DEVICE_INITIALIZING);
//-----------------------------------------------------------------------------------------------------------//
After this i initialize the stack size of the device object and Device
Extension.
//-------------------------------------DISPATCH
ROUTINE-----------------------------------------//
PDEVICE_OBJECT attachedDevice =
((MY_DEVICE_EXTENSION)DeviceObject->DeviceExtension->RealDeviceObject->DeviceExtension)->AttachedToDeviceObject;
PFILE_OBJECT fileObject;
DbgPrint(“SHADOW DEVICE OBJECT…\n”);
pIoStackLocation = IoGetCurrentIrpStackLocation(Irp);
fileObject->DeviceObject = attachedDevice;
IoSkipCurrentIrpStackLocation(Irp);
status = IoCallDriver( attachedDevice, Irp );
//--------------------------------------------------------------------------------------------------------//
When the call comes to me i call ZwCreateFile during normal disptach but i
redirect this call to the shadow device and then call ZwClose.
The Problem is that the call hangs in my Dispatch routine at IoCallDriver
when i try to open the file from network. First time the call passes but the
second time it tries to call it again it fails. (while opening a file in
wordpad the file can be opened multiple times.)
Please let me know if there is some problem here
Thanks
Suhail
Get fast, reliable Internet access with MSN 9 Dial-up – now 3 months FREE!
http://join.msn.click-url.com/go/onm00200361ave/direct/01/