- fixed a couple of bugs in ntdll environment functions (one in trace,
  the other one in environment variable expansion)
- the process parameters, when passed thru wineserver, are now fully
  handled in ntdll, they are stored in the RTL_USER_PROCESS_PARAMETERS
  structure.
- later on in kernel32 loading sequence, those parameters are copied
  into STARTUPINFO shadow structures
- later modification to those paramters are now reflected to the
  RTL_USER_PROCESS_PARAMETERS structure (and STARTUPINFO is kept
  untouched) (for example, StdHandle setting) (Win 2k behaves like this)
- ENVDB has been removed
- command line inheritance (from unix command line) is now purely in ntdll
- all kernel32 environment functions now rely on their ntdll counterparts
- goodies: input/output handle inheritance while asking for a detached
  console is better handled; a few more kernel32 environment tests now
  pass ; silenced a valgrind warning in process creation

diff --git a/dlls/kernel/kernel_main.c b/dlls/kernel/kernel_main.c
index aa7296b..291c204 100644
--- a/dlls/kernel/kernel_main.c
+++ b/dlls/kernel/kernel_main.c
@@ -48,6 +48,8 @@
 extern void COMPUTERNAME_Init(void);
 
 extern  int __wine_set_signal_handler(unsigned, int (*)(unsigned));
+/* memory/environ.c */
+extern void ENV_CopyStartupInformation(void);
 
 extern int main_create_flags;
 
@@ -113,6 +115,9 @@
 
     /* Setup computer name */
     COMPUTERNAME_Init();
+    
+    /* copy process information from ntdll */
+    ENV_CopyStartupInformation();
 
     if ((hModule = LoadLibrary16( "krnl386.exe" )) >= 32)
     {
@@ -168,6 +173,14 @@
         if (RtlImageNtHeader(mod)->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI)
             AllocConsole();
     }
+    else if (!(main_create_flags & DETACHED_PROCESS))
+    {
+        /* 1/ shall inherit console + handles
+         * 2/ shall create std handles, if handles are not inherited
+         * TBD when not using wineserver handles for console handles
+         */
+    }
+
     if (main_create_flags & CREATE_NEW_PROCESS_GROUP)
         SetConsoleCtrlHandler(NULL, TRUE);