Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Problems in capture_win_ifnames.c

From: Gisle Vanem <gvanem@xxxxxxxxxxxx>
Date: Thu, 22 Nov 2012 18:20:01 +0100
The code in capture_win_ifnames.c assume there's always
a GUID in the ifname. Not so here. From my 'tcpdump -D':
 1: \\.\airpcap00
 2: \Device\NPF_GenericDialupAdapter
 3: \Device\NPF_{7F56352E-EF2F-49F4-844C-BA1FA0105667}
 4: \Device\NPF_{8D3A23A7-9C6C-408B-A23B-6736F9E56510}
 5: \Device\NPF_{37FC13D9-2F52-47CA-AB64-32B2B434C749}
 6: \Device\NPF_{75451EE7-5145-471A-BAF5-124BE8439D10}

So a "dumpcap.exe -L" complains:
Failed the extract guid from interface devicename, unicode convert result=14, guid input ='\\.\airpcap00', LastErrorCode=0x00000000. Failed the extract guid from interface devicename, unicode convert result=21, guid input ='GenericDialupAdapter', LastErrorCode=0x00000000.
...

Besides the code seems to need a Vista SDK since 'NETIO_STATUS' here
(Win-XP SP3) is only defined in <netioapi.h>. Which is not included AFAICS.
Verified by "cl -showIncludes". A small fix:


--- SVN-Latest\capture_win_ifnames.c    Thu Nov 22 01:56:25 2012
+++ capture_win_ifnames.c       Thu Nov 22 18:16:21 2012
@@ -48,6 +48,14 @@
#include "capture_ifinfo.h"
#include "capture_win_ifnames.h"
#include "wsutil/file_util.h"
+
+#ifndef NDIS_IF_MAX_STRING_SIZE
+#define NDIS_IF_MAX_STRING_SIZE IF_MAX_STRING_SIZE   /* =256 in <ifdef.h> */
+#endif
+
+#ifndef NETIO_STATUS
+#define NETIO_STATUS DWORD
+#endif

/* Link with ole32.lib - provides CLSIDFromString() to convert guid text to a GUID */
#pragma comment(lib, "ole32.lib")


--gv