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 Date: Wed, 12 Jun 2002 19:45:20 +0400 From: egor duda Reply-To: egor duda Organization: deo X-Priority: 3 (Normal) Message-ID: <1149904301.20020612194520@logos-m.ru> To: "Conrad Scott" CC: cygwin-developers AT cygwin DOT com Subject: Re: DuplicateHandle() question In-Reply-To: <091e01c2120f$25e50290$6132bc3e@BABEL> References: <091e01c2120f$25e50290$6132bc3e AT BABEL> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! Wednesday, 12 June, 2002 Conrad Scott Conrad DOT Scott AT dsl DOT pipex DOT com wrote: CS> [I hope this is sufficiently on-topic for this list.] CS> I'm looking at the cygserver shm implementation and I've got a Win32 issue CS> that I wondered if anyone out there might be able to help me with. CS> The problem is that the server uses DuplicateHandle() to create a handle in CS> the client process. Then if the server later decides to abort the operation, It'd be late to decide. Being a server doesn't make it so important to decide for other process what to do with its handles. 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). CS> Any thoughts? or am I misunderstanding some deep fact about Win32 handles? Win32 handles are pretty similar to unix descriptors. if some process duplicates an fd and pass it, say, to child, it has no control of what child will do with his fds. 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? Egor. mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19