Re: Process ID lifetime and how to marshal a kernel object handle
- From: "m" <m@xxx>
- Date: Mon, 12 Jan 2009 18:33:48 -0500
Is there a reason why you can't just open a new handle (by name) in the
second process?
One reliable way to keep a process around is to keep a handle open. The
process won't be cleaned up by the OS, and the ID won't be reused, until all
handles are closed.
"Arno Schoedl" <aschoedl@xxxxxxxxxxxxxx> wrote in message
news:3abb4347-a208-4d2b-8fb5-1981025468f4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I want to COM-marshal a kernel object handle from one process to
another. In IMarshal::MarshalInterface, I duplicate the handle within
the source process to hold a reference to the kernel object that I am
marshaling. In IMarshal::UnmarshalInterface, I duplicate the handle
from the source process to the destination process with
DUPLICATE_CLOSE_SOURCE.
The problem is that in doing that, I make use of the source process ID
stored in my marshal data. I am worried that in cases when the source
process has terminated, its process ID may be reused, and thus I may
end up duplicating some random handle. Is this worry warranted? Does
anyone have an idea on how to COM-marshal a handle correctly?
Arno
.
- Follow-Ups:
- Re: Process ID lifetime and how to marshal a kernel object handle
- From: Arno Schoedl
- Re: Process ID lifetime and how to marshal a kernel object handle
- References:
- Process ID lifetime and how to marshal a kernel object handle
- From: Arno Schoedl
- Process ID lifetime and how to marshal a kernel object handle
- Prev by Date: Re: how to use winddk
- Next by Date: Reading filenames with non-English characters
- Previous by thread: Re: Process ID lifetime and how to marshal a kernel object handle
- Next by thread: Re: Process ID lifetime and how to marshal a kernel object handle
- Index(es):
Relevant Pages
|