rawinput controller feedback fix

This commit is contained in:
Turanszki Janos
2019-12-04 00:46:08 +00:00
parent fdfce122b0
commit d85d6096c1
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -298,9 +298,12 @@ namespace wiRawInput
{
if (index < controller_handles.size())
{
HANDLE hid_device = CreateFile(controller_lookup[controller_handles[index]].name.c_str(), GENERIC_READ | GENERIC_WRITE,
HANDLE hid_device = CreateFile(
controller_lookup[controller_handles[index]].name.c_str(),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, 0, NULL);
OPEN_EXISTING, 0, NULL
);
assert(hid_device != INVALID_HANDLE_VALUE);
uint8_t buf[32] = {};
buf[0] = 0x05;
@@ -311,7 +314,8 @@ namespace wiRawInput
buf[7] = data.led_color.getG();
buf[8] = data.led_color.getB();
DWORD bytes_written;
assert(WriteFile(hid_device, buf, sizeof(buf), &bytes_written, NULL));
BOOL result = WriteFile(hid_device, buf, sizeof(buf), &bytes_written, NULL);
assert(result == TRUE);
assert(bytes_written == arraysize(buf));
CloseHandle(hid_device);
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 35;
// minor bug fixes, alterations, refactors, updates
const int revision = 10;
const int revision = 11;
long GetVersion()