Tom's Hardware > Forum > Windows XP > Device Driver > Filter Driver - Not intercepting IRP’s.

Filter Driver - Not intercepting IRP’s.

Forum Windows XP : Device Driver - Filter Driver - Not intercepting IRP’s.

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsxp.device_driver.dev (More info?)

 

Hi,
I am writing a File system Fileter driver to listen all the File
system calls.
In the Device Entry function, i am creating a device object and set it
in IO manager by IoAttachDeviceToDeviceStack method.
the code is...
------
<code>
ntStatus = IoCreateDevice(
DriverObject,
sizeof(DEVICE_EXTENSION),
&deviceNameUnicodeString,
FILE_DEVICE_UNKNOWN,
0,
TRUE,
&filterDeviceObject);

pDevExt = (PDEVICE_EXTENSION) filterDeviceObject->DeviceExtension;
pDevExt->pDevice = filterDeviceObject; // back pointer
pDevExt->driver_state = Stopped;

LogEvent(ntStatus, filterDeviceObject, L"\nFilterDriver2.SYS:
Entering DriverEntry\n" );

pDevExt->pTargetDevice = IoAttachDeviceToDeviceStack(
filterDeviceObject,
DriverObject->DeviceObject);
</code>
-----------
DriverObject is passed in the DriverEntry function.
Now, I am setting the flag for the filterDeviceObject by using,

<code>
pFilterDevObj->DeviceType = pDevExt->pTargetDevice->DeviceType;
pFilterDevObj->Characteristics =
pDevExt->pTargetDevice->Characteristics;

pFilterDevObj->Flags |= ( pDevExt->pTargetDevice->Flags &
( DO_BUFFERED_IO |
DO_POWER_INRUSH |
DO_POWER_PAGABLE));

// Initialize Event Logging counters:
pDevExt->IrpRetryCount = 0;
pDevExt->IrpSequenceNumber = 0;
</code>

When setting the flag, the system crashes and restarts.

How to solve this

If I remove setting flags, I unable to intercept the IRP’s.

How to do this

Thanks in advance.

--
http://www.WindowsForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.WindowsForumz.com/Devic [...] 68203.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.WindowsForumz.com/eform.php?p=489077

Sponsored Links
Register or log in to remove.
Tom's Hardware > Forum > Windows XP > Device Driver > Filter Driver - Not intercepting IRP’s.
Go to:

There are 1000 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them