NTSTATUS Status;
BOOLEAN NotConsole = FALSE;
PRTL_USER_PROCESS_PARAMETERS Parameters = NtCurrentPeb()->ProcessParameters;
+ LPCWSTR ExeName;
WCHAR lpTest[MAX_PATH];
GetModuleFileNameW(NULL, lpTest, MAX_PATH);
{
/* Assume one is needed */
Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE;
+ Request.Data.AllocConsoleRequest.Visible = TRUE;
/* Handle the special flags given to us by BasepInitializeEnvironment */
if (Parameters->ConsoleHandle == HANDLE_DETACHED_PROCESS)
else if (Parameters->ConsoleHandle == HANDLE_CREATE_NO_WINDOW)
{
/* We'll get the real one soon */
- DPRINT1("NOT SUPPORTED: HANDLE_CREATE_NO_WINDOW\n");
+ DPRINT("Creating new invisible console\n");
Parameters->ConsoleHandle = NULL;
+ Request.Data.AllocConsoleRequest.Visible = FALSE;
}
else
{
}
}
- /* Initialize Console Ctrl Handler */
+ /* Initialize Console Ctrl Handler and input EXE name */
ConsoleInitialized = TRUE;
RtlInitializeCriticalSection(&ConsoleLock);
NrAllocatedHandlers = 1;
NrCtrlHandlers = 1;
CtrlHandlers = InitialHandler;
CtrlHandlers[0] = DefaultConsoleCtrlHandler;
+
+ ExeName = wcsrchr(Parameters->ImagePathName.Buffer, L'\\');
+ if (ExeName)
+ SetConsoleInputExeNameW(ExeName + 1);
/* Now use the proper console handle */
Request.Data.AllocConsoleRequest.Console = Parameters->ConsoleHandle;
wcscpy(SystemDirectory.Buffer, WindowsDirectory.Buffer);
wcscat(SystemDirectory.Buffer, L"\\System32");
+ /* Initialize command line */
+ InitCommandLines();
+
/* Open object base directory */
Status = OpenBaseDirectory(&hBaseDir);
if (!NT_SUCCESS(Status))
}
#undef InterlockedIncrement
+#undef InterlockedDecrement
+#undef InterlockedExchange
+#undef InterlockedExchangeAdd
+#undef InterlockedCompareExchange
+
LONG
WINAPI
InterlockedIncrement(IN OUT LONG volatile *lpAddend)
return _InterlockedIncrement(lpAddend);
}
-#undef InterlockedDecrement
LONG
WINAPI
InterlockedDecrement(IN OUT LONG volatile *lpAddend)
return _InterlockedDecrement(lpAddend);
}
-#undef InterlockedExchange
LONG
WINAPI
InterlockedExchange(IN OUT LONG volatile *Target,
return _InterlockedExchange(Target, Value);
}
-#undef InterlockedExchangeAdd
LONG
WINAPI
InterlockedExchangeAdd(IN OUT LONG volatile *Addend,
return _InterlockedExchangeAdd(Addend, Value);
}
-#undef InterlockedCompareExchange
LONG
WINAPI
InterlockedCompareExchange(IN OUT LONG volatile *Destination,