Re: Process ID lifetime and how to marshal a kernel object handle

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Jan 16, 9:40 pm, "Pavel A." <pave...@xxxxxxxxxxxxxxx> wrote:
Arno Schoedl wrote:
What is the 1st process (that owns the handle) just opens the
2nd, and then duplicates the handle into it.

In COM marshalling, you don't know the destination process when
creating the marshal data. Whichever process gets it and calls
Unmarshal is expected to be able to unmarshal.

Arno

Ok. then - how to pass the id of the destination process back to the 1st
process?

--PA

I don't. I copy the handle within the source process, store its value
in the marshal data, and then copy it again from the destination
process, at which time the destination process ID is known, of course.
The first copy is necessary to prevent the file from closing when the
original source process handle is closed while the handle is still "on
the wire".
.



Relevant Pages