mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:25:45 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
67
base/applications/network/net/cmdHelpMsg.c
Normal file
67
base/applications/network/net/cmdHelpMsg.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS net command
|
||||
* FILE: base/applications/network/net/cmdHelpMsg.c
|
||||
* PURPOSE:
|
||||
*
|
||||
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
||||
*/
|
||||
|
||||
#include "net.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
INT cmdHelpMsg(INT argc, WCHAR **argv)
|
||||
{
|
||||
INT i;
|
||||
LONG errNum;
|
||||
LPWSTR endptr;
|
||||
// DWORD dwLength = 0;
|
||||
LPWSTR lpBuffer;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
ConResPuts(StdOut, IDS_HELPMSG_SYNTAX);
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 2; i < argc; i++)
|
||||
{
|
||||
if (_wcsicmp(argv[i], L"/help") == 0)
|
||||
{
|
||||
ConResPuts(StdOut, IDS_HELPMSG_HELP);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
errNum = wcstol(argv[2], &endptr, 10);
|
||||
if (*endptr != 0)
|
||||
{
|
||||
ConResPuts(StdOut, IDS_HELPMSG_SYNTAX);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Retrieve the message string without appending extra newlines */
|
||||
// dwLength =
|
||||
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK,
|
||||
NULL,
|
||||
errNum,
|
||||
LANG_USER_DEFAULT,
|
||||
(LPWSTR)&lpBuffer,
|
||||
0, NULL);
|
||||
if (lpBuffer /* && dwLength */)
|
||||
{
|
||||
ConPrintf(StdOut, L"\n%s\n", lpBuffer);
|
||||
LocalFree(lpBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConPrintf(StdOut, L"Unrecognized error code: %ld\n", errNum);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue