On Sun, 12 Dec 2004 14:02:54 +0100, you wrote:
Is this one acceptable?
If there is still a problem, then I need more hints to what is needed.
the only part which is questionnable is as follows:
- what happens (in your case) if the child (after being run through all the
init) calls FreeConsole and then AllocConsole?
- I don't know the answer. The patch will let the new standard handles be still
the ones the child as inherited, while it could be the ones allocated by AllocConsole. I don't know the answer for sure (my wild guess would be the second), but that requires testing (and a proper test case for winetest wouldn't hurt of course). If I'm right, then you should keep AllocConsole as it is and in dlls/kernel/kernel_main.c set the default handles to what's inherited after calling AllocConsole
Eric,
Testing on Win2K:
If I do a FreeConsole() & AllocConsole() in a child that has obtained stdio handles from the StartupInfo struct, I get exactly the same handles. Even the CREATE_NEW_CONSOLE flag is irrelevant. In contrast, if the handles are just inherited (no STARTF_USESTDHANDLES flag), I get new handles directed to the new console.
So, with luck, I think my approach seems the correct one.
Resubmitting, with minor cleanups.
Changelog: server : process.c dlls/kernel : console.c A starting process must obey the STARTF_USESTDHANDLES flag and use the standard io handles from the StartupInfo structure, even it is starting a new console.
Rein.