Crashing: IRP_MJ_CREATE

Hi,

The driver is crashing when i tried to access an Global linked list structure inside the IRP_MJ_CREATE. I have not implemented any locking mechanism. Is it neccesssary to lock before accessing the data structure? if so, please let me know which locking mechanism is best suited to minifilter driver.

Thanks in Advance.
Srinivasa Raghavan.

Yes you can have concurrent IRP_MJ_CREATE’s or IRP_MJ_CREATE and other
calls concurrent so you need locking. Asking what type of locking is
dependant on what your design is, Windows has a large number of constructs
for locking, the best choice depends on IRQL, the type of access (i.e. do
you know if it is a read or a write) and the length of time the lock is
being held.

You should have some basic knowledge of the above before you go near a file
system filter, have your company send you to a drivers class.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply

wrote in message news:xxxxx@ntfsd…
> Hi,
>
> The driver is crashing when i tried to access an Global linked list
> structure inside the IRP_MJ_CREATE. I have not implemented any locking
> mechanism. Is it neccesssary to lock before accessing the data structure?
> if so, please let me know which locking mechanism is best suited to
> minifilter driver.
>
> Thanks in Advance.
> Srinivasa Raghavan.
>

Absent any additional insight (along Don’s line of questioning) my first suggestion would be to start with an ERESOURCE lock. This is almost always sufficient for any file system or file system filter driver and is FAR easier to debug than any other form of lock.

ERESOURCE locks also work well with lists. Use the shared version for looking things up in the list and the exclusive version for adding or removing to/from the list.

But Don’s point is a good one, that the question you are asking is way too broad - it is sort of like asking us “what car do you recommend to me” without us knowing ANYTHING about you or your problem.

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com