ReactOS
0.4.16-dev-1946-g52006dd
winsock.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS IF Monitor DLL
3
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4
* PURPOSE: NetSh Helper interface context functions
5
* COPYRIGHT: Copyright 2025 Eric Kohl <eric.kohl@reactos.org>
6
*/
7
8
#include "
precomp.h
"
9
10
#include <guiddef.h>
11
12
#define NDEBUG
13
#include <debug.h>
14
15
#include "
guid.h
"
16
#include "
resource.h
"
17
18
static
FN_HANDLE_CMD
ResetCommand
;
19
static
FN_HANDLE_CMD
ShowCatalogCommand
;
20
21
static
22
CMD_ENTRY
g_TestCmdTable
[] =
23
{
24
{
L
"reset"
,
ResetCommand
,
IDS_HLP_WINSOCK_RESET
,
IDS_HLP_WINSOCK_RESET_EX
, 0}
25
};
26
27
static
28
CMD_ENTRY
g_WinsockShowCmdTable
[] =
29
{
30
{
L
"catalog"
,
ShowCatalogCommand
,
IDS_HLP_WINSOCK_SHOW_CATALOG
,
IDS_HLP_WINSOCK_SHOW_CATALOG_EX
, 0}
31
};
32
33
static
34
CMD_GROUP_ENTRY
g_WinsockGroupCmds
[] =
35
{
36
{
L
"show"
,
IDS_HLP_WINSOCK_SHOW
,
sizeof
(
g_WinsockShowCmdTable
)/
sizeof
(
CMD_ENTRY
), 0,
g_WinsockShowCmdTable
,
NULL
},
37
};
38
39
40
static
41
DWORD
42
WINAPI
43
ResetCommand
(
44
LPCWSTR
pwszMachine,
45
LPWSTR
*
argv
,
46
DWORD
dwCurrentIndex
,
47
DWORD
dwArgCount
,
48
DWORD
dwFlags
,
49
LPCVOID
pvData
,
50
BOOL
*
pbDone
)
51
{
52
PrintMessage
(
L
"ResetCommand(): Not implemented yet!\n"
);
53
return
ERROR_SUCCESS
;
54
}
55
56
57
static
58
DWORD
59
WINAPI
60
ShowCatalogCommand
(
61
LPCWSTR
pwszMachine,
62
LPWSTR
*
argv
,
63
DWORD
dwCurrentIndex
,
64
DWORD
dwArgCount
,
65
DWORD
dwFlags
,
66
LPCVOID
pvData
,
67
BOOL
*
pbDone
)
68
{
69
PrintMessage
(
L
"ShowCatalogCommand(): Not implemented yet!\n"
);
70
return
ERROR_SUCCESS
;
71
}
72
73
74
static
75
DWORD
76
WINAPI
77
WinsockStart
(
78
_In_
const
GUID
*pguidParent,
79
_In_
DWORD
dwVersion
)
80
{
81
NS_CONTEXT_ATTRIBUTES
ContextAttributes;
82
83
DPRINT1
(
"WinsockStart()\n"
);
84
85
ZeroMemory
(&ContextAttributes,
sizeof
(ContextAttributes));
86
ContextAttributes.
dwVersion
= 1;
87
ContextAttributes.
pwszContext
=
L
"winsock"
;
88
ContextAttributes.
guidHelper
= GUID_IFMON_WINSOCK;
89
90
ContextAttributes.
ulNumTopCmds
= 1;
91
ContextAttributes.
pTopCmds
=
g_TestCmdTable
;
92
93
ContextAttributes.
ulNumGroups
= 1;
94
ContextAttributes.
pCmdGroups
=
g_WinsockGroupCmds
;
95
96
RegisterContext
(&ContextAttributes);
97
98
return
ERROR_SUCCESS
;
99
}
100
101
102
DWORD
103
WINAPI
104
RegisterWinsockHelper
(
VOID
)
105
{
106
NS_HELPER_ATTRIBUTES
HelperAttributes;
107
108
ZeroMemory
(&HelperAttributes,
sizeof
(HelperAttributes));
109
HelperAttributes.
dwVersion
= 1;
110
HelperAttributes.
guidHelper
= GUID_IFMON_WINSOCK;
111
HelperAttributes.
pfnStart
=
WinsockStart
;
112
HelperAttributes.
pfnStop
=
NULL
;
113
RegisterHelper
(
NULL
, &HelperAttributes);
114
115
return
ERROR_SUCCESS
;
116
}
PrintMessage
VOID PrintMessage(DWORD dwMessage)
Definition:
arp.c:95
RegisterContext
DWORD WINAPI RegisterContext(_In_ const NS_CONTEXT_ATTRIBUTES *pChildContext)
Definition:
context.c:909
DPRINT1
#define DPRINT1
Definition:
precomp.h:8
ERROR_SUCCESS
#define ERROR_SUCCESS
Definition:
deptool.c:10
NULL
#define NULL
Definition:
types.h:112
IDS_HLP_WINSOCK_SHOW_CATALOG_EX
#define IDS_HLP_WINSOCK_SHOW_CATALOG_EX
Definition:
resource.h:18
IDS_HLP_WINSOCK_RESET_EX
#define IDS_HLP_WINSOCK_RESET_EX
Definition:
resource.h:15
IDS_HLP_WINSOCK_SHOW
#define IDS_HLP_WINSOCK_SHOW
Definition:
resource.h:16
IDS_HLP_WINSOCK_SHOW_CATALOG
#define IDS_HLP_WINSOCK_SHOW_CATALOG
Definition:
resource.h:17
IDS_HLP_WINSOCK_RESET
#define IDS_HLP_WINSOCK_RESET
Definition:
resource.h:14
L
#define L(x)
Definition:
resources.c:13
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
guid.h
RegisterHelper
DWORD WINAPI RegisterHelper(_In_ const GUID *pguidParentHelper, _In_ const NS_HELPER_ATTRIBUTES *pHelperAttributes)
Definition:
helper.c:385
g_WinsockGroupCmds
static CMD_GROUP_ENTRY g_WinsockGroupCmds[]
Definition:
winsock.c:34
ShowCatalogCommand
static FN_HANDLE_CMD ShowCatalogCommand
Definition:
winsock.c:19
WinsockStart
static DWORD WINAPI WinsockStart(_In_ const GUID *pguidParent, _In_ DWORD dwVersion)
Definition:
winsock.c:77
RegisterWinsockHelper
DWORD WINAPI RegisterWinsockHelper(VOID)
Definition:
winsock.c:104
g_TestCmdTable
static CMD_ENTRY g_TestCmdTable[]
Definition:
winsock.c:22
g_WinsockShowCmdTable
static CMD_ENTRY g_WinsockShowCmdTable[]
Definition:
winsock.c:28
ResetCommand
static FN_HANDLE_CMD ResetCommand
Definition:
winsock.c:18
GUID
Definition:
shobjidl.idl:3021
void
Definition:
nsiface.idl:2307
ZeroMemory
#define ZeroMemory
Definition:
minwinbase.h:31
LPCVOID
CONST void * LPCVOID
Definition:
minwindef.h:164
argv
#define argv
Definition:
mplay32.c:18
dwFlags
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition:
netsh.h:141
pvData
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition:
netsh.h:116
dwVersion
_In_ DWORD dwVersion
Definition:
netsh.h:85
dwArgCount
_In_ LPWSTR _In_ DWORD dwArgCount
Definition:
netsh.h:115
pbDone
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD _In_ LPCVOID _Out_ BOOL * pbDone
Definition:
netsh.h:143
dwCurrentIndex
_In_ LPWSTR _In_ DWORD dwCurrentIndex
Definition:
netsh.h:139
_In_
#define _In_
Definition:
no_sal2.h:158
_CMD_ENTRY
Definition:
netsh.h:148
_CMD_GROUP_ENTRY
Definition:
netsh.h:158
_NS_CONTEXT_ATTRIBUTES
Definition:
netsh.h:184
_NS_CONTEXT_ATTRIBUTES::pwszContext
LPWSTR pwszContext
Definition:
netsh.h:194
_NS_CONTEXT_ATTRIBUTES::pTopCmds
CMD_ENTRY * pTopCmds
Definition:
netsh.h:199
_NS_CONTEXT_ATTRIBUTES::guidHelper
GUID guidHelper
Definition:
netsh.h:195
_NS_CONTEXT_ATTRIBUTES::dwVersion
DWORD dwVersion
Definition:
netsh.h:189
_NS_CONTEXT_ATTRIBUTES::ulNumTopCmds
ULONG ulNumTopCmds
Definition:
netsh.h:198
_NS_CONTEXT_ATTRIBUTES::pCmdGroups
CMD_GROUP_ENTRY * pCmdGroups
Definition:
netsh.h:201
_NS_CONTEXT_ATTRIBUTES::ulNumGroups
ULONG ulNumGroups
Definition:
netsh.h:200
_NS_HELPER_ATTRIBUTES
Definition:
netsh.h:168
_NS_HELPER_ATTRIBUTES::dwVersion
DWORD dwVersion
Definition:
netsh.h:173
_NS_HELPER_ATTRIBUTES::pfnStop
PNS_HELPER_STOP_FN pfnStop
Definition:
netsh.h:180
_NS_HELPER_ATTRIBUTES::guidHelper
GUID guidHelper
Definition:
netsh.h:178
_NS_HELPER_ATTRIBUTES::pfnStart
PNS_HELPER_START_FN pfnStart
Definition:
netsh.h:179
precomp.h
resource.h
WINAPI
#define WINAPI
Definition:
msvc.h:6
LPCWSTR
const WCHAR * LPCWSTR
Definition:
xmlstorage.h:185
LPWSTR
WCHAR * LPWSTR
Definition:
xmlstorage.h:184
dll
win32
ifmon
winsock.c
Generated on Thu Dec 4 2025 06:05:04 for ReactOS by
1.9.6