ReactOS  0.4.15-dev-1397-g19779b3
error.c File Reference
#include "precomp.h"
Include dependency graph for error.c:

Go to the source code of this file.

Functions

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

Function Documentation

◆ error_bad_command()

VOID error_bad_command ( PCTSTR  s)

Definition at line 124 of file error.c.

125 {
127  nErrorLevel = 9009;
128 }
INT nErrorLevel
Definition: cmd.c:158
#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 93 of file error.c.

94 {
96  nErrorLevel = 1;
97 }
INT nErrorLevel
Definition: cmd.c:158
#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 117 of file error.c.

118 {
120  nErrorLevel = 1;
121 }
INT nErrorLevel
Definition: cmd.c:158
#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 ( PCTSTR  s)

Definition at line 145 of file error.c.

146 {
148  nErrorLevel = 1;
149 }
INT nErrorLevel
Definition: cmd.c:158
#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 72 of file error.c.

73 {
75  nErrorLevel = 1;
76 }
INT nErrorLevel
Definition: cmd.c:158
#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 131 of file error.c.

132 {
134  nErrorLevel = 1;
135 }
INT nErrorLevel
Definition: cmd.c:158
#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 138 of file error.c.

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

Referenced by BatchGetString(), BatchParams(), cmd_call(), cmd_path(), cmd_setlocal(), cmd_start(), DoCommand(), ExecuteAsync(), ForF(), and PushDirectory().

◆ error_parameter_format()

VOID error_parameter_format ( TCHAR  ch)

Definition at line 65 of file error.c.

66 {
68  nErrorLevel = 1;
69 }
INT nErrorLevel
Definition: cmd.c:158
#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 86 of file error.c.

87 {
89  nErrorLevel = 1;
90 }
INT nErrorLevel
Definition: cmd.c:158
#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 110 of file error.c.

111 {
113  nErrorLevel = 1;
114 }
INT nErrorLevel
Definition: cmd.c:158
#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 ( PCTSTR  s)

Definition at line 100 of file error.c.

101 {
102  TCHAR szMsg[RC_STRING_MAX_SIZE];
103 
105  ConErrPrintf(_T("%s - %s\n"), szMsg, s);
106  nErrorLevel = 1;
107 }
INT nErrorLevel
Definition: cmd.c:158
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
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:165
#define STRING_ERROR_FILE_NOT_FOUND
Definition: resource.h:9
#define LoadString
Definition: winuser.h:5794
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

Referenced by DeleteFiles(), and ForF().

◆ error_syntax()

VOID error_syntax ( PCTSTR  s)

Definition at line 152 of file error.c.

153 {
154  TCHAR szMsg[RC_STRING_MAX_SIZE];
155 
157 
158  if (s)
159  ConErrPrintf(_T("%s - %s\n"), szMsg, s);
160  else
161  ConErrPrintf(_T("%s.\n"), szMsg);
162 
163  nErrorLevel = 1;
164 }
INT nErrorLevel
Definition: cmd.c:158
#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:165
#define LoadString
Definition: winuser.h:5794
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

Referenced by cmd_move(), cmd_rename(), ExecuteIf(), ForF(), and ParseErrorEx().

◆ error_too_many_parameters()

VOID error_too_many_parameters ( PCTSTR  s)

Definition at line 79 of file error.c.

80 {
82  nErrorLevel = 1;
83 }
INT nErrorLevel
Definition: cmd.c:158
#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 ( IN DWORD  dwErrorCode,
IN PCTSTR szFormat  OPTIONAL,
  ... 
)

Definition at line 26 of file error.c.

30 {
31  va_list arg_ptr;
32  PTSTR szError;
34  TCHAR szMessage[1024];
35 
36  if (dwErrorCode == ERROR_SUCCESS)
37  return;
38 
39  *szMessage = 0;
40  if (szFormat)
41  {
42  va_start(arg_ptr, szFormat);
43  _vstprintf(szMessage, szFormat, arg_ptr);
44  va_end(arg_ptr);
45  }
46 
49  (PTSTR)&szError, 0, NULL))
50  {
51  ConErrPrintf(_T("%s%s%s"), szError, szMessage, (*szMessage ? _T("\n") : _T("")));
52  if (szError)
53  LocalFree(szError);
54  return;
55  }
56 
57  /* Fall back just in case the error is not defined */
59  if (szFormat)
60  ConErrPrintf(_T("%s -- %s\n"), szMsg, szMessage);
61  else
62  ConErrPrintf(_T("%s\n"), szMsg);
63 }
#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
#define va_end(ap)
Definition: acmsvcex.h:90
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
char * va_list
Definition: acmsvcex.h:78
CHAR * PTSTR
Definition: xmlstorage.h:191
#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
va_start(ap, x)
#define FormatMessage
Definition: winbase.h:3635
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define NULL
Definition: types.h:112
HANDLE CMD_ModuleHandle
Definition: cmd.c:165
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LoadString
Definition: winuser.h:5794
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

Referenced by IopLogWorker().

◆ msg_pause()

VOID msg_pause ( VOID  )

Definition at line 167 of file error.c.

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

Referenced by cmd_pause(), and cmd_replace().