mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
22 lines
540 B
C++
22 lines
540 B
C++
#include "Common/CommonWindows.h"
|
|
|
|
#include <hidsdi.h>
|
|
|
|
#include "HidCommon.h"
|
|
|
|
bool WriteReport(HANDLE handle, const u8 *data, size_t size) {
|
|
DWORD written;
|
|
bool result = WriteFile(handle, data, (DWORD)size, &written, NULL);
|
|
if (!result) {
|
|
u32 errorCode = GetLastError();
|
|
if (errorCode == ERROR_INVALID_PARAMETER) {
|
|
if (!HidD_SetOutputReport(handle, (PVOID)data, (DWORD)size)) {
|
|
errorCode = GetLastError();
|
|
}
|
|
}
|
|
WARN_LOG(Log::UI, "WriteReport: Failed initializing: %08x", errorCode);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|