ReactOS  0.4.14-dev-317-g96040ec
error.c File Reference
#include "precomp.h"
Include dependency graph for error.c:

Go to the source code of this file.

Functions

VOID ErrorMessage (DWORD dwErrorCode, LPTSTR szFormat,...)
 
VOID error_parameter_format (TCHAR ch)
 
VOID error_invalid_switch (TCHAR ch)
 
VOID error_too_many_parameters (LPTSTR s)
 
VOID error_path_not_found (VOID)
 
VOID error_file_not_found (VOID)
 
VOID error_sfile_not_found (LPTSTR f)
 
VOID error_req_param_missing (VOID)
 
VOID error_invalid_drive (VOID)
 
VOID error_bad_command (LPTSTR s)
 
VOID error_no_pipe (VOID)
 
VOID error_out_of_memory (VOID)
 
VOID error_invalid_parameter_format (LPTSTR s)
 
VOID error_syntax (LPTSTR s)
 
VOID msg_pause (VOID)
 

Function Documentation

◆ error_bad_command()

VOID error_bad_command ( LPTSTR  s)

Definition at line 122 of file error.c.

123 {
125  nErrorLevel = 9009;
126 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPrintf(uID,...)
Definition: console.h:51
#define STRING_ERROR_BADCOMMAND
Definition: resource.h:13
GLdouble s
Definition: gl.h:2039

Referenced by Execute(), and ForF().

◆ error_file_not_found()

VOID error_file_not_found ( VOID  )

Definition at line 91 of file error.c.

92 {
94  nErrorLevel = 1;
95 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPuts(uID)
Definition: console.h:39
#define STRING_ERROR_FILE_NOT_FOUND
Definition: resource.h:9

Referenced by cmd_move(), cmd_rename(), and PrintSummary().

◆ error_invalid_drive()

VOID error_invalid_drive ( VOID  )

Definition at line 115 of file error.c.

116 {
118  nErrorLevel = 1;
119 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPuts(uID)
Definition: console.h:39
#define STRING_ERROR_INVALID_DRIVE
Definition: resource.h:13

Referenced by cmd_chdir(), and cmd_vol().

◆ error_invalid_parameter_format()

VOID error_invalid_parameter_format ( LPTSTR  s)

Definition at line 143 of file error.c.

144 {
146  nErrorLevel = 1;
147 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPrintf(uID,...)
Definition: console.h:51
#define STRING_ERROR_INVALID_PARAM_FORMAT
Definition: resource.h:5
GLdouble s
Definition: gl.h:2039

Referenced by cmd_move(), cmd_setlocal(), and CommandDelete().

◆ error_invalid_switch()

VOID error_invalid_switch ( TCHAR  ch)

Definition at line 70 of file error.c.

71 {
73  nErrorLevel = 1;
74 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPrintf(uID,...)
Definition: console.h:51
#define STRING_ERROR_INVALID_SWITCH
Definition: resource.h:6

Referenced by cmd_mklink(), cmd_shift(), cmd_ver(), and DirReadParam().

◆ error_no_pipe()

VOID error_no_pipe ( VOID  )

Definition at line 129 of file error.c.

130 {
132  nErrorLevel = 1;
133 }
INT nErrorLevel
Definition: cmd.c:157
#define STRING_ERROR_CANNOTPIPE
Definition: resource.h:15
#define ConErrResPuts(uID)
Definition: console.h:39

Referenced by ExecutePipeline().

◆ error_out_of_memory()

VOID error_out_of_memory ( VOID  )

Definition at line 136 of file error.c.

137 {
139  nErrorLevel = 1;
140 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPuts(uID)
Definition: console.h:39
#define STRING_ERROR_OUT_OF_MEMORY
Definition: resource.h:14

Referenced by Batch(), BatchGetString(), BatchParams(), cmd_setlocal(), cmd_start(), CommandAssoc(), DoCommand(), ExecuteAsync(), ForF(), and PushDirectory().

◆ error_parameter_format()

VOID error_parameter_format ( TCHAR  ch)

Definition at line 63 of file error.c.

64 {
66  nErrorLevel = 1;
67 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPrintf(uID,...)
Definition: console.h:51
#define STRING_ERROR_PARAMETERF_ERROR
Definition: resource.h:5

Referenced by DirReadParam().

◆ error_path_not_found()

VOID error_path_not_found ( VOID  )

Definition at line 84 of file error.c.

85 {
87  nErrorLevel = 1;
88 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPuts(uID)
Definition: console.h:39
#define STRING_ERROR_PATH_NOT_FOUND
Definition: resource.h:8

◆ error_req_param_missing()

VOID error_req_param_missing ( VOID  )

Definition at line 108 of file error.c.

109 {
111  nErrorLevel = 1;
112 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPuts(uID)
Definition: console.h:39
#define STRING_ERROR_REQ_PARAM_MISSING
Definition: resource.h:10

Referenced by cmd_ctty(), cmd_mklink(), cmd_move(), cmd_rename(), cmd_rmdir(), cmd_type(), CommandDelay(), CommandDelete(), and CommandScreen().

◆ error_sfile_not_found()

VOID error_sfile_not_found ( LPTSTR  f)

Definition at line 98 of file error.c.

99 {
100  TCHAR szMsg[RC_STRING_MAX_SIZE];
101 
103  ConErrPrintf(_T("%s - %s\n"), szMsg, f);
104  nErrorLevel = 1;
105 }
INT nErrorLevel
Definition: cmd.c:157
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
VOID ConErrPrintf(LPTSTR szFormat,...)
Definition: tee.c:36
char TCHAR
Definition: xmlstorage.h:189
GLfloat f
Definition: glext.h:7540
#define _T(x)
Definition: vfdio.h:22
HANDLE CMD_ModuleHandle
Definition: cmd.c:164
#define STRING_ERROR_FILE_NOT_FOUND
Definition: resource.h:9
#define LoadString
Definition: winuser.h:5720
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

◆ error_syntax()

VOID error_syntax ( LPTSTR  s)

Definition at line 150 of file error.c.

151 {
152  TCHAR szMsg[RC_STRING_MAX_SIZE];
153 
155 
156  if (s)
157  ConErrPrintf(_T("%s - %s\n"), szMsg, s);
158  else
159  ConErrPrintf(_T("%s.\n"), szMsg);
160 
161  nErrorLevel = 1;
162 }
INT nErrorLevel
Definition: cmd.c:157
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define STRING_ERROR_ERROR2
Definition: resource.h:44
VOID ConErrPrintf(LPTSTR szFormat,...)
Definition: tee.c:36
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
GLdouble s
Definition: gl.h:2039
HANDLE CMD_ModuleHandle
Definition: cmd.c:164
#define LoadString
Definition: winuser.h:5720
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

Referenced by cmd_for(), cmd_if(), cmd_move(), cmd_rename(), ExecuteIf(), ForF(), GetBatchVar(), and ParseError().

◆ error_too_many_parameters()

VOID error_too_many_parameters ( LPTSTR  s)

Definition at line 77 of file error.c.

78 {
80  nErrorLevel = 1;
81 }
INT nErrorLevel
Definition: cmd.c:157
#define ConErrResPrintf(uID,...)
Definition: console.h:51
GLdouble s
Definition: gl.h:2039
#define STRING_ERROR_TOO_MANY_PARAMETERS
Definition: resource.h:7

Referenced by cmd_mklink(), cmd_move(), and ExecutePipeline().

◆ ErrorMessage()

VOID ErrorMessage ( DWORD  dwErrorCode,
LPTSTR  szFormat,
  ... 
)

Definition at line 26 of file error.c.

27 {
29  TCHAR szMessage[1024];
30  LPTSTR szError;
31  va_list arg_ptr;
32 
33  if (dwErrorCode == ERROR_SUCCESS)
34  return;
35 
36  nErrorLevel = 1;
37 
38  if (szFormat)
39  {
40  va_start(arg_ptr, szFormat);
41  _vstprintf(szMessage, szFormat, arg_ptr);
42  va_end(arg_ptr);
43  }
44 
47  (LPTSTR)&szError, 0, NULL))
48  {
49  ConErrPrintf(_T("%s %s\n"), szError, szMessage);
50  if (szError)
51  LocalFree (szError);
52  return;
53  }
54 
55  /* Fall back just in case the error is not defined */
57  if (szFormat)
58  ConErrPrintf(_T("%s -- %s\n"), szMsg, szMessage);
59  else
60  ConErrPrintf(_T("%s\n"), szMsg);
61 }
INT nErrorLevel
Definition: cmd.c:157
#define ERROR_SUCCESS
Definition: deptool.c:10
#define STRING_CONSOLE_ERROR
Definition: resource.h:6
#define LANG_NEUTRAL
Definition: nls.h:22
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define _vstprintf
Definition: tchar.h:540
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define va_end(ap)
Definition: acmsvcex.h:90
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
VOID ConErrPrintf(LPTSTR szFormat,...)
Definition: tee.c:36
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define FormatMessage
Definition: winbase.h:3619
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define va_start(ap, A)
Definition: acmsvcex.h:91
HANDLE CMD_ModuleHandle
Definition: cmd.c:164
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LoadString
Definition: winuser.h:5720
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

Referenced by IopLogWorker().

◆ msg_pause()

VOID msg_pause ( VOID  )

Definition at line 165 of file error.c.

166 {
168 }
#define STRING_ERROR_D_PAUSEMSG
Definition: resource.h:16
#define ConOutResPuts(uID)
Definition: console.h:36

Referenced by cmd_pause(), and cmd_replace().