Hi Maxim,<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>
<o:p> </o:p>
Thank you for the reply. Anything I can do to replace locking the pages would be very good. Just so I’m clear, you’re saying that the IOCTL IRP (MJ_SYSTEM_CONTROL?) that makes the shared memory request should use METHOD_xxx_DIRECT (IN for output and OUT for input), and that pending this IRP in the dispatch handler will effectively lock the memory? Forgive my ignorance, but if Process A, say, makes a shared memory request, and I pend its IRP, and Process B comes along with the same request, and then Process A abnormally terminates, how do I resolve which IRP to cancel? You say to cancel all pending IRP’s, but then wouldn’t
that effectively unlock Process B’s shared memory? I’m obviously missing something here.<o:p></o:p>
<o:p> </o:p>
-Mike<o:p></o:p>
<o:p> </o:p>
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Wednesday, June 28, 2006 11:43 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Determing Process ID with shared memory
<o:p> </o:p>
> I have a filter driver that can potentially have any number of processes set<o:p></o:p>
up its<o:p></o:p>
>own shared memory. I segregate the separate locked pages by using the<o:p></o:p>
>process ID of the requesting processs using PsGetCurrentProcessId(). When<o:p></o:p>
<o:p> </o:p>
You can lock the pages by pending the METHOD_xxx_DIRECT IOCTL IRP, instead of<o:p></o:p>
doing your own MmProbeAndLockPages.<o:p></o:p>
<o:p> </o:p>
If this IRP will be cancellable - then its completion at cancellation will<o:p></o:p>
automatically do the job.<o:p></o:p>
<o:p> </o:p>
In MJ_CLEANUP handler, just cancel all pending IRPs.<o:p></o:p>
<o:p> </o:p>
Maxim Shatskih, Windows DDK MVP<o:p></o:p>
StorageCraft Corporation<o:p></o:p>
xxxxx@storagecraft.com<o:p></o:p>
http://www.storagecraft.com<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
—<o:p></o:p>
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17<o:p></o:p>
<o:p> </o:p>
You are currently subscribed to ntfsd as: xxxxx@spursuits.com<o:p></o:p>
To unsubscribe send a blank email to xxxxx@lists.osr.com<o:p></o:p>