If I have a memory mapping that I want to restrict to a single
process, I can, I think, use IoGetCurrentProcess() to get a cookie
that I can test. If the unmap ioctl is called by a process with
the same cookie, I will allow the unmap to proceed.
But how 'bout if the process that initially did the map dies?
If I can find a way to tell that a process is dead, then I can
automatically break the lock and allow the new mapping. So it
there a way, given a cookie from IoGetCurrentProcess(), or from
PsGetCurrentProcessId(), I can tell if the process is still alive?
I suppose I can track it with a create_process_notify routine,
but that seems like overkill, and there is no way to unregister
the notify routine when no longer needed.
Steve Williams “The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
steve at picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep.”
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
“Stephen Williams” wrote in message news:xxxxx@ntdev…
>
> But how 'bout if the process that initially did the map dies?
>
KEY to making any of these map things successful: REQUIRE the process to
keep an open handle to your driver when doing the mapping. When the handle
gets cleaned-up (or closed), you UNMAP the mapping.
So, effectively, you’re told whenever a process goes away…
Peter
OSR
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
xxxxx@osr.com said:
KEY to making any of these map things successful: REQUIRE the process
to keep an open handle to your driver when doing the mapping. When
the handle gets cleaned-up (or closed), you UNMAP the mapping.
I’ve come to a similar conclusion, and that’s what I’ve been doing.
Still, it seemed like Windows might have something more direct. Under
Linux and Solaris, the VMA struct for a mapped area has functions that
are called for such things as page misses and implicit unmapping. I’m
trying to get similar behavior out of Windows 2000. Arg, why do they
make these things so hard!
Steve Williams “The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
steve at picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep.”
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com