Re: NDISKD / NETSH wish for Santa Claus ...

if one can live with copying dbgeng/dbghelp/ndiskd dlls into a local
folder or run this app from windbg installation folder

compiling the following few lines into an exe will get the report nice
and fine in %temp%

it seems this fantastic extension command is yet to be documented officially

@jeffrey can the path to report be customised with some magic cookie ?
is some Environmentvariable like _NDISKD_REPORT_PATH available for
use ?

#include <dbgeng.h>
IDebugClient2* g_Client = NULL;
IDebugControl* g_Control = NULL;
IDebugSymbols* g_Symbols = NULL;
void __cdecl main(void) {
ULONG64 Handle = NULL;
if ( S_OK == DebugCreate(__uuidof(IDebugClient), (void**)&g_Client)) {
if (S_OK == g_Client->QueryInterface(__uuidof(IDebugControl),
(void**)&g_Control)) {
if (S_OK ==
g_Client->QueryInterface(__uuidof(IDebugSymbols), (void**)&g_Symbols))
{
if (S_OK == g_Symbols->SetSymbolPath(“f:\symbols”)) {
if (S_OK ==
g_Client->AttachKernel(DEBUG_ATTACH_LOCAL_KERNEL,NULL )) {
if (S_OK ==
g_Control->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE)) {
if (S_OK ==
g_Control->AddExtension(“ndiskd.dll”,0,&Handle)) {

g_Control->CallExtension(Handle,“netreport”,“-verbose”);
}
}
}
}
}
}
}
if(g_Symbols)
g_Symbols->Release();
if(g_Control)
g_Control->Release();
if(g_Client)
g_Client->Release();
return;
}
/* contents of sources file
TARGETNAME = netreport
TARGETTYPE = PROGRAM
UMTYPE = console
UMENTRY = main
USE_MSVCRT =1
TARGETLIBS = $(DBGSDK_LIB_PATH)\dbgeng.lib
SOURCES = netreport.cpp
MSC_WARNING_LEVEL = /W3 /WX
*/

On 7/3/14, Scott Noone wrote:
> Can you live with copying the debugging and LiveKD to the machine? LiveKD
> will pass arguments to the debugger and therefore execute an initial command
>
> for you:
>
> livekd.exe “-c "!ndiskd.netreport -verbose;q"”
>
>
> -scott
> OSR
> @OSRDrivers
>
>
> “Dave Cattley” wrote in message news:xxxxx@ntdev…
> My challenge is that I would like to know the runtime layering / binding
> order of LWFs.
>
> Is that something that can be interrogated from a running system?
>
> I have a common support situation where depending on the order of install
> which translates into a default append order of FilterClasses the binding
> altitude of various filters that add their own FilterClass can end up in an
>
> arbitrary order. Given other factors (like a Filter opting out for some
> reason) it would be really helpful to be able to capture the runtime state
> of an adapter’s filter subscriptions.
>
> I will never ask for you to jump into the snake-pit of fancy HTML5 rending
> again.
>
> Cheers,
> Dave Cattley
>
> Sent from Windows Mail
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
></dbgeng.h>

That is the makings of a nice little utility for OSROnline :slight_smile:

Cheers,
Dave Cattley

> can the path to report be customised with some magic cookie ?

The only way to customize the output path is to mess with your process’s %TMP% environment variable. But it’s easy enough to add an override option, so I did. Look for this new option in a future version of the WDK:

1: kd> !ndiskd.netreport -outputpath d:\tmp\myreport.htm

NETWORK STACK REPORT

Report was saved to d:\tmp\myreport.htm

@jeffrey thanks that sounds great
incidentally i had chosen to mess with %tmp% after failing to scour
the output from a garbage filled %tmp%

:\>echo %tmp%
C:\DOCUME~1\Admin\LOCALS~1\Temp

:\>dir /b
dbgeng.dll
dbghelp.dll
ndiskd.dll
netreport.exe

:\>set tmp=%cd% & netreport.exe

:\>dir /b
dbgeng.dll
dbghelp.dll
ndiskd.dll
netreport.exe
NKD2C8.html

:\>

:\>type NKD2C8.html | grep loopback

:\>type NKD2C8.html | grep -i loopback
name : “Microsoft Loopback Adapter”,
name : “Microsoft Loopback Adapter - Virtual Machine Netw
ork Services Driver”,
86dc4658 - Microsoft Loopback Adapter
86e04130 - Microsoft Loopback Adapter - Virtual Machine Network Services Dri
ver
DOES_LOOPBACK, MEDIA_CONNECTED
NOT_SUPPORTS_MEDIA_SENSE, DOES_NOT_DO_LOOPBACK,
NOT_SUPPORTS_MEDIA_SENSE, DOES_NOT_DO_LOOPBACK,

Obtained from running !ndiskd.miniport -basic -diag -state -pm -terse -static -dml 0 -unicode 1 86f11ad0

Microsoft Loopback Adapter

On 9/13/14, Jeffrey Tippet wrote:
>> can the path to report be customised with some magic cookie ?
>
> The only way to customize the output path is to mess with your process’s
> %TMP% environment variable. But it’s easy enough to add an override option,
> so I did. Look for this new option in a future version of the WDK:
>
>
> 1: kd> !ndiskd.netreport -outputpath d:\tmp\myreport.htm
>
> NETWORK STACK REPORT
>
> Report was saved to d:\tmp\myreport.htm
>
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>