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 A+