Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 30 Jan 2002 13:14:16 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: A real fork() on NT Message-ID: <20020130131416.D11608@cygbert.vinschen.de> Mail-Followup-To: cygwin AT cygwin DOT com References: <006e01c1a96a$f60429a0$aace0544 AT CX535256D> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.22.1i On Wed, Jan 30, 2002 at 11:03:00AM +0000, Christopher January wrote: > > When looking at XP's CreateProcessW (or rather, CreateProcessInternalW) I > > noticed something strange about the way it creates a process. It seems > > that NT is sort of capable of a fork() command. The function > > NtCreateProcess appears to create a "blank" process, into which you can put > > anything you want. After NtCreateProcess, kernel32 maps the EXE into that > > new process's memory space, creates a thread, and finally calls > > NtResumeThread to start its execution. > > > > If this long, nasty, scattered function could be reverse engineered, it > > should be possible to create a true fork() for NT, instead of doing the > > normal cygwin "hack" method. > Coincidentally, I was looking into a similar thing myself. Windows NT has a > POSIX subsystem that's capable of doing fork()'s so it is obviously possible. > Have you any ideas of the arguments passed to the function or what it returns? That isn't really new. I'd like to point you to the example 6.1, "Forking a Win32 Process" on p. 161ff of Gary Nebbett's excellent book "Windows NT/2000 Native API Reference", published by MTP, ISBN 1-57870-199-6, which also describes the problem with kernel32.dll initialization of the child process. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/