220{
229 DWORD outIDCount, i1, iAddr;
230 DWORD bCastAddr, outNumberOfBytes;
236
237
238 IntfIDList =
HeapAlloc(hHeap, 0,
sizeof(*IntfIDList));
240
241
244 {
247 }
248
249 DPRINT(
"TcpFile %p\n", TcpFile);
250
252 {
253 DPRINT(
"ERROR in AllocAndGetEntityArray: out of memory!\n");
256 }
257
259 pIFEntry =
HeapAlloc(hHeap, 0, IFEntryLen);
260 if (pIFEntry == 0)
261 {
265 }
266
267
268 pEntityID = outEntityID;
269 for (i1 = 0; i1 < outIDCount; i1++)
270 {
271
274 {
275 pEntityID++;
276 continue;
277 }
278
282
283
286 pIntfIDItem->
id = *pEntityID;
288
290
291 pEntityID++;
292 }
293
294
295 outNumberOfBytes = 0;
297 {
299 }
300 DPRINT(
"Buffer size needed: %lu\n", outNumberOfBytes);
302 {
303
304 if (NumberOfBytesReturned)
305 *NumberOfBytesReturned = 0;
308 }
309
310
316 {
318
321
323 TcpFile,
325 &inTcpReq1,
326 sizeof(inTcpReq1),
329 &BufLenNeeded,
331 {
335 }
336 }
337
338
341 {
343
345 for (iAddr = 0; iAddr < pIntfIDItem->
numaddr; iAddr++)
346 {
347 DPRINT(
"BufLen %lu\n",BufLenNeeded);
352
356
359 bCastAddr = (pIPAddrEntry->
iae_bcastaddr == 0) ? 0 : 0xffffffff;
361
365
369
370 pIPAddrEntry++;
371 pIntfInfo++;
372 }
374 }
375
376
377 pEntityID = outEntityID;
378 for (i1 = 0; i1 < outIDCount; i1++)
379 {
383
385 {
386 pEntityID++;
387 continue;
388 }
389
393
394
396 {
397 pEntityID++;
398 continue;
399 }
400
401
404 {
406 for (iAddr = 0; iAddr < pIntfIDItem->
numaddr; iAddr++)
407 {
410
411 pIPAddrEntry++;
412 pIntfInfo++;
413 }
414 }
415
416 pEntityID++;
417 }
418
419 if (NumberOfBytesReturned)
420 *NumberOfBytesReturned = outNumberOfBytes;
421 if (NeedsCompletion !=
NULL)
422 *NeedsCompletion =
FALSE;
423
426 DPRINT(
"WSHIoctl_GetInterfaceList - CLEANUP\n");
429 if (pIFEntry !=
NULL)
433 {
438 }
441}
#define IP_MIB_ADDRTABLE_ENTRY_ID
static void list_remove(struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define NT_SUCCESS(StatCode)
#define HeapFree(x, y, z)
static void cleanup(void)
INT GetIPSNMPInfo(IN HANDLE TcpFile, IN TDIEntityID *pEntityID, OUT IPSNMPInfo *outIPSNMPInfo)
INT GetIFEntry(IN HANDLE TcpFile, IN TDIEntityID *pEntityID, OUT IFEntry *pIFEntry, IN ULONG IFEntryLen)
BOOL AllocAndGetEntityArray(IN HANDLE TcpFile, IN HANDLE hHeap, OUT TDIEntityID **ppEntities, OUT PDWORD idCount)
INT GetTdiEntityType(IN HANDLE TcpFile, IN TDIEntityID *pEntityID, OUT PULONG pType)
#define MAX_ADAPTER_DESCRIPTION_LENGTH
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
@ IF_OPER_STATUS_CONNECTING
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE_REV(cursor, cursor2, list, type, field)
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
VOID closeTcpFile(HANDLE h)
sockaddr_gen iiBroadcastAddress
IPAddrEntry * pIPAddrEntry0
#define INFO_CLASS_PROTOCOL
#define INFO_TYPE_PROVIDER
#define IOCTL_TCP_QUERY_INFORMATION_EX
#define RtlZeroMemory(Destination, Length)
struct sockaddr_in AddressIn
_In_ WDFREQUEST _In_ size_t OutputBufferLength
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
DWORD WINAPI GetLastError(void)
struct _INTERFACE_INFO INTERFACE_INFO
struct _INTERFACE_INFO * LPINTERFACE_INFO