Author: jmorlan
Date: Sat Jul 26 17:49:49 2008
New Revision: 34816
URL:
http://svn.reactos.org/svn/reactos?rev=34816&view=rev
Log:
- In cmd, add ConOutResPrintf and ConErrResPrintf functions for printf-ing from a resource
string; use it to shorten several instances of LoadString+Con*Printf.
- Also change FilePromptYN and FilePromptYNA to take a resource ID. Remove varargs code
which nobody used (and didn't actually work anyway)
Modified:
trunk/reactos/base/shell/cmd/chcp.c
trunk/reactos/base/shell/cmd/choice.c
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/color.c
trunk/reactos/base/shell/cmd/console.c
trunk/reactos/base/shell/cmd/copy.c
trunk/reactos/base/shell/cmd/date.c
trunk/reactos/base/shell/cmd/del.c
trunk/reactos/base/shell/cmd/echo.c
trunk/reactos/base/shell/cmd/error.c
trunk/reactos/base/shell/cmd/free.c
trunk/reactos/base/shell/cmd/goto.c
trunk/reactos/base/shell/cmd/internal.c
trunk/reactos/base/shell/cmd/label.c
trunk/reactos/base/shell/cmd/memory.c
trunk/reactos/base/shell/cmd/misc.c
trunk/reactos/base/shell/cmd/move.c
trunk/reactos/base/shell/cmd/path.c
trunk/reactos/base/shell/cmd/ren.c
trunk/reactos/base/shell/cmd/replace.c
trunk/reactos/base/shell/cmd/set.c
trunk/reactos/base/shell/cmd/timer.c
trunk/reactos/base/shell/cmd/type.c
trunk/reactos/base/shell/cmd/ver.c
trunk/reactos/base/shell/cmd/verify.c
trunk/reactos/base/shell/cmd/vol.c
Modified: trunk/reactos/base/shell/cmd/chcp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/chcp.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/chcp.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/chcp.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -19,7 +19,6 @@
INT CommandChcp (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR *arg;
INT args;
UINT uNewCodePage;
@@ -39,8 +38,7 @@
if (args == 0)
{
/* display active code page number */
- LoadString(CMD_ModuleHandle, STRING_CHCP_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, InputCodePage);
+ ConErrResPrintf(STRING_CHCP_ERROR1, InputCodePage);
freep (arg);
return 0;
}
@@ -48,8 +46,7 @@
if (args >= 2)
{
/* too many parameters */
- LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_PARAM_FORMAT, szMsg,
RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, param);
+ ConErrResPrintf(STRING_ERROR_INVALID_PARAM_FORMAT, param);
nErrorLevel = 1;
freep (arg);
return 1;
@@ -59,8 +56,7 @@
if (uNewCodePage == 0)
{
- LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_PARAM_FORMAT, szMsg,
RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, arg[0]);
+ ConErrResPrintf(STRING_ERROR_INVALID_PARAM_FORMAT, arg[0]);
freep (arg);
nErrorLevel = 1;
return 1;
Modified: trunk/reactos/base/shell/cmd/choice.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/choice.c?re…
==============================================================================
--- trunk/reactos/base/shell/cmd/choice.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/choice.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -102,7 +102,6 @@
INT
CommandChoice (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR lpOptions;
TCHAR Options[6];
LPTSTR lpText = NULL;
@@ -208,8 +207,7 @@
}
else if (arg[i][0] == _T('/'))
{
- LoadString(CMD_ModuleHandle, STRING_CHOICE_ERROR_OPTION, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, arg[i]);
+ ConErrResPrintf(STRING_CHOICE_ERROR_OPTION, arg[i]);
freep (arg);
return 1;
}
Modified: trunk/reactos/base/shell/cmd/cmd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -687,7 +687,6 @@
VOID ParseCommandLine (LPTSTR cmd)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR cmdline[CMDLINE_LENGTH];
LPTSTR s;
#ifdef FEATURE_REDIRECTION
@@ -786,15 +785,13 @@
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, in);
+ ConErrResPrintf(STRING_CMD_ERROR1, in);
return;
}
if (!SetStdHandle (STD_INPUT_HANDLE, hFile))
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, in);
+ ConErrResPrintf(STRING_CMD_ERROR1, in);
return;
}
TRACE ("Input redirected from: %s\n", debugstr_aw(in));
@@ -820,8 +817,7 @@
if (hFile[1] == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR2, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg);
+ ConErrResPrintf(STRING_CMD_ERROR2);
return;
}
@@ -884,8 +880,7 @@
if (out[size] != _T(':'))
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, out);
+ ConErrResPrintf(STRING_CMD_ERROR3, out);
return;
}
@@ -896,8 +891,7 @@
if (hFile == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, out);
+ ConErrResPrintf(STRING_CMD_ERROR3, out);
return;
}
@@ -905,8 +899,7 @@
if (!SetStdHandle (STD_OUTPUT_HANDLE, hFile))
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, out);
+ ConErrResPrintf(STRING_CMD_ERROR3, out);
return;
}
@@ -955,16 +948,14 @@
NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, err);
+ ConErrResPrintf(STRING_CMD_ERROR3, err);
return;
}
}
if (!SetStdHandle (STD_ERROR_HANDLE, hFile))
{
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, err);
+ ConErrResPrintf(STRING_CMD_ERROR3, err);
return;
}
Modified: trunk/reactos/base/shell/cmd/cmd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -161,6 +161,8 @@
VOID ConOutResPuts (UINT resID);
VOID ConErrResPuts (UINT resID);
+VOID ConOutResPrintf (UINT resID, ...);
+VOID ConErrResPrintf (UINT resID, ...);
VOID ConOutResPaging(BOOL NewPage, UINT resID);
/* Prototypes for COPY.C */
@@ -311,8 +313,8 @@
#define PROMPT_BREAK 3
INT PagePrompt (VOID);
-INT FilePromptYN (LPTSTR, ...);
-INT FilePromptYNA (LPTSTR, ...);
+INT FilePromptYN (UINT);
+INT FilePromptYNA (UINT);
/* Prototypes for MOVE.C */
Modified: trunk/reactos/base/shell/cmd/color.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/color.c?rev…
==============================================================================
--- trunk/reactos/base/shell/cmd/color.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/color.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -65,8 +65,6 @@
*/
INT CommandColor (LPTSTR first, LPTSTR rest)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
if (_tcsncmp (rest, _T("/?"), 2) == 0)
{
ConOutResPaging(TRUE,STRING_COLOR_HELP1);
@@ -115,14 +113,12 @@
if (((bc) && (bc->bEcho)) || !bc)
{
- LoadString(CMD_ModuleHandle, STRING_COLOR_ERROR3, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, wColor);
+ ConErrResPrintf(STRING_COLOR_ERROR3, wColor);
}
if ((wColor & 0xF) == (wColor &0xF0) >> 4)
{
- LoadString(CMD_ModuleHandle, STRING_COLOR_ERROR4, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, wColor);
+ ConErrResPrintf(STRING_COLOR_ERROR4, wColor);
nErrorLevel = 1;
return 1;
}
Modified: trunk/reactos/base/shell/cmd/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?r…
==============================================================================
--- trunk/reactos/base/shell/cmd/console.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/console.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -382,6 +382,17 @@
}
}
+VOID ConOutResPrintf (UINT resID, ...)
+{
+ TCHAR szMsg[RC_STRING_MAX_SIZE];
+ va_list arg_ptr;
+
+ va_start (arg_ptr, resID);
+ LoadString(CMD_ModuleHandle, resID, szMsg, RC_STRING_MAX_SIZE);
+ ConPrintf(szMsg, arg_ptr, STD_OUTPUT_HANDLE);
+ va_end (arg_ptr);
+}
+
VOID ConOutPrintf (LPTSTR szFormat, ...)
{
va_list arg_ptr;
@@ -420,6 +431,17 @@
ConPuts(szText, STD_ERROR_HANDLE);
}
+
+VOID ConErrResPrintf (UINT resID, ...)
+{
+ TCHAR szMsg[RC_STRING_MAX_SIZE];
+ va_list arg_ptr;
+
+ va_start (arg_ptr, resID);
+ LoadString(CMD_ModuleHandle, resID, szMsg, RC_STRING_MAX_SIZE);
+ ConPrintf(szMsg, arg_ptr, STD_ERROR_HANDLE);
+ va_end (arg_ptr);
+}
VOID ConErrPrintf (LPTSTR szFormat, ...)
{
Modified: trunk/reactos/base/shell/cmd/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/copy.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -54,7 +54,6 @@
DWORD lpdwFlags,
BOOL bTouch)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
FILETIME srctime,NewFileTime;
HANDLE hFileSrc;
HANDLE hFileDest;
@@ -80,8 +79,7 @@
NULL, OPEN_EXISTING, 0, NULL);
if (hFileSrc == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, source);
+ ConOutResPrintf(STRING_COPY_ERROR1, source);
nErrorLevel = 1;
return 0;
}
@@ -108,8 +106,7 @@
NULL, OPEN_EXISTING, 0, NULL);
if (hFileSrc == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, source);
+ ConOutResPrintf(STRING_COPY_ERROR1, source);
nErrorLevel = 1;
return 0;
}
@@ -286,18 +283,15 @@
static INT CopyOverwrite (LPTSTR fn)
{
/*ask the user if they want to override*/
- TCHAR szMsg[RC_STRING_MAX_SIZE];
INT res;
- LoadString(CMD_ModuleHandle, STRING_COPY_HELP1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,fn);
- res = FilePromptYNA (_T(""));
+ ConOutResPrintf(STRING_COPY_HELP1, fn);
+ res = FilePromptYNA (0);
return res;
}
INT cmd_copy (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR *arg;
INT argc, i, nFiles, nOverwrite = 0, nSrc = -1, nDes = -1;
/* this is the path up to the folder of the src and dest ie C:\windows\ */
@@ -462,8 +456,7 @@
default:
/* Invalid switch */
- LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_SWITCH, szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, _totupper(arg[i][1]));
+ ConOutResPrintf(STRING_ERROR_INVALID_SWITCH,
_totupper(arg[i][1]));
nErrorLevel = 1;
freep (arg);
return 1;
@@ -524,8 +517,7 @@
if(nFiles > 2)
{
/* There are too many file names in command */
- LoadString(CMD_ModuleHandle, STRING_ERROR_TOO_MANY_PARAMETERS, szMsg,
RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg,_T(""));
+ ConErrResPrintf(STRING_ERROR_TOO_MANY_PARAMETERS,_T(""));
nErrorLevel = 1;
freep (arg);
return 1;
@@ -604,8 +596,7 @@
szTouch = _tcsstr (arg[nSrc], _T("+"));
if(_tcsncmp (szTouch,_T("+,,\0"),4) || nDes != -1)
{
- LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_PARAM_FORMAT,
szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg,arg[nSrc]);
+ ConErrResPrintf(STRING_ERROR_INVALID_PARAM_FORMAT,arg[nSrc]);
nErrorLevel = 1;
freep (arg);
return 1;
@@ -794,8 +785,7 @@
/* Check to see if the file is the same file */
if(!bTouch && !_tcscmp (tmpSrcPath, tmpDestPath))
{
- LoadString(CMD_ModuleHandle, STRING_COPY_ERROR2, szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg);
+ ConOutResPrintf(STRING_COPY_ERROR2);
nErrorLevel = 1;
break;
@@ -821,8 +811,7 @@
else
{
/* print out the error message */
- LoadString(CMD_ModuleHandle, STRING_COPY_ERROR3, szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg);
+ ConOutResPrintf(STRING_COPY_ERROR3);
ConOutFormatMessage (GetLastError(), szSrcPath);
nErrorLevel = 1;
}
@@ -834,8 +823,7 @@
} while(!bDone);
/* print out the number of files copied */
- LoadString(CMD_ModuleHandle, STRING_COPY_FILE, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, nFiles);
+ ConOutResPrintf(STRING_COPY_FILE, nFiles);
FindClose(hFile);
Modified: trunk/reactos/base/shell/cmd/date.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/date.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/date.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/date.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -46,24 +46,19 @@
static VOID
PrintDateString (VOID)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
switch (nDateFormat)
{
case 0: /* mmddyy */
default:
- LoadString(CMD_ModuleHandle, STRING_DATE_HELP1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
+ ConOutResPrintf(STRING_DATE_HELP1, cDateSeparator, cDateSeparator);
break;
case 1: /* ddmmyy */
- LoadString(CMD_ModuleHandle, STRING_DATE_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
+ ConOutResPrintf(STRING_DATE_HELP2, cDateSeparator, cDateSeparator);
break;
case 2: /* yymmdd */
- LoadString(CMD_ModuleHandle, STRING_DATE_HELP3, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
+ ConOutResPrintf(STRING_DATE_HELP3, cDateSeparator, cDateSeparator);
break;
}
}
Modified: trunk/reactos/base/shell/cmd/del.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/del.c?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/del.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/del.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -77,12 +77,6 @@
};
static TCHAR szDeleteWipe[RC_STRING_MAX_SIZE];
-static TCHAR szDelHelp2[RC_STRING_MAX_SIZE];
-static TCHAR szDelHelp3[RC_STRING_MAX_SIZE];
-static TCHAR szDelHelp4[RC_STRING_MAX_SIZE];
-static TCHAR szDelError5[RC_STRING_MAX_SIZE];
-static TCHAR szDelError6[RC_STRING_MAX_SIZE];
-static TCHAR szDelError7[RC_STRING_MAX_SIZE];
static TCHAR CMDPath[MAX_PATH];
static BOOLEAN StringsLoaded = FALSE;
@@ -90,12 +84,6 @@
static VOID LoadStrings(VOID)
{
LoadString( CMD_ModuleHandle, STRING_DELETE_WIPE, szDeleteWipe,
RC_STRING_MAX_SIZE);
- LoadString( CMD_ModuleHandle, STRING_DEL_HELP2, szDelHelp2, RC_STRING_MAX_SIZE);
- LoadString( CMD_ModuleHandle, STRING_DEL_HELP3, szDelHelp3, RC_STRING_MAX_SIZE);
- LoadString( CMD_ModuleHandle, STRING_DEL_HELP4, szDelHelp4, RC_STRING_MAX_SIZE);
- LoadString( CMD_ModuleHandle, STRING_DEL_ERROR5, szDelError5,
RC_STRING_MAX_SIZE);
- LoadString( CMD_ModuleHandle, STRING_DEL_ERROR6, szDelError6,
RC_STRING_MAX_SIZE);
- LoadString( CMD_ModuleHandle, STRING_DEL_ERROR7, szDelError7,
RC_STRING_MAX_SIZE);
GetModuleFileName(NULL, CMDPath, MAX_PATH);
StringsLoaded = TRUE;
}
@@ -193,7 +181,7 @@
if (!((*dwFlags & DEL_YES) || (*dwFlags & DEL_QUIET) || (*dwFlags &
DEL_PROMPT)))
{
- res = FilePromptYNA (szDelHelp2);
+ res = FilePromptYNA (STRING_DEL_HELP2);
if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
return 0x80000000;
if(res == PROMPT_ALL)
@@ -256,9 +244,9 @@
/* ask for deleting */
if (*dwFlags & DEL_PROMPT)
{
- ConErrPrintf(szDelError5, szFullPath);
-
- res = FilePromptYN (szDelError6);
+ ConErrResPrintf(STRING_DEL_ERROR5, szFullPath);
+
+ res = FilePromptYN (STRING_DEL_ERROR6);
if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
{
@@ -270,7 +258,7 @@
/*user cant ask it to be quiet and tell you what it did*/
if (!(*dwFlags & DEL_QUIET) && !(*dwFlags & DEL_TOTAL))
{
- ConErrPrintf(szDelError7, szFullPath);
+ ConErrResPrintf(STRING_DEL_ERROR7, szFullPath);
}
/* delete the file */
@@ -552,11 +540,11 @@
dwFiles &= 0x7fffffff;
if (dwFiles < 2)
{
- ConOutPrintf(szDelHelp3, dwFiles);
+ ConOutResPrintf(STRING_DEL_HELP3, dwFiles);
}
else
{
- ConOutPrintf(szDelHelp4, dwFiles);
+ ConOutResPrintf(STRING_DEL_HELP4, dwFiles);
}
}
Modified: trunk/reactos/base/shell/cmd/echo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/echo.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/echo.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/echo.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -31,7 +31,6 @@
INT CommandEcho (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR p1, p2;
TRACE ("CommandEcho '%s' : '%s'\n", debugstr_aw(cmd),
debugstr_aw(param));
@@ -98,8 +97,7 @@
}
else
{
- LoadString(CMD_ModuleHandle, STRING_ECHO_HELP5, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, bEcho ? D_ON : D_OFF);
+ ConOutResPrintf(STRING_ECHO_HELP5, bEcho ? D_ON : D_OFF);
}
}
Modified: trunk/reactos/base/shell/cmd/error.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/error.c?rev…
==============================================================================
--- trunk/reactos/base/shell/cmd/error.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/error.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -61,30 +61,21 @@
VOID error_parameter_format(TCHAR ch)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
- LoadString(CMD_ModuleHandle, STRING_ERROR_PARAMETERF_ERROR, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, ch);
+ ConErrResPrintf(STRING_ERROR_PARAMETERF_ERROR, ch);
nErrorLevel = 1;
}
VOID error_invalid_switch (TCHAR ch)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
- LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_SWITCH, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, ch);
+ ConErrResPrintf(STRING_ERROR_INVALID_SWITCH, ch);
nErrorLevel = 1;
}
VOID error_too_many_parameters (LPTSTR s)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
- LoadString(CMD_ModuleHandle, STRING_ERROR_TOO_MANY_PARAMETERS, szMsg,
RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, s);
+ ConErrResPrintf(STRING_ERROR_TOO_MANY_PARAMETERS, s);
nErrorLevel = 1;
}
Modified: trunk/reactos/base/shell/cmd/free.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/free.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/free.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/free.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -35,8 +35,7 @@
if (_tcslen (szDisk) < 2 || szDisk[1] != _T(':'))
{
- LoadString(CMD_ModuleHandle, STRING_FREE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg);
+ ConErrResPrintf(STRING_FREE_ERROR1);
return;
}
@@ -81,8 +80,7 @@
ConvertULargeInteger (uliSize, szFree, 40, TRUE);
- LoadString(CMD_ModuleHandle, STRING_FREE_HELP1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, szDrive, szVolume, szSerial, szTotal, szUsed, szFree);
+ ConOutResPrintf(STRING_FREE_HELP1, szDrive, szVolume, szSerial, szTotal, szUsed,
szFree);
}
Modified: trunk/reactos/base/shell/cmd/goto.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/goto.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/goto.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/goto.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -124,8 +124,7 @@
}
- LoadString(CMD_ModuleHandle, STRING_GOTO_ERROR2, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, param);
+ ConErrResPrintf(STRING_GOTO_ERROR2, param);
ExitBatch(NULL);
return 1;
}
Modified: trunk/reactos/base/shell/cmd/internal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/internal.c?…
==============================================================================
--- trunk/reactos/base/shell/cmd/internal.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/internal.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -277,7 +277,6 @@
TCHAR szFinalPath[MAX_PATH];
TCHAR * tmpPath;
TCHAR szCurrent[MAX_PATH];
- TCHAR szMsg[RC_STRING_MAX_SIZE];
INT i;
@@ -301,8 +300,7 @@
if(!tmpPath)
{
/* Didnt find an directories */
- LoadString(CMD_ModuleHandle, STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg);
+ ConErrResPrintf(STRING_ERROR_PATH_NOT_FOUND);
nErrorLevel = 1;
return 1;
}
@@ -368,8 +366,7 @@
return 0;
}
/* Didnt find an directories */
- LoadString(CMD_ModuleHandle, STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg);
+ ConErrResPrintf(STRING_ERROR_PATH_NOT_FOUND);
nErrorLevel = 1;
return 1;
@@ -414,8 +411,7 @@
}while(FindNextFile (hFile, &f));
/* Didnt find an directories */
- LoadString(CMD_ModuleHandle, STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg);
+ ConErrResPrintf(STRING_ERROR_PATH_NOT_FOUND);
nErrorLevel = 1;
return 1;
}
@@ -589,7 +585,6 @@
HANDLE hFile;
WIN32_FIND_DATA f;
INT res;
- TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR szFullPath[MAX_PATH];
if (!_tcsncmp (param, _T("/?"), 2))
@@ -658,8 +653,7 @@
/* ask if they want to delete evrything in the folder */
if (!RD_QUIET)
{
- LoadString( CMD_ModuleHandle, STRING_DEL_HELP2, szMsg, RC_STRING_MAX_SIZE);
- res = FilePromptYNA (szMsg);
+ res = FilePromptYNA (STRING_DEL_HELP2);
if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
{
freep(arg);
Modified: trunk/reactos/base/shell/cmd/label.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/label.c?rev…
==============================================================================
--- trunk/reactos/base/shell/cmd/label.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/label.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -24,7 +24,6 @@
INT cmd_label (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR szRootPath[] = _T("A:\\");
TCHAR szLabel[80];
TCHAR szOldLabel[80];
@@ -74,18 +73,15 @@
/* print drive info */
if (szOldLabel[0] != _T('\0'))
{
- LoadString(CMD_ModuleHandle, STRING_LABEL_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, _totupper(szRootPath[0]), szOldLabel);
+ ConOutResPrintf(STRING_LABEL_HELP2, _totupper(szRootPath[0]), szOldLabel);
}
else
{
- LoadString(CMD_ModuleHandle, STRING_LABEL_HELP3, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, _totupper(szRootPath[0]));
+ ConOutResPrintf(STRING_LABEL_HELP3, _totupper(szRootPath[0]));
}
/* print the volume serial number */
- LoadString(CMD_ModuleHandle, STRING_LABEL_HELP4, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
+ ConOutResPrintf(STRING_LABEL_HELP4, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
if (szLabel[0] == _T('\0'))
{
Modified: trunk/reactos/base/shell/cmd/memory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/memory.c?re…
==============================================================================
--- trunk/reactos/base/shell/cmd/memory.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/memory.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -34,7 +34,6 @@
INT CommandMemory (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
MEMORYSTATUS ms;
TCHAR szMemoryLoad[20];
TCHAR szTotalPhys[20];
@@ -62,10 +61,9 @@
ConvertDWord (ms.dwTotalVirtual, szTotalVirtual, 20, TRUE);
ConvertDWord (ms.dwAvailVirtual, szAvailVirtual, 20, TRUE);
- LoadString(CMD_ModuleHandle, STRING_MEMMORY_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,
- szMemoryLoad, szTotalPhys, szAvailPhys, szTotalPageFile,
- szAvailPageFile, szTotalVirtual, szAvailVirtual);
+ ConOutResPrintf(STRING_MEMMORY_HELP2,
+ szMemoryLoad, szTotalPhys, szAvailPhys, szTotalPageFile,
+ szAvailPageFile, szTotalVirtual, szAvailVirtual);
return 0;
}
Modified: trunk/reactos/base/shell/cmd/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/misc.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/misc.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/misc.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -519,22 +519,17 @@
}
-INT FilePromptYN (LPTSTR szFormat, ...)
+INT FilePromptYN (UINT resID)
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
- TCHAR szOut[512];
- va_list arg_ptr;
// TCHAR cKey = 0;
// LPTSTR szKeys = _T("yna");
TCHAR szIn[10];
LPTSTR p;
- va_start (arg_ptr, szFormat);
- _vstprintf (szOut, szFormat, arg_ptr);
- va_end (arg_ptr);
-
- ConOutPrintf (szFormat);
+ if (resID != 0)
+ ConOutResPrintf (resID);
/* preliminary fix */
ConInString (szIn, 10);
@@ -589,22 +584,17 @@
}
-INT FilePromptYNA (LPTSTR szFormat, ...)
+INT FilePromptYNA (UINT resID)
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
- TCHAR szOut[512];
- va_list arg_ptr;
// TCHAR cKey = 0;
// LPTSTR szKeys = _T("yna");
TCHAR szIn[10];
LPTSTR p;
- va_start (arg_ptr, szFormat);
- _vstprintf (szOut, szFormat, arg_ptr);
- va_end (arg_ptr);
-
- ConOutPrintf (szFormat);
+ if (resID != 0)
+ ConOutResPrintf (resID);
/* preliminary fix */
ConInString (szIn, 10);
Modified: trunk/reactos/base/shell/cmd/move.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/move.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/move.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/move.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -55,11 +55,9 @@
static INT MoveOverwrite (LPTSTR fn)
{
/*ask the user if they want to override*/
- TCHAR szMsg[RC_STRING_MAX_SIZE];
INT res;
- LoadString(CMD_ModuleHandle, STRING_MOVE_HELP1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,fn);
- res = FilePromptYNA (_T(""));
+ ConOutResPrintf(STRING_MOVE_HELP1, fn);
+ res = FilePromptYNA (0);
return res;
}
@@ -87,7 +85,6 @@
INT cmd_move (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR *arg;
INT argc, i, nFiles;
TCHAR szDestPath[MAX_PATH];
@@ -519,11 +516,9 @@
}
}
if (MoveStatus)
- LoadString(CMD_ModuleHandle, STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
+ ConOutResPrintf(STRING_MOVE_ERROR1);
else
- LoadString(CMD_ModuleHandle, STRING_MOVE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
-
- ConOutPrintf(szMsg);
+ ConOutResPrintf(STRING_MOVE_ERROR2);
}
while ((!OnlyOneFile || dwMoveStatusFlags & MOVE_SRC_CURRENT_IS_DIR ) &&
!(dwMoveStatusFlags & MOVE_SOURCE_IS_DIR) &&
Modified: trunk/reactos/base/shell/cmd/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/path.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/path.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/path.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -49,14 +49,12 @@
{
DWORD dwBuffer;
LPTSTR pszBuffer;
- TCHAR szMsg[RC_STRING_MAX_SIZE];
pszBuffer = (LPTSTR)cmd_alloc (ENV_BUFFER_SIZE * sizeof(TCHAR));
dwBuffer = GetEnvironmentVariable (_T("PATH"), pszBuffer, ENV_BUFFER_SIZE);
if (dwBuffer == 0)
{
- LoadString(CMD_ModuleHandle, STRING_VOL_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, _T("PATH"));
+ ConOutResPrintf(STRING_VOL_HELP2, _T("PATH"));
return 0;
}
else if (dwBuffer > ENV_BUFFER_SIZE)
Modified: trunk/reactos/base/shell/cmd/ren.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/ren.c?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/ren.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/ren.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -42,7 +42,6 @@
*/
INT cmd_rename (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR *arg = NULL;
INT args = 0;
INT nEvalArgs = 0; /* nunber of evaluated arguments */
@@ -232,8 +231,7 @@
{
if (!(dwFlags & REN_ERROR))
{
- LoadString(CMD_ModuleHandle, STRING_REN_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, GetLastError());
+ ConErrResPrintf(STRING_REN_ERROR1, GetLastError());
}
}
}
@@ -245,10 +243,9 @@
if (!(dwFlags & REN_QUIET))
{
if (dwFiles == 1)
- LoadString( CMD_ModuleHandle, STRING_REN_HELP2, szMsg, RC_STRING_MAX_SIZE);
+ ConOutResPrintf(STRING_REN_HELP2, dwFiles);
else
- LoadString( CMD_ModuleHandle, STRING_REN_HELP3, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,dwFiles);
+ ConOutResPrintf(STRING_REN_HELP3, dwFiles);
}
freep(arg);
Modified: trunk/reactos/base/shell/cmd/replace.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/replace.c?r…
==============================================================================
--- trunk/reactos/base/shell/cmd/replace.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/replace.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -29,10 +29,7 @@
/*just makes a print out if there is a problem with the switches*/
void invalid_switch(LPTSTR is)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
- LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,is);
+ ConOutResPrintf(STRING_REPLACE_ERROR1,is);
ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
}
@@ -49,7 +46,6 @@
/*makes the replace*/
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR d[MAX_PATH];
TCHAR s[MAX_PATH];
HANDLE hFileSrc, hFileDest;
@@ -71,8 +67,7 @@
hFileSrc = CreateFile (source, GENERIC_READ, FILE_SHARE_READ,NULL, OPEN_EXISTING, 0,
NULL);
if (hFileSrc == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, source);
+ ConOutResPrintf(STRING_COPY_ERROR1, source);
return 0;
}
@@ -99,8 +94,7 @@
if (hFileSrc == INVALID_HANDLE_VALUE)
{
- LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, dest);
+ ConOutResPrintf(STRING_COPY_ERROR1, dest);
return 0;
}
@@ -125,20 +119,18 @@
{
/* Output depending on add flag */
if(dwFlags & REPLACE_ADD)
- LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP9, szMsg, RC_STRING_MAX_SIZE);
- else
- LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP10, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, dest);
- if( !FilePromptYNA (_T("")))
+ ConOutResPrintf(STRING_REPLACE_HELP9, dest);
+ else
+ ConOutResPrintf(STRING_REPLACE_HELP10, dest);
+ if( !FilePromptYNA (0))
return 0;
}
/* Output depending on add flag */
if(dwFlags & REPLACE_ADD)
- LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP11, szMsg, RC_STRING_MAX_SIZE);
+ ConOutResPrintf(STRING_REPLACE_HELP11, dest);
else
- LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP5, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,dest);
+ ConOutResPrintf(STRING_REPLACE_HELP5, dest);
/* Make sure source and destination is not the same */
if(!_tcscmp(s, d))
@@ -210,7 +202,7 @@
/* Function to iterate over source files and call replace for each of them */
INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PATH], BOOL
*doMore)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE], tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
+ TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
INT filesReplaced=0, i;
DWORD dwAttrib = 0;
HANDLE hFile;
@@ -269,8 +261,7 @@
{
if(!(dwFlags & REPLACE_READ_ONLY))
{
- LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR5, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, tmpDestPath);
+ ConOutResPrintf(STRING_REPLACE_ERROR5, tmpDestPath);
*doMore = FALSE;
break;
}
@@ -369,7 +360,6 @@
INT cmd_replace (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR *arg;
INT argc, i,filesReplaced = 0, nFiles, srcIndex = -1, destIndex = -1;
DWORD dwFlags = 0;
@@ -474,8 +464,7 @@
if (_tcschr (arg[destIndex], _T('*')) != NULL ||
_tcschr (arg[destIndex], _T('?')) != NULL)
{
- LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,arg[destIndex]);
+ ConOutResPrintf(STRING_REPLACE_ERROR2,arg[destIndex]);
ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
freep(arg);
return 1;
@@ -484,8 +473,7 @@
/* Make sure that destination exists */
if(!IsExistingDirectory(szDestPath))
{
- LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, szDestPath);
+ ConOutResPrintf(STRING_REPLACE_ERROR2, szDestPath);
ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
freep(arg);
return 1;
@@ -511,8 +499,7 @@
/* Check so that source is not a directory, because that is not allowed */
if(IsExistingDirectory(szSrcPath))
{
- LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR6, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, szSrcPath);
+ ConOutResPrintf(STRING_REPLACE_ERROR6, szSrcPath);
ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
freep(arg);
return 1;
@@ -563,10 +550,9 @@
{
/* Add switch dependent output */
if(dwFlags & REPLACE_ADD)
- LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP8, szMsg, RC_STRING_MAX_SIZE);
+ ConOutResPrintf(STRING_REPLACE_HELP8, filesReplaced);
else
- LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP4, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, filesReplaced);
+ ConOutResPrintf(STRING_REPLACE_HELP4, filesReplaced);
}
}
/* Return memory */
Modified: trunk/reactos/base/shell/cmd/set.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/set.c?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/set.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/set.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -53,7 +53,6 @@
INT cmd_set (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
INT i;
LPTSTR p;
@@ -114,8 +113,7 @@
if ( !_tcsnicmp (param, _T("/"), 1) )
{
- LoadString(CMD_ModuleHandle, STRING_SYNTAX_COMMAND_INCORRECT, szMsg,
RC_STRING_MAX_SIZE);
- ConErrPrintf (szMsg, param);
+ ConErrResPrintf (STRING_SYNTAX_COMMAND_INCORRECT, param);
return 0;
}
@@ -126,8 +124,7 @@
if (p == param)
{
/* handle set =val case */
- LoadString(CMD_ModuleHandle, STRING_SYNTAX_COMMAND_INCORRECT, szMsg,
RC_STRING_MAX_SIZE);
- ConErrPrintf (szMsg, param);
+ ConErrResPrintf (STRING_SYNTAX_COMMAND_INCORRECT, param);
return 0;
}
@@ -149,8 +146,7 @@
dwBuffer = GetEnvironmentVariable (param, pszBuffer, ENV_BUFFER_SIZE);
if (dwBuffer == 0)
{
- LoadString(CMD_ModuleHandle, STRING_PATH_ERROR, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf (szMsg, param);
+ ConErrResPrintf (STRING_PATH_ERROR, param);
return 0;
}
else if (dwBuffer > ENV_BUFFER_SIZE)
Modified: trunk/reactos/base/shell/cmd/timer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/timer.c?rev…
==============================================================================
--- trunk/reactos/base/shell/cmd/timer.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/timer.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -34,7 +34,6 @@
static VOID
PrintElapsedTime (DWORD time,INT format)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
DWORD h,m,s,ms;
TRACE ("PrintElapsedTime(%d,%d)",time,format);
@@ -42,8 +41,7 @@
switch (format)
{
case 0:
- LoadString(CMD_ModuleHandle, STRING_TIMER_HELP1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, time);
+ ConOutResPrintf(STRING_TIMER_HELP1, time);
break;
case 1:
@@ -53,11 +51,10 @@
time /=60;
m = time % 60;
h = time / 60;
- LoadString( CMD_ModuleHandle, STRING_TIMER_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg,
- h, cTimeSeparator,
- m, cTimeSeparator,
- s, cDecimalSeparator, ms/10);
+ ConOutResPrintf(STRING_TIMER_HELP2,
+ h, cTimeSeparator,
+ m, cTimeSeparator,
+ s, cDecimalSeparator, ms/10);
break;
}
}
@@ -65,8 +62,6 @@
INT CommandTimer (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
// all timers are kept
static DWORD clksT[10];
@@ -99,14 +94,11 @@
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
- LoadString(CMD_ModuleHandle, STRING_TIMER_HELP3, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, cTimeSeparator, cTimeSeparator, cDecimalSeparator);
+ ConOutResPrintf(STRING_TIMER_HELP3, cTimeSeparator, cTimeSeparator,
cDecimalSeparator);
return 0;
}
nErrorLevel = 0;
-
- LoadString( CMD_ModuleHandle, STRING_TIMER_TIME, szMsg, RC_STRING_MAX_SIZE);
p = split (param, &argc, FALSE);
@@ -160,7 +152,7 @@
cT=GetTickCount();
cS=TRUE;
- ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ ConOutResPrintf
(STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
PrintTime();
freep(p);
return 0;
@@ -170,7 +162,7 @@
{
if(cS)
{
- ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ ConOutResPrintf
(STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
PrintTime();
PrintElapsedTime(GetTickCount()-cT, iFormat);
freep(p);
@@ -179,7 +171,7 @@
cT=GetTickCount();
cS=TRUE;
- ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
PrintTime();
freep(p);
return 0;
@@ -190,7 +182,7 @@
if (cS)
{
cS=FALSE;
- ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
PrintTime();
PrintElapsedTime(GetTickCount()-cT, iFormat);
freep(p);
@@ -199,7 +191,7 @@
cT=GetTickCount();
cS=TRUE;
- ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
PrintTime();
freep(p);
return 0;
@@ -211,13 +203,13 @@
if (cS)
{
cS=FALSE;
- ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
PrintTime();
PrintElapsedTime(GetTickCount()-cT, iFormat);
freep(p);
return 0;
}
- ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
PrintTime();
freep(p);
return 0;
Modified: trunk/reactos/base/shell/cmd/type.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/type.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/type.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/type.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -33,7 +33,6 @@
INT cmd_type (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR buff[256];
HANDLE hFile, hConsoleOut;
BOOL bRet;
@@ -71,8 +70,7 @@
{
if (_T('/') == argv[i][0] && _totupper(argv[i][1]) != _T('P'))
{
- LoadString(CMD_ModuleHandle, STRING_TYPE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, argv[i] + 1);
+ ConErrResPrintf(STRING_TYPE_ERROR1, argv[i] + 1);
continue;
}
Modified: trunk/reactos/base/shell/cmd/ver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/ver.c?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/ver.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/ver.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -29,7 +29,6 @@
OSVERSIONINFO VersionInfo;
unsigned RosVersionLen;
LPTSTR RosVersion;
- TCHAR szMsg[RC_STRING_MAX_SIZE];
ConOutResPuts (STRING_CMD_SHELLINFO );
VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@@ -44,8 +43,7 @@
(RosVersion - VersionInfo.szCSDVersion);
if (7 <= RosVersionLen && 0 == _tcsnicmp(RosVersion,
_T("ReactOS"), 7))
{
- LoadString( CMD_ModuleHandle, STRING_VERSION_RUNVER, (LPTSTR) szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf (szMsg, RosVersion);
+ ConOutResPrintf(STRING_VERSION_RUNVER, RosVersion);
}
}
ConOutPuts (_T("\n"));
Modified: trunk/reactos/base/shell/cmd/verify.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/verify.c?re…
==============================================================================
--- trunk/reactos/base/shell/cmd/verify.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/verify.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -29,8 +29,6 @@
INT cmd_verify (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
-
if (!_tcsncmp (param, _T("/?"), 2))
{
ConOutResPaging(TRUE,STRING_VERIFY_HELP1);
@@ -41,8 +39,7 @@
if (!*param)
{
- LoadString(CMD_ModuleHandle, STRING_VERIFY_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, bVerify ? D_ON : D_OFF);
+ ConOutResPrintf(STRING_VERIFY_HELP2, bVerify ? D_ON : D_OFF);
}
else if (_tcsicmp (param, D_OFF) == 0)
bVerify = FALSE;
Modified: trunk/reactos/base/shell/cmd/vol.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/vol.c?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/vol.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/vol.c [iso-8859-1] Sat Jul 26 17:49:49 2008
@@ -28,7 +28,6 @@
static INT
PrintVolumeHeader (LPTSTR pszRootPath)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR szVolName[80];
DWORD dwSerialNr;
@@ -49,18 +48,15 @@
/* print drive info */
if (szVolName[0] != '\0')
{
- LoadString(CMD_ModuleHandle, STRING_VOL_HELP1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, pszRootPath[0],szVolName);
+ ConOutResPrintf(STRING_VOL_HELP1, pszRootPath[0],szVolName);
}
else
{
- LoadString(CMD_ModuleHandle, STRING_VOL_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, pszRootPath[0]);
+ ConOutResPrintf(STRING_VOL_HELP2, pszRootPath[0]);
}
/* print the volume serial number */
- LoadString(CMD_ModuleHandle, STRING_VOL_HELP3, szMsg, RC_STRING_MAX_SIZE);
- ConOutPrintf(szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
+ ConOutResPrintf(STRING_VOL_HELP3, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
return 0;
}