mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[RAPPS] improve ConInitStdStreams initialization logic (#3098)
This commit is contained in:
parent
7a11c65561
commit
ce0110195b
2 changed files with 10 additions and 6 deletions
|
@ -40,6 +40,7 @@ BOOL HandleInstallCommand(LPWSTR szCommand, int argcLeft, LPWSTR * argvLeft)
|
||||||
{
|
{
|
||||||
if (argcLeft == 0)
|
if (argcLeft == 0)
|
||||||
{
|
{
|
||||||
|
ConInitStdStreams(); // Initialize the Console Standard Streams
|
||||||
ConResMsgPrintf(StdOut, NULL, IDS_CMD_NEED_PACKAGE_NAME, szCommand);
|
ConResMsgPrintf(StdOut, NULL, IDS_CMD_NEED_PACKAGE_NAME, szCommand);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -72,9 +73,11 @@ BOOL HandleSetupCommand(LPWSTR szCommand, int argcLeft, LPWSTR * argvLeft)
|
||||||
{
|
{
|
||||||
if (argcLeft != 1)
|
if (argcLeft != 1)
|
||||||
{
|
{
|
||||||
|
ConInitStdStreams(); // Initialize the Console Standard Streams
|
||||||
ConResMsgPrintf(StdOut, NULL, IDS_CMD_NEED_FILE_NAME, szCommand);
|
ConResMsgPrintf(StdOut, NULL, IDS_CMD_NEED_FILE_NAME, szCommand);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
FreeConsole();
|
||||||
|
|
||||||
ATL::CSimpleArray<ATL::CStringW> PkgNameList;
|
ATL::CSimpleArray<ATL::CStringW> PkgNameList;
|
||||||
HINF InfHandle = SetupOpenInfFileW(argvLeft[0], NULL, INF_STYLE_WIN4, NULL);
|
HINF InfHandle = SetupOpenInfFileW(argvLeft[0], NULL, INF_STYLE_WIN4, NULL);
|
||||||
|
@ -272,6 +275,8 @@ BOOL ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
|
||||||
|
|
||||||
if (hMutex)
|
if (hMutex)
|
||||||
CloseHandle(hMutex);
|
CloseHandle(hMutex);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (MatchCmdOption(argv[1], CMD_KEY_INSTALL))
|
else if (MatchCmdOption(argv[1], CMD_KEY_INSTALL))
|
||||||
{
|
{
|
||||||
|
@ -281,7 +286,11 @@ BOOL ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
|
||||||
{
|
{
|
||||||
return HandleSetupCommand(argv[1], argc - 2, argv + 2);
|
return HandleSetupCommand(argv[1], argc - 2, argv + 2);
|
||||||
}
|
}
|
||||||
else if (MatchCmdOption(argv[1], CMD_KEY_FIND))
|
|
||||||
|
|
||||||
|
ConInitStdStreams(); // Initialize the Console Standard Streams
|
||||||
|
|
||||||
|
if (MatchCmdOption(argv[1], CMD_KEY_FIND))
|
||||||
{
|
{
|
||||||
return HandleFindCommand(argv[1], argc - 2, argv + 2);
|
return HandleFindCommand(argv[1], argc - 2, argv + 2);
|
||||||
}
|
}
|
||||||
|
@ -299,7 +308,4 @@ BOOL ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
|
||||||
ConResPuts(StdOut, IDS_CMD_INVALID_OPTION);
|
ConResPuts(StdOut, IDS_CMD_INVALID_OPTION);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,8 +145,6 @@ VOID SaveSettings(HWND hwnd)
|
||||||
|
|
||||||
int wmain(int argc, wchar_t *argv[])
|
int wmain(int argc, wchar_t *argv[])
|
||||||
{
|
{
|
||||||
ConInitStdStreams(); // Initialize the Console Standard Streams
|
|
||||||
|
|
||||||
BOOL bIsFirstLaunch;
|
BOOL bIsFirstLaunch;
|
||||||
|
|
||||||
InitializeAtlModule(GetModuleHandle(NULL), TRUE);
|
InitializeAtlModule(GetModuleHandle(NULL), TRUE);
|
||||||
|
|
Loading…
Reference in a new issue