ReactOS 0.4.16-dev-1878-g24e88af
netsh.h
Go to the documentation of this file.
1#ifndef _NETSH_H_
2#define _NETSH_H_
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#define NETSH_ERROR_BASE 15000
9#define ERROR_NO_ENTRIES (NETSH_ERROR_BASE + 0)
10#define ERROR_INVALID_SYNTAX (NETSH_ERROR_BASE + 1)
11#define ERROR_PROTOCOL_NOT_IN_TRANSPORT (NETSH_ERROR_BASE + 2)
12#define ERROR_NO_CHANGE (NETSH_ERROR_BASE + 3)
13#define ERROR_CMD_NOT_FOUND (NETSH_ERROR_BASE + 4)
14#define ERROR_ENTRY_PT_NOT_FOUND (NETSH_ERROR_BASE + 5)
15#define ERROR_DLL_LOAD_FAILED (NETSH_ERROR_BASE + 6)
16#define ERROR_INIT_DISPLAY (NETSH_ERROR_BASE + 7)
17#define ERROR_TAG_ALREADY_PRESENT (NETSH_ERROR_BASE + 8)
18#define ERROR_INVALID_OPTION_TAG (NETSH_ERROR_BASE + 9)
19#define ERROR_NO_TAG (NETSH_ERROR_BASE + 10)
20#define ERROR_MISSING_OPTION (NETSH_ERROR_BASE + 11)
21#define ERROR_TRANSPORT_NOT_PRESENT (NETSH_ERROR_BASE + 12)
22#define ERROR_SHOW_USAGE (NETSH_ERROR_BASE + 13)
23#define ERROR_INVALID_OPTION_VALUE (NETSH_ERROR_BASE + 14)
24#define ERROR_OKAY (NETSH_ERROR_BASE + 15)
25#define ERROR_CONTINUE_IN_PARENT_CONTEXT (NETSH_ERROR_BASE + 16)
26#define ERROR_SUPPRESS_OUTPUT (NETSH_ERROR_BASE + 17)
27#define ERROR_HELPER_ALREADY_REGISTERED (NETSH_ERROR_BASE + 18)
28#define ERROR_CONTEXT_ALREADY_REGISTERED (NETSH_ERROR_BASE + 19)
29#define ERROR_PARSING_FAILURE (NETSH_ERROR_BASE + 20)
30#define NETSH_ERROR_END ERROR_CONTEXT_ALREADY_REGISTERED
31
32typedef enum _NS_REQS
33{
39
41{
48 CMD_FLAG_PRIORITY = 0x80000000
49};
50
52{
57 NETSH_SAVE = 4
58};
59
60#define DEFAULT_CONTEXT_PRIORITY 100
61
62#define NETSH_ROOT_GUID {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}
63
64typedef
67 _In_ DWORD dwMsgID,
69 _In_ DWORD nBufferMax);
70
71typedef
74 _In_ DWORD dwNetshVersion,
75 _Out_ PVOID pReserved);
76
77typedef
80 _In_ const GUID *pguidParent,
82
83typedef
87
88typedef
91 _In_ DWORD dwAction);
92
93typedef
96 _In_ LPCWSTR pwszMachine);
97
98typedef
101 _In_ LPCWSTR pwszRouter,
102 _In_ LPWSTR *ppwcArguments,
103 _In_ DWORD dwArgCount,
105
106typedef
109 _In_ UINT CIMOSType,
110 _In_ UINT CIMOSProductSuite,
111 _In_ LPCWSTR CIMOSVersion,
112 _In_ LPCWSTR CIMOSBuildNumber,
113 _In_ LPCWSTR CIMServicePackMajorVersion,
114 _In_ LPCWSTR CIMServicePackMinorVersion,
115 _In_ UINT uiReserved,
117
118typedef
121 _In_ LPCWSTR pwszMachine,
122 _In_ LPWSTR *ppwcArguments,
123 _In_ DWORD dwCurrentIndex,
124 _In_ DWORD dwArgCount,
127 _Out_ BOOL *pbDone);
128
129
130typedef struct _CMD_ENTRY
131{
139
140typedef struct _CMD_GROUP_ENTRY
141{
149
151{
152 union
153 {
154 struct
155 {
158 };
160 };
165
167{
168 union
169 {
170 struct
171 {
174 };
176 };
191
192typedef struct _TAG_TYPE
193{
198
199typedef struct _TOKEN_VALUE
200{
204
205DWORD
206WINAPI
209 _In_ LPCWSTR pwcArg,
210 _In_ DWORD dwNumArg,
211 _In_ const TOKEN_VALUE *pEnumTable,
212 _Out_ PDWORD pdwValue);
213
214BOOL
215WINAPI
217 _In_ LPCWSTR pwszUserToken,
218 _In_ LPCWSTR pwszCmdToken);
219
220DWORD
221WINAPI
224 _Inout_ LPWSTR *ppwcArguments,
225 _In_ DWORD dwCurrentIndex,
226 _In_ DWORD dwArgCount,
227 _Inout_ PTAG_TYPE pttTags,
228 _In_ DWORD dwTagCount,
229 _In_ DWORD dwMinArgs,
230 _In_ DWORD dwMaxArgs,
231 _Out_ DWORD *pdwTagType);
232
233DWORD
234CDECL
237 _In_ DWORD dwErrId,
238 ...);
239
240DWORD
241CDECL
244 _In_ DWORD dwMsgId,
245 ...);
246
247DWORD
248CDECL
250 _In_ LPCWSTR pwszMessage,
251 ...);
252
253DWORD
254WINAPI
256 _In_ const NS_CONTEXT_ATTRIBUTES *pChildContext);
257
258DWORD
259WINAPI
261 _In_ const GUID *pguidParentContext,
262 _In_ const NS_HELPER_ATTRIBUTES *pfnRegisterSubContext);
263
264#ifdef __cplusplus
265}
266#endif
267
268#endif /* _NETSH_H_ */
DWORD dwVersion
Definition: LocaleTests.cpp:63
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:176
#define CDECL
Definition: compat.h:29
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
CONST void * LPCVOID
Definition: minwindef.h:164
LPCWSTR LPCWSTR LPCWSTR DWORD dwFlags
Definition: env.c:37
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
unsigned int UINT
Definition: ndis.h:50
HMODULE hModule
Definition: netsh.c:17
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:120
enum _NS_REQS NS_REQS
struct _TAG_TYPE TAG_TYPE
DWORD(WINAPI * PGET_RESOURCE_STRING_FN)(_In_ DWORD dwMsgID, _Out_ LPWSTR lpBuffer, _In_ DWORD nBufferMax)
Definition: netsh.h:66
_NS_REQS
Definition: netsh.h:33
@ NS_REQ_PRESENT
Definition: netsh.h:35
@ NS_REQ_ONE_OR_MORE
Definition: netsh.h:37
@ NS_REQ_ALLOW_MULTIPLE
Definition: netsh.h:36
@ NS_REQ_ZERO
Definition: netsh.h:34
struct _NS_HELPER_ATTRIBUTES NS_HELPER_ATTRIBUTES
DWORD WINAPI MatchEnumTag(_In_ HANDLE hModule, _In_ LPCWSTR pwcArg, _In_ DWORD dwNumArg, _In_ const TOKEN_VALUE *pEnumTable, _Out_ PDWORD pdwValue)
Definition: netsh.c:285
struct _TOKEN_VALUE TOKEN_VALUE
struct _CMD_GROUP_ENTRY * PCMD_GROUP_ENTRY
DWORD CDECL PrintMessage(_In_ LPCWSTR pwszMessage,...)
Definition: netsh.c:484
DWORD CDECL PrintError(_In_opt_ HANDLE hModule, _In_ DWORD dwErrId,...)
Definition: netsh.c:381
DWORD(WINAPI * PNS_HELPER_STOP_FN)(_In_ DWORD dwReserved)
Definition: netsh.h:85
NS_CMD_FLAGS
Definition: netsh.h:41
@ CMD_FLAG_ONLINE
Definition: netsh.h:45
@ CMD_FLAG_HIDDEN
Definition: netsh.h:46
@ CMD_FLAG_PRIVATE
Definition: netsh.h:42
@ CMD_FLAG_LIMIT_MASK
Definition: netsh.h:47
@ CMD_FLAG_PRIORITY
Definition: netsh.h:48
@ CMD_FLAG_INTERACTIVE
Definition: netsh.h:43
@ CMD_FLAG_LOCAL
Definition: netsh.h:44
DWORD WINAPI RegisterContext(_In_ const NS_CONTEXT_ATTRIBUTES *pChildContext)
Definition: context.c:906
DWORD(WINAPI * PNS_CONTEXT_DUMP_FN)(_In_ LPCWSTR pwszRouter, _In_ LPWSTR *ppwcArguments, _In_ DWORD dwArgCount, _In_ LPCVOID pvData)
Definition: netsh.h:100
struct _TAG_TYPE * PTAG_TYPE
struct _TOKEN_VALUE * PTOKEN_VALUE
struct _NS_HELPER_ATTRIBUTES * PNS_HELPER_ATTRIBUTES
struct _CMD_GROUP_ENTRY CMD_GROUP_ENTRY
DWORD(WINAPI * PNS_DLL_INIT_FN)(_In_ DWORD dwNetshVersion, _Out_ PVOID pReserved)
Definition: netsh.h:73
BOOL WINAPI MatchToken(_In_ LPCWSTR pwszUserToken, _In_ LPCWSTR pwszCmdToken)
Definition: netsh.c:313
DWORD WINAPI RegisterHelper(_In_ const GUID *pguidParentContext, _In_ const NS_HELPER_ATTRIBUTES *pfnRegisterSubContext)
Definition: helper.c:385
DWORD(WINAPI * PNS_HELPER_START_FN)(_In_ const GUID *pguidParent, _In_ DWORD dwVersion)
Definition: netsh.h:79
BOOL(WINAPI * PNS_OSVERSIONCHECK)(_In_ UINT CIMOSType, _In_ UINT CIMOSProductSuite, _In_ LPCWSTR CIMOSVersion, _In_ LPCWSTR CIMOSBuildNumber, _In_ LPCWSTR CIMServicePackMajorVersion, _In_ LPCWSTR CIMServicePackMinorVersion, _In_ UINT uiReserved, _In_ DWORD dwReserved)
Definition: netsh.h:108
DWORD(WINAPI * PNS_CONTEXT_CONNECT_FN)(_In_ LPCWSTR pwszMachine)
Definition: netsh.h:95
DWORD(WINAPI * PNS_CONTEXT_COMMIT_FN)(_In_ DWORD dwAction)
Definition: netsh.h:90
struct _NS_CONTEXT_ATTRIBUTES NS_CONTEXT_ATTRIBUTES
struct _CMD_ENTRY CMD_ENTRY
DWORD WINAPI PreprocessCommand(_In_opt_ HANDLE hModule, _Inout_ LPWSTR *ppwcArguments, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _Inout_ PTAG_TYPE pttTags, _In_ DWORD dwTagCount, _In_ DWORD dwMinArgs, _In_ DWORD dwMaxArgs, _Out_ DWORD *pdwTagType)
DWORD CDECL PrintMessageFromModule(_In_ HANDLE hModule, _In_ DWORD dwMsgId,...)
Definition: netsh.c:465
struct _NS_CONTEXT_ATTRIBUTES * PNS_CONTEXT_ATTRIBUTES
struct _CMD_ENTRY * PCMD_ENTRY
NS_MODE_CHANGE
Definition: netsh.h:52
@ NETSH_COMMIT
Definition: netsh.h:53
@ NETSH_FLUSH
Definition: netsh.h:55
@ NETSH_SAVE
Definition: netsh.h:57
@ NETSH_UNCOMMIT
Definition: netsh.h:54
@ NETSH_COMMIT_STATE
Definition: netsh.h:56
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
DWORD * PDWORD
Definition: pedump.c:68
Definition: netsh.h:131
PFN_HANDLE_CMD pfnCmdHandler
Definition: netsh.h:133
DWORD dwCmdHlpToken
Definition: netsh.h:135
LPCWSTR pwszCmdToken
Definition: netsh.h:132
DWORD dwFlags
Definition: netsh.h:136
PNS_OSVERSIONCHECK pOsVersionCheck
Definition: netsh.h:137
DWORD dwShortCmdHelpToken
Definition: netsh.h:134
Definition: netsh.h:141
PNS_OSVERSIONCHECK pOsVersionCheck
Definition: netsh.h:147
LPCWSTR pwszCmdGroupToken
Definition: netsh.h:142
ULONG ulCmdGroupSize
Definition: netsh.h:144
DWORD dwFlags
Definition: netsh.h:145
PCMD_ENTRY pCmdGroup
Definition: netsh.h:146
DWORD dwShortCmdHelpToken
Definition: netsh.h:143
ULONGLONG _ullAlign
Definition: netsh.h:175
CMD_ENTRY * pTopCmds
Definition: netsh.h:182
CMD_GROUP_ENTRY * pCmdGroups
Definition: netsh.h:184
PNS_OSVERSIONCHECK pfnOsVersionCheck
Definition: netsh.h:189
PNS_CONTEXT_DUMP_FN pfnDumpFn
Definition: netsh.h:186
PNS_CONTEXT_CONNECT_FN pfnConnectFn
Definition: netsh.h:187
PNS_CONTEXT_COMMIT_FN pfnCommitFn
Definition: netsh.h:185
PNS_HELPER_STOP_FN pfnStop
Definition: netsh.h:163
ULONGLONG _ullAlign
Definition: netsh.h:159
PNS_HELPER_START_FN pfnStart
Definition: netsh.h:162
DWORD dwRequired
Definition: netsh.h:195
BOOL bPresent
Definition: netsh.h:196
LPCWSTR pwszTag
Definition: netsh.h:194
DWORD dwValue
Definition: netsh.h:202
LPCWSTR pwszToken
Definition: netsh.h:201
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749
#define WINAPI
Definition: msvc.h:6
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WCHAR * LPWSTR
Definition: xmlstorage.h:184