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);
else
{
ErrorMessage (GetLastError (),
- "Error executing CreateProcess()!!\n");
+ "Error executing CreateProcess()!!\n");
}
}
}
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))
cci.dwSize = bInsert ? 10 : 100;
cci.bVisible = bVisible;
-// SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
+ SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
}
#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);
SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
{
TCHAR szPathBuffer[MAX_PATH];
- LPTSTR pszBuffer;
+ LPTSTR pszBuffer = NULL;
DWORD dwBuffer;
INT n;
LPTSTR p,s,f;
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)
{
#ifdef _DEBUG
DebugPrintf (_T("Testing: \'%s\'\n"), szPathBuffer);
#endif
+ConOutPrintf(_T("Testing: \'%s\'\n"), szPathBuffer);
if (IsValidFileName (szPathBuffer))
{
free (pszBuffer);
return FALSE;
-}
\ No newline at end of file
+}
;SetConsoleCommandHistoryMode@4
;SetConsoleCtrlHandler@8
;SetConsoleCursor@8
-;SetConsoleCursorInfo@8
+SetConsoleCursorInfo@8
+SetConsoleCursorInfo = SetConsoleCursorInfo@8
SetConsoleCursorPosition@8
SetConsoleCursorPosition = SetConsoleCursorPosition@8
;SetConsoleDisplayMode@12
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);
else
{
ErrorMessage (GetLastError (),
- "Error executing CreateProcess()!!\n");
+ "Error executing CreateProcess()!!\n");
}
}
}
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))
cci.dwSize = bInsert ? 10 : 100;
cci.bVisible = bVisible;
-// SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
+ SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &cci);
}
#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);
SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
{
TCHAR szPathBuffer[MAX_PATH];
- LPTSTR pszBuffer;
+ LPTSTR pszBuffer = NULL;
DWORD dwBuffer;
INT n;
LPTSTR p,s,f;
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)
{
#ifdef _DEBUG
DebugPrintf (_T("Testing: \'%s\'\n"), szPathBuffer);
#endif
+ConOutPrintf(_T("Testing: \'%s\'\n"), szPathBuffer);
if (IsValidFileName (szPathBuffer))
{
free (pszBuffer);
return FALSE;
-}
\ No newline at end of file
+}