Parameter deduction notes: -------------------------- Here is the sequence of winsock calls traced from winipcfg.exe on win95. The trace only shows the input and output parameters to the WSControl calls. WSAStartup WsControl call 1 WsControl call 2 WsControl call 3 WsControl call 4 WsControl call 5 WsControl call 6 WsControl call 7 WsControl call 8 WsControl call 9 WsControl call 10 WsControl call 11 inet_addr ntohl inet_addr ntohl ------------------------------------------------------------------------------ WsControl Call 1 -- Get Entity ID List before WsControl call 1 protocol 6 action 0 inbuf 0063FB34 inbuflen 36 outbuf 00410FC0 outbuflen 256 inbuf: 0x00000000 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 ................ 0x00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 1 protocol 6 action 0 inbuf 0063FB34 inbuflen 36 outbuf 00410FC0 outbuflen 72 result 0 inbuf: unchanged outbuf: 0x00000000 00 04 00 00 00 00 00 00 01 04 00 00 00 00 00 00 ................ 0x00000010 01 03 00 00 00 00 00 00 80 03 00 00 00 00 00 00 ................ 0x00000020 80 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 ................ 0x00000030 80 02 00 00 01 00 00 00 00 02 00 00 01 00 00 00 ................ 0x00000040 00 02 00 00 02 00 00 00 ........ Interpretation: Entity Instance Symbol Possible Description ------ -------- ------------ -------------------- 400 0 CO_TL_ENTITY //transport layer entity?? in this case supporting?? 401 0 CL_TL_ENTITY //transport layer entity?? in this case supporting TCP and UDP 301 0 CL_NL_ENTITY //network layer entity?? in this case supporting IP 380 0 ER_ENTITY //error reporting entity?? in this case supporting ICMP 280 0 AT_ENTITY //address translation entity?? in this case supporting ARP 200 0 IF_ENTITY //generic interface entity?? in this case supporting ethernet 280 1 AT_ENTITY //address translation entity?? in this case supporting ARP 200 1 IF_ENTITY //generic interface entity?? in this case supporting PPP 200 2 IF_ENTITY //generic interface entity?? in this case supporting loopback These values are fed into the tcpRequestQueryInfoEx.ID.toi_entity fields of the subsequent calls. Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = GENERIC_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_GENERIC; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = ENTITY_LIST_ID; Call output setup: //this probably allocates too much space; not sure if MAX_TDI_ENTITIES //represents the max number of entities that can be returned or, if it //is the highest entity value that can be defined. DWORD entityIdsBufSize = MAX_TDI_ENTITIES * sizeof(TDIEntityID); TDIEntityID *entityIds = calloc(entityIdsBufSize, 1); returns a list of all the entity ids //...after the call we compute: DWORD entityCount = entityIdsBufSize / sizeof(TDIEntityID); DWORD ifCount = 0; int i = 0; for (i = 0; i < entityCount; i++) { if (entityIds[i].tei_entity == IF_ENTITY) ++ifCount; } ------------------------------------------------------------------------------ WsControl Call 2 -- Entity Type Query for Interface Instance 0 before WsControl call 2 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FD08 outbuflen 4 inbuf: 0x00000000 00 02 00 00 00 00 00 00 00 01 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 2 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FD08 outbuflen 0 result 0 inbuf: unchanged outbuf: 0x00000000 02 02 00 00 .... Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = IF_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_GENERIC; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = ENTITY_TYPE_ID; Call output setup: ULONG entityType; DWORD entityTypeSize = sizeof(entityType); returns entityType == IF_MIB // Supports MIB-2 interface. ------------------------------------------------------------------------------ WsControl Call 3 -- Interface Entry Query for Interface Instance 0 before WsControl call 3 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC24 outbuflen 222 inbuf: 0x00000000 00 02 00 00 00 00 00 00 00 02 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 3 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC24 outbuflen 136 result 0 inbuf: unchanged outbuf: 0x00000000 03 00 00 00 06 00 00 00 dc 05 00 00 80 96 98 00 .............-~. 0x00000010 06 00 00 00 00 a0 c9 38 3a 8c 02 c0 01 00 00 00 .......8:....... 0x00000020 01 00 00 00 00 00 00 00 ec e2 2a 00 47 0c 00 00 ..........*.G... 0x00000030 2a 10 00 00 00 00 00 00 00 00 00 00 de 04 00 00 *............... 0x00000040 31 6c 4d 00 cd 10 00 00 19 00 00 00 00 00 00 00 1lM............. 0x00000050 00 00 00 00 00 00 00 00 2c 00 00 00 49 6e 74 65 ........,...Inte 0x00000060 6c 20 45 74 68 65 72 45 78 70 72 65 73 73 20 50 l EtherExpress P 0x00000070 52 4f 2f 31 30 30 20 4d 6f 62 69 6c 65 20 43 61 RO/100 Mobile Ca 0x00000080 72 64 42 75 73 20 33 32 rdBus 32 Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = IF_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_PROTOCOL; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = IF_MIB_STATS_ID; Call output setup: //note: win95 winipcfg use 130 for MAX_IFDESCR_LEN while //ddk\src\network\wshsmple\SMPLETCP.H defines it as 256 DWORD ifentrySize = sizeof(IFEntry) + 128 + 1; IFEntry *ifentry = calloc(ifentrySize, 1); returns IFEntry and variable length description ------------------------------------------------------------------------------ WsControl Call 4 -- Entity Type Query for Interface Instance 1 before WsControl call 4 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FD08 outbuflen 4 inbuf: 0x00000000 00 02 00 00 01 00 00 00 00 01 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 4 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FD08 outbuflen 0 result 0 inbuf: unchanged outbuf: 0x00000000 02 02 00 00 .... Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = IF_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 1; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_GENERIC; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = ENTITY_TYPE_ID; Call output setup: ULONG entityType; DWORD entityTypeSize = sizeof(entityType); returns entityType == IF_MIB // Supports MIB-2 interface. ------------------------------------------------------------------------------ WsControl Call 5 -- Interface Entry Query for Interface Instance 1 before WsControl call 5 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC24 outbuflen 222 inbuf: 0x00000000 00 02 00 00 01 00 00 00 00 02 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 5 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC24 outbuflen 107 result 0 inbuf: unchanged outbuf: 0x00000000 02 00 00 00 06 00 00 00 dc 05 00 00 b0 1d 00 00 ................ 0x00000010 06 00 00 00 44 45 53 54 00 00 02 c0 01 00 00 00 ....DEST........ 0x00000020 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000050 00 00 00 00 00 00 00 00 0f 00 00 00 50 50 50 20 ............PPP 0x00000060 41 64 61 70 74 65 72 2e 00 00 00 Adapter.... Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = IF_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 1; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_PROTOCOL; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = IF_MIB_STATS_ID; Call output setup: //note: win95 winipcfg use 130 for MAX_IFDESCR_LEN while //ddk\src\network\wshsmple\SMPLETCP.H defines it as 256 DWORD ifentrySize = sizeof(IFEntry) + 128 + 1; IFEntry *ifentry = calloc(ifentrySize, 1); returns IFEntry and variable length description ------------------------------------------------------------------------------ WsControl Call 6 -- Entity Type Query for Interface Instance 2 before WsControl call 6 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FD08 outbuflen 4 inbuf: 0x00000000 00 02 00 00 02 00 00 00 00 01 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 6 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FD08 outbuflen 0 result 0 inbuf: unchanged outbuf: 0x00000000 02 02 00 00 .... Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = IF_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 1; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_GENERIC; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = ENTITY_TYPE_ID; Call output setup: ULONG entityType; DWORD entityTypeSize = sizeof(entityType); returns entityType == IF_MIB // Supports MIB-2 interface. ------------------------------------------------------------------------------ WsControl Call 7 -- Interface Entry Query for Interface Instance 2 before WsControl call 7 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC24 outbuflen 222 inbuf: 0x00000000 00 02 00 00 02 00 00 00 00 02 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 7 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC24 outbuflen 118 result 0 inbuf: unchanged outbuf: 0x00000000 01 00 00 00 18 00 00 00 14 01 00 00 80 96 98 00 .............-~. 0x00000010 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ................ 0x00000020 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000050 00 00 00 00 00 00 00 00 1a 00 00 00 4d 53 20 54 ............MS T 0x00000060 43 50 20 4c 6f 6f 70 62 61 63 6b 20 69 6e 74 65 CP Loopback inte 0x00000070 72 66 61 63 65 00 rface. Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = IF_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 2; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_PROTOCOL; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = IF_MIB_STATS_ID; Call output setup: //note: win95 winipcfg use 130 for MAX_IFDESCR_LEN while //ddk\src\network\wshsmple\SMPLETCP.H defines it as 256 DWORD ifentrySize = sizeof(IFEntry) + 128 + 1; IFEntry *ifentry = calloc(ifentrySize, 1); returns IFEntry and variable length description ------------------------------------------------------------------------------ WsControl Call 8 -- Entity Type Query for TCP Interface before WsControl call 8 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC1C outbuflen 4 inbuf: 0x00000000 01 03 00 00 00 00 00 00 00 01 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 8 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FC1C outbuflen 0 result 0 inbuf: unchanged outbuf: 0x00000000 03 03 00 00 .... Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = CL_NL_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_GENERIC; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = ENTITY_TYPE_ID; Call output setup: ULONG entityType; DWORD entityTypeSize = sizeof(entityType); returns entityType == CL_NL_IP // Entity implements IP. supports IPSNMPInfo query?? ------------------------------------------------------------------------------ WsControl Call 9 -- IP SNMP Information Query for TCP Interface before WsControl call 9 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FBC0 outbuflen 92 inbuf: 0x00000000 01 03 00 00 00 00 00 00 00 02 00 00 00 01 00 00 ................ 0x00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 9 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 0063FBC0 outbuflen 92 result 0 inbuf: unchanged outbuf: 0x00000000 02 00 00 00 20 00 00 00 23 15 00 00 02 00 00 00 .... ...#....... 0x00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 21 15 00 00 d7 10 00 00 00 00 00 00 00 00 00 00 !............... 0x00000030 00 00 00 00 3c 00 00 00 00 00 00 00 00 00 00 00 ....<........... 0x00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000050 03 00 00 00 03 00 00 00 06 00 00 00 ............ Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = CL_NL_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_PROTOCOL; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = IP_MIB_STATS_ID; Call output setup: IPSNMPInfo ipSnmpInfo; DWORD ipSnmpInfoLen = sizeof(ipSnmpInfo); returns IPSNMPInfo struct ----------------------------------------------------------------------------- WsControl Call 10 -- Interface Address Table Query for TCP Interface before WsControl call 10 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 00510F84 outbuflen 72 inbuf: 0x00000000 01 03 00 00 00 00 00 00 00 02 00 00 00 01 00 00 ................ 0x00000010 02 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 10 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 00510F84 outbuflen 72 result 0 inbuf: unchanged outbuf: 0x00000000 0a 0a 01 a9 03 00 00 00 ff ff 00 00 01 00 00 00 ................ 0x00000010 ff ff 00 00 02 00 48 c0 00 00 00 00 02 00 00 00 ......H......... 0x00000020 00 00 00 00 01 00 00 00 ff ff 00 00 01 00 48 c0 ..............H. 0x00000030 7f 00 00 01 01 00 00 00 ff 00 00 00 01 00 00 00 ................ 0x00000040 ff ff 00 00 00 00 48 c0 ......H. Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = CL_NL_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_PROTOCOL; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = IP_MIB_ADDRTABLE_ENTRY_ID; Call output setup: DWORD ipAddrEntryBufLen = sizeof(IPAddrEntry) * ifCount; IPAddrEntry *ipAddrEntry = calloc(ipAddrEntryBufLen, 1); returns IPAddrEntry[ifCount] array ------------------------------------------------------------------------------ WsControl Call 11 -- Route Table Query for TCP Interface before WsControl call 11 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 004114C4 outbuflen 288 inbuf: 0x00000000 01 03 00 00 00 00 00 00 00 02 00 00 00 01 00 00 ................ 0x00000010 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x00000020 00 00 00 00 .... after WsControl call 11 protocol 6 action 0 inbuf 0063FD18 inbuflen 36 outbuf 004114C4 outbuflen 288 result 0 inbuf: unchanged outbuf: 0x00000000 e0 00 00 00 03 00 00 00 01 00 00 00 ff ff ff ff ................ Entry 5 0x00000010 ff ff ff ff ff ff ff ff 0a 0a 01 a9 03 00 00 00 ................ 0x00000020 02 00 00 00 5c 1b 00 00 e0 00 00 00 ff ff ff ff ....\........... 0x00000030 0a ff ff ff 03 00 00 00 01 00 00 00 ff ff ff ff ................ Entry 3 0x00000040 ff ff ff ff ff ff ff ff 0a 0a 01 a9 03 00 00 00 ................ 0x00000050 02 00 00 00 5c 1b 00 00 ff ff ff ff ff ff ff ff ....\........... 0x00000060 0a 0a 00 00 03 00 00 00 01 00 00 00 ff ff ff ff ................ Entry 1 0x00000070 ff ff ff ff ff ff ff ff 0a 0a 01 a9 03 00 00 00 ................ 0x00000080 02 00 00 00 5c 1b 00 00 ff ff 00 00 ff ff ff ff ....\........... 0x00000090 ff ff ff ff 02 00 00 00 01 00 00 00 ff ff ff ff ................ Entry 6 0x000000a0 ff ff ff ff ff ff ff ff 0a 0a 01 a9 03 00 00 00 ................ 0x000000b0 02 00 00 00 60 1b 00 00 ff ff ff ff ff ff ff ff ....`........... 0x000000c0 0a 0a 01 a9 01 00 00 00 01 00 00 00 ff ff ff ff ................ Entry 2 0x000000d0 ff ff ff ff ff ff ff ff 7f 00 00 01 03 00 00 00 ................ 0x000000e0 02 00 00 00 5c 1b 00 00 ff ff ff ff ff ff ff ff ....\........... 0x000000f0 7f 00 00 00 01 00 00 00 01 00 00 00 ff ff ff ff ................ Entry 4 0x00000100 ff ff ff ff ff ff ff ff 7f 00 00 01 03 00 00 00 ................ 0x00000110 02 00 00 00 62 1b 00 00 ff 00 00 00 ff ff ff ff ....b........... Corresponding route table: Network Address Netmask Gateway Address Interface Metric 10.10.0.0 255.255.0.0 10.10.1.169 10.10.1.169 1 Entry 1 10.10.1.169 255.255.255.255 127.0.0.1 127.0.0.1 1 Entry 2 10.255.255.255 255.255.255.255 10.10.1.169 10.10.1.169 1 Entry 3 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 Entry 4 224.0.0.0 224.0.0.0 10.10.1.169 10.10.1.169 1 Entry 5 255.255.255.255 255.255.255.255 10.10.1.169 0.0.0.0 1 Entry 6 Call input setup: //define not found; invented #define IP_MIB_ROUTETABLE_ENTRY_ID 0x101 TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = CL_NL_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_PROTOCOL; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = IP_MIB_ROUTETABLE_ENTRY_ID; Call output setup: //struct not found; invented typedef struct IPRouteEntry { ulong ire_addr; ulong ire_index; //matches if_index in IFEntry and iae_index in IPAddrEntry ulong ire_metric; ulong ire_unk1; ulong ire_unk2; ulong ire_unk3; ulong ire_gw; ulong ire_unk4; ulong ire_unkn5; ulong ire_unk6; ulong ire_mask; ulong ire_unk7; } IPRouteEntry; DWORD ipRouteEntryBufLen = sizeof(IPRouteEntry) * ipSnmpInfo.ipsi_numroutes; IPRouteEntry *ipAddrEntry = calloc(ipRouteEntryBufLen, 1); returns IPAddrEntry[ipSnmpInfo.ipsi_numroutes] array ------------------------------------------------------------------------------ Theoretical WsControl Call -- Interface Info Query Call input setup: TCP_REQUEST_QUERY_INFORMATION_EX tcpRequestQueryInfoEx; memset(&tcpRequestQueryInfoEx, 0, sizeof(tcpRequestQueryInfoEx)); tcpRequestQueryInfoEx.ID.toi_entity.tei_entity = IF_ENTITY; tcpRequestQueryInfoEx.ID.toi_entity.tei_instance = 0; tcpRequestQueryInfoEx.ID.toi_class = INFO_CLASS_PROTOCOL; tcpRequestQueryInfoEx.ID.toi_type = INFO_TYPE_PROVIDER; tcpRequestQueryInfoEx.ID.toi_id = IP_INTFC_INFO_ID; Call output setup: DWORD ipIfInfoBufSize = sizeof(IPInterfaceInfo) + sizeof(ulong); IPInterfaceInfo ipIfInfoBufSize = calloc(ipIfInfoBufSize, 1); ------------------------------------------------------------------------------ Setting of parameters might also be tried. It would be good to trace winipcfg during some of its write operations to see what parameters to set.