mirror of
https://github.com/reactos/reactos.git
synced 2024-12-25 16:50:57 +00:00
last bugfixes for cmd
svn path=/trunk/; revision=389
This commit is contained in:
parent
7e74c066a7
commit
eda973b1cc
7 changed files with 44 additions and 23 deletions
|
@ -197,27 +197,35 @@ Execute (LPTSTR first, LPTSTR rest)
|
|||
else
|
||||
{
|
||||
/* exec the program */
|
||||
#ifndef __REACTOS__
|
||||
TCHAR szFullCmdLine [1024];
|
||||
#endif
|
||||
PROCESS_INFORMATION prci;
|
||||
STARTUPINFO stui;
|
||||
// DWORD dwError = 0;
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf ("[EXEC: %s %s]\n", szFullName, rest);
|
||||
#endif
|
||||
#ifndef __REACTOS__
|
||||
/* build command line for CreateProcess() */
|
||||
_tcscpy (szFullCmdLine, szFullName);
|
||||
_tcscat (szFullCmdLine, _T(" "));
|
||||
_tcscat (szFullCmdLine, rest);
|
||||
#endif
|
||||
|
||||
/* fill startup info */
|
||||
memset (&stui, 0, sizeof (STARTUPINFO));
|
||||
stui.cb = sizeof (STARTUPINFO);
|
||||
stui.dwFlags = STARTF_USESHOWWINDOW;
|
||||
stui.wShowWindow = SW_SHOWDEFAULT;
|
||||
|
||||
|
||||
#ifndef __REACTOS__
|
||||
if (CreateProcess (NULL, szFullCmdLine, NULL, NULL, FALSE,
|
||||
0, NULL, NULL, &stui, &prci))
|
||||
0, NULL, NULL, &stui, &prci))
|
||||
#else
|
||||
if (CreateProcess (szFullName, rest, NULL, NULL, FALSE,
|
||||
0, NULL, NULL, &stui, &prci))
|
||||
#endif
|
||||
{
|
||||
DWORD dwExitCode;
|
||||
WaitForSingleObject (prci.hProcess, INFINITE);
|
||||
|
@ -229,7 +237,7 @@ Execute (LPTSTR first, LPTSTR rest)
|
|||
else
|
||||
{
|
||||
ErrorMessage (GetLastError (),
|
||||
"Error executing CreateProcess()!!\n");
|
||||
"Error executing CreateProcess()!!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,9 @@ VOID ConInKey (PINPUT_RECORD lpBuffer)
|
|||
|
||||
do
|
||||
{
|
||||
WaitForSingleObject (hInput, INFINITE);
|
||||
#ifndef __REACTOS__
|
||||
WaitForSingleObject (hInput, INFINITE);
|
||||
#endif
|
||||
ReadConsoleInput (hInput, lpBuffer, 1, &dwRead);
|
||||
if ((lpBuffer->EventType == KEY_EVENT) &&
|
||||
(lpBuffer->Event.KeyEvent.bKeyDown == TRUE))
|
||||
|
@ -239,5 +241,5 @@ VOID SetCursorType (BOOL bInsert, BOOL bVisible)
|
|||
cci.dwSize = bInsert ? 10 : 100;
|
||||
cci.bVisible = bVisible;
|
||||
|
||||
// SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
|
||||
SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
#define ENV_BUFFER_SIZE 1024
|
||||
|
||||
|
||||
static LPTSTR ext[] = {".BAT", ".CMD", ".COM", ".EXE"};
|
||||
static LPTSTR ext[] = {".bat", ".cmd", ".com", ".exe"};
|
||||
static INT nExtCount = sizeof(ext) / sizeof(LPTSTR);
|
||||
|
||||
|
||||
|
@ -89,7 +89,7 @@ BOOL
|
|||
SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
||||
{
|
||||
TCHAR szPathBuffer[MAX_PATH];
|
||||
LPTSTR pszBuffer;
|
||||
LPTSTR pszBuffer = NULL;
|
||||
DWORD dwBuffer;
|
||||
INT n;
|
||||
LPTSTR p,s,f;
|
||||
|
@ -99,8 +99,7 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
|||
dwBuffer = GetEnvironmentVariable (_T("PATH"), pszBuffer, ENV_BUFFER_SIZE);
|
||||
if (dwBuffer == 0)
|
||||
{
|
||||
ConErrPrintf (_T("Not PATH environment variable found!\n"));
|
||||
return 0;
|
||||
ConErrPrintf (_T("No PATH environment variable found!\n"));
|
||||
}
|
||||
else if (dwBuffer > ENV_BUFFER_SIZE)
|
||||
{
|
||||
|
@ -135,6 +134,7 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
|||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("Testing: \'%s\'\n"), szPathBuffer);
|
||||
#endif
|
||||
ConOutPrintf(_T("Testing: \'%s\'\n"), szPathBuffer);
|
||||
|
||||
if (IsValidFileName (szPathBuffer))
|
||||
{
|
||||
|
@ -259,4 +259,4 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
|||
free (pszBuffer);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -608,7 +608,8 @@ SetConsoleCP = SetConsoleCP@4
|
|||
;SetConsoleCommandHistoryMode@4
|
||||
;SetConsoleCtrlHandler@8
|
||||
;SetConsoleCursor@8
|
||||
;SetConsoleCursorInfo@8
|
||||
SetConsoleCursorInfo@8
|
||||
SetConsoleCursorInfo = SetConsoleCursorInfo@8
|
||||
SetConsoleCursorPosition@8
|
||||
SetConsoleCursorPosition = SetConsoleCursorPosition@8
|
||||
;SetConsoleDisplayMode@12
|
||||
|
|
|
@ -197,27 +197,35 @@ Execute (LPTSTR first, LPTSTR rest)
|
|||
else
|
||||
{
|
||||
/* exec the program */
|
||||
#ifndef __REACTOS__
|
||||
TCHAR szFullCmdLine [1024];
|
||||
#endif
|
||||
PROCESS_INFORMATION prci;
|
||||
STARTUPINFO stui;
|
||||
// DWORD dwError = 0;
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf ("[EXEC: %s %s]\n", szFullName, rest);
|
||||
#endif
|
||||
#ifndef __REACTOS__
|
||||
/* build command line for CreateProcess() */
|
||||
_tcscpy (szFullCmdLine, szFullName);
|
||||
_tcscat (szFullCmdLine, _T(" "));
|
||||
_tcscat (szFullCmdLine, rest);
|
||||
#endif
|
||||
|
||||
/* fill startup info */
|
||||
memset (&stui, 0, sizeof (STARTUPINFO));
|
||||
stui.cb = sizeof (STARTUPINFO);
|
||||
stui.dwFlags = STARTF_USESHOWWINDOW;
|
||||
stui.wShowWindow = SW_SHOWDEFAULT;
|
||||
|
||||
|
||||
#ifndef __REACTOS__
|
||||
if (CreateProcess (NULL, szFullCmdLine, NULL, NULL, FALSE,
|
||||
0, NULL, NULL, &stui, &prci))
|
||||
0, NULL, NULL, &stui, &prci))
|
||||
#else
|
||||
if (CreateProcess (szFullName, rest, NULL, NULL, FALSE,
|
||||
0, NULL, NULL, &stui, &prci))
|
||||
#endif
|
||||
{
|
||||
DWORD dwExitCode;
|
||||
WaitForSingleObject (prci.hProcess, INFINITE);
|
||||
|
@ -229,7 +237,7 @@ Execute (LPTSTR first, LPTSTR rest)
|
|||
else
|
||||
{
|
||||
ErrorMessage (GetLastError (),
|
||||
"Error executing CreateProcess()!!\n");
|
||||
"Error executing CreateProcess()!!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,9 @@ VOID ConInKey (PINPUT_RECORD lpBuffer)
|
|||
|
||||
do
|
||||
{
|
||||
WaitForSingleObject (hInput, INFINITE);
|
||||
#ifndef __REACTOS__
|
||||
WaitForSingleObject (hInput, INFINITE);
|
||||
#endif
|
||||
ReadConsoleInput (hInput, lpBuffer, 1, &dwRead);
|
||||
if ((lpBuffer->EventType == KEY_EVENT) &&
|
||||
(lpBuffer->Event.KeyEvent.bKeyDown == TRUE))
|
||||
|
@ -239,5 +241,5 @@ VOID SetCursorType (BOOL bInsert, BOOL bVisible)
|
|||
cci.dwSize = bInsert ? 10 : 100;
|
||||
cci.bVisible = bVisible;
|
||||
|
||||
// SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
|
||||
SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
#define ENV_BUFFER_SIZE 1024
|
||||
|
||||
|
||||
static LPTSTR ext[] = {".BAT", ".CMD", ".COM", ".EXE"};
|
||||
static LPTSTR ext[] = {".bat", ".cmd", ".com", ".exe"};
|
||||
static INT nExtCount = sizeof(ext) / sizeof(LPTSTR);
|
||||
|
||||
|
||||
|
@ -89,7 +89,7 @@ BOOL
|
|||
SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
||||
{
|
||||
TCHAR szPathBuffer[MAX_PATH];
|
||||
LPTSTR pszBuffer;
|
||||
LPTSTR pszBuffer = NULL;
|
||||
DWORD dwBuffer;
|
||||
INT n;
|
||||
LPTSTR p,s,f;
|
||||
|
@ -99,8 +99,7 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
|||
dwBuffer = GetEnvironmentVariable (_T("PATH"), pszBuffer, ENV_BUFFER_SIZE);
|
||||
if (dwBuffer == 0)
|
||||
{
|
||||
ConErrPrintf (_T("Not PATH environment variable found!\n"));
|
||||
return 0;
|
||||
ConErrPrintf (_T("No PATH environment variable found!\n"));
|
||||
}
|
||||
else if (dwBuffer > ENV_BUFFER_SIZE)
|
||||
{
|
||||
|
@ -135,6 +134,7 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
|||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("Testing: \'%s\'\n"), szPathBuffer);
|
||||
#endif
|
||||
ConOutPrintf(_T("Testing: \'%s\'\n"), szPathBuffer);
|
||||
|
||||
if (IsValidFileName (szPathBuffer))
|
||||
{
|
||||
|
@ -259,4 +259,4 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
|||
free (pszBuffer);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue