Network Development Framework (NDF) Release Notes Printing Communications Associates, Inc. 4201 Brunswick Court Smyrna, GA 30080 USA TEL: (770) 432-4580 FAX: (770) 436-7246 tdivine@pcausa.com ====================================================================== Component Name : Advanced TDI Samples For Windows NT, 2000, XP. SKU : 040, 041, 042 ====================================================================== Component Version : 2.02.06.15 Release Date : 3/14/05 1.) Added a new Port Blocking TDI filter driver (TDIPBlkH). This driver was derived from the Build 614 TDI Loopback Data Monitor (TDILpbkH). 2.) In TDIxyzH filter drivers Renamed IOControlHandler to be IOControlHandlerForMethodNeither to emphasize that it is specifically designed to handle IOCTL calls passed using METHOD_NEITHER. 3.) In KSLib and TDIPassL changed length of ProcessName buffers from NT_PROCNAMELEN to NT_PROCNAMELEN + 1. ProcessName buffer is now 16 characters plus nul terminator in drivers. Also modified KS_GetCurrentProcessName to convert returned process name to upper case before it is returned. This is to facilitate process name comparison in kernel at raised IRQL. Under some conditions memcmp can be used but using strncmp would raise an exception. 4.) Added new TCP outbound connection redirector filter driver (TDIREDIR). This driver was derived from the Build 612 TDI Layered PassThru driver sample (TDIPASSL). ====================================================================== Component Version : 2.02.06.14 Release Date : 1/28/05 1.) New source code directory layout WAS: \PCADev\TDI\... IS : \PCADev\TDI\nnnn\... Where nnnn is the "Build Number", constructed from teh last two bytes of the Version Number. For example, the Build Number for V2.02.06.14 is 614. 2.) Converted most user-mode modules to be built under Visual Studio .NET 2003. TDIQ - TDI Query Win32 application. TTCPCtrl - TDI TTCP Control application. 3.) Fixed two bugs in TDIPassH: 3.1) In Filter.c module FLT_DispatchDeviceControl routine handler for IOCTL_TDI_ACCEPT... WAS: if (pAccReq->RequestConnectionInformation != NULL) { // save requested remote address info FLT_SetRemoteAddressForConnectionEx ( pIrpStack->FileObject, (pAccReq->ReturnConnectionInformation)->RemoteAddress, (pAccReq->ReturnConnectionInformation)->RemoteAddressLength); } SHOULD BE: if (pAccReq->RequestConnectionInformation != NULL) { // save requested remote address info FLT_SetRemoteAddressForConnectionEx ( pIrpStack->FileObject, (pAccReq->RequestConnectionInformation)->RemoteAddress, (pAccReq->RequestConnectionInformation)->RemoteAddressLength); } 3.2) In Filter.c module FLT_DispatchInternalDeviceControl routine handler for TDI_ACCEPT... WAS: if (pAccReq->RequestConnectionInformation != NULL) { // save requested remote address info FLT_SetRemoteAddressForConnectionEx ( pIrpStack->FileObject, (pAccReq->ReturnConnectionInformation)->RemoteAddress, (pAccReq->ReturnConnectionInformation)->RemoteAddressLength); } SHOULD BE: if (pAccReq->RequestConnectionInformation != NULL) { // save requested remote address info FLT_SetRemoteAddressForConnectionEx ( pIrpStack->FileObject, (pAccReq->RequestConnectionInformation)->RemoteAddress, (pAccReq->RequestConnectionInformation)->RemoteAddressLength); } These bugs also appear in TDILpbkH and TDIRPort drivers. Similar inconsistency in TDI_LISTEN... 5.) Fixed bug in TDIPassH driver in Handlers.c module, FLT_OnReceive and FLT_OnReceiveDatagram methods. Before the fix these methods assumed that the number of bytes received was simply the ReceiveLength specified in the original request. In fact, it is necessary to examine IoStatus.Information to determine the number of bytes actually received. Same bug appears in TDILpbkH driver sample. 6.) Remove hard-coded -DDBG define when setting C_DEFINES in SOURCES file for drivers TdiLpbkH and TdiRPort. 7.) Systematically renamed "FileObject" fields and parameters to be explicitly AddressObject or ConnectionObject to simplify code interpretation. 8.) Revised debug message generation in TDIxxxH driver samples: 8.1) Now use DBGPRINT MACRO instead of call to KdPrint. 8.2) Systematically revised line terminators. Now done in DBGPRINT. 8.3) Revised debug messages that use "%S" format specifier to print device name. This format specifier can only be used at IRQL < DISPATCH_LEVEL. Some systems seem to overlook this restriction. However, on others the debug print statement causes a crash when processing "%S". 9.) Added diagnostic fields to LOG_INFO structure used by the TDI logging sample applications. The user-mode sample applications have been modified slightly. Existing users who may have derived applications from the logging samples should make a quick review of these changes. 10.) Expanded spin lock protection in the TDIPassL driver sample. Added spin lock protection to FreeTCPConnList, OpenTCPConnList, FreeAddrObjList and OpenAddrObjList. 11.) Made improvements to map ConnectionContext to ConnectionObject in TCP event callbacks. 11.1) In ehandlers.c TDIClientEventConnect routine now call new function FLT_SetRemoteAddressAndContextForConnectionEx that saves ConnectionContext in CONNECTION_INFO on the connect event. 11.2) In filter.c FLT_TcpipIrpHandler for IRP_MJ_CREATE on TDI_CONNECTION_FILE now call FLT_SetConnectionContextForConnectionEx to save connection context in CONNECTION_INFO on create. 11.3) Now use LF_GetAddressInformationFromConnectionContext to lookup address information from ConnectionContext in FLT_OnEventDisconnect, FLT_OnEventReceive and FLT_OnEventChainedReceive. There are also new dump functions that print address information from the connection context. 12.) Prior TDI sample builds used system calls which were undocumented on Windows NT 4.0 but were documented for usability on Windows 2000 and higher. Replaced use of undocumented code with functions provided by Micorsoft with Windows 2000 and higher. This resulted is substantial distillation of undoc.h and pcshelp modules. 13.) Modified TDILpbkH to use queued spin locks for several key locks. Other samples continue to use older-style locks. TDILpbkH was also modified to call Dpc-level spin locks when at DISPATCH_LEVEL. 14.) Improved UDP remote address handling in TDIPassH, TDIRPort and TDILpbkH TDI filter drivers. ====================================================================== Component Name : Advanced TDI Samples For Windows NT & 2000 SKU : 040, 041, 042 ====================================================================== Component Version : 2.02.05.13 Release Date : 4/14/03 1.) New source code directory layout 1.1) WAS: \PCADev\TDISAMP\... IS : \PCADev\TDISAMP\nnnn\... Where nnnn is the "Build Number", constructed from teh last two bytes of the Version Number. For example, the Build Number for V2.02.05.13 is 513. 1.2) Reorganized applications and drivers into common folder. For example, TDIEcho application and driver are now inder one folder: Application: \PCADev\TDISAMP\513\TDIEcho\App Driver: \PCADev\TDISAMP\513\TDIEcho\Driver 2.) Removed several unnecessary ASSERT statments in filter drivers. These are harmless, but can cause confusion - especially on checked build when no debugger is running. On checked build when no debugger is running the ASSERT results in a BSOD. The unnecessary ASSERTs have the following basic form: ASSERT( XYZ ); if( XYZ ) { } 3.) Fixed gross bug in KSLib related to inadequate ReferenceCount management. One manifestation of the bug would be to start and then stop the TDIEcho server. Then send a UDP datagram the server host. TCP/IP would fault when processing the datagram even though the TDIECHO driver was no longer loaded. The fix to this problem was made in KSUtil.c. Basically, ReferenceCount logic was modified so it only tracked Open/Close operations. Calls to _I_KS_DerefTransportAddress were removed from these routines: _I_KS_AddressRequestComplete KS_SendDatagramOnAddress KS_ReceiveDatagramOnAddress Calls to _I_KS_RefTransportAddress were removed from these routines: KS_SendDatagramOnAddress KS_ReceiveDatagramOnAddress Calls to _I_KS_DerefConnectionEndpoint were removed from these routines: _I_KS_EndpointRequestComplete Calls to _I_KS_RefConnectionEndpoint were removed from these routines: KS_Disconnect _I_KS_DoSendOrReceive 4.) Fixed two gross bugs in KSLib related to synchronous operations. 4.1) Basically, synchronous calls to TDI implemented in KSKib should ALWAYS wait and the completion function will ALWAYS be called. Conditional waits of this form were incorrect. The conditional statement should be removed altogether: if( (Status == STATUS_SUCCESS) || (Status == STATUS_PENDING) ) { Status = KeWaitForSingleObject(...); ... } 4.2) For some calls which used _I_KS_AddressRequestComplete as the completion routine the IRP was touched after it had beed freed. Fixed this bug. 5.) Fixed bug that caused TDIEcho driver to generate page fault if the driver was unloaded while it still had open TCP connections pending. In TCPS_Shutdown, specify TDI_DISCONNECT_ABORT as Disconnect flags. 6.) Implemented a new TDI Echo Server Control MFC application(ECHOCtrl). This application simplifies the process of starting, stopping and installing the TDIECHO driver. In addition, ECHOCtrl includes a mechanism to poll and display TDI Echo server statistics. 7.) Removed some unreferenfed labels that caused the Windows XP DDK version of the Windows 2000 DDK build environment to fail. 8.) Fixed some bugs exposed by Windows XP DriverVerifier: 8.1) TDITTCP driver did not call IoCompleteRequest for IRP_MJ_CLEANUP (Five places...). Fixed using TdiCompleteRequest MACRO. 8.2) PassThru Plus (PtPlus) driver did not set IoStatus.Status before making second call to IoCompleteRequest in TDIH_IndicateReceivedPackets function in TcpRcv.c module. 9.) Several bug fixes and improvements in TDITTCP sample driver. 9.1) Unload handlers were not fully implemented. In particular, uload did not about active connections and close open objects. Result was that a fault would occur if driver was unloaded while active connections were in progress. 9.2) Now initialize driver dispatch table only once in TDITTCP.c. Previously the table was initialized multiple times (but with the same function pointers, so no damage done). 9.3) Fixed bug in TcpClient.c call to KS_Connect(). Previous version incorrectly checked nNdisStatus instead of Status returned from KS_Connect(). 10.) Extended KS library to support setting of additional TDI events: TDI_EVENT_ERROR_EX TDI_EVENT_CHAINED_RECEIVE TDI_EVENT_CHAINED_RECEIVE_DATAGRAM TDI_EVENT_CHAINED_RECEIVE_EXPEDITED 11.) Added support for functions depreciated or added at Windows 2000 and higher. This necessitated adding the preprocessor definition NT_VER to control the use of version-specific features: Windows NT 4.0 - NT_VER=400 Windows 2000 - NT_VER=500 Windows XP - NT_VER=510 Windows .NET - NT_VER=520 Windows version-dependent features include: 11.1) NT_VER >= 500: Use of OBJ_KERNEL_HANDLE to allow use of TDI object handles in arbitrary process context. 11.2) NT_VER >= 500: Support setting of TDI_EVENT_ERROR_EX event handler. 11.3) NT_VER >= 500: Use NdisAllocateMemoryWithTag 11.4) NT_VER >= 500: Use NdisQueryBufferSafe 11.5) NT_VER >= 500: Include basic call to TdiRegisterPnPHandlers in TDIECHO sample (perhaps others...). 12.) Modified KS library routines for setting event handlers: 12.1) Added new KS library function KS_SetSingleEventHandler(). This common routine performs the work of setting individual handlers from the KS_SetEventHandlers() routine. Also, provides flexibility to accomodate new event types in the future without breaking the KS_XXX API. 12.2) Added two new event setting routined designed specifically to "remind" the developer of which events can be set on unassociated transport addresses and which events should be associated with a connection endpoint before they are registered. KS_SetEventHandlersOnAddress - Allows setting of events that are permitted to be set on a transport address that has not (yet) been associated with a connection endpoint. KS_SetEventHandlersOnAssociatedAddress - Allows setting of events that events that should be associated with a connection endpoint before they are registered. 13.) Improved debug message support. New KSDBGP ("KS debug print") MACRO replaces KdPrint(). KSDBGP has debug-level verbosity control. See KSDebug.h. 14.) Fixed bug in TDIH_IndicateReceivedPackets associated with handling IRP returned by higher-level filtered client's ClientEventReceive call. This bug cause browsing to some sites to fail. Example site that caused this problem to show was www.cnnfn.com. Page just never comes up. This problem also prevented Outlook from checking mail at Hotmail. Fix is to simply handle the returned IRP exactly as if it had entered the dispatch routine. In other words, now just call TDIH_TdiReceive to queue the IRP for later processing. 15.) Made modifications to TDI filter code that handled IRPs with insufficient I/O stack locations. This situation primarily concerns the case where the TDI filter is attached AFTER the NetBT TDI client has already opened a TDI provider device. This is absoultely the case if the TDI filter is loaded dynamically. If the TDI filter is not loaded before NetBT, then the TDI filter will enter the insufficient stacl location processing ("bogus stack locations" debug message). Code in V2.00.03.11 was sufficient to insure that no access violations were generated when the insufficient I/O stack location code was exercised; HOWEVER, NetBT did not function properly. The revised code in this release allows NetBT to function normally in this case. These modifications call IoSkipCurrentIrpStackLocation in most cases. However, a slightly different check was needed to handle receive and receive datagram event handlers; for these, simply don't touch the IoRequest if it doesn't have sufficient stack locations. If NetBT data must be filtered then there are two solutions: 1.) Install the filter before NetBT opens a TDI provider or 2.) use "repeater IRPs". This modification is sufficient to allow the PassThru filter to be dynamically loaded and still have NetBT work OK. However, this fix is NOT sufficient to allow the PassThru Plus filter to be loaded dynamically and still have NetBT work OK. 16.) Fixed bug in KS_GetCurrentProcessName. Code to insure that the process name was NULL terminated wrote past end of memory allocated for string. WAS : ProcessName[NT_PROCNAMELEN] = 0; SHOULD BE: ProcessName[NT_PROCNAMELEN - 1] = 0; 17.) Reduced redundant calls to IoGetRelatedDeviceObject found in TCI Client samples. 17.1) Added m_pDeviceObject field to KS_ADDRESS structure. This field is now initialized by calling IoGetRelatedDeviceObject() in KS_OpenTransportAddress(). 17.2) Added m_pDeviceObject field to KS_ENDPOINT structure. This field is now initialized by calling IoGetRelatedDeviceObject() in _I_KS_OpenConnectionContext() (called from KS_OpenConnectionEndpoint() ). 17.3) Modified TDIEcho and TDITTCP samples by eliminating calls to IoGetRelatedDeviceObject() and using pre-initialized fields instead. 18.) Fixed minor bug in KS_TCPSetInformation() in kstcpex.c. More memory then necessary was allocaed for PTCP_REQUEST_SET_INFORMATION_EX buffer. No functional problem because of this bug. 19.) Fixed bug related to setting TCP_SOCKET_NODELAY option in TCPC_TestThread() function of TcpClient.c module in TdiTTCP sample. Bug was that option was set AFTER the connection was established. For correct operation, the option should be set BEFORE the connection is established. 20.) Fixed bug in PassThru TDI filter sample, TDIH_TdiOpenConnectionComplete function. Code did not account for possibility that pTDIH_DeviceExtension could be NULL in some cases. Now check for NULL pTDIH_DeviceExtension. 21.) Component renaming and additional samples: 21.1) Renamed Layered PassThru TDI filter driver to TDIPassL. 21.2) Added new hooking PassThru TDI filter named TDIPassH. ====================================================================== Component Version : 2.01.04.12 Release Date : 6/24/02 1.) Extensive rework of TDIQ application. Several bug fixes. For clairty, revised module partitioning to make four stand-alone functional modules: ipconfig.c ipstat.c iproute.c ifstat.c ====================================================================== Component Version : 2.00.03.11 Release Date : 6/21/01 1.) Fixed important memory leak in PassThru TDI Filter sample. In the Addr.c module in the TDIH_TdiOpenAddressComplete() function at about line 185 there was a call to ExAllocatePool() that preceeded the attempt to fetch a previously used AddrObj from FreeAddrObjList. This call to ExAllocatePool should be deleted. Make similar fix in PassThru Plus (PTPlus) TDI Filter sample. 2.) Fixed bug in KS_in_cksum(). This function did not properly account for byte order of the host processor and would calculate checksum incorrectly if length of data to sum was odd. Improvements to other functions that are dependent on host processor byte order. ====================================================================== Component Version : 2.00.03.10 Release Date : 4/30/00 1.) Add PassThru TDI Filter sample. 2.) Remove superflous calls to MmProbeProbeAndLockPages in KSUtil.c. 3.) Added KS_GetCurrentProcessName function to KSUtil.c to support associating processes with Address Objects in TDI Filter. ====================================================================== Component Version : 2.00.03.09 Release Date : 3/1/00 1.) Initial release of Advanced TDI Client Samples for Windows NT and Windows 2000. ====================================================================== Component Version : 1.10.02.08 Release Date : 10/5/99 1.) Modified TDIVXD.H to eliminate use of PLARGE_INTEGER typedef. This allows the TDI VxDs to be compiled successfully under the newer VtoolsD 3.X that comes bundled with the DriverStudio product. Note: VtoolsD 3.X headers do not seem to properly define PLARGE_INTEGER... 2.) Tested build under VC++ 5.0 and VC++ 6.0. ====================================================================== Component Version : 1.10.02.07 Release Date : 10/19/97 1.) Small changes in PCA_VTDI_Get_Version() and PCA_VTDI_Get_Info() to eliminate compiler warnings and to use VxDCall instead of VxDJump for graceful recovery. 2.) Modified TDIServer.EXE so that load dialog does not show TDI UDP Daytime Server group when running on Windows NT. This is because the current samples only include a TDI UDP Daytime Server driver for Windows 95. 3.) Modified W32NdisApi W32N_BindAdapter95() routine (called by W32N_OpenAdapter() ) to use the complete path to the VxD instead of assuming that the VxD was in the current directory. This allows HookPeek to be run successfully without requiring NDISHOOK.VXD to be in the current directory. NOTE: An important lesson to be learned is that when a complete path is used to load a VxD, the path MUST be a shortname path... ====================================================================== Component Version : 1.10.02.06 Release Date : 7/15/97 1.) Began adding support for active TCP connections opens. 2.) Improved PCA_VTDI_Get_Version() and PCA_VTDI_Get_Info() functions. They now fail gracefully if VTDI is not installed. 3.) Some modifications to W32NdisApi.DLL. ====================================================================== Component Version : 1.10.02.05 Release Date : 6/2/97 1.) Some generalization of the universal 95/NT device driver loader. 2.) Addition of UDP Daytime server driver for Windows 95. The two sets of drivers have some code in common. This required reorganization of source code directories and modification to the TDIServer driver loader. ====================================================================== Component Version : 1.10.02.04 Release Date : 5/27/97 1.) Extensive revision of TDIServer Driver Loader Application. Now performs Load/Unload operation under Windows 95 and Windows NT. 2.) Extensively revised TDIEcho.VxD. Now use VxDTdiBuildXxxx macros, which parallel the DTdiBuildXxxx macros used under Windows NT. 3.) Improved disconnect handling, including case where driver is unloaded while a connection is active. 4.) Added Windows NT TDIEcho.Sys driver. ====================================================================== Component Version : 1.00.01.03 Release Date : 5/20/97 1.) Renamed some functions to be the same as corresponding Windows NT sample. ====================================================================== Component Version : 1.00.01.02 Release Date : 4/26/97 1.) Modifications to DeviceIoControl API to allow TDIServer Win32 application to monitor and control TDIEcho VxD operation. The initial version was simply a VxD loader. ====================================================================== Component Version : 1.00.00.01 Release Date : 4/23/97 1.) Initial release of TDIECHO sample executables for limited outside evaluation.