2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS net command
4 * FILE: base/applications/network/net/main.c
7 * PROGRAMMERS: Magnus Olsen (greatlord@reactos.org)
12 #define MAX_BUFFER_SIZE 4096
14 typedef struct _COMMAND
17 INT (*func
)(INT
, WCHAR
**);
18 // VOID (*help)(INT, WCHAR**);
23 {L
"accounts", cmdAccounts
},
24 {L
"computer", unimplemented
},
25 {L
"config", cmdConfig
},
26 {L
"continue", cmdContinue
},
27 {L
"file", unimplemented
},
30 {L
"helpmsg", cmdHelpMsg
},
31 {L
"localgroup", cmdLocalGroup
},
32 {L
"name", unimplemented
},
34 {L
"print", unimplemented
},
35 {L
"send", unimplemented
},
36 {L
"session", unimplemented
},
37 {L
"share", unimplemented
},
39 {L
"statistics", cmdStatistics
},
41 {L
"time", unimplemented
},
44 {L
"view", unimplemented
},
51 PrintPaddedResourceString(
57 nLength
= ConResPuts(StdOut
, uID
);
58 if (nLength
< nPaddedLength
)
59 PrintPadding(L
' ', nPaddedLength
- nLength
);
69 WCHAR szMsgBuffer
[MAX_BUFFER_SIZE
];
71 for (i
= 0; i
< nPaddedLength
; i
++)
73 szMsgBuffer
[nPaddedLength
] = UNICODE_NULL
;
75 ConPuts(StdOut
, szMsgBuffer
);
91 pBuf
= HeapAlloc(GetProcessHeap(), 0, dwLength
- 1);
92 ZeroMemory(lpInput
, dwLength
* sizeof(WCHAR
));
93 hFile
= GetStdHandle(STD_INPUT_HANDLE
);
94 GetConsoleMode(hFile
, &dwOldMode
);
96 SetConsoleMode(hFile
, ENABLE_LINE_INPUT
| (bEcho
? ENABLE_ECHO_INPUT
: 0));
98 ReadFile(hFile
, (PVOID
)pBuf
, dwLength
- 1, &dwRead
, NULL
);
100 MultiByteToWideChar(CP_OEMCP
, 0, pBuf
, dwRead
, lpInput
, dwLength
- 1);
101 HeapFree(GetProcessHeap(), 0, pBuf
);
103 for (p
= lpInput
; *p
; p
++)
112 SetConsoleMode(hFile
, dwOldMode
);
116 int wmain(int argc
, WCHAR
**argv
)
120 /* Initialize the Console Standard Streams */
125 ConResPuts(StdOut
, IDS_NET_SYNTAX
);
129 /* Scan the command table */
130 for (cmdptr
= cmds
; cmdptr
->name
; cmdptr
++)
132 if (_wcsicmp(argv
[1], cmdptr
->name
) == 0)
134 return cmdptr
->func(argc
, argv
);
138 ConResPuts(StdOut
, IDS_NET_SYNTAX
);
143 INT
unimplemented(INT argc
, WCHAR
**argv
)
145 ConPuts(StdOut
, L
"This command is not implemented yet\n");