none
Issues with porting TDI to IPv6 RRS feed

  • Question

  • I am porting some old TDI driver to support for IPv6, I did not get any proper documents for the Ipv6 TDI support. But in tdi.h file I can see the supported structure.

    here is my code:

               TA_IP6_ADDRESS               SendToAddressIp;
                TDI_ADDRESS_IP6              containedSendToAddressIp;
                TDI_CONNECTION_INFORMATION   ConnectInfo;
                // initialize send to ip6 address structure
                RtlFillMemory(&containedSendToAddressIp, sizeof(TDI_ADDRESS_IP6), 0);
                containedSendToAddressIp.sin6_port  = swap((USHORT)remoteport);

                memcpy(containedSendToAddressIp.sin6_addr, remoteIp6, 16); // 16 byte IPV6

               // containedSendToAddressIp.sin6_scope_id = 4; // IPV6 value add
                containedSendToAddressIp.sin6_flowinfo = 0;  // IPV6 value add

                // fill in the transport specific address with the ip address
                RtlFillMemory(&SendToAddressIp, sizeof(TA_IP6_ADDRESS), 0);
                SendToAddressIp.TAAddressCount           = 1;
                SendToAddressIp.Address[0].AddressLength = TDI_ADDRESS_LENGTH_IP6;
                SendToAddressIp.Address[0].AddressType   = TDI_ADDRESS_TYPE_IP6;
                RtlCopyMemory(&(SendToAddressIp.Address[0].Address[0]),
                       &containedSendToAddressIp, sizeof(TDI_ADDRESS_IP6));

                // initialize connection information structure
                RtlFillMemory(&ConnectInfo, sizeof(TDI_CONNECTION_INFORMATION), 0);
                ConnectInfo.UserDataLength = 0;
                ConnectInfo.UserData = NULL;
                ConnectInfo.OptionsLength = 0;
                ConnectInfo.Options = NULL;
                ConnectInfo.RemoteAddressLength = sizeof(TA_IP6_ADDRESS);
                ConnectInfo.RemoteAddress       = &SendToAddressIp;



                  {

                    if (PIRP irp = IoAllocateIrp(m_device->StackSize, false)) {

                       
                        // compute the timeout
                        //
                        QUADWORD timeout = (QUADWORD)timeoutMs * -10000i64;

                        // Initialize the IRP
                        //
                        TdiBuildConnect(
                            irp,
                            m_device,
                            m_object,
                            completionRoutine,
                            context,
                            timeout ? (PLARGE_INTEGER)&timeout : 0,
                             &ConnectInfo,
                          // &(info6->GetConnectInfo6()),
                            0
                        );

                        // call the driver
                        //
                        IoCallDriver(m_device, irp);

                        status = STATUS_PENDING;

                    }
                }
            }

        }

    Here I am always getting the Error 0xC0000141: The address handle given to the transport was invalid.

    I think I am doing some thing wrong in setting the structures.

    Thanks in advance,

    Birajendu.

    Tuesday, June 4, 2013 7:55 AM

Answers

  • TDI is deprecated, and is being removed from Windows. Windows Phone and Windows RT no longer support TDI, and it will be fully removed from all versions soon. You cannot logo software that uses TDI.

    We don't support IPv6 with TDI; the supported way to use IPv6 is to use WSK or WFP on Windows Vista or later. That being said, there's an article here that goes over the basics.

    Wednesday, June 5, 2013 1:34 AM

All replies

  • TDI is deprecated, and is being removed from Windows. Windows Phone and Windows RT no longer support TDI, and it will be fully removed from all versions soon. You cannot logo software that uses TDI.

    We don't support IPv6 with TDI; the supported way to use IPv6 is to use WSK or WFP on Windows Vista or later. That being said, there's an article here that goes over the basics.

    Wednesday, June 5, 2013 1:34 AM
  • Hi Jeffrey

    I have already followed the link and my code snippet is mostly derived from the link. I am trying the implementation in a windows 7, I would like to know , whether IPV6 is  supported with TDI, or its completely deprecated.

    The link does not tells any thing beyond XP SP1, So I am confused.

    Looking at the IPV6 structure declaration in tdi.h, it seems there is still support? Please clarify me if I am wrong.

    Thanks in advance.

    Birajendu.


    Wednesday, June 5, 2013 5:04 AM
  • No, TDI is not supported by Microsoft on Windows 7.  Use WSK or WFP instead; these are supported, easier to write and debug, better documented, and have more features.
    Wednesday, June 5, 2013 7:28 PM