ReactOS 0.4.15-dev-7931-gfd331f1
precomp.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS NetSh
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Network Shell main header file
5 * COPYRIGHT: Copyright 2023 Eric Kohl <eric.kohl@reactos.org>
6 */
7
8#ifndef PRECOMP_H
9#define PRECOMP_H
10
11/* INCLUDES ******************************************************************/
12
13#include <stdio.h>
14#include <stdlib.h>
15#include <stdarg.h>
16
17#define WIN32_NO_STATUS
18#include <windef.h>
19#include <winbase.h>
20#include <winreg.h>
21#include <wincon.h>
22#include <winuser.h>
23
24#include <errno.h>
25
26#include <conutils.h>
27#include <netsh.h>
28
29#include "resource.h"
30
31
32/* DEFINES *******************************************************************/
33
34#define MAX_STRING_SIZE 1024
35#define MAX_ARGS_COUNT 256
36
37#define REG_NETSH_PATH L"Software\\Microsoft\\NetSh"
38
39
40/* TYPEDEFS ******************************************************************/
41
42typedef struct _DLL_LIST_ENTRY
43{
46
50
52
54
55typedef struct _HELPER_ENTRY
56{
59
61
64
67
69
70
71
72typedef struct _COMMAND_ENTRY
73{
76
83
84typedef struct _COMMAND_GROUP
85{
88
92
96
97typedef struct _CONTEXT_ENTRY
98{
101
103
107
110
113
117
118
119/* GLOBAL VARIABLES ***********************************************************/
120
123
124
125/* PROTOTYPES *****************************************************************/
126
127/* context.c */
128
129BOOL
131
132
133/* help.c */
134DWORD
135WINAPI
137 LPCWSTR pwszMachine,
138 LPWSTR *ppwcArguments,
139 DWORD dwCurrentIndex,
140 DWORD dwArgCount,
143 BOOL *pbDone);
144
145VOID
147 PCOMMAND_GROUP pGroup);
148
149
150/* helper.c */
151VOID
153
154VOID
156
157
158DWORD
159WINAPI
161 LPCWSTR pwszMachine,
162 LPWSTR *ppwcArguments,
163 DWORD dwCurrentIndex,
164 DWORD dwArgCount,
167 BOOL *pbDone);
168
169DWORD
170WINAPI
172 LPCWSTR pwszMachine,
173 LPWSTR *ppwcArguments,
174 DWORD dwCurrentIndex,
175 DWORD dwArgCount,
178 BOOL *pbDone);
179
180DWORD
181WINAPI
183 LPCWSTR pwszMachine,
184 PWSTR *ppwcArguments,
185 DWORD dwCurrentIndex,
186 DWORD dwArgCount,
189 BOOL *pbDone);
190
191
192/* interpreter.c */
193BOOL
196
197BOOL
199 LPWSTR *argv,
200 DWORD dwArgCount);
201
202VOID
204
205#endif /* PRECOMP_H */
struct _COMMAND_GROUP * PCOMMAND_GROUP
VOID LoadHelpers(VOID)
Definition: helper.c:241
struct _COMMAND_ENTRY COMMAND_ENTRY
BOOL InterpretScript(LPWSTR pszFileName)
Definition: interpreter.c:183
struct _COMMAND_GROUP COMMAND_GROUP
BOOL CreateRootContext(VOID)
Definition: context.c:282
VOID UnloadHelpers(VOID)
Definition: helper.c:318
struct _CONTEXT_ENTRY CONTEXT_ENTRY
struct _DLL_LIST_ENTRY * PDLL_LIST_ENTRY
DWORD WINAPI HelpCommand(LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: help.c:116
PCONTEXT_ENTRY pRootContext
Definition: context.c:17
VOID InterpretInteractive(VOID)
Definition: interpreter.c:188
DWORD WINAPI AddHelperCommand(LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: helper.c:425
DWORD WINAPI DeleteHelperCommand(LPCWSTR pwszMachine, LPWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
Definition: helper.c:457
struct _DLL_LIST_ENTRY DLL_LIST_ENTRY
VOID HelpGroup(PCOMMAND_GROUP pGroup)
Definition: help.c:93
PCONTEXT_ENTRY pCurrentContext
Definition: context.c:18
struct _CONTEXT_ENTRY * PCONTEXT_ENTRY
struct _HELPER_ENTRY * PHELPER_ENTRY
struct _HELPER_ENTRY HELPER_ENTRY
struct _COMMAND_ENTRY * PCOMMAND_ENTRY
DWORD WINAPI ShowHelperCommand(LPCWSTR pwszMachine, PWSTR *ppwcArguments, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone)
BOOL InterpretCommand(LPWSTR *argv, DWORD dwArgCount)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define argv
Definition: mplay32.c:18
DWORD(WINAPI * PFN_HANDLE_CMD)(_In_ LPCWSTR pwszMachine, _In_ LPWSTR *ppwcArguments, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ DWORD dwFlags, _In_ LPCVOID pvData, _Out_ BOOL *pbDone)
Definition: netsh.h:64
Definition: precomp.h:73
DWORD dwCmdHlpToken
Definition: precomp.h:80
PFN_HANDLE_CMD pfnCmdHandler
Definition: precomp.h:78
LPCWSTR pwszCmdToken
Definition: precomp.h:77
struct _COMMAND_ENTRY * pPrev
Definition: precomp.h:74
DWORD dwShortCmdHelpToken
Definition: precomp.h:79
DWORD dwFlags
Definition: precomp.h:81
struct _COMMAND_ENTRY * pNext
Definition: precomp.h:75
PCOMMAND_ENTRY pCommandListTail
Definition: precomp.h:94
PCOMMAND_ENTRY pCommandListHead
Definition: precomp.h:93
struct _COMMAND_GROUP * pPrev
Definition: precomp.h:86
DWORD dwFlags
Definition: precomp.h:91
LPCWSTR pwszCmdGroupToken
Definition: precomp.h:89
struct _COMMAND_GROUP * pNext
Definition: precomp.h:87
DWORD dwShortCmdHelpToken
Definition: precomp.h:90
Definition: precomp.h:98
PWSTR pszContextName
Definition: precomp.h:104
PCOMMAND_ENTRY pCommandListTail
Definition: precomp.h:109
PCOMMAND_GROUP pGroupListTail
Definition: precomp.h:112
struct _CONTEXT_ENTRY * pSubContextHead
Definition: precomp.h:114
struct _CONTEXT_ENTRY * pPrev
Definition: precomp.h:99
HMODULE hModule
Definition: precomp.h:106
struct _CONTEXT_ENTRY * pParentContext
Definition: precomp.h:102
struct _CONTEXT_ENTRY * pNext
Definition: precomp.h:100
GUID Guid
Definition: precomp.h:105
PCOMMAND_GROUP pGroupListHead
Definition: precomp.h:111
PCOMMAND_ENTRY pCommandListHead
Definition: precomp.h:108
struct _CONTEXT_ENTRY * pSubContextTail
Definition: precomp.h:115
Definition: precomp.h:43
PWSTR pszDllName
Definition: precomp.h:47
PWSTR pszShortName
Definition: precomp.h:48
PWSTR pszValueName
Definition: precomp.h:49
struct _DLL_LIST_ENTRY * pNext
Definition: precomp.h:45
HMODULE hModule
Definition: precomp.h:51
struct _DLL_LIST_ENTRY * pPrev
Definition: precomp.h:44
Definition: precomp.h:56
struct _HELPER_ENTRY * pSubHelperTail
Definition: precomp.h:66
NS_HELPER_ATTRIBUTES Attributes
Definition: precomp.h:60
struct _HELPER_ENTRY * pSubHelperHead
Definition: precomp.h:65
PDLL_LIST_ENTRY pDllEntry
Definition: precomp.h:62
BOOL bStarted
Definition: precomp.h:63
struct _HELPER_ENTRY * pNext
Definition: precomp.h:58
struct _HELPER_ENTRY * pPrev
Definition: precomp.h:57
uint16_t * PWSTR
Definition: typedefs.h:56
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749
CONST void * LPCVOID
Definition: windef.h:191
#define WINAPI
Definition: msvc.h:6
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185