Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/Hid/HidCommon.cpp
5692 views
1
#include "Common/CommonWindows.h"
2
3
#include <hidsdi.h>
4
5
#include "HidCommon.h"
6
7
bool WriteReport(HANDLE handle, const u8 *data, size_t size) {
8
DWORD written;
9
bool result = WriteFile(handle, data, (DWORD)size, &written, NULL);
10
if (!result) {
11
u32 errorCode = GetLastError();
12
if (errorCode == ERROR_INVALID_PARAMETER) {
13
if (!HidD_SetOutputReport(handle, (PVOID)data, (DWORD)size)) {
14
errorCode = GetLastError();
15
}
16
}
17
WARN_LOG(Log::UI, "WriteReport: Failed initializing: %08x", errorCode);
18
return false;
19
}
20
return true;
21
}
22
23