From e611b132f9b8abe35b362e5870b74bce94a1e58e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 16 May 2020 20:51:50 -0700 Subject: initial commit --- private/ntos/nbt/nt/netbtkd/kdextlib.c | 843 ++++++++++++++++++++++++++++++++ private/ntos/nbt/nt/netbtkd/kdextlib.h | 139 ++++++ private/ntos/nbt/nt/netbtkd/makefile | 6 + private/ntos/nbt/nt/netbtkd/netbtkd.c | 369 ++++++++++++++ private/ntos/nbt/nt/netbtkd/netbtkd.def | 8 + private/ntos/nbt/nt/netbtkd/sources | 53 ++ 6 files changed, 1418 insertions(+) create mode 100644 private/ntos/nbt/nt/netbtkd/kdextlib.c create mode 100644 private/ntos/nbt/nt/netbtkd/kdextlib.h create mode 100644 private/ntos/nbt/nt/netbtkd/makefile create mode 100644 private/ntos/nbt/nt/netbtkd/netbtkd.c create mode 100644 private/ntos/nbt/nt/netbtkd/netbtkd.def create mode 100644 private/ntos/nbt/nt/netbtkd/sources (limited to 'private/ntos/nbt/nt/netbtkd') diff --git a/private/ntos/nbt/nt/netbtkd/kdextlib.c b/private/ntos/nbt/nt/netbtkd/kdextlib.c new file mode 100644 index 000000000..132d57b5d --- /dev/null +++ b/private/ntos/nbt/nt/netbtkd/kdextlib.c @@ -0,0 +1,843 @@ +/*++ + +Copyright (c) 1990 Microsoft Corporation + +Module Name: + + kdextlib.c + +Abstract: + + Library routines for dumping data structures given a meta level descrioption + +Author: + + Balan Sethu Raman (SethuR) 11-May-1994 + +Notes: + The implementation tends to avoid memory allocation and deallocation as much as possible. + Therefore We have choosen an arbitrary length as the default buffer size. A mechanism will + be provided to modify this buffer length through the debugger extension commands. + +Revision History: + + 11-Nov-1994 SethuR Created + +--*/ + +#include +#include +#include "ntverp.h" + +#define KDEXTMODE + +#include +#include +#include +#include +#include + +#include + +PNTKD_OUTPUT_ROUTINE lpOutputRoutine; +PNTKD_GET_EXPRESSION lpGetExpressionRoutine; +PNTKD_GET_SYMBOL lpGetSymbolRoutine; +PNTKD_READ_VIRTUAL_MEMORY lpReadMemoryRoutine; + +#define PRINTF lpOutputRoutine +#define ERROR lpOutputRoutine + +#define NL 1 +#define NONL 0 + +#define SETCALLBACKS() \ + lpOutputRoutine = lpExtensionApis->lpOutputRoutine; \ + lpGetExpressionRoutine = lpExtensionApis->lpGetExpressionRoutine; \ + lpGetSymbolRoutine = lpExtensionApis->lpGetSymbolRoutine; \ + lpReadMemoryRoutine = lpExtensionApis->lpReadVirtualMemRoutine; + +#define DEFAULT_UNICODE_DATA_LENGTH 512 +USHORT s_UnicodeStringDataLength = DEFAULT_UNICODE_DATA_LENGTH; +WCHAR s_UnicodeStringData[DEFAULT_UNICODE_DATA_LENGTH]; +WCHAR *s_pUnicodeStringData = s_UnicodeStringData; + +#define DEFAULT_ANSI_DATA_LENGTH 512 +USHORT s_AnsiStringDataLength = DEFAULT_ANSI_DATA_LENGTH; +CHAR s_AnsiStringData[DEFAULT_ANSI_DATA_LENGTH]; +CHAR *s_pAnsiStringData = s_AnsiStringData; + +// +// No. of columns used to display struct fields; +// + +ULONG s_MaxNoOfColumns = 3; +ULONG s_NoOfColumns = 1; + +/* + * Fetches the data at the given address + */ +BOOLEAN +GetData( DWORD dwAddress, PVOID ptr, ULONG size) +{ + BOOL b; + ULONG BytesRead; + + b = (lpReadMemoryRoutine)((LPVOID) dwAddress, ptr, size, &BytesRead ); + + + if (!b || BytesRead != size ) { + return FALSE; + } + + return TRUE; +} + +/* + * Fetch the null terminated ASCII string at dwAddress into buf + */ +BOOL +GetString( DWORD dwAddress, PSZ buf ) +{ + do { + if( !GetData( dwAddress,buf, 1) ) + return FALSE; + + dwAddress++; + buf++; + + } while( *buf != '\0' ); + + return TRUE; +} + +/* + * Displays a byte in hexadecimal + */ +VOID +PrintHexChar( UCHAR c ) +{ + PRINTF( "%c%c", "0123456789abcdef"[ (c>>4)&7 ], "0123456789abcdef"[ c&7 ] ); +} + +/* + * Displays a buffer of data in hexadecimal + */ +VOID +PrintHexBuf( PUCHAR buf, ULONG cbuf ) +{ + while( cbuf-- ) { + PrintHexChar( *buf++ ); + PRINTF( " " ); + } +} + +/* + * Displays a unicode string + */ +BOOL +PrintStringW(LPSTR msg, PUNICODE_STRING puStr, BOOL nl ) +{ + UNICODE_STRING UnicodeString; + ANSI_STRING AnsiString; + BOOLEAN b; + + if( msg ) + PRINTF( msg ); + + if( puStr->Length == 0 ) { + if( nl ) + PRINTF( "\n" ); + return TRUE; + } + + UnicodeString.Buffer = s_pUnicodeStringData; + UnicodeString.MaximumLength = s_UnicodeStringDataLength; + UnicodeString.Length = (puStr->Length > s_UnicodeStringDataLength) + ? s_UnicodeStringDataLength + : puStr->Length; + + b = (lpReadMemoryRoutine)( + (LPVOID) puStr->Buffer, + UnicodeString.Buffer, + UnicodeString.Length, + NULL); + + if (b) { + RtlUnicodeStringToAnsiString(&AnsiString, puStr, TRUE); + PRINTF("%s%s", AnsiString.Buffer, nl ? "\n" : "" ); + RtlFreeAnsiString(&AnsiString); + } + + return b; +} + +/* + * Displays a ANSI string + */ +BOOL +PrintStringA(LPSTR msg, PANSI_STRING pStr, BOOL nl ) +{ + ANSI_STRING AnsiString; + BOOLEAN b; + + if( msg ) + PRINTF( msg ); + + if( pStr->Length == 0 ) { + if( nl ) + PRINTF( "\n" ); + return TRUE; + } + + AnsiString.Buffer = s_pAnsiStringData; + AnsiString.MaximumLength = s_AnsiStringDataLength; + AnsiString.Length = (pStr->Length > (s_AnsiStringDataLength - 1)) + ? (s_AnsiStringDataLength - 1) + : pStr->Length; + + b = (lpReadMemoryRoutine)( + (LPVOID) pStr->Buffer, + AnsiString.Buffer, + AnsiString.Length, + NULL); + + if (b) { + AnsiString.Buffer[ AnsiString.Length ] = '\0'; + PRINTF("%s%s", AnsiString.Buffer, nl ? "\n" : "" ); + } + + return b; +} + +/* + * Displays all the fields of a given struct. This is the driver routine that is called + * with the appropriate descriptor array to display all the fields in a given struct. + */ + +char *NewLine = "\n"; +char *FieldSeparator = " "; +char *DotSeparator = "."; +#define NewLineForFields(FieldNo) \ + ((((FieldNo) % s_NoOfColumns) == 0) ? NewLine : FieldSeparator) +#define FIELD_NAME_LENGTH 30 + +VOID +PrintStructFields( DWORD dwAddress, VOID *ptr, FIELD_DESCRIPTOR *pFieldDescriptors ) +{ + int i; + int j; + BYTE ch; + + // Display the fields in the struct. + for( i=0; pFieldDescriptors->Name; i++, pFieldDescriptors++ ) { + + // Indentation to begin the struct display. + PRINTF( " " ); + + if( strlen( pFieldDescriptors->Name ) > FIELD_NAME_LENGTH ) { + PRINTF( "%-17s...%s ", pFieldDescriptors->Name, pFieldDescriptors->Name+strlen(pFieldDescriptors->Name)-10 ); + } else { + PRINTF( "%-30s ", pFieldDescriptors->Name ); + } + + PRINTF( "(0x%-2X) ", pFieldDescriptors->Offset ); + + switch( pFieldDescriptors->FieldType ) { + case FieldTypeByte: + case FieldTypeChar: + PRINTF( "%-16d%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset ), + NewLineForFields(i) ); + break; + + case FieldTypeBoolean: + PRINTF( "%-16s%s", + *(BOOLEAN *)(((char *)ptr) + pFieldDescriptors->Offset ) ? "TRUE" : "FALSE", + NewLineForFields(i)); + break; + + case FieldTypeBool: + PRINTF( "%-16s%s", + *(BOOLEAN *)(((char *)ptr) + pFieldDescriptors->Offset ) ? "TRUE" : "FALSE", + NewLineForFields(i)); + break; + + case FieldTypePointer: + PRINTF( "%-16X%s", + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset ), + NewLineForFields(i) ); + break; + + case FieldTypeULongULong: + PRINTF( "%d%s", + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset ), + FieldSeparator ); + PRINTF( "%d%s", + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset + sizeof(ULONG)), + NewLineForFields(i) ); + break; + + case FieldTypeListEntry: + + if ( (ULONG)(dwAddress + pFieldDescriptors->Offset) == + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset )) + { + PRINTF( "%s", "List Empty\n" ); + } + else + { + PRINTF( "%-8X%s", + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset ), + FieldSeparator ); + PRINTF( "%-8X%s", + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset + sizeof(ULONG)), + NewLineForFields(i) ); + } + break; + + // Ip address: 4 bytes long + case FieldTypeIpAddr: + PRINTF( "%X%s", + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset ), + FieldSeparator ); + PRINTF( "(%d%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + 3), + DotSeparator ); + PRINTF( "%d%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + 2 ), + DotSeparator ); + PRINTF( "%d%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + 1 ), + DotSeparator ); + PRINTF( "%d)%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset ), + NewLineForFields(i) ); + break; + + // Mac address: 6 bytes long + case FieldTypeMacAddr: + for (j=0; j<5; j++) + { + PRINTF( "%X%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + j), + FieldSeparator ); + } + PRINTF( "%X%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + 5), + NewLineForFields(i) ); + break; + + // Netbios name: 16 bytes long + case FieldTypeNBName: + // + // if first byte is printable, print the first 15 bytes as characters + // and 16th byte as a hex value. otherwise, print all the 16 bytes + // as hex values + // + ch = *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset); + if (ch >= 0x20 && ch <= 0x7e) + { + for (j=0; j<15; j++) + { + PRINTF( "%c", *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + j)); + } + PRINTF( "<%X>%s", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + 15), + NewLineForFields(i) ); + } + else + { + for (j=0; j<16; j++) + { + PRINTF( "%.2X", + *(BYTE *)(((char *)ptr) + pFieldDescriptors->Offset + j)); + } + PRINTF( "%s", NewLineForFields(i) ); + } + break; + + case FieldTypeULong: + case FieldTypeLong: + PRINTF( "%-16d%s", + *(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset ), + NewLineForFields(i) ); + break; + + case FieldTypeShort: + PRINTF( "%-16X%s", + *(SHORT *)(((char *)ptr) + pFieldDescriptors->Offset ), + NewLineForFields(i) ); + break; + + case FieldTypeUShort: + PRINTF( "%-16X%s", + *(USHORT *)(((char *)ptr) + pFieldDescriptors->Offset ), + NewLineForFields(i) ); + break; + + case FieldTypeUnicodeString: + PrintStringW( NULL, (UNICODE_STRING *)(((char *)ptr) + pFieldDescriptors->Offset ), NONL ); + PRINTF( NewLine ); + break; + + case FieldTypeAnsiString: + PrintStringA( NULL, (ANSI_STRING *)(((char *)ptr) + pFieldDescriptors->Offset ), NONL ); + PRINTF( NewLine ); + break; + + case FieldTypeSymbol: + { + UCHAR SymbolName[ 200 ]; + ULONG Displacement; + PVOID sym = (PVOID)(*(ULONG *)(((char *)ptr) + pFieldDescriptors->Offset )); + + lpGetSymbolRoutine( sym, SymbolName, &Displacement ); + PRINTF( "%-16s%s", + SymbolName, + NewLineForFields(i) ); + } + break; + + case FieldTypeEnum: + { + ULONG EnumValue; + ENUM_VALUE_DESCRIPTOR *pEnumValueDescr; + // Get the associated numericla value. + + EnumValue = *((ULONG *)((BYTE *)ptr + pFieldDescriptors->Offset)); + + if ((pEnumValueDescr = pFieldDescriptors->AuxillaryInfo.pEnumValueDescriptor) + != NULL) { + // + // An auxilary textual description of the value is + // available. Display it instead of the numerical value. + // + + LPSTR pEnumName = NULL; + + while (pEnumValueDescr->EnumName != NULL) { + if (EnumValue == pEnumValueDescr->EnumValue) { + pEnumName = pEnumValueDescr->EnumName; + break; + } + } + + if (pEnumName != NULL) { + PRINTF( "%-16s ", pEnumName ); + } else { + PRINTF( "%-4d (%-10s) ", EnumValue,"@$#%^&*"); + } + + } else { + // + // No auxilary information is associated with the ehumerated type + // print the numerical value. + // + PRINTF( "%-16d",EnumValue); + } + } + break; + + case FieldTypeStruct: + PRINTF( "@%-15X%s", + (dwAddress + pFieldDescriptors->Offset ), + NewLineForFields(i) ); + break; + + case FieldTypeLargeInteger: + case FieldTypeFileTime: + default: + ERROR( "Unrecognized field type %c for %s\n", pFieldDescriptors->FieldType, pFieldDescriptors->Name ); + break; + } + } +} + +LPSTR LibCommands[] = { + "dump @
", + "columns -- controls the number of columns in the display ", + "logdump ", + 0 +}; + +BOOL +help( + DWORD dwCurrentPC, + PNTKD_EXTENSION_APIS lpExtensionApis, + LPSTR lpArgumentString +) +{ + int i; + + SETCALLBACKS(); + + for( i=0; Extensions[i]; i++ ) + PRINTF( " %s\n", Extensions[i] ); + + for( i=0; LibCommands[i]; i++ ) + PRINTF( " %s\n", LibCommands[i] ); + + return TRUE; +} + + +BOOL +columns( + DWORD dwCurrentPC, + PNTKD_EXTENSION_APIS lpExtensionApis, + LPSTR lpArgumentString +) +{ + ULONG NoOfColumns; + int i; + + SETCALLBACKS(); + + sscanf(lpArgumentString,"%ld",&NoOfColumns); + + if (NoOfColumns > s_MaxNoOfColumns) { + // PRINTF( "No. Of Columns exceeds maximum(%ld) -- directive Ignored\n", s_MaxNoOfColumns ); + } else { + s_NoOfColumns = NoOfColumns; + } + + PRINTF("Not Yet Implemented\n"); + + return TRUE; +} + + + +BOOL +globals( + DWORD dwCurrentPC, + PNTKD_EXTENSION_APIS lpExtensionApis, + LPSTR lpArgumentString +) +{ + DWORD dwAddress; + CHAR buf[ 100 ]; + int i; + int c=0; + + SETCALLBACKS(); + + strcpy( buf, "srv!" ); + + for( i=0; GlobalBool[i]; i++, c++ ) { + BOOL b; + + strcpy( &buf[4], GlobalBool[i] ); + dwAddress = (lpGetExpressionRoutine) ( buf ); + if( dwAddress == 0 ) { + ERROR( "Unable to get address of %s\n", GlobalBool[i] ); + continue; + } + if( !GetData( dwAddress,&b, sizeof(b)) ) + return FALSE; + + PRINTF( "%s%-30s %10s%s", + c&1 ? " " : "", + GlobalBool[i], + b ? " TRUE" : "FALSE", + c&1 ? "\n" : "" ); + } + + for( i=0; GlobalShort[i]; i++, c++ ) { + SHORT s; + + strcpy( &buf[4], GlobalShort[i] ); + dwAddress = (lpGetExpressionRoutine) ( buf ); + if( dwAddress == 0 ) { + ERROR( "Unable to get address of %s\n", GlobalShort[i] ); + continue; + } + if( !GetData( dwAddress,&s,sizeof(s)) ) + return FALSE; + + PRINTF( "%s%-30s %10d%s", + c&1 ? " " : "", + GlobalShort[i], + s, + c&1 ? "\n" : "" ); + } + + for( i=0; GlobalLong[i]; i++, c++ ) { + LONG l; + + strcpy( &buf[4], GlobalLong[i] ); + dwAddress = (lpGetExpressionRoutine) ( buf ); + if( dwAddress == 0 ) { + ERROR( "Unable to get address of %s\n", GlobalLong[i] ); + continue; + } + if( !GetData( dwAddress,&l, sizeof(l)) ) + return FALSE; + + PRINTF( "%s%-30s %10d%s", + c&1 ? " " : "", + GlobalLong[i], + l, + c&1 ? "\n" : "" ); + } + + PRINTF( "\n" ); + + return TRUE; +} + + +BOOL +version +( + DWORD dwCurrentPC, + PNTKD_EXTENSION_APIS lpExtensionApis, + LPSTR lpArgumentString +) +{ +#if VER_DEBUG + char *kind = "checked"; +#else + char *kind = "free"; +#endif + + SETCALLBACKS(); + + PRINTF( "Redirector debugger Extension dll for %s build %u\n", kind, VER_PRODUCTBUILD ); + + return TRUE; +} + +#define NAME_DELIMITER '@' +#define NAME_DELIMITERS "@" +#define INVALID_INDEX 0xffffffff +#define MIN(x,y) ((x) < (y) ? (x) : (y)) + +ULONG SearchStructs(LPSTR lpArgument) +{ + ULONG i = 0; + STRUCT_DESCRIPTOR *pStructs = Structs; + ULONG NameIndex = INVALID_INDEX; + ULONG ArgumentLength = strlen(lpArgument); + BOOLEAN fAmbigous = FALSE; + + + while ((pStructs->StructName != 0)) { + int Result = _strnicmp(lpArgument, + pStructs->StructName, + MIN(strlen(pStructs->StructName),ArgumentLength)); + + if (Result == 0) { + if (NameIndex != INVALID_INDEX) { + // We have encountered duplicate matches. Print out the + // matching strings and let the user disambiguate. + fAmbigous = TRUE; + break; + } else { + NameIndex = i; + } + + } + pStructs++;i++; + } + + if (fAmbigous) { + PRINTF("Ambigous Name Specification -- The following structs match\n"); + PRINTF("%s\n",Structs[NameIndex].StructName); + PRINTF("%s\n",Structs[i].StructName); + while (pStructs->StructName != 0) { + if (_strnicmp(lpArgument, + pStructs->StructName, + MIN(strlen(pStructs->StructName),ArgumentLength)) == 0) { + PRINTF("%s\n",pStructs->StructName); + } + pStructs++; + } + PRINTF("Dumping Information for %s\n",Structs[NameIndex].StructName); + } + + return(NameIndex); +} + +VOID DisplayStructs() +{ + STRUCT_DESCRIPTOR *pStructs = Structs; + + PRINTF("The following structs are handled .... \n"); + while (pStructs->StructName != 0) { + PRINTF("\t%s\n",pStructs->StructName); + pStructs++; + } +} + +BOOL +dump( + DWORD dwCurrentPC, + PNTKD_EXTENSION_APIS lpExtensionApis, + LPSTR lpArgumentString +) +{ + DWORD dwAddress; + + SETCALLBACKS(); + + if( lpArgumentString && *lpArgumentString ) { + // Parse the argument string to determine the structure to be displayed. + // Scan for the NAME_DELIMITER ( '@' ). + + LPSTR lpName = lpArgumentString; + LPSTR lpArgs = strpbrk(lpArgumentString, NAME_DELIMITERS); + ULONG Index; + + if (lpArgs) { + // + // The specified command is of the form + // dump @
+ // + // Locate the matching struct for the given name. In the case + // of ambiguity we seek user intervention for disambiguation. + // + // We do an inplace modification of the argument string to + // facilitate matching. + // + *lpArgs = '\0'; + + Index = SearchStructs(lpName); + + // + // Let us restore the original value back. + // + + *lpArgs = NAME_DELIMITER; + + if (INVALID_INDEX != Index) { + BYTE DataBuffer[512]; + + dwAddress = (lpGetExpressionRoutine)( ++lpArgs ); + if (GetData(dwAddress,DataBuffer,Structs[Index].StructSize)) { + + PRINTF( + "++++++++++++++++ %s@%lx ++++++++++++++++\n", + Structs[Index].StructName, + dwAddress); + PrintStructFields( + dwAddress, + &DataBuffer, + Structs[Index].FieldDescriptors); + PRINTF( + "---------------- %s@%lx ----------------\n", + Structs[Index].StructName, + dwAddress); + } else { + PRINTF("Error reading Memory @ %lx\n",dwAddress); + } + } else { + // No matching struct was found. Display the list of + // structs currently handled. + + DisplayStructs(); + } + } else { + // + // The command is of the form + // dump + // + // Currently we do not handle this. In future we will map it to + // the name of a global variable and display it if required. + // + + DisplayStructs(); + } + } else { + // + // display the list of structs currently handled. + // + + DisplayStructs(); + } + + return TRUE; +} + +#if 0 +BOOL +logdump( + DWORD dwCurrentPC, + PNTKD_EXTENSION_APIS lpExtensionApis, + LPSTR lpArgumentString +) +{ + DWORD dwAddress; + BYTE DataBuffer[512]; + + SETCALLBACKS(); + + if( lpArgumentString && *lpArgumentString ) { + RX_LOG RxLog; + + dwAddress = (lpGetExpressionRoutine)(lpArgumentString); + if (GetData(dwAddress,&RxLog,sizeof(RX_LOG))) { + // Dump the log header followed by the log entries ... + ULONG dwCurEntry; + + PRINTF("s_RxLog.State %lx\n",RxLog.State); + PRINTF("s_RxLog.pHeadEntry %lx\n",RxLog.pHeadEntry); + PRINTF("s_RxLog.pTailEntry %lx\n",RxLog.pTailEntry); + PRINTF("s_RxLog.LogBufferSize %lx\n",RxLog.LogBufferSize); + PRINTF("s_RxLog.pLogBuffer %lx\n",RxLog.pLogBuffer); + PRINTF("s_RxLog.pWrapAroundPoint %lx\n",RxLog.pWrapAroundPoint); + PRINTF("s_RxLog.NumberOfEntriesIgnored %lx\n",RxLog.NumberOfEntriesIgnored); + PRINTF("s_RxLog.NumberOfLogWriteAttempts %lx\n",RxLog.NumberOfLogWriteAttempts); + + dwCurEntry = (DWORD)RxLog.pHeadEntry; + for (;;) { + PRX_LOG_ENTRY_HEADER pHeader; + ULONG LogRecordLength; + DWORD dwNextEntry; + + if (!GetData(dwCurEntry,DataBuffer,sizeof(RX_LOG_ENTRY_HEADER))) { + PRINTF("Error reading Memory @ %lx\n",dwAddress); + break; + } + + pHeader = (PRX_LOG_ENTRY_HEADER)DataBuffer; + LogRecordLength = pHeader->EntrySize - sizeof(RX_LOG_ENTRY_HEADER); + dwNextEntry = dwCurEntry + pHeader->EntrySize; + + if ((pHeader->EntrySize > 0) && + GetData((dwCurEntry + sizeof(RX_LOG_ENTRY_HEADER)), + DataBuffer, + LogRecordLength)) { + DataBuffer[LogRecordLength] = '\0'; + PRINTF("%s",DataBuffer); + } + + + if (RxLog.pTailEntry > RxLog.pHeadEntry) { + if (dwNextEntry > (DWORD)RxLog.pTailEntry) { + break; + } + } else { + if (dwNextEntry > (DWORD)RxLog.pHeadEntry) { + if ((dwNextEntry >= (DWORD)RxLog.pWrapAroundPoint) || + (dwNextEntry >= (DWORD)((PBYTE)RxLog.pLogBuffer + RxLog.LogBufferSize))) { + dwNextEntry = (DWORD)RxLog.pLogBuffer; + } + } else if (dwNextEntry > (DWORD)RxLog.pTailEntry) { + break; + } + } + + dwCurEntry = dwNextEntry; + } + } else { + PRINTF("Error reading Memory @ %lx\n",dwAddress); + } + } else { + PRINTF("usage: logdump \n"); + } + + return TRUE; +} +#endif + diff --git a/private/ntos/nbt/nt/netbtkd/kdextlib.h b/private/ntos/nbt/nt/netbtkd/kdextlib.h new file mode 100644 index 000000000..10bb0fbf9 --- /dev/null +++ b/private/ntos/nbt/nt/netbtkd/kdextlib.h @@ -0,0 +1,139 @@ + +/*++ + +Copyright (c) 1990 Microsoft Corporation + +Module Name: + + rdr2kd.h + +Abstract: + + Redirector Kernel Debugger extension + +Author: + + Balan Sethu Raman (SethuR) 11-May-1994 + +Revision History: + + 11-Nov-1994 SethuR Created + +--*/ + +#ifndef _KDEXTLIB_H_ +#define _KDEXTLIB_H_ + +#include + +// +// The help strings printed out +// + +extern LPSTR Extensions[]; + +// +// The FIELD_DESCRIPTOR data structure is used to describe the field in a structure sufficiently +// for displaying information during debugging. The three pieces of information that are required +// are 1) the name of the field, 2) the offset in the corresponding structure and 3) a type descriptor. +// The type descriptor covers most primitive types. +// +// The task of generating these descriptors by augmenting the front end, but that will have to +// wait till we play around with these extensions and modify the data structures to meet most +// of the requirements. +// +// There are some types that can benefit from some auxillary information in the descriptors. A +// case in point is the "enum" defeinition. Merely printing out a numerical value for an enum +// type will invariably force the person using these extensions to refer to the corresponding +// include file. In order to avoid this we will accept an additional array for enum types that +// contains a textual description of the numerical value. +// +// There are certain conventions that have been adopted to ease the definition of the macros +// as well as facilitate the automation of the generation of these descriptors. +// These are as follows .... +// +// 1) All ENUM_VALUE_DESCRIPTOR definitions are named EnumValueDescrsOf_ENUMTYPENAME, where +// ENUMTYPENAME defines the corresponding enumerated type. +// + +typedef struct _ENUM_VALUE_DESCRIPTOR { + ULONG EnumValue; + LPSTR EnumName; +} ENUM_VALUE_DESCRIPTOR; + +typedef enum _FIELD_TYPE_CLASS { + FieldTypeByte, + FieldTypeChar, + FieldTypeBoolean, + FieldTypeBool, + FieldTypeULong, + FieldTypeLong, + FieldTypeUShort, + FieldTypeShort, + FieldTypePointer, + FieldTypeULongULong, + FieldTypeListEntry, + FieldTypeIpAddr, + FieldTypeMacAddr, + FieldTypeNBName, + FieldTypeUnicodeString, + FieldTypeAnsiString, + FieldTypeSymbol, + FieldTypeEnum, + FieldTypeByteBitMask, + FieldTypeWordBitMask, + FieldTypeDWordBitMask, + FieldTypeFloat, + FieldTypeDouble, + FieldTypeStruct, + FieldTypeLargeInteger, + FieldTypeFileTime +} FIELD_TYPE_CLASS, *PFIELD_TYPE_CLASS; + +typedef struct _FIELD_DESCRIPTOR_ { + FIELD_TYPE_CLASS FieldType; // The type of variable to be printed + LPSTR Name; // The name of the field + USHORT Offset; // The offset of the field in the structure + union { + ENUM_VALUE_DESCRIPTOR *pEnumValueDescriptor; // Auxillary information for enumerated types. + } AuxillaryInfo; +} FIELD_DESCRIPTOR; + +#define FIELD3(FieldType,StructureName, FieldName) \ + {FieldType, #FieldName , FIELD_OFFSET(StructureName,FieldName) ,NULL} + +#define FIELD4(FieldType, StructureName, FieldName, AuxInfo) \ + {FieldType, #FieldName , FIELD_OFFSET(StructureName,FieldName) ,AuxInfo} + +// +// The structs that are displayed by the debugger extensions are further +// described in another array. Each entry in the array contains the name of +// the structure and the associated Field descriptor list. +// + +typedef struct _STRUCT_DESCRITOR_ { + LPSTR StructName; + ULONG StructSize; + FIELD_DESCRIPTOR *FieldDescriptors; +} STRUCT_DESCRIPTOR; + +#define STRUCT(StructTypeName,FieldDescriptors) \ + { #StructTypeName,sizeof(StructTypeName),FieldDescriptors} + +// +// The array of structs handled by the debugger extension. +// + +extern STRUCT_DESCRIPTOR Structs[]; + +// +// Support for displaying global variables +// + +extern LPSTR GlobalBool[]; +extern LPSTR GlobalShort[]; +extern LPSTR GlobalLong[]; +extern LPSTR GlobalPtrs[]; + +#endif // _KDEXTLIB_H_ + diff --git a/private/ntos/nbt/nt/netbtkd/makefile b/private/ntos/nbt/nt/netbtkd/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/ntos/nbt/nt/netbtkd/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/ntos/nbt/nt/netbtkd/netbtkd.c b/private/ntos/nbt/nt/netbtkd/netbtkd.c new file mode 100644 index 000000000..6e1c60b41 --- /dev/null +++ b/private/ntos/nbt/nt/netbtkd/netbtkd.c @@ -0,0 +1,369 @@ +/*++ + +Copyright (c) 1990 Microsoft Corporation + +Module Name: + + netbtkd.c + +Abstract: + + Netbt Kernel Debugger extension + +Author: + + Shirish Koti + +Revision History: + + 6-Jun-1991 Koti Created + +--*/ + +#include "types.h" + +#include + +/* + * RDR2 global variables. + * + */ + +LPSTR GlobalBool[] = {0}; +LPSTR GlobalShort[] = {0}; +LPSTR GlobalLong[] = {0}; +LPSTR GlobalPtrs[] = {0}; + +LPSTR Extensions[] = { + "Netbt debugger extensions", + 0 +}; + +/* + * DeviceContext debugging. + * + */ + +FIELD_DESCRIPTOR DeviceContext[] = + { + FIELD3(FieldTypeStruct,tDEVICECONTEXT,DeviceObject), + FIELD3(FieldTypeListEntry,tDEVICECONTEXT,Linkage), + FIELD3(FieldTypePointer,tDEVICECONTEXT,SpinLock), + FIELD3(FieldTypePointer,tDEVICECONTEXT,Verify), + FIELD3(FieldTypeListEntry,tDEVICECONTEXT,UpConnectionInUse), + FIELD3(FieldTypeListEntry,tDEVICECONTEXT,LowerConnection), + FIELD3(FieldTypeListEntry,tDEVICECONTEXT,LowerConnFreeHead), + FIELD3(FieldTypeUnicodeString,tDEVICECONTEXT,BindName), + FIELD3(FieldTypeUnicodeString,tDEVICECONTEXT,ExportName), + FIELD3(FieldTypeIpAddr,tDEVICECONTEXT,IpAddress), + FIELD3(FieldTypeIpAddr,tDEVICECONTEXT,SubnetMask), + FIELD3(FieldTypeIpAddr,tDEVICECONTEXT,BroadcastAddress), + FIELD3(FieldTypeIpAddr,tDEVICECONTEXT,NetMask), + FIELD3(FieldTypePointer,tDEVICECONTEXT,hNameServer), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pNameServerDeviceObject), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pNameServerFileObject), + FIELD3(FieldTypePointer,tDEVICECONTEXT,hDgram), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pDgramDeviceObject), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pDgramFileObject), + FIELD3(FieldTypePointer,tDEVICECONTEXT,hSession), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pSessionDeviceObject), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pSessionFileObject), + FIELD3(FieldTypePointer,tDEVICECONTEXT,hControl), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pControlDeviceObject), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pControlFileObject), + FIELD3(FieldTypeIpAddr,tDEVICECONTEXT,lNameServerAddress), + FIELD3(FieldTypeIpAddr,tDEVICECONTEXT,lBackupServer), + FIELD3(FieldTypePointer,tDEVICECONTEXT,pPermClient), + FIELD3(FieldTypeULongULong,tDEVICECONTEXT,AdapterNumber), + FIELD3(FieldTypeMacAddr,tDEVICECONTEXT,MacAddress), + FIELD3(FieldTypeChar,tDEVICECONTEXT,LockNumber), + FIELD3(FieldTypeBoolean,tDEVICECONTEXT,RefreshToBackup), + FIELD3(FieldTypeBoolean,tDEVICECONTEXT,PointToPoint), + FIELD3(FieldTypeBoolean,tDEVICECONTEXT,WinsIsDown), + 0 + }; + +FIELD_DESCRIPTOR NameAddr[] = + { + FIELD3(FieldTypeListEntry,tNAMEADDR,Linkage), + FIELD3(FieldTypePointer,tNAMEADDR,pAddressEle), + FIELD3(FieldTypeIpAddr,tNAMEADDR,IpAddress), + FIELD3(FieldTypePointer,tNAMEADDR,pIpAddrsList), + FIELD3(FieldTypePointer,tNAMEADDR,pTracker), + FIELD3(FieldTypePointer,tNAMEADDR,pTimer), + FIELD3(FieldTypePointer,tNAMEADDR,Ttl), + FIELD3(FieldTypeULong,tNAMEADDR,RefCount), + FIELD3(FieldTypePointer,tNAMEADDR,NameTypeState), + FIELD3(FieldTypePointer,tNAMEADDR,Verify), + FIELD3(FieldTypeULongULong,tNAMEADDR,AdapterMask), + FIELD3(FieldTypeULongULong,tNAMEADDR,RefreshMask), + FIELD3(FieldTypeUShort,tNAMEADDR,TimeOutCount), + FIELD3(FieldTypeBoolean,tNAMEADDR,fProxyReq), +#ifdef PROXY_NODE + FIELD3(FieldTypeBoolean,tNAMEADDR,fPnode), +#endif + FIELD3(FieldTypeNBName,tNAMEADDR,Name), + 0 + }; + +FIELD_DESCRIPTOR AddressEle[] = + { + FIELD3(FieldTypeListEntry,tADDRESSELE,Linkage), + FIELD3(FieldTypePointer,tADDRESSELE,Verify), + FIELD3(FieldTypePointer,tADDRESSELE,SpinLock), + FIELD3(FieldTypeListEntry,tADDRESSELE,ClientHead), + FIELD3(FieldTypePointer,tADDRESSELE,pNameAddr), + FIELD3(FieldTypeULong,tADDRESSELE,RefCount), + FIELD3(FieldTypePointer,tADDRESSELE,pDeviceContext), + FIELD3(FieldTypePointer,tADDRESSELE,SecurityDescriptor), + FIELD3(FieldTypeUShort,tADDRESSELE,NameType), + FIELD3(FieldTypeChar,tADDRESSELE,LockNumber), + FIELD3(FieldTypeBoolean,tADDRESSELE,MultiClients), + 0 + }; + +FIELD_DESCRIPTOR ClientEle[] = + { + FIELD3(FieldTypeListEntry,tCLIENTELE,Linkage), + FIELD3(FieldTypePointer,tCLIENTELE,Verify), + FIELD3(FieldTypePointer,tCLIENTELE,pIrp), + FIELD3(FieldTypePointer,tCLIENTELE,SpinLock), + FIELD3(FieldTypePointer,tCLIENTELE,pAddress), + FIELD3(FieldTypeListEntry,tCLIENTELE,ConnectHead), + FIELD3(FieldTypeListEntry,tCLIENTELE,ConnectActive), + FIELD3(FieldTypeListEntry,tCLIENTELE,RcvDgramHead), + FIELD3(FieldTypeListEntry,tCLIENTELE,ListenHead), + FIELD3(FieldTypeListEntry,tCLIENTELE,SndDgrams), + FIELD3(FieldTypePointer,tCLIENTELE,evConnect), + FIELD3(FieldTypePointer,tCLIENTELE,ConEvContext), + FIELD3(FieldTypePointer,tCLIENTELE,evReceive), + FIELD3(FieldTypePointer,tCLIENTELE,RcvEvContext), + FIELD3(FieldTypePointer,tCLIENTELE,evDisconnect), + FIELD3(FieldTypePointer,tCLIENTELE,DiscEvContext), + FIELD3(FieldTypePointer,tCLIENTELE,evError), + FIELD3(FieldTypePointer,tCLIENTELE,ErrorEvContext), + FIELD3(FieldTypePointer,tCLIENTELE,evRcvDgram), + FIELD3(FieldTypePointer,tCLIENTELE,RcvDgramEvContext), + FIELD3(FieldTypePointer,tCLIENTELE,evRcvExpedited), + FIELD3(FieldTypePointer,tCLIENTELE,RcvExpedEvContext), + FIELD3(FieldTypePointer,tCLIENTELE,evSendPossible), + FIELD3(FieldTypePointer,tCLIENTELE,SendPossEvContext), + FIELD3(FieldTypePointer,tCLIENTELE,pDeviceContext), + FIELD3(FieldTypeULong,tCLIENTELE,RefCount), + FIELD3(FieldTypeChar,tCLIENTELE,LockNumber), + FIELD3(FieldTypeBoolean,tCLIENTELE,WaitingForRegistration), + 0 + }; + + +FIELD_DESCRIPTOR ConnectEle[] = + { + FIELD3(FieldTypeListEntry,tCONNECTELE,Linkage), + FIELD3(FieldTypePointer,tCONNECTELE,Verify), + FIELD3(FieldTypePointer,tCONNECTELE,SpinLock), + FIELD3(FieldTypePointer,tCONNECTELE,pLowerConnId), + FIELD3(FieldTypePointer,tCONNECTELE,pClientEle), + FIELD3(FieldTypePointer,tCONNECTELE,ConnectContext), + FIELD3(FieldTypeNBName,tCONNECTELE,RemoteName), + FIELD3(FieldTypePointer,tCONNECTELE,pNewMdl), + FIELD3(FieldTypeULong,tCONNECTELE,CurrentRcvLen), + FIELD3(FieldTypeULong,tCONNECTELE,FreeBytesInMdl), + FIELD3(FieldTypeULong,tCONNECTELE,TotalPcktLen), + FIELD3(FieldTypeULong,tCONNECTELE,BytesInXport), + FIELD3(FieldTypeULong,tCONNECTELE,BytesRcvd), + FIELD3(FieldTypeULong,tCONNECTELE,ReceiveIndicated), + FIELD3(FieldTypePointer,tCONNECTELE,pNextMdl), + FIELD3(FieldTypeULong,tCONNECTELE,OffsetFromStart), + FIELD3(FieldTypePointer,tCONNECTELE,pIrp), + FIELD3(FieldTypePointer,tCONNECTELE,pIrpClose), + FIELD3(FieldTypePointer,tCONNECTELE,pIrpDisc), + FIELD3(FieldTypePointer,tCONNECTELE,pIrpRcv), + FIELD3(FieldTypeULong,tCONNECTELE,RefCount), + FIELD3(FieldTypeULong,tCONNECTELE,state), + FIELD3(FieldTypeBoolean,tCONNECTELE,Orig), + FIELD3(FieldTypeChar,tCONNECTELE,LockNumber), + FIELD3(FieldTypeChar,tCONNECTELE,SessionSetupCount), + FIELD3(FieldTypeChar,tCONNECTELE,DiscFlag), + FIELD3(FieldTypeBoolean,tCONNECTELE,JunkMsgFlag), + 0 + }; + +FIELD_DESCRIPTOR LowerConn[] = + { + FIELD3(FieldTypeListEntry,tLOWERCONNECTION,Linkage), + FIELD3(FieldTypePointer,tLOWERCONNECTION,Verify), + FIELD3(FieldTypePointer,tLOWERCONNECTION,SpinLock), + FIELD3(FieldTypePointer,tLOWERCONNECTION,pUpperConnection), + FIELD3(FieldTypePointer,tLOWERCONNECTION,FileHandle), + FIELD3(FieldTypePointer,tLOWERCONNECTION,pFileObject), + FIELD3(FieldTypePointer,tLOWERCONNECTION,AddrFileHandle), + FIELD3(FieldTypePointer,tLOWERCONNECTION,pAddrFileObject), + FIELD3(FieldTypePointer,tLOWERCONNECTION,pDeviceContext), + FIELD3(FieldTypePointer,tLOWERCONNECTION,pIndicateMdl), + FIELD3(FieldTypeULongULong,tLOWERCONNECTION,BytesRcvd), + FIELD3(FieldTypeULongULong,tLOWERCONNECTION,BytesSent), + FIELD3(FieldTypePointer,tLOWERCONNECTION,pMdl), + FIELD3(FieldTypeUShort,tLOWERCONNECTION,BytesInIndicate), + FIELD3(FieldTypeUShort,tLOWERCONNECTION,StateRcv), + FIELD3(FieldTypeIpAddr,tLOWERCONNECTION,SrcIpAddr), + FIELD3(FieldTypeULong,tLOWERCONNECTION,State), + FIELD3(FieldTypeULong,tLOWERCONNECTION,RefCount), + FIELD3(FieldTypePointer,tLOWERCONNECTION,pIrp), + FIELD3(FieldTypePointer,tLOWERCONNECTION,CurrentStateProc), + FIELD3(FieldTypeBoolean,tLOWERCONNECTION,bReceivingToIndicateBuffer), + FIELD3(FieldTypeChar,tLOWERCONNECTION,LockNumber), + FIELD3(FieldTypeBoolean,tLOWERCONNECTION,bOriginator), + FIELD3(FieldTypeBoolean,tLOWERCONNECTION,InRcvHandler), + FIELD3(FieldTypeBoolean,tLOWERCONNECTION,DestroyConnection), + 0 + }; + + +FIELD_DESCRIPTOR Tracker[] = + { + FIELD3(FieldTypeListEntry,tDGRAM_SEND_TRACKING,Linkage), + FIELD3(FieldTypeListEntry,tDGRAM_SEND_TRACKING,TrackerList), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,Verify), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,pClientIrp), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,pConnEle), + FIELD3(FieldTypeStruct,tDGRAM_SEND_TRACKING,SendBuffer), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,pSendInfo), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,pDeviceContext), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,pTimer), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,RefCount), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,pNameAddr), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,pTimeout), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,AllocatedLength), + FIELD3(FieldTypePointer,tDGRAM_SEND_TRACKING,CompletionRoutine), + FIELD3(FieldTypeUShort,tDGRAM_SEND_TRACKING,Flags), + FIELD3(FieldTypeListEntry,tDGRAM_SEND_TRACKING,DebugLinkage), + 0 + }; + +FIELD_DESCRIPTOR Nbt_Config[] = + { + FIELD3(FieldTypePointer,tNBTCONFIG,SpinLock), + FIELD3(FieldTypeULong,tNBTCONFIG,NumConnections), + FIELD3(FieldTypeULong,tNBTCONFIG,NumAddresses), + FIELD3(FieldTypeListEntry,tNBTCONFIG,DeviceContexts), + FIELD3(FieldTypeListEntry,tNBTCONFIG,DgramTrackerFreeQ), + FIELD3(FieldTypeListEntry,tNBTCONFIG,NodeStatusHead), + FIELD3(FieldTypeListEntry,tNBTCONFIG,AddressHead), + FIELD3(FieldTypeListEntry,tNBTCONFIG,PendingNameQueries), + FIELD3(FieldTypePointer,tNBTCONFIG,pControlObj), + FIELD3(FieldTypePointer,tNBTCONFIG,DriverObject), + FIELD3(FieldTypeListEntry,tNBTCONFIG,IrpFreeList), + FIELD3(FieldTypePointer,tNBTCONFIG,SessionMdlFreeSingleList), + FIELD3(FieldTypePointer,tNBTCONFIG,DgramMdlFreeSingleList), + FIELD3(FieldTypePointer,tNBTCONFIG,pTcpBindName), + FIELD3(FieldTypePointer,tNBTCONFIG,pLocalHashTbl), + FIELD3(FieldTypePointer,tNBTCONFIG,pRemoteHashTbl), + FIELD3(FieldTypeStruct,tNBTCONFIG,OutOfRsrc), + FIELD3(FieldTypeUShort,tNBTCONFIG,uNumDevices), + FIELD3(FieldTypeUShort,tNBTCONFIG,uNumLocalNames), + FIELD3(FieldTypeUShort,tNBTCONFIG,uNumRemoteNames), + FIELD3(FieldTypeUShort,tNBTCONFIG,uNumBucketsRemote), + FIELD3(FieldTypeUShort,tNBTCONFIG,uNumBucketsLocal), + FIELD3(FieldTypeUShort,tNBTCONFIG,TimerQSize), + FIELD3(FieldTypeULong,tNBTCONFIG,uBcastTimeout), + FIELD3(FieldTypeULong,tNBTCONFIG,uRetryTimeout), + FIELD3(FieldTypeUShort,tNBTCONFIG,uNumRetries), + FIELD3(FieldTypeUShort,tNBTCONFIG,uNumBcasts), + FIELD3(FieldTypeUShort,tNBTCONFIG,ScopeLength), + FIELD3(FieldTypeUShort,tNBTCONFIG,SizeTransportAddress), + FIELD3(FieldTypePointer,tNBTCONFIG,pScope), + FIELD3(FieldTypePointer,tNBTCONFIG,pBcastNetbiosName), + FIELD3(FieldTypeULong,tNBTCONFIG,MinimumTtl), + FIELD3(FieldTypeULong,tNBTCONFIG,RefreshDivisor), + FIELD3(FieldTypeULong,tNBTCONFIG,RemoteHashTimeout), + FIELD3(FieldTypeULong,tNBTCONFIG,WinsDownTimeout), + FIELD3(FieldTypePointer,tNBTCONFIG,pRefreshTimer), + FIELD3(FieldTypePointer,tNBTCONFIG,pSessionKeepAliveTimer), + FIELD3(FieldTypePointer,tNBTCONFIG,pRemoteHashTimer), + FIELD3(FieldTypeULong,tNBTCONFIG,InitialRefreshTimeout), + FIELD3(FieldTypeULong,tNBTCONFIG,KeepAliveTimeout), + FIELD3(FieldTypeULong,tNBTCONFIG,RegistryBcastAddr), + FIELD3(FieldTypeUShort,tNBTCONFIG,DhcpNumConnections), + FIELD3(FieldTypeUShort,tNBTCONFIG,CurrentHashBucket), + FIELD3(FieldTypeUShort,tNBTCONFIG,PduNodeType), + FIELD3(FieldTypeUShort,tNBTCONFIG,TransactionId), + FIELD3(FieldTypeUShort,tNBTCONFIG,NameServerPort), + FIELD3(FieldTypeUShort,tNBTCONFIG,sTimeoutCount), + FIELD3(FieldTypeStruct,tNBTCONFIG,JointLock), + FIELD3(FieldTypeChar,tNBTCONFIG,LockNumber), + FIELD3(FieldTypeUShort,tNBTCONFIG,RemoteTimeoutCount), + FIELD3(FieldTypeBoolean,tNBTCONFIG,UseRegistryBcastAddr), + FIELD3(FieldTypeULong,tNBTCONFIG,MaxDgramBuffering), + FIELD3(FieldTypeULong,tNBTCONFIG,LmHostsTimeout), + FIELD3(FieldTypePointer,tNBTCONFIG,pLmHosts), + FIELD3(FieldTypeULong,tNBTCONFIG,PathLength), + FIELD3(FieldTypeChar,tNBTCONFIG,AdapterCount), + FIELD3(FieldTypeBoolean,tNBTCONFIG,MultiHomed), + FIELD3(FieldTypeBoolean,tNBTCONFIG,SingleResponse), + FIELD3(FieldTypeBoolean,tNBTCONFIG,SelectAdapter), + FIELD3(FieldTypeBoolean,tNBTCONFIG,ResolveWithDns), + FIELD3(FieldTypeBoolean,tNBTCONFIG,EnableLmHosts), + FIELD3(FieldTypeBoolean,tNBTCONFIG,EnableProxyRegCheck), + FIELD3(FieldTypeBoolean,tNBTCONFIG,DoingRefreshNow), + FIELD3(FieldTypeChar,tNBTCONFIG,CurrProc), + FIELD3(FieldTypeUShort,tNBTCONFIG,OpRefresh), + 0 + }; + + +FIELD_DESCRIPTOR NbtWorkContext[] = + { + FIELD3(FieldTypeStruct,NBT_WORK_ITEM_CONTEXT,Item), + FIELD3(FieldTypePointer,NBT_WORK_ITEM_CONTEXT,pTracker), + FIELD3(FieldTypePointer,NBT_WORK_ITEM_CONTEXT,pClientContext), + FIELD3(FieldTypePointer,NBT_WORK_ITEM_CONTEXT,ClientCompletion), + FIELD3(FieldTypeBoolean,NBT_WORK_ITEM_CONTEXT,TimedOut), + 0 + }; + + +FIELD_DESCRIPTOR Timer_Entry[] = + { + FIELD3(FieldTypeStruct,tTIMERQENTRY,VxdTimer), + FIELD3(FieldTypeListEntry,tTIMERQENTRY,Linkage), + FIELD3(FieldTypePointer,tTIMERQENTRY,Context), + FIELD3(FieldTypePointer,tTIMERQENTRY,Context2), + FIELD3(FieldTypePointer,tTIMERQENTRY,CompletionRoutine), + FIELD3(FieldTypePointer,tTIMERQENTRY,ClientContext), + FIELD3(FieldTypePointer,tTIMERQENTRY,ClientCompletion), + FIELD3(FieldTypePointer,tTIMERQENTRY,pCacheEntry), + FIELD3(FieldTypeULong,tTIMERQENTRY,DeltaTime), + FIELD3(FieldTypeUShort,tTIMERQENTRY,Flags), + FIELD3(FieldTypeUShort,tTIMERQENTRY,Retries), + FIELD3(FieldTypeChar,tTIMERQENTRY,RefCount), + 0 + }; + +FIELD_DESCRIPTOR Dns_Queries[] = + { + FIELD3(FieldTypePointer,tDNS_QUERIES,QueryIrp), + FIELD3(FieldTypeListEntry,tDNS_QUERIES,ToResolve), + FIELD3(FieldTypePointer,tDNS_QUERIES,Context), + FIELD3(FieldTypeBoolean,tDNS_QUERIES,ResolvingNow), + 0 + }; + +// +// List of structs currently handled by the debugger extensions +// + +STRUCT_DESCRIPTOR Structs[] = + { + STRUCT(tDEVICECONTEXT,DeviceContext), + STRUCT(tNAMEADDR,NameAddr), + STRUCT(tADDRESSELE,AddressEle), + STRUCT(tCLIENTELE,ClientEle), + STRUCT(tCONNECTELE,ConnectEle), + STRUCT(tLOWERCONNECTION,LowerConn), + STRUCT(tDGRAM_SEND_TRACKING,Tracker), + STRUCT(tNBTCONFIG,Nbt_Config), + STRUCT(NBT_WORK_ITEM_CONTEXT,NbtWorkContext), + STRUCT(tTIMERQENTRY,Timer_Entry), + STRUCT(tDNS_QUERIES,Dns_Queries), + 0 + }; diff --git a/private/ntos/nbt/nt/netbtkd/netbtkd.def b/private/ntos/nbt/nt/netbtkd/netbtkd.def new file mode 100644 index 000000000..3e91e095e --- /dev/null +++ b/private/ntos/nbt/nt/netbtkd/netbtkd.def @@ -0,0 +1,8 @@ +LIBRARY NETBTKD +DESCRIPTION 'Netbt KD extensions' + +EXPORTS + help + dump + columns + diff --git a/private/ntos/nbt/nt/netbtkd/sources b/private/ntos/nbt/nt/netbtkd/sources new file mode 100644 index 000000000..f8bca6009 --- /dev/null +++ b/private/ntos/nbt/nt/netbtkd/sources @@ -0,0 +1,53 @@ +!IF 0 + +Copyright (c) 1989 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + + +Author: + + Steve Wood (stevewo) 12-Apr-1990 + +NOTE: Commented description of this file is in \nt\bak\bin\sources.tpl + +!ENDIF + +MAJORCOMP=ntos +MINORCOMP=netbt + +TARGETNAME=netbtkd +TARGETPATH=obj +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\libc.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib\ + $(BASEDIR)\public\sdk\lib\*\kernel32.lib + +C_DEFINES=-DPROXY_NODE +INCLUDES=..;..\inc;..\..\inc;..\..\..\inc;..\..\..\..\inc + +!IFNDEF DISABLE_NET_UNICODE +UNICODE=1 +NET_C_DEFINES=-DUNICODE +!ENDIF + +DLLBASE=0x1010000 + +C_DEFINES=$(C_DEFINES) -DRDBSSDBG + +SOURCES=kdextlib.c \ + netbtkd.c + +UMTYPE=console +OPTIONAL_NTTEST= + + -- cgit v1.2.3