diff --git a/reactos/apps/utils/cmd/cmd.c b/reactos/apps/utils/cmd/cmd.c index 4ace3a339b8..3d928b32d7a 100644 --- a/reactos/apps/utils/cmd/cmd.c +++ b/reactos/apps/utils/cmd/cmd.c @@ -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"); } } } diff --git a/reactos/apps/utils/cmd/console.c b/reactos/apps/utils/cmd/console.c index d5a68b9cae1..03d0dfb8a8a 100644 --- a/reactos/apps/utils/cmd/console.c +++ b/reactos/apps/utils/cmd/console.c @@ -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); } diff --git a/reactos/apps/utils/cmd/where.c b/reactos/apps/utils/cmd/where.c index 70f96c39e87..fab018d0d0e 100644 --- a/reactos/apps/utils/cmd/where.c +++ b/reactos/apps/utils/cmd/where.c @@ -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; -} \ No newline at end of file +} diff --git a/reactos/lib/kernel32/kernel32.def b/reactos/lib/kernel32/kernel32.def index 5a6a540cd96..338e2117fe2 100644 --- a/reactos/lib/kernel32/kernel32.def +++ b/reactos/lib/kernel32/kernel32.def @@ -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 diff --git a/rosapps/cmd/cmd.c b/rosapps/cmd/cmd.c index 4ace3a339b8..3d928b32d7a 100644 --- a/rosapps/cmd/cmd.c +++ b/rosapps/cmd/cmd.c @@ -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"); } } } diff --git a/rosapps/cmd/console.c b/rosapps/cmd/console.c index d5a68b9cae1..03d0dfb8a8a 100644 --- a/rosapps/cmd/console.c +++ b/rosapps/cmd/console.c @@ -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); } diff --git a/rosapps/cmd/where.c b/rosapps/cmd/where.c index 70f96c39e87..fab018d0d0e 100644 --- a/rosapps/cmd/where.c +++ b/rosapps/cmd/where.c @@ -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; -} \ No newline at end of file +}