|
| 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 <[email protected]> |
| 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 |
| 19 | +DWORD |
| 20 | +WINAPI |
| 21 | +InterfaceShowInterface( |
| 22 | + LPCWSTR pwszMachine, |
| 23 | + LPWSTR *argv, |
| 24 | + DWORD dwCurrentIndex, |
| 25 | + DWORD dwArgCount, |
| 26 | + DWORD dwFlags, |
| 27 | + LPCVOID pvData, |
| 28 | + BOOL *pbDone); |
| 29 | + |
| 30 | +static |
| 31 | +CMD_ENTRY |
| 32 | +InterfaceShowCommands[] = |
| 33 | +{ |
| 34 | + {L"interface", InterfaceShowInterface, IDS_HLP_INTERFACE_SHOW_INTERFACE, IDS_HLP_INTERFACE_SHOW_INTERFACE_EX, 0} |
| 35 | +}; |
| 36 | + |
| 37 | +static |
| 38 | +CMD_GROUP_ENTRY |
| 39 | +InterfaceGroups[] = |
| 40 | +{ |
| 41 | + {L"show", IDS_HLP_INTERFACE_SHOW, sizeof(InterfaceShowCommands) / sizeof(CMD_ENTRY), 0, InterfaceShowCommands, NULL}, |
| 42 | +}; |
| 43 | + |
| 44 | + |
| 45 | +static |
| 46 | +DWORD |
| 47 | +WINAPI |
| 48 | +InterfaceShowInterface( |
| 49 | + LPCWSTR pwszMachine, |
| 50 | + LPWSTR *argv, |
| 51 | + DWORD dwCurrentIndex, |
| 52 | + DWORD dwArgCount, |
| 53 | + DWORD dwFlags, |
| 54 | + LPCVOID pvData, |
| 55 | + BOOL *pbDone) |
| 56 | +{ |
| 57 | + PrintMessage(L"InterfaceShowInterface(): Not implemented yet!\n"); |
| 58 | + |
| 59 | + return ERROR_SUCCESS; |
| 60 | +} |
| 61 | + |
| 62 | + |
| 63 | +DWORD |
| 64 | +WINAPI |
| 65 | +InterfaceStart( |
| 66 | + _In_ const GUID *pguidParent, |
| 67 | + _In_ DWORD dwVersion) |
| 68 | +{ |
| 69 | + NS_CONTEXT_ATTRIBUTES ContextAttributes; |
| 70 | + |
| 71 | + DPRINT1("InterfaceStart()\n"); |
| 72 | + |
| 73 | + ZeroMemory(&ContextAttributes, sizeof(ContextAttributes)); |
| 74 | + ContextAttributes.dwVersion = 1; |
| 75 | + ContextAttributes.pwszContext = L"interface"; |
| 76 | + ContextAttributes.guidHelper = GUID_IFMON_INTERFACE; |
| 77 | + |
| 78 | + ContextAttributes.ulNumTopCmds = 0; |
| 79 | + ContextAttributes.pTopCmds = NULL; |
| 80 | + |
| 81 | + ContextAttributes.ulNumGroups = sizeof(InterfaceGroups) / sizeof(CMD_GROUP_ENTRY); |
| 82 | + ContextAttributes.pCmdGroups = InterfaceGroups; |
| 83 | + |
| 84 | + RegisterContext(&ContextAttributes); |
| 85 | + |
| 86 | + return ERROR_SUCCESS; |
| 87 | +} |
| 88 | + |
| 89 | + |
| 90 | +DWORD |
| 91 | +WINAPI |
| 92 | +RegisterInterfaceHelper(VOID) |
| 93 | +{ |
| 94 | + NS_HELPER_ATTRIBUTES HelperAttributes; |
| 95 | + |
| 96 | + DPRINT1("RegisterInterfaceHelper()\n"); |
| 97 | + |
| 98 | + ZeroMemory(&HelperAttributes, sizeof(HelperAttributes)); |
| 99 | + HelperAttributes.dwVersion = 1; |
| 100 | + HelperAttributes.guidHelper = GUID_IFMON_INTERFACE; |
| 101 | + HelperAttributes.pfnStart = InterfaceStart; |
| 102 | + HelperAttributes.pfnStop = NULL; |
| 103 | + RegisterHelper(NULL, &HelperAttributes); |
| 104 | + |
| 105 | + return ERROR_SUCCESS; |
| 106 | +} |
0 commit comments