mirror of
https://github.com/reactos/reactos.git
synced 2025-07-28 12:01:55 +00:00
Fix debug output of strings
svn path=/trunk/; revision=33536
This commit is contained in:
parent
c65c9124fa
commit
c79d92ab52
22 changed files with 80 additions and 95 deletions
|
@ -170,7 +170,7 @@ LPTSTR BatchParams (LPTSTR s1, LPTSTR s2)
|
||||||
|
|
||||||
VOID ExitBatch (LPTSTR msg)
|
VOID ExitBatch (LPTSTR msg)
|
||||||
{
|
{
|
||||||
TRACE ("ExitBatch: (\'%s\')\n", msg);
|
TRACE ("ExitBatch: (\'%s\')\n", debugstr_aw(msg));
|
||||||
|
|
||||||
if (bc != NULL)
|
if (bc != NULL)
|
||||||
{
|
{
|
||||||
|
@ -223,7 +223,7 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||||
FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||||
|
|
||||||
TRACE ("Batch: (\'%s\', \'%s\', \'%s\') hFile = %x\n",
|
TRACE ("Batch: (\'%s\', \'%s\', \'%s\') hFile = %x\n",
|
||||||
fullname, firstword, param, hFile);
|
debugstr_aw(fullname), debugstr_aw(firstword), debugstr_aw(param), hFile);
|
||||||
|
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -434,7 +434,7 @@ LPTSTR ReadBatchLine (LPBOOL bLocalEcho)
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TRACE ("ReadBatchLine(): textline: \'%s\'\n", textline);
|
TRACE ("ReadBatchLine(): textline: \'%s\'\n", debugstr_aw(textline));
|
||||||
|
|
||||||
/* Strip leading spaces and trailing space/control chars */
|
/* Strip leading spaces and trailing space/control chars */
|
||||||
for (first = textline; _istspace (*first); first++)
|
for (first = textline; _istspace (*first); first++)
|
||||||
|
|
|
@ -44,7 +44,7 @@ INT cmd_call (LPTSTR cmd, LPTSTR param)
|
||||||
{
|
{
|
||||||
LPBATCH_CONTEXT n = NULL;
|
LPBATCH_CONTEXT n = NULL;
|
||||||
|
|
||||||
TRACE ("cmd_call: (\'%s\',\'%s\')\n", cmd, param);
|
TRACE ("cmd_call: (\'%s\',\'%s\')\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
ConOutResPaging(TRUE,STRING_CALL_HELP);
|
ConOutResPaging(TRUE,STRING_CALL_HELP);
|
||||||
|
|
|
@ -283,7 +283,7 @@ static BOOL RunFile(LPTSTR filename)
|
||||||
MYEX hShExt;
|
MYEX hShExt;
|
||||||
HINSTANCE ret;
|
HINSTANCE ret;
|
||||||
|
|
||||||
TRACE ("RunFile(%s)\n", filename);
|
TRACE ("RunFile(%s)\n", debugstr_aw(filename));
|
||||||
hShell32 = LoadLibrary(_T("SHELL32.DLL"));
|
hShell32 = LoadLibrary(_T("SHELL32.DLL"));
|
||||||
if (!hShell32)
|
if (!hShell32)
|
||||||
{
|
{
|
||||||
|
@ -330,7 +330,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
||||||
TCHAR szWindowTitle[MAX_PATH];
|
TCHAR szWindowTitle[MAX_PATH];
|
||||||
DWORD dwExitCode = 0;
|
DWORD dwExitCode = 0;
|
||||||
|
|
||||||
TRACE ("Execute: \'%s\' \'%s\'\n", first, rest);
|
TRACE ("Execute: \'%s\' \'%s\'\n", debugstr_aw(first), debugstr_aw(rest));
|
||||||
|
|
||||||
/* we need biger buffer that First, Rest, Full are already
|
/* we need biger buffer that First, Rest, Full are already
|
||||||
need rewrite some code to use cmd_realloc when it need instead
|
need rewrite some code to use cmd_realloc when it need instead
|
||||||
|
@ -465,7 +465,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
||||||
dot = _tcsrchr (szFullName, _T('.'));
|
dot = _tcsrchr (szFullName, _T('.'));
|
||||||
if (dot && (!_tcsicmp (dot, _T(".bat")) || !_tcsicmp (dot, _T(".cmd"))))
|
if (dot && (!_tcsicmp (dot, _T(".bat")) || !_tcsicmp (dot, _T(".cmd"))))
|
||||||
{
|
{
|
||||||
TRACE ("[BATCH: %s %s]\n", szFullName, rest);
|
TRACE ("[BATCH: %s %s]\n", debugstr_aw(szFullName), debugstr_aw(rest));
|
||||||
Batch (szFullName, first, rest);
|
Batch (szFullName, first, rest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -474,7 +474,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
||||||
PROCESS_INFORMATION prci;
|
PROCESS_INFORMATION prci;
|
||||||
STARTUPINFO stui;
|
STARTUPINFO stui;
|
||||||
|
|
||||||
TRACE ("[EXEC: %s %s]\n", full, rest);
|
TRACE ("[EXEC: %s %s]\n", debugstr_aw(full), debugstr_aw(rest));
|
||||||
/* build command line for CreateProcess() */
|
/* build command line for CreateProcess() */
|
||||||
|
|
||||||
/* fill startup info */
|
/* fill startup info */
|
||||||
|
@ -522,11 +522,11 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TRACE ("[ShellExecute: %s]\n", full);
|
TRACE ("[ShellExecute: %s]\n", debugstr_aw(full));
|
||||||
// See if we can run this with ShellExecute() ie myfile.xls
|
// See if we can run this with ShellExecute() ie myfile.xls
|
||||||
if (!RunFile(full))
|
if (!RunFile(full))
|
||||||
{
|
{
|
||||||
TRACE ("[ShellExecute failed!: %s]\n", full);
|
TRACE ("[ShellExecute failed!: %s]\n", debugstr_aw(full));
|
||||||
error_bad_command ();
|
error_bad_command ();
|
||||||
nErrorLevel = 1;
|
nErrorLevel = 1;
|
||||||
}
|
}
|
||||||
|
@ -572,7 +572,7 @@ DoCommand (LPTSTR line)
|
||||||
INT cl;
|
INT cl;
|
||||||
LPCOMMAND cmdptr;
|
LPCOMMAND cmdptr;
|
||||||
|
|
||||||
TRACE ("DoCommand: (\'%s\')\n", line);
|
TRACE ("DoCommand: (\'%s\')\n", debugstr_aw(line));
|
||||||
|
|
||||||
com = cmd_alloc( (_tcslen(line) +512)*sizeof(TCHAR) );
|
com = cmd_alloc( (_tcslen(line) +512)*sizeof(TCHAR) );
|
||||||
if (com == NULL)
|
if (com == NULL)
|
||||||
|
@ -707,7 +707,7 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||||
_tcscpy (cmdline, cmd);
|
_tcscpy (cmdline, cmd);
|
||||||
s = &cmdline[0];
|
s = &cmdline[0];
|
||||||
|
|
||||||
TRACE ("ParseCommandLine: (\'%s\')\n", s);
|
TRACE ("ParseCommandLine: (\'%s\')\n", debugstr_aw(s));
|
||||||
|
|
||||||
#ifdef FEATURE_ALIASES
|
#ifdef FEATURE_ALIASES
|
||||||
/* expand all aliases */
|
/* expand all aliases */
|
||||||
|
@ -793,7 +793,7 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||||
ConErrPrintf(szMsg, in);
|
ConErrPrintf(szMsg, in);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TRACE ("Input redirected from: %s\n", in);
|
TRACE ("Input redirected from: %s\n", debugstr_aw(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now do all but the last pipe command */
|
/* Now do all but the last pipe command */
|
||||||
|
@ -913,7 +913,7 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||||
if (GetFileType (hFile) == FILE_TYPE_DISK)
|
if (GetFileType (hFile) == FILE_TYPE_DISK)
|
||||||
SetFilePointer (hFile, 0, &lHighPos, FILE_END);
|
SetFilePointer (hFile, 0, &lHighPos, FILE_END);
|
||||||
}
|
}
|
||||||
TRACE ("Output redirected to: %s\n", out);
|
TRACE ("Output redirected to: %s\n", debugstr_aw(out));
|
||||||
}
|
}
|
||||||
else if (hOldConOut != INVALID_HANDLE_VALUE)
|
else if (hOldConOut != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -971,7 +971,7 @@ VOID ParseCommandLine (LPTSTR cmd)
|
||||||
if (GetFileType (hFile) == FILE_TYPE_DISK)
|
if (GetFileType (hFile) == FILE_TYPE_DISK)
|
||||||
SetFilePointer (hFile, 0, &lHighPos, FILE_END);
|
SetFilePointer (hFile, 0, &lHighPos, FILE_END);
|
||||||
}
|
}
|
||||||
TRACE ("Error redirected to: %s\n", err);
|
TRACE ("Error redirected to: %s\n", debugstr_aw(err));
|
||||||
}
|
}
|
||||||
else if (hOldConErr != INVALID_HANDLE_VALUE)
|
else if (hOldConErr != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -1686,7 +1686,7 @@ Initialize (int argc, const TCHAR* argv[])
|
||||||
TRACE ("[command args:\n");
|
TRACE ("[command args:\n");
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
TRACE ("%d. %s\n", i, argv[i]);
|
TRACE ("%d. %s\n", i, debugstr_aw(argv[i]));
|
||||||
}
|
}
|
||||||
TRACE ("]\n");
|
TRACE ("]\n");
|
||||||
|
|
||||||
|
|
|
@ -244,4 +244,4 @@ cmd_exit(int code)
|
||||||
ExitProcess(code);
|
ExitProcess(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _DEBUG */
|
#endif /* _DEBUG_MEM */
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
#ifndef _CONFIG_H_INCLUDED_
|
#ifndef _CONFIG_H_INCLUDED_
|
||||||
#define _CONFIG_H_INCLUDED_
|
#define _CONFIG_H_INCLUDED_
|
||||||
|
|
||||||
/* Define to enable debugging code */
|
|
||||||
//#define _DEBUG
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
//#define NT4_INTERNAL_COMMANDS
|
//#define NT4_INTERNAL_COMMANDS
|
||||||
|
|
|
@ -165,10 +165,10 @@ copy (TCHAR source[MAX_PATH],
|
||||||
}
|
}
|
||||||
else if (!append)
|
else if (!append)
|
||||||
{
|
{
|
||||||
TRACE ("SetFileAttributes (%s, FILE_ATTRIBUTE_NORMAL);\n", dest);
|
TRACE ("SetFileAttributes (%s, FILE_ATTRIBUTE_NORMAL);\n", debugstr_aw(dest));
|
||||||
SetFileAttributes (dest, FILE_ATTRIBUTE_NORMAL);
|
SetFileAttributes (dest, FILE_ATTRIBUTE_NORMAL);
|
||||||
|
|
||||||
TRACE ("DeleteFile (%s);\n", dest);
|
TRACE ("DeleteFile (%s);\n", debugstr_aw(dest));
|
||||||
DeleteFile (dest);
|
DeleteFile (dest);
|
||||||
|
|
||||||
hFileDest = CreateFile (dest, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
|
hFileDest = CreateFile (dest, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
|
||||||
|
|
|
@ -226,7 +226,7 @@ INT cmd_date (LPTSTR cmd, LPTSTR param)
|
||||||
|
|
||||||
PrintDateString ();
|
PrintDateString ();
|
||||||
ConInString (s, 40);
|
ConInString (s, 40);
|
||||||
TRACE ("\'%s\'\n", s);
|
TRACE ("\'%s\'\n", debugstr_aw(s));
|
||||||
while (*s && s[_tcslen (s) - 1] < _T(' '))
|
while (*s && s[_tcslen (s) - 1] < _T(' '))
|
||||||
s[_tcslen (s) - 1] = _T('\0');
|
s[_tcslen (s) - 1] = _T('\0');
|
||||||
if (ParseDate (s))
|
if (ParseDate (s))
|
||||||
|
|
|
@ -251,9 +251,7 @@ DeleteFiles(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
TRACE("Full filename: %s\n", debugstr_aw(szFullPath));
|
||||||
ConErrPrintf(_T("Full filename: %s\n"), szFullPath);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ask for deleting */
|
/* ask for deleting */
|
||||||
if (*dwFlags & DEL_PROMPT)
|
if (*dwFlags & DEL_PROMPT)
|
||||||
|
|
|
@ -1590,9 +1590,7 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */
|
||||||
ptrStartNode = cmd_alloc(sizeof(DIRFINDLISTNODE));
|
ptrStartNode = cmd_alloc(sizeof(DIRFINDLISTNODE));
|
||||||
if (ptrStartNode == NULL)
|
if (ptrStartNode == NULL)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
WARN("DEBUG: Cannot allocate memory for ptrStartNode!\n");
|
||||||
ConErrPrintf(_T("DEBUG: Cannot allocate memory for ptrStartNode!\n"));
|
|
||||||
#endif
|
|
||||||
return 1; /* Error cannot allocate memory for 1st object */
|
return 1; /* Error cannot allocate memory for 1st object */
|
||||||
}
|
}
|
||||||
ptrNextNode = ptrStartNode;
|
ptrNextNode = ptrStartNode;
|
||||||
|
@ -1610,9 +1608,7 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */
|
||||||
ptrNextNode->ptrNext = cmd_alloc(sizeof(DIRFINDLISTNODE));
|
ptrNextNode->ptrNext = cmd_alloc(sizeof(DIRFINDLISTNODE));
|
||||||
if (ptrNextNode->ptrNext == NULL)
|
if (ptrNextNode->ptrNext == NULL)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
WARN("DEBUG: Cannot allocate memory for ptrNextNode->ptrNext!\n");
|
||||||
ConErrPrintf(_T("DEBUG: Cannot allocate memory for ptrNextNode->ptrNext!\n"));
|
|
||||||
#endif
|
|
||||||
while (ptrStartNode)
|
while (ptrStartNode)
|
||||||
{
|
{
|
||||||
ptrNextNode = ptrStartNode->ptrNext;
|
ptrNextNode = ptrStartNode->ptrNext;
|
||||||
|
@ -1670,9 +1666,7 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */
|
||||||
ptrFileArray = cmd_alloc(sizeof(LPWIN32_FIND_DATA) * dwCount);
|
ptrFileArray = cmd_alloc(sizeof(LPWIN32_FIND_DATA) * dwCount);
|
||||||
if (ptrFileArray == NULL)
|
if (ptrFileArray == NULL)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
WARN("DEBUG: Cannot allocate memory for ptrFileArray!\n");
|
||||||
ConErrPrintf(_T("DEBUG: Cannot allocate memory for ptrFileArray!\n"));
|
|
||||||
#endif
|
|
||||||
while (ptrStartNode)
|
while (ptrStartNode)
|
||||||
{
|
{
|
||||||
ptrNextNode = ptrStartNode->ptrNext;
|
ptrNextNode = ptrStartNode->ptrNext;
|
||||||
|
@ -1869,27 +1863,25 @@ CommandDir(LPTSTR first, LPTSTR rest)
|
||||||
|
|
||||||
/* <Debug :>
|
/* <Debug :>
|
||||||
Uncomment this to show the final state of switch flags*/
|
Uncomment this to show the final state of switch flags*/
|
||||||
#ifdef _DEBUG
|
{
|
||||||
{
|
int i;
|
||||||
int i;
|
TRACE("Attributes mask/value %x/%x\n",stFlags.stAttribs.dwAttribMask,stFlags.stAttribs.dwAttribVal );
|
||||||
ConOutPrintf(_T("Attributes mask/value %x/%x\n"),stFlags.stAttribs.dwAttribMask,stFlags.stAttribs.dwAttribVal );
|
TRACE("(B) Bare format : %i\n", stFlags.bBareFormat );
|
||||||
ConOutPrintf(_T("(B) Bare format : %i\n"), stFlags.bBareFormat );
|
TRACE("(C) Thousand : %i\n", stFlags.bTSeperator );
|
||||||
ConOutPrintf(_T("(C) Thousand : %i\n"), stFlags.bTSeperator );
|
TRACE("(W) Wide list : %i\n", stFlags.bWideList );
|
||||||
ConOutPrintf(_T("(W) Wide list : %i\n"), stFlags.bWideList );
|
TRACE("(D) Wide list sort by column : %i\n", stFlags.bWideListColSort );
|
||||||
ConOutPrintf(_T("(D) Wide list sort by column : %i\n"), stFlags.bWideListColSort );
|
TRACE("(L) Lowercase : %i\n", stFlags.bLowerCase );
|
||||||
ConOutPrintf(_T("(L) Lowercase : %i\n"), stFlags.bLowerCase );
|
TRACE("(N) New : %i\n", stFlags.bNewLongList );
|
||||||
ConOutPrintf(_T("(N) New : %i\n"), stFlags.bNewLongList );
|
TRACE("(O) Order : %i\n", stFlags.stOrderBy.sCriteriaCount );
|
||||||
ConOutPrintf(_T("(O) Order : %i\n"), stFlags.stOrderBy.sCriteriaCount );
|
for (i =0;i<stFlags.stOrderBy.sCriteriaCount;i++)
|
||||||
for (i =0;i<stFlags.stOrderBy.sCriteriaCount;i++)
|
TRACE(" Order Criteria [%i]: %i (Reversed: %i)\n",i, stFlags.stOrderBy.eCriteria[i], stFlags.stOrderBy.bCriteriaRev[i] );
|
||||||
ConOutPrintf(_T(" Order Criteria [%i]: %i (Reversed: %i)\n"),i, stFlags.stOrderBy.eCriteria[i], stFlags.stOrderBy.bCriteriaRev[i] );
|
TRACE("(P) Pause : %i\n", stFlags.bPause );
|
||||||
ConOutPrintf(_T("(P) Pause : %i\n"), stFlags.bPause );
|
TRACE("(Q) Owner : %i\n", stFlags.bUser );
|
||||||
ConOutPrintf(_T("(Q) Owner : %i\n"), stFlags.bUser );
|
TRACE("(S) Recursive : %i\n", stFlags.bRecursive );
|
||||||
ConOutPrintf(_T("(S) Recursive : %i\n"), stFlags.bRecursive );
|
TRACE("(T) Time field : %i\n", stFlags.stTimeField.eTimeField );
|
||||||
ConOutPrintf(_T("(T) Time field : %i\n"), stFlags.stTimeField.eTimeField );
|
TRACE("(X) Short names : %i\n", stFlags.bShortName );
|
||||||
ConOutPrintf(_T("(X) Short names : %i\n"), stFlags.bShortName );
|
TRACE("Parameter : %s\n", debugstr_aw(params[loop]) );
|
||||||
ConOutPrintf(_T("Parameter : %s\n"), params[loop] );
|
}
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Print the drive header if the volume changed */
|
/* Print the drive header if the volume changed */
|
||||||
ChangedVolume = TRUE;
|
ChangedVolume = TRUE;
|
||||||
|
|
|
@ -34,7 +34,7 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param)
|
||||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||||
LPTSTR p1, p2;
|
LPTSTR p1, p2;
|
||||||
|
|
||||||
TRACE ("CommandEcho '%s' : '%s'\n", cmd, param);
|
TRACE ("CommandEcho '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (_tcsicmp (cmd, _T("echo.")) == 0)
|
if (_tcsicmp (cmd, _T("echo.")) == 0)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +110,7 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param)
|
||||||
INT CommandEchos (LPTSTR cmd, LPTSTR param)
|
INT CommandEchos (LPTSTR cmd, LPTSTR param)
|
||||||
{
|
{
|
||||||
|
|
||||||
TRACE ("CommandEchos '%s' : '%s'\n", cmd, param);
|
TRACE ("CommandEchos '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
@ -128,7 +128,7 @@ INT CommandEchos (LPTSTR cmd, LPTSTR param)
|
||||||
INT CommandEchoerr (LPTSTR cmd, LPTSTR param)
|
INT CommandEchoerr (LPTSTR cmd, LPTSTR param)
|
||||||
{
|
{
|
||||||
|
|
||||||
TRACE ("CommandEchoerr '%s' : '%s'\n", cmd, param);
|
TRACE ("CommandEchoerr '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
@ -155,7 +155,7 @@ INT CommandEchoerr (LPTSTR cmd, LPTSTR param)
|
||||||
INT CommandEchoserr (LPTSTR cmd, LPTSTR param)
|
INT CommandEchoserr (LPTSTR cmd, LPTSTR param)
|
||||||
{
|
{
|
||||||
|
|
||||||
TRACE ("CommandEchoserr '%s' : '%s'\n", cmd, param);
|
TRACE ("CommandEchoserr '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,7 @@ INT cmd_for (LPTSTR cmd, LPTSTR param)
|
||||||
TCHAR var;
|
TCHAR var;
|
||||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||||
|
|
||||||
TRACE ("cmd_for (\'%s\', \'%s\'\n", cmd, param);
|
TRACE ("cmd_for (\'%s\', \'%s\'\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,7 +42,7 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param)
|
||||||
LPTSTR tmp, tmp2;
|
LPTSTR tmp, tmp2;
|
||||||
LONG lNewPosHigh = 0;
|
LONG lNewPosHigh = 0;
|
||||||
|
|
||||||
TRACE ("cmd_goto (\'%s\', \'%s\'\n", cmd, param);
|
TRACE ("cmd_goto (\'%s\', \'%s\'\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ INT cmd_if (LPTSTR cmd, LPTSTR param)
|
||||||
INT x_flag = 0; /* when set cause 'then' clause to be executed */
|
INT x_flag = 0; /* when set cause 'then' clause to be executed */
|
||||||
LPTSTR pp;
|
LPTSTR pp;
|
||||||
|
|
||||||
TRACE ("cmd_if: (\'%s\', \'%s\')\n", cmd, param);
|
TRACE ("cmd_if: (\'%s\', \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -191,7 +191,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
|
|
||||||
/* get destination */
|
/* get destination */
|
||||||
GetFullPathName (arg[argc - 1], MAX_PATH, szDestPath, NULL);
|
GetFullPathName (arg[argc - 1], MAX_PATH, szDestPath, NULL);
|
||||||
TRACE ("Destination: %s\n", szDestPath);
|
TRACE ("Destination: %s\n", debugstr_aw(szDestPath));
|
||||||
|
|
||||||
/* get source folder */
|
/* get source folder */
|
||||||
GetDirectory(arg[argc - 2], szSrcDirPath, 1);
|
GetDirectory(arg[argc - 2], szSrcDirPath, 1);
|
||||||
|
@ -202,7 +202,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
GetFullPathName(arg[argc - 2], MAX_PATH, szSrcPath, &pszFile);
|
GetFullPathName(arg[argc - 2], MAX_PATH, szSrcPath, &pszFile);
|
||||||
if (_tcscmp(szSrcDirPath,szSrcPath) == 0)
|
if (_tcscmp(szSrcDirPath,szSrcPath) == 0)
|
||||||
szSrcDirPath[pszFile - szSrcPath] = _T('\0');
|
szSrcDirPath[pszFile - szSrcPath] = _T('\0');
|
||||||
TRACE ("Source Folder: %s\n", szSrcDirPath);
|
TRACE ("Source Folder: %s\n", debugstr_aw(szSrcDirPath));
|
||||||
|
|
||||||
hFile = FindFirstFile (arg[argc - 2], &findBuffer);
|
hFile = FindFirstFile (arg[argc - 2], &findBuffer);
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
|
@ -235,7 +235,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
if(szSrcPath[_tcslen(szSrcPath) - 1] != _T('\\'))
|
if(szSrcPath[_tcslen(szSrcPath) - 1] != _T('\\'))
|
||||||
_tcscat (szSrcPath, _T("\\"));
|
_tcscat (szSrcPath, _T("\\"));
|
||||||
_tcscat(szSrcPath,findBuffer.cFileName);
|
_tcscat(szSrcPath,findBuffer.cFileName);
|
||||||
TRACE ("Source Path: %s\n", szSrcPath);
|
TRACE ("Source Path: %s\n", debugstr_aw(szSrcPath));
|
||||||
/* check if there can be found files as files have first priority */
|
/* check if there can be found files as files have first priority */
|
||||||
if (IsExistingFile(szSrcPath)) dwMoveStatusFlags |= MOVE_SOURCE_IS_FILE;
|
if (IsExistingFile(szSrcPath)) dwMoveStatusFlags |= MOVE_SOURCE_IS_FILE;
|
||||||
else dwMoveStatusFlags |= MOVE_SOURCE_IS_DIR;
|
else dwMoveStatusFlags |= MOVE_SOURCE_IS_DIR;
|
||||||
|
@ -258,7 +258,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
}
|
}
|
||||||
FindClose(hFile);
|
FindClose(hFile);
|
||||||
|
|
||||||
TRACE ("Do we have only one file: %s\n", OnlyOneFile ? _T("TRUE") : _T("FALSE"));
|
TRACE ("Do we have only one file: %s\n", OnlyOneFile ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
/* we have to start again to be sure we don't miss any files or folders*/
|
/* we have to start again to be sure we don't miss any files or folders*/
|
||||||
hFile = FindFirstFile (arg[argc - 2], &findBuffer);
|
hFile = FindFirstFile (arg[argc - 2], &findBuffer);
|
||||||
|
@ -293,7 +293,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
/* move it */
|
/* move it */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
TRACE ("Found file/directory: %s\n", findBuffer.cFileName);
|
TRACE ("Found file/directory: %s\n", debugstr_aw(findBuffer.cFileName));
|
||||||
nOverwrite = 1;
|
nOverwrite = 1;
|
||||||
dwMoveFlags = 0;
|
dwMoveFlags = 0;
|
||||||
dwMoveStatusFlags &= ~MOVE_DEST_IS_FILE &
|
dwMoveStatusFlags &= ~MOVE_DEST_IS_FILE &
|
||||||
|
@ -315,7 +315,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
dwMoveStatusFlags |= MOVE_SRC_CURRENT_IS_DIR; /* source is file but at the current round we found a directory */
|
dwMoveStatusFlags |= MOVE_SRC_CURRENT_IS_DIR; /* source is file but at the current round we found a directory */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TRACE ("Source is dir: %s\n", szSrcPath);
|
TRACE ("Source is dir: %s\n", debugstr_aw(szSrcPath));
|
||||||
dwMoveFlags = MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH | MOVEFILE_COPY_ALLOWED;
|
dwMoveFlags = MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH | MOVEFILE_COPY_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
if (IsExistingDirectory(szDestPath))
|
if (IsExistingDirectory(szDestPath))
|
||||||
{
|
{
|
||||||
/* destination is existing directory */
|
/* destination is existing directory */
|
||||||
TRACE ("Destination is directory: %s\n", szDestPath);
|
TRACE ("Destination is directory: %s\n", debugstr_aw(szDestPath));
|
||||||
|
|
||||||
dwMoveStatusFlags |= MOVE_DEST_IS_DIR;
|
dwMoveStatusFlags |= MOVE_DEST_IS_DIR;
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
|
||||||
if (IsExistingFile(szDestPath))
|
if (IsExistingFile(szDestPath))
|
||||||
{
|
{
|
||||||
/* destination is a file */
|
/* destination is a file */
|
||||||
TRACE ("Destination is file: %s\n", szDestPath);
|
TRACE ("Destination is file: %s\n", debugstr_aw(szDestPath));
|
||||||
|
|
||||||
dwMoveStatusFlags |= MOVE_DEST_IS_FILE | MOVE_DEST_EXISTS;
|
dwMoveStatusFlags |= MOVE_DEST_IS_FILE | MOVE_DEST_EXISTS;
|
||||||
_tcscpy (szFullDestPath, szDestPath);
|
_tcscpy (szFullDestPath, szDestPath);
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
INT cmd_pause (LPTSTR cmd, LPTSTR param)
|
INT cmd_pause (LPTSTR cmd, LPTSTR param)
|
||||||
{
|
{
|
||||||
|
|
||||||
TRACE ("cmd_pause: \'%s\' : \'%s\')\n", cmd, param);
|
TRACE ("cmd_pause: \'%s\' : \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,5 +38,10 @@
|
||||||
|
|
||||||
#include <wine/debug.h>
|
#include <wine/debug.h>
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
|
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
|
||||||
|
#ifdef UNICODE
|
||||||
|
#define debugstr_aw debugstr_w
|
||||||
|
#else
|
||||||
|
#define debugstr_aw debugstr_a
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __CMD_PRECOMP_H */
|
#endif /* __CMD_PRECOMP_H */
|
||||||
|
|
|
@ -148,10 +148,8 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||||
|
|
||||||
srcPattern = arg[i];
|
srcPattern = arg[i];
|
||||||
|
|
||||||
#ifdef _DEBUG
|
TRACE("\n\nSourcePattern: %s\n", debugstr_aw(srcPattern));
|
||||||
ConErrPrintf(_T("\n\nSourcePattern: %s\n"), srcPattern);
|
TRACE("DestinationPattern: %s\n", debugstr_aw(dstPattern));
|
||||||
ConErrPrintf(_T("DestinationPattern: %s\n"), dstPattern);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
hFile = FindFirstFile(srcPattern, &f);
|
hFile = FindFirstFile(srcPattern, &f);
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
|
@ -179,9 +177,7 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||||
&& !(dwFlags & REN_SUBDIR))
|
&& !(dwFlags & REN_SUBDIR))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifdef _DEBUG
|
TRACE("Found source name: %s\n", debugstr_aw(f.cFileName));
|
||||||
ConErrPrintf(_T("Found source name: %s\n"), f.cFileName);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* build destination file name */
|
/* build destination file name */
|
||||||
p = f.cFileName;
|
p = f.cFileName;
|
||||||
|
@ -220,9 +216,7 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
|
||||||
}
|
}
|
||||||
*r = 0;
|
*r = 0;
|
||||||
|
|
||||||
#ifdef _DEBUG
|
TRACE("DestinationFile: %s\n", debugstr_aw(dstFile));
|
||||||
ConErrPrintf(_T("DestinationFile: %s\n"), dstFile);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(dwFlags & REN_QUIET) && !(dwFlags & REN_TOTAL))
|
if (!(dwFlags & REN_QUIET) && !(dwFlags & REN_TOTAL))
|
||||||
ConOutPrintf(_T("%s -> %s\n"), f.cFileName, dstFile);
|
ConOutPrintf(_T("%s -> %s\n"), f.cFileName, dstFile);
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
INT cmd_shift (LPTSTR cmd, LPTSTR param)
|
INT cmd_shift (LPTSTR cmd, LPTSTR param)
|
||||||
{
|
{
|
||||||
|
|
||||||
TRACE ("cmd_shift: (\'%s\', \'%s\')\n", cmd, param);
|
TRACE ("cmd_shift: (\'%s\', \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param));
|
||||||
|
|
||||||
if (!_tcsncmp (param, _T("/?"), 2))
|
if (!_tcsncmp (param, _T("/?"), 2))
|
||||||
{
|
{
|
||||||
|
|
|
@ -253,10 +253,10 @@ INT cmd_start (LPTSTR First, LPTSTR Rest)
|
||||||
szFullCmdLine[_tcslen(szFullCmdLine)] = _T('\"');
|
szFullCmdLine[_tcslen(szFullCmdLine)] = _T('\"');
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE ("[BATCH: %s %s]\n", szFullName, rest);
|
TRACE ("[BATCH: %s %s]\n", debugstr_aw(szFullName), debugstr_aw(rest));
|
||||||
|
|
||||||
|
|
||||||
TRACE ("[EXEC: %s %s]\n", szFullName, rest);
|
TRACE ("[EXEC: %s %s]\n", debugstr_aw(szFullName), debugstr_aw(rest));
|
||||||
/* build command line for CreateProcess() */
|
/* build command line for CreateProcess() */
|
||||||
if (bBat == FALSE)
|
if (bBat == FALSE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -177,7 +177,7 @@ INT cmd_time (LPTSTR cmd, LPTSTR param)
|
||||||
|
|
||||||
ConInString (s, 40);
|
ConInString (s, 40);
|
||||||
|
|
||||||
TRACE ("\'%s\'\n", s);
|
TRACE ("\'%s\'\n", debugstr_aw(s));
|
||||||
|
|
||||||
while (*s && s[_tcslen (s) - 1] < _T(' '))
|
while (*s && s[_tcslen (s) - 1] < _T(' '))
|
||||||
s[_tcslen(s) - 1] = _T('\0');
|
s[_tcslen(s) - 1] = _T('\0');
|
||||||
|
|
|
@ -92,7 +92,8 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtensio
|
||||||
/* initialize full name buffer */
|
/* initialize full name buffer */
|
||||||
*pFullName = _T('\0');
|
*pFullName = _T('\0');
|
||||||
|
|
||||||
TRACE ("SearchForExecutableSingle: \'%s\' with ext: \'%s\'\n", pFileName, pExtension);
|
TRACE ("SearchForExecutableSingle: \'%s\' with ext: \'%s\'\n",
|
||||||
|
debugstr_aw(pFileName), debugstr_aw(pExtension));
|
||||||
|
|
||||||
/* Check if valid directly on specified path */
|
/* Check if valid directly on specified path */
|
||||||
if (_tcschr (pFileName, _T('\\')) != NULL)
|
if (_tcschr (pFileName, _T('\\')) != NULL)
|
||||||
|
@ -114,7 +115,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtensio
|
||||||
|
|
||||||
if (IsExistingFile (szPathBuffer))
|
if (IsExistingFile (szPathBuffer))
|
||||||
{
|
{
|
||||||
TRACE ("Found: \'%s\'\n", szPathBuffer);
|
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
||||||
_tcscpy (pFullName, szPathBuffer);
|
_tcscpy (pFullName, szPathBuffer);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +136,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtensio
|
||||||
|
|
||||||
if (IsExistingFile (szPathBuffer))
|
if (IsExistingFile (szPathBuffer))
|
||||||
{
|
{
|
||||||
TRACE ("Found: \'%s\'\n", szPathBuffer);
|
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
||||||
_tcscpy (pFullName, szPathBuffer);
|
_tcscpy (pFullName, szPathBuffer);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -183,7 +184,7 @@ SearchForExecutableSingle (LPCTSTR pFileName, LPTSTR pFullName, LPTSTR pExtensio
|
||||||
|
|
||||||
if (IsExistingFile (szPathBuffer))
|
if (IsExistingFile (szPathBuffer))
|
||||||
{
|
{
|
||||||
TRACE ("Found: \'%s\'\n", szPathBuffer);
|
TRACE ("Found: \'%s\'\n", debugstr_aw(szPathBuffer));
|
||||||
cmd_free (pszBuffer);
|
cmd_free (pszBuffer);
|
||||||
_tcscpy (pFullName, szPathBuffer);
|
_tcscpy (pFullName, szPathBuffer);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -202,7 +203,7 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
||||||
LPTSTR pCh;
|
LPTSTR pCh;
|
||||||
LPTSTR pExt;
|
LPTSTR pExt;
|
||||||
DWORD dwBuffer;
|
DWORD dwBuffer;
|
||||||
TRACE ("SearchForExecutable: \'%s\'\n", pFileName);
|
TRACE ("SearchForExecutable: \'%s\'\n", debugstr_aw(pFileName));
|
||||||
/* load environment varable PATHEXT */
|
/* load environment varable PATHEXT */
|
||||||
pszBuffer = (LPTSTR)cmd_alloc (ENV_BUFFER_SIZE * sizeof(TCHAR));
|
pszBuffer = (LPTSTR)cmd_alloc (ENV_BUFFER_SIZE * sizeof(TCHAR));
|
||||||
dwBuffer = GetEnvironmentVariable (_T("PATHEXT"), pszBuffer, ENV_BUFFER_SIZE);
|
dwBuffer = GetEnvironmentVariable (_T("PATHEXT"), pszBuffer, ENV_BUFFER_SIZE);
|
||||||
|
@ -216,7 +217,7 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName)
|
||||||
_tcscpy(pszBuffer, pszDefaultPathExt);
|
_tcscpy(pszBuffer, pszDefaultPathExt);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE ("SearchForExecutable(): Loaded PATHEXT: %s\n", pszBuffer);
|
TRACE ("SearchForExecutable(): Loaded PATHEXT: %s\n", debugstr_aw(pszBuffer));
|
||||||
|
|
||||||
pExt = _tcsrchr(pFileName, _T('.'));
|
pExt = _tcsrchr(pFileName, _T('.'));
|
||||||
if (pExt != NULL)
|
if (pExt != NULL)
|
||||||
|
|
|
@ -158,9 +158,7 @@ static INT ServiceActivate (LPTSTR param, HWND hWnd)
|
||||||
|
|
||||||
if (iAction & A_CLOSE)
|
if (iAction & A_CLOSE)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
FIXME("!!!FIXME: CLOSE Not implemented!!!\n");
|
||||||
ConErrPrintf(_T("!!!FIXME: CLOSE Not implemented!!!\n"));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wp.length = sizeof(WINDOWPLACEMENT);
|
wp.length = sizeof(WINDOWPLACEMENT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue