Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Message-ID: <00f201c21234$4e19d3b0$6132bc3e@BABEL> From: "Conrad Scott" To: "egor duda" Cc: References: <091e01c2120f$25e50290$6132bc3e AT BABEL> <1149904301 DOT 20020612194520 AT logos-m DOT ru> Subject: Re: DuplicateHandle() question Date: Wed, 12 Jun 2002 18:12:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Egor, Thanks for the reply. "egor duda" wrote: > Hi! > > Conrad Scott Conrad DOT Scott AT dsl DOT pipex DOT com wrote: > CS> how can it close that child handle? Or can't it? If it can't, the server > CS> will have to arrange for the client to close it for itself, which makes the > CS> error handling all the more complex (i.e. send back the offending handle > CS> along with the error response). > > I don't quite understand why server would want client to discard some > handle. Can you describe step-by-step scenario when it's needed? Do > you have shmctl(..., IPC_RMID, ...) in mind? Not shmctl(2) but shmget(2): when creating and accessing shm segments for a client, the cygserver calls CreateFileMapping() to create the memory areas and then uses DuplicateHandle() on the resulting handles to create handles for the client (in client process) to these file mappings. The problem then arises that the sever can fail having duplicated some but not all of the handles for the client, i.e. it's just an error cleanup question: I'm not looking to have the server arbitrarily close client handles. AIUI at that point the handles are valid in the client process but the server can't close them, i.e. the client has to close them. Is that true or is there some way for the server to close them (i.e. a "close in other process" function)? I assume not. Does that all make more sense? // Conrad p.s. I'm also assuming that trying to get the client to do the duplication is going to run into security issues, as that would solve the issue otherwise.