[Webkit-unassigned] [Bug 47500] Need a way to pass HANDLEs between processes on Windows

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 11 12:25:14 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=47500


Adam Roben (aroben) <aroben at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |47499




--- Comment #1 from Adam Roben (aroben) <aroben at apple.com>  2010-10-11 12:25:14 PST ---
In order to pass a HANDLE between processes, we'll need to call ::DuplicateHandle to copy the handle into the target process. But doing this requires knowing what the target process is, which is not known at argument-encoding time.

Anders suggests that we use CoreIPC::Attachment for this. Specifically, we'd:

A1) Make CoreIPC::Connection perform a handshake that exchanges process HANDLEs between the two ends of the connection (on Vista and newer we could perhaps use ::GetNamedPipeClientProcessId/::GetNamedPipeServerProcessId to simplify this)
A2) Use the process HANDLE received in the handshake to call ::DuplicateHandle when sending the message

I think another option that wouldn't require the handshake is:

B1) Call ::DuplicateHandle to duplicate the HANDLE in the source process at argument-encoding time
B2) Send both the HANDLE and the source process's PID in the message to the target process
B3) When the message is received in the target process, call ::DuplicateHandle to copy the handle into the target process and pass DUPLICATE_CLOSE_SOURCE to close the HANDLE the source process made in (B1)

I'm not positive that the ::DuplicateHandle call in (B3) will actually succeed, however. Maybe Windows doesn't allow it to be used like this.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list