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
18static FN_HANDLE_CMD ResetCommand;
19static FN_HANDLE_CMD ShowCatalogCommand;
20
21static
23{
25};
26
27static
29{
31};
32
33static
35{
37};
38
39
40static
44 LPCWSTR pwszMachine,
45 LPWSTR *argv,
50 BOOL *pbDone)
51{
52 PrintMessage(L"ResetCommand(): Not implemented yet!\n");
53 return ERROR_SUCCESS;
54}
55
56
57static
61 LPCWSTR pwszMachine,
62 LPWSTR *argv,
67 BOOL *pbDone)
68{
69 PrintMessage(L"ShowCatalogCommand(): Not implemented yet!\n");
70 return ERROR_SUCCESS;
71}
72
73
74static
78 _In_ const GUID *pguidParent,
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
102DWORD
103WINAPI
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}
VOID PrintMessage(DWORD dwMessage)
Definition: arp.c:95
DWORD WINAPI RegisterContext(_In_ const NS_CONTEXT_ATTRIBUTES *pChildContext)
Definition: context.c:909
#define DPRINT1
Definition: precomp.h:8
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define IDS_HLP_WINSOCK_SHOW_CATALOG_EX
Definition: resource.h:18
#define IDS_HLP_WINSOCK_RESET_EX
Definition: resource.h:15
#define IDS_HLP_WINSOCK_SHOW
Definition: resource.h:16
#define IDS_HLP_WINSOCK_SHOW_CATALOG
Definition: resource.h:17
#define IDS_HLP_WINSOCK_RESET
Definition: resource.h:14
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI RegisterHelper(_In_ const GUID *pguidParentHelper, _In_ const NS_HELPER_ATTRIBUTES *pHelperAttributes)
Definition: helper.c:385
static CMD_GROUP_ENTRY g_WinsockGroupCmds[]
Definition: winsock.c:34
static FN_HANDLE_CMD ShowCatalogCommand
Definition: winsock.c:19
static DWORD WINAPI WinsockStart(_In_ const GUID *pguidParent, _In_ DWORD dwVersion)
Definition: winsock.c:77
DWORD WINAPI RegisterWinsockHelper(VOID)
Definition: winsock.c:104
static CMD_ENTRY g_TestCmdTable[]
Definition: winsock.c:22
static CMD_ENTRY g_WinsockShowCmdTable[]
Definition: winsock.c:28
static FN_HANDLE_CMD ResetCommand
Definition: winsock.c:18
#define ZeroMemory
Definition: minwinbase.h:31
CONST void * LPCVOID
Definition: minwindef.h:164
#define argv
Definition: mplay32.c:18
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
_In_ DWORD dwVersion
Definition: netsh.h:85
_In_ LPWSTR _In_ DWORD dwArgCount
Definition: netsh.h:115
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD _In_ LPCVOID _Out_ BOOL * pbDone
Definition: netsh.h:143
_In_ LPWSTR _In_ DWORD dwCurrentIndex
Definition: netsh.h:139
#define _In_
Definition: no_sal2.h:158
Definition: netsh.h:148
Definition: netsh.h:158
CMD_ENTRY * pTopCmds
Definition: netsh.h:199
CMD_GROUP_ENTRY * pCmdGroups
Definition: netsh.h:201
PNS_HELPER_STOP_FN pfnStop
Definition: netsh.h:180
PNS_HELPER_START_FN pfnStart
Definition: netsh.h:179
#define WINAPI
Definition: msvc.h:6
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WCHAR * LPWSTR
Definition: xmlstorage.h:184