ReactOS  0.4.15-dev-318-g99b52df
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 LPTSTR szFormat OPTIONAL,...)
 
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 126 of file error.c.

127 {
129  nErrorLevel = 9009;
130 }
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 95 of file error.c.

96 {
98  nErrorLevel = 1;
99 }
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 119 of file error.c.

120 {
122  nErrorLevel = 1;
123 }
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 147 of file error.c.

148 {
150  nErrorLevel = 1;
151 }
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 74 of file error.c.

75 {
77  nErrorLevel = 1;
78 }
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 133 of file error.c.

134 {
136  nErrorLevel = 1;
137 }
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 140 of file error.c.

141 {
143  nErrorLevel = 1;
144 }
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 67 of file error.c.

68 {
70  nErrorLevel = 1;
71 }
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 88 of file error.c.

89 {
91  nErrorLevel = 1;
92 }
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 112 of file error.c.

113 {
115  nErrorLevel = 1;
116 }
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 102 of file error.c.

103 {
104  TCHAR szMsg[RC_STRING_MAX_SIZE];
105 
107  ConErrPrintf(_T("%s - %s\n"), szMsg, f);
108  nErrorLevel = 1;
109 }
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:5794
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

◆ error_syntax()

VOID error_syntax ( LPTSTR  s)

Definition at line 154 of file error.c.

155 {
156  TCHAR szMsg[RC_STRING_MAX_SIZE];
157 
159 
160  if (s)
161  ConErrPrintf(_T("%s - %s\n"), szMsg, s);
162  else
163  ConErrPrintf(_T("%s.\n"), szMsg);
164 
165  nErrorLevel = 1;
166 }
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:5794
#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 81 of file error.c.

82 {
84  nErrorLevel = 1;
85 }
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 ( IN DWORD  dwErrorCode,
IN LPTSTR szFormat  OPTIONAL,
  ... 
)

Definition at line 26 of file error.c.

30 {
31  va_list arg_ptr;
32  LPTSTR szError;
34  TCHAR szMessage[1024];
35 
36  if (dwErrorCode == ERROR_SUCCESS)
37  return;
38 
39  nErrorLevel = 1;
40 
41  *szMessage = 0;
42  if (szFormat)
43  {
44  va_start(arg_ptr, szFormat);
45  _vstprintf(szMessage, szFormat, arg_ptr);
46  va_end(arg_ptr);
47  }
48 
51  (LPTSTR)&szError, 0, NULL))
52  {
53  ConErrPrintf(_T("%s %s\n"), szError, szMessage);
54  if (szError)
55  LocalFree(szError);
56  return;
57  }
58 
59  /* Fall back just in case the error is not defined */
61  if (szFormat)
62  ConErrPrintf(_T("%s -- %s\n"), szMsg, szMessage);
63  else
64  ConErrPrintf(_T("%s\n"), szMsg);
65 }
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:3635
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:5794
#define RC_STRING_MAX_SIZE
Definition: resource.h:3

Referenced by IopLogWorker().

◆ msg_pause()

VOID msg_pause ( VOID  )

Definition at line 169 of file error.c.

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

Referenced by cmd_pause(), and cmd_replace().