Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125/* * PROJECT: ReactOS IF Monitor DLL * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) * PURPOSE: NetSh Helper interface context functions * COPYRIGHT: Copyright 2025 Eric Kohl <eric.kohl@reactos.org> */
#include "precomp.h"
#include <guiddef.h>
#define NDEBUG#include <debug.h>
#include "guid.h"#include "resource.h"
static FN_HANDLE_CMD InterfaceShowInterface;
staticCMD_ENTRYInterfaceShowCommands[] = { {L"interface", InterfaceShowInterface, IDS_HLP_INTERFACE_SHOW_INTERFACE, IDS_HLP_INTERFACE_SHOW_INTERFACE_EX, 0}};
staticCMD_GROUP_ENTRYInterfaceGroups[] = { {L"show", IDS_HLP_INTERFACE_SHOW, sizeof(InterfaceShowCommands) / sizeof(CMD_ENTRY), 0, InterfaceShowCommands, NULL},};
staticDWORDWINAPIInterfaceShowInterface( LPCWSTR pwszMachine, LPWSTR *argv, DWORD dwCurrentIndex, DWORD dwArgCount, DWORD dwFlags, LPCVOID pvData, BOOL *pbDone){ PrintMessage(L"InterfaceShowInterface(): Not implemented yet!\n");
return ERROR_SUCCESS;}
staticDWORDWINAPIInterfaceDumpFn( _In_ LPCWSTR pwszRouter, _In_ LPWSTR *ppwcArguments, _In_ DWORD dwArgCount, _In_ LPCVOID pvData){ DPRINT("InterfaceDumpFn(%S %p %lu %p)\n", pwszRouter, ppwcArguments, dwArgCount, pvData);
PrintMessageFromModule(hDllInstance, IDS_DUMP_HEADERLINE); PrintMessage(L"# Interface Configuration\n"); PrintMessageFromModule(hDllInstance, IDS_DUMP_HEADERLINE); PrintMessage(L"pushd interface\n"); PrintMessageFromModule(hDllInstance, IDS_DUMP_NEWLINE);
PrintMessageFromModule(hDllInstance, IDS_DUMP_NEWLINE); PrintMessage(L"popd\n"); PrintMessage(L"# End of Interface Configuration\n"); PrintMessageFromModule(hDllInstance, IDS_DUMP_NEWLINE);
return ERROR_SUCCESS;}
DWORDWINAPIInterfaceStart( _In_ const GUID *pguidParent, _In_ DWORD dwVersion){ NS_CONTEXT_ATTRIBUTES ContextAttributes;
DPRINT("InterfaceStart()\n");
ZeroMemory(&ContextAttributes, sizeof(ContextAttributes)); ContextAttributes.dwVersion = 1; ContextAttributes.pwszContext = L"interface"; ContextAttributes.guidHelper = GUID_IFMON_INTERFACE;
ContextAttributes.ulNumTopCmds = 0; ContextAttributes.pTopCmds = NULL;
ContextAttributes.ulNumGroups = sizeof(InterfaceGroups) / sizeof(CMD_GROUP_ENTRY); ContextAttributes.pCmdGroups = InterfaceGroups;
ContextAttributes.pfnDumpFn = InterfaceDumpFn;
RegisterContext(&ContextAttributes);
return ERROR_SUCCESS;}
DWORDWINAPIRegisterInterfaceHelper(VOID){ NS_HELPER_ATTRIBUTES HelperAttributes;
DPRINT("RegisterInterfaceHelper()\n");
ZeroMemory(&HelperAttributes, sizeof(HelperAttributes)); HelperAttributes.dwVersion = 1; HelperAttributes.guidHelper = GUID_IFMON_INTERFACE; HelperAttributes.pfnStart = InterfaceStart; HelperAttributes.pfnStop = NULL; RegisterHelper(NULL, &HelperAttributes);
return ERROR_SUCCESS;}