mirror of https://github.com/AxioDL/boo.git
Windows fixes
This commit is contained in:
parent
048d22be2a
commit
64b949aecd
|
@ -174,7 +174,7 @@ class HIDDeviceWinUSB final : public IHIDDevice
|
||||||
std::unique_lock<std::mutex> lk(device->m_initMutex);
|
std::unique_lock<std::mutex> lk(device->m_initMutex);
|
||||||
|
|
||||||
/* POSIX.. who needs it?? -MS */
|
/* POSIX.. who needs it?? -MS */
|
||||||
m_overlapped.hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
|
device->m_overlapped.hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
|
||||||
device->m_hidHandle = CreateFileA(device->m_devPath.c_str(),
|
device->m_hidHandle = CreateFileA(device->m_devPath.c_str(),
|
||||||
GENERIC_WRITE | GENERIC_READ,
|
GENERIC_WRITE | GENERIC_READ,
|
||||||
FILE_SHARE_WRITE | FILE_SHARE_READ,
|
FILE_SHARE_WRITE | FILE_SHARE_READ,
|
||||||
|
@ -231,7 +231,7 @@ class HIDDeviceWinUSB final : public IHIDDevice
|
||||||
device->m_devImp.finalCycle();
|
device->m_devImp.finalCycle();
|
||||||
|
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
CloseHandle(m_overlapped.hEvent);
|
CloseHandle(device->m_overlapped.hEvent);
|
||||||
CloseHandle(device->m_hidHandle);
|
CloseHandle(device->m_hidHandle);
|
||||||
device->m_hidHandle = nullptr;
|
device->m_hidHandle = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -367,23 +367,11 @@ public:
|
||||||
fprintf(stderr, "Read Failed: %08X\n", Error);
|
fprintf(stderr, "Read Failed: %08X\n", Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else if (!GetOverlappedResultEx(m_hidHandle, &m_overlapped, &BytesRead, 10, TRUE))
|
||||||
{
|
|
||||||
if (!GetOverlappedResult(m_hidHandle, &m_overlapped, &BytesRead, FALSE))
|
|
||||||
{
|
|
||||||
Error = GetLastError();
|
|
||||||
if (Error == ERROR_IO_INCOMPLETE)
|
|
||||||
return;
|
|
||||||
fprintf(stderr, "Read Failed: %08X\n", Error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WaitForSingleObject(m_overlapped.hEvent, 10) != WAIT_OBJECT_0)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_devImp.receivedHIDReport(inBuffer, BytesRead, HIDReportType::Input, inBuffer[0]);
|
m_devImp.receivedHIDReport(inBuffer, BytesRead, HIDReportType::Input, inBuffer[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue