you mean you want to monitor the creation of sockets on a windows based pc, right? (in order to conduct reporting or similar functionality)
first DeviceIoControl is function used to send IRPs down driver stacks (in simple terms it is used to communicate with drivers from user mode)
second TDI is a network driver interface, I think you can use this to get a list of sockets but that is kernel mode programming and from the way you structured your question i doubt you will be able to develop a driver (at least not yet) besides that what you are looking for can be done in user mode by using the following functions:
GetExtendedUDPTable
http://msdn.microsoft.com/en-us/library/aa365930(v=vs.85).aspx[
^]
GetExtendedTCPTable
http://msdn.microsoft.com/en-us/library/aa365928(v=vs.85).aspx[
^]