summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii/wiiyourself
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-wii/wiiyourself')
-rw-r--r--tracker-wii/wiiyourself/wiimote.cpp4
-rw-r--r--tracker-wii/wiiyourself/wiimote.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/tracker-wii/wiiyourself/wiimote.cpp b/tracker-wii/wiiyourself/wiimote.cpp
index e1e49101..e7a8ca90 100644
--- a/tracker-wii/wiiyourself/wiimote.cpp
+++ b/tracker-wii/wiiyourself/wiimote.cpp
@@ -255,7 +255,9 @@ bool wiimote::Connect (unsigned wiimote_index, bool force_hidwrites)
{
// get the buffer size for this device detail instance
DWORD req_size = 0;
- SetupDiGetDeviceInterfaceDetail(dev_info, &didata, NULL, 0, &req_size, NULL);
+ (void)SetupDiGetDeviceInterfaceDetail(dev_info, &didata, NULL, 0, &req_size, NULL);
+ if (req_size < sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA))
+ WARN(_T("couldn't get device size for %u"), index);
// (bizarre way of doing it) create a buffer large enough to hold the
// fixed-size detail struct components, and the variable string size
diff --git a/tracker-wii/wiiyourself/wiimote.h b/tracker-wii/wiiyourself/wiimote.h
index 3588b7c7..27551c76 100644
--- a/tracker-wii/wiiyourself/wiimote.h
+++ b/tracker-wii/wiiyourself/wiimote.h
@@ -10,6 +10,7 @@
#pragma once
+#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h> // auto Unicode/Ansi support