4 modified files
reactos/subsys/system/cmd
diff -u -r1.15 -r1.16
--- cmd.c 6 Jun 2004 17:33:13 -0000 1.15
+++ cmd.c 21 Jun 2004 18:57:22 -0000 1.16
@@ -1,4 +1,4 @@
-/* $Id: cmd.c,v 1.15 2004/06/06 17:33:13 hbirr Exp $
+/* $Id: cmd.c,v 1.16 2004/06/21 18:57:22 weiden Exp $
*
* CMD.C - command-line interface.
*
@@ -1334,7 +1334,7 @@
OPEN_EXISTING, 0, NULL);
if (GetConsoleScreenBufferInfo(hConsole, &Info) == FALSE)
{
- ConErrPrintf (_T("GetConsoleScreenBufferInfo: Error: %ld\n"), GetLastError());
+ ConOutFormatMessage(GetLastError());
return(1);
}
wColor = Info.wAttributes;
reactos/subsys/system/cmd
diff -u -r1.4 -r1.5
--- cmd.h 26 Dec 2003 09:52:37 -0000 1.4
+++ cmd.h 21 Jun 2004 18:57:22 -0000 1.5
@@ -1,4 +1,4 @@
-/* $Id: cmd.h,v 1.4 2003/12/26 09:52:37 navaraf Exp $
+/* $Id: cmd.h,v 1.5 2004/06/21 18:57:22 weiden Exp $
*
* CMD.H - header file for the modules in CMD.EXE
*
@@ -170,6 +170,7 @@
VOID ConErrChar (TCHAR);
VOID ConErrPuts (LPTSTR);
VOID ConErrPrintf (LPTSTR, ...);
+VOID ConOutFormatMessage (DWORD MessageId, ...);
SHORT GetCursorX (VOID);
SHORT GetCursorY (VOID);
reactos/subsys/system/cmd
diff -u -r1.5 -r1.6
--- console.c 30 Apr 2004 16:52:41 -0000 1.5
+++ console.c 21 Jun 2004 18:57:22 -0000 1.6
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.5 2004/04/30 16:52:41 navaraf Exp $
+/* $Id: console.c,v 1.6 2004/06/21 18:57:22 weiden Exp $
*
* CONSOLE.C - console input/output functions.
*
@@ -223,6 +223,20 @@
#endif
}
+VOID ConOutFormatMessage (DWORD MessageId, ...)
+{
+ DWORD temp;
+ LPTSTR text;
+ va_list arg_ptr;
+ temp = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ MessageId,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &text,
+ 0,
+ &arg_ptr);
+ ConErrPrintf (text);
+}
VOID ConOutPrintf (LPTSTR szFormat, ...)
{
reactos/subsys/system/cmd
diff -u -r1.3 -r1.4
--- internal.c 30 Jan 2004 12:34:02 -0000 1.3
+++ internal.c 21 Jun 2004 18:57:22 -0000 1.4
@@ -247,8 +247,8 @@
if (!SetCurrentDirectory (dir))
{
//ErrorMessage (GetLastError(), _T("CD"));
- ConErrPrintf (_T("Dir \"%s\" doesn't seem to exist!"),dir);
-
+ ConOutFormatMessage(GetLastError());
+
/* throw away current directory */
free (lpOldPath);
lpOldPath = NULL;
CVSspam 0.2.8