ReactOS 0.4.15-dev-7942-gd23573b
cmdHelpMsg.c File Reference
#include "net.h"
#include <stdlib.h>
Include dependency graph for cmdHelpMsg.c:

Go to the source code of this file.

Functions

INT cmdHelpMsg (INT argc, WCHAR **argv)
 

Function Documentation

◆ cmdHelpMsg()

INT cmdHelpMsg ( INT  argc,
WCHAR **  argv 
)

Definition at line 14 of file cmdHelpMsg.c.

15{
16 INT i;
17 LONG errNum;
18 PWSTR endptr;
20 PWSTR pInserts[10] = {L"***", L"***", L"***", L"***",
21 L"***", L"***", L"***", L"***",
22 L"***", NULL};
23
24 if (argc < 3)
25 {
27 ConPuts(StdOut, L"\n");
28 PrintNetMessage(MSG_HELPMSG_SYNTAX);
29 return 1;
30 }
31
32 for (i = 2; i < argc; i++)
33 {
34 if (_wcsicmp(argv[i], L"/help") == 0)
35 {
37 ConPuts(StdOut, L"\n");
38 PrintNetMessage(MSG_HELPMSG_SYNTAX);
39 PrintNetMessage(MSG_HELPMSG_HELP);
40 return 1;
41 }
42 }
43
44 errNum = wcstol(argv[2], &endptr, 10);
45 if (*endptr != 0)
46 {
48 ConPuts(StdOut, L"\n");
49 PrintNetMessage(MSG_HELPMSG_SYNTAX);
50 return 1;
51 }
52
53 if (errNum >= MIN_LANMAN_MESSAGE_ID && errNum <= MAX_LANMAN_MESSAGE_ID)
54 {
58 errNum,
61 0,
62 (va_list *)pInserts);
63 if (pBuffer)
64 {
65 ConPrintf(StdOut, L"\n%s\n", pBuffer);
67 }
68 else
69 {
71 }
72 }
73 else
74 {
75 /* Retrieve the message string without appending extra newlines */
78 NULL,
79 errNum,
82 0,
83 (va_list *)pInserts);
84 if (pBuffer)
85 {
86 ConPrintf(StdOut, L"\n%s\n", pBuffer);
88 }
89 else
90 {
92 }
93 }
94
95 return 0;
96}
static int argc
Definition: ServiceArgs.c:12
char * va_list
Definition: acmsvcex.h:78
static VOID PrintErrorMessage(DWORD dwError)
Definition: at.c:308
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: fc.c:16
void ConPrintf(FILE *fp, LPCWSTR psz,...)
Definition: fc.c:20
#define StdOut
Definition: fc.c:14
HMODULE hModuleNetMsg
Definition: main.c:46
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:239
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:120
#define NULL
Definition: types.h:112
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define MAX_LANMAN_MESSAGE_ID
Definition: lmcons.h:11
#define MIN_LANMAN_MESSAGE_ID
Definition: lmcons.h:10
#define argv
Definition: mplay32.c:18
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
PVOID pBuffer
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:424
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:422
WCHAR * LPWSTR
Definition: xmlstorage.h:184