// but since we can't call on libusb_set_debug() before libusb_init(), we use the env variable method
old_dbg_str = getenv("LIBUSB_DEBUG");
if (debug_mode) {
- putenv("LIBUSB_DEBUG=4"); // LIBUSB_LOG_LEVEL_DEBUG
+ if (putenv("LIBUSB_DEBUG=4") != 0) // LIBUSB_LOG_LEVEL_DEBUG
+ printf("Unable to set debug level");
}
version = libusb_get_version();
// GetSystemTimeAsFileTime() is not available on CE
SYSTEMTIME st;
GetSystemTime(&st);
- SystemTimeToFileTime(&st, &filetime);
+ if (!SystemTimeToFileTime(&st, &filetime))
+ return 0;
rtime.LowPart = filetime.dwLowDateTime;
rtime.HighPart = filetime.dwHighDateTime;
rtime.QuadPart -= epoch_time;
break;
case 0x63: w = (ws?"8.1":"2012_R2");
break;
- case 0x64: w = (ws?"8.2":"2012_R3");
+ case 0x64: w = (ws?"10":"2015");
break;
default:
if (windows_version < 0x50)
windows_version = WINDOWS_UNSUPPORTED;
else
- w = "9 or later";
+ w = "11 or later";
break;
}
}
#if defined(_MSC_VER)
// disable /W4 MSVC warnings that are benign
-#pragma warning(disable:4127) // conditional expression is constant
-#pragma warning(disable:4100) // unreferenced formal parameter
-#pragma warning(disable:4214) // bit field types other than int
-#pragma warning(disable:4201) // nameless struct/union
+#pragma warning(disable:4100) // unreferenced formal parameter
+#pragma warning(disable:4127) // conditional expression is constant
+#pragma warning(disable:4201) // nameless struct/union
+#pragma warning(disable:4214) // bit field types other than int
+#pragma warning(disable:4996) // deprecated API calls
+#pragma warning(disable:28159) // more deprecated API calls
#endif
// Missing from MSVC6 setupapi.h
-#define LIBUSB_NANO 10921
+#define LIBUSB_NANO 10922