Thanks again for the report and suggested fix. I personally have no Windows 8 (or 10) system available since none of my customers ever asked for that, but I can confirm that the code lines deleted by the proposed patch are not needed. So, I removed them and tested the patched version on Windows 7 (Professional, 64-bit).
I also committed the changes to the "testing" branch of our git repository, and if every compiles during the night (and all tests succeed), the changes should be visible in DCMTK's public git repository pretty soon (commit 64bbef6).
Code:
commit 64bbef6831804382a029d0d4e8a30e0f991ab2bf
Author: Joerg Riesmeier <obfuscated-email-address>
Date: Mon Feb 1 10:51:48 2016 +0100
Fixed issue with getMACAddress() on Windows 8++.
Fixed issue with getMACAddress() on some Windows 8 (and newer) systems.
Removed unneeded call to SnmpExtensionQuery() that caused a crash on such
systems.
Thanks to forum user "andreasb" for the report and suggested fix, and to
forum user "Rich in Soquel" for confirming that this fix also solves an
issue on Windows 10.
Closes DCMTK Bug #594 (hopefully)
diff --git a/dcmdata/libsrc/dcuid.cc b/dcmdata/libsrc/dcuid.cc
index 3fd3a3d..fbc558d 100644
--- a/dcmdata/libsrc/dcuid.cc
+++ b/dcmdata/libsrc/dcuid.cc
@@ -1466,7 +1466,6 @@ static unsigned char *getMACAddress(unsigned char buffer[6])
UINT OID_ipMACEntAddr[] = {1, 3, 6, 1, 2, 1, 2, 2, 1, 6};
AsnObjectIdentifier MIB_ifMACEntAddr = {sizeof(OID_ipMACEntAddr) / sizeof(UINT), OID_ipMACEntAddr};
AsnObjectIdentifier MIB_ifEntryType = {sizeof(OID_ifEntryType) / sizeof(UINT), OID_ifEntryType};
- AsnObjectIdentifier MIB_ifEntryNum = {sizeof(OID_ifEntryNum) / sizeof(UINT), OID_ifEntryNum};
SnmpVarBindList varBindList;
SnmpVarBind varBind[2];
AsnInteger32 errorStatus;
@@ -1484,10 +1483,6 @@ static unsigned char *getMACAddress(unsigned char buffer[6])
varBindList.list = varBind;
varBind[0].name = MIB_NULL;
varBind[1].name = MIB_NULL;
- /* copy in the OID to find the number of entries in the interface table */
- varBindList.len = 1; /* only retrieving one item */
- m_Copy(&varBind[0].name, &MIB_ifEntryNum);
- ret = m_Query(SNMP_PDU_GETNEXT, &varBindList, &errorStatus, &errorIndex);
varBindList.len = 2;
/* copy in the OID of ifType, the type of interface */
m_Copy(&varBind[0].name, &MIB_ifEntryType);