TDI FAQ

Home Up NDIS FAQ IM Driver FAQ TDI FAQ Packet Filtering Win95 IFS FAQ Other Resources Consultants

Answers to TDI Frequently Asked Questions

The information on this page is intended primarily for network software developers who are working on lower-level network-related Transport Data Interface (TDI) device drivers for Windows 95 and Windows NT.

Table of Contents

General

bulletWhat is "TDI"?
 
bulletWhere can I find TDI programming information?
 
bulletWhere can I find sample TDI drivers?
 
bulletWhere can I find sample TDI clients?
 
bulletTo Free or Not To Free (A TDI-Related IRP)?

 

Windows 95

bulletAre there any bugs in the VXDTDI header files provided by Microsoft?
 
bulletWhat Windows 95 protocols use TDI?
 
bulletWhere can I find information about the VxD Interface for Windows 95 Winsock Helper DLLs?

 

Windows NT

 

Legal Questions

bulletPatent Related To Managing Internet Access

 

General

 

What is "TDI"?

TDI is short for the "Transport Driver Interface". The primary purpose of TDI is to define a standard API for the upper edge of Windows NT transport protocol stacks (i.e., the low-level kernel-mode driver implementation of protocols such as TCP/IP, NetBEUI, etc.). A variation of TDI is also used on the Windows 95 platform, but only for the TCP/IP protocol.

TDI provides standard methods for protocol addressing, sending and receiving datagrams, writing and reading on streams, detecting disconnects, etc.

 

Back to Top

 

Where can I find TDI programming information?

Windows NT
If you are developing TDI drivers or a TDI client driver for the Windows NT platform, then TDI information is found in the Windows NT DDK Help file under the highest-level topic "Network Drivers".
 
The Microsoft DDK documentation is available on the Microsoft Developer Network (MSDN) software subscription CD's. It is also provided as part of the free MDSN OnLine service at http://www.microsoft.com/msdn leave-site.gif (117 bytes).
 
Windows 95
If you are interested in TDI drivers for Windows 9X/ME, then fetch the files from:
ftp://ftp.microsoft.com/bussys/winsock/
These files are unsupported, and provided as an assistance for the advanced programmer.

 

Back to Top

 

Where can I find sample TDI drivers?

Windows NT
The Microsoft Windows NT DDK includes a sample TDI driver. The Microsoft DDK documentation is available on the Microsoft Developer Network (MSDN) software subscription CD's. It is also provided as part of the free MDSN OnLine service at http://www.microsoft.com/msdn leave-site.gif (117 bytes).
 
Windows 95
None are known to be available

 

Back to Top

 

Where can I find sample TDI clients?

Windows NT
The Microsoft Windows NT Installable File System Kit (NTIFSKIT) includes a SMB redirector which is a NETBIOS TDI client. Information about the Microsoft NTIFSKIT can be found at http://www.microsoft.com/hwdev/ntifskit  
 
PCAUSA licenses a NT kernel-mode driver sample which is a TCP/IP TDI client.

Windows 95
PCAUSA licenses a VxD driver sample which is a TCP/IP TDI client.
 
Back to Top

 

To Free or Not To Free (A TDI-Related IRP)"

A frequent question related to use of TDI concerns freeing IRPs that are allocated and then used to call a TDI provider. Some designs never free IRPs after allocation and some always free (or recycle) IRPs after allocation.

How can these two differing approaches to freeing IRPs both be correct?

The answer depends on how you allocate the IRP...

There are two common methods used for allocation of IRPs in TDI drivers:

bulletTdiBuildInternalDeviceControlIrp
bulletIoAllocateIrp

 

TdiBuildInternalDeviceControlIrp
TdiBuildInternalDeviceControlIrp is a MACRO around IoBuildDeviceIoControlRequest.
 
The DDK says this about IoBuildDeviceIoControlRequest:
 
"When the next-lower driver completes this IRP, the I/O Manager releases it."
 
So, if you use TdiBuildInternalDeviceControlIrp you don't free the IRP yourself.
 
I seldom use TdiBuildInternalDeviceControlIrp because the DDK places this restriction on its use:
 
"Callers of IoBuildDeviceIoControlRequest must be running at IRQL PASSIVE_LEVEL"
 
Not too useful in many cases.

 

IoAllocateIrp
An alternative is to use IoAllocateIrp. If you use this function, then you are obligated to eventually free the IRP by calling IoFreeIrp.

I use IoAllocateIrp/IoFreeIrp fairly frequently because the DDK says:

"Callers of IoAllocateIrp must be running at IRQL <= DISPATCH_LEVEL"

This provides much more flexibility in my book.

 

This mystery solved - at least.

 

Windows 95 Questions

Are there any bugs in the VXDTDI header files provided by Microsoft?

Sort of... There's one problem that bites everyone at first. The VTDI service table includes two entries, VTDI_Get_Lock and VTDI_Free_Lock, that are only provided in the debug versions of the VTDI VxD (which I've never seen). In order to build code that works on retail versions of VTDI you must modify the service table.

PCA uses a preprocessor directive for this, as shown below:

Begin_Service_Table( VTDI )
VTDI_Service(VTDI_Get_Version)
VTDI_Service(VTDI_Start_Timer)
VTDI_Service(VTDI_Stop_Timer)
// Added by PCA
#ifdef USE_DEBUG_VTDI_386
VTDI_Service(VTDI_Get_Lock)
VTDI_Service(VTDI_Free_Lock)
#endif
...
End_Service_Table(VTDI)

Back to Top

 

What Windows 95 protocols use TDI?

The only Microsoft protocol for Windows 95 which uses TDI is the MSTCP (TCP/IP) protocol.

 

Where can I find information about the VxD Interface for Windows 95 Winsock Helper DLLs?

Fetch the currently available information from:

ftp://ftp.microsoft.com/bussys/winsock/

These files are unsupported, and provided as an assistance for the advanced programmer.

 

Back to Top

 

Windows NT Questions

 

Legal Questions

We are not lawyers! If you have legal questions, consult your legal counsel.

Patent Related To Managing Internet Access

One should examine the following Patent before considering use of process information to filter internet access:

United States Patent 5,987,611; "System and methodology for managing internet access on a per application basis for client computers connected to the internet ".

PCAUSA does not know the merits of this Patent or how it may apply to any intended use in TDI filtering.

Details can be found by searching at the U.S. Patent Office website. 

 

PCAUSA Home · Privacy Statement · Products · Ordering · Support · Utilities · Resources
Mailing Lists  · PCAUSA Newsletter · PCAUSA Discussion List
 
Rawether for Windows and WinDis 32 are trademarks of Printing Communications Assoc., Inc. (PCAUSA)
Microsoft, MS, Windows, Windows 95, Windows 98, Windows Millennium, Windows 2000, and Win32 are registered trademarks and Visual C++ and Windows NT are trademarks of the Microsoft Corporation.
Send mail to webmaster@pcausa.com with questions or comments about this web site.
Copyright © 1996-2008 Printing Communications Assoc., Inc. (PCAUSA)
Last modified: December 31, 2007