Ioctl_Tdi_Tl_Io_Control_Endpoint

Ask your beginner questions here.
Post Reply
Carlbyte
Posts: 74
Joined: Fri Mar 21, 2014 12:18 pm

Ioctl_Tdi_Tl_Io_Control_Endpoint

Post by Carlbyte » Sat Sep 10, 2016 6:49 pm

Anyone know how to send an IOCTL_TDI_TL_IO_CONTROL_ENDPOINT using NtDeviceIoControlFile? I searched and not found any documentation on this subject.

typedef struct _TDI_TL_IO_CONTROL_ENDPOINT {
TDI_TL_IO_CONTROL_TYPE Type;
ULONG Level;
union {
ULONG IoControlCode;
ULONG OptionName;
};
__field_bcount(InputBufferLength) PVOID InputBuffer;
ULONG InputBufferLength;
__field_bcount(OutputBufferLength) PVOID OutputBuffer;
ULONG OutputBufferLength;
} TDI_TL_IO_CONTROL_ENDPOINT, *PTDI_TL_IO_CONTROL_ENDPOINT;

Carlbyte
Posts: 74
Joined: Fri Mar 21, 2014 12:18 pm

Re: Ioctl_Tdi_Tl_Io_Control_Endpoint

Post by Carlbyte » Sun Sep 11, 2016 2:25 pm

I'm trying to getsockopt in kernel mode. Any idea?

User avatar
Brock
Posts: 212
Joined: Wed Apr 28, 2010 3:13 am
Location: Valparaiso, Florida USA
Contact:

Re: Ioctl_Tdi_Tl_Io_Control_Endpoint

Post by Brock » Sun Sep 11, 2016 10:17 pm

TDI_TL_IO_CONTROL_ENDPOINT "Type" struct member would likely have to be GetSockOptIoControlType defined in this enum from what I see at first glance:

Code: Select all

typedef enum {
    EndpointIoControlType,
    SetSockOptIoControlType,
    GetSockOptIoControlType,
    SocketIoControlType,
} TDI_TL_IO_CONTROL_TYPE, *PTDI_TL_IO_CONTROL_TYPE;
Level and Option Name (OptName) would probably coincide with Winsock's GetSockOpt() input params, named identically as Level and Optname:

Code: Select all

int getsockopt(
  _In_    SOCKET s,
  _In_    int    level,
  _In_    int    optname,
  _Out_   char   *optval,
  _Inout_ int    *optlen
);
Accept nothing less than STATUS_SUCCESS

Carlbyte
Posts: 74
Joined: Fri Mar 21, 2014 12:18 pm

Re: Ioctl_Tdi_Tl_Io_Control_Endpoint

Post by Carlbyte » Mon Sep 12, 2016 11:12 pm

For my purposes ... I used IOCTL AFD_GET_CONTEXT with SOCK_SHARED_INFO

Post Reply