[Kernel] Fix return of XamUserGetDeviceContext.

This commit is contained in:
gibbed 2018-05-27 19:34:38 -05:00
parent dc5bd83098
commit da06cb4f06
1 changed files with 8 additions and 10 deletions

View File

@ -28,15 +28,13 @@ using xe::hid::X_INPUT_VIBRATION;
constexpr uint32_t XINPUT_FLAG_GAMEPAD = 0x01;
constexpr uint32_t XINPUT_FLAG_ANY_USER = 1 << 30;
dword_result_t XamResetInactivity(dword_t unk) {
// Result ignored.
return 0;
void XamResetInactivity() {
// Do we need to do anything?
}
DECLARE_XAM_EXPORT(XamResetInactivity, ExportTag::kInput | ExportTag::kStub);
dword_result_t XamEnableInactivityProcessing(dword_t zero, dword_t unk) {
// Expects 0.
return 0;
dword_result_t XamEnableInactivityProcessing(dword_t unk, dword_t enable) {
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT(XamEnableInactivityProcessing,
ExportTag::kInput | ExportTag::kStub);
@ -186,16 +184,16 @@ dword_result_t XamInputGetKeystrokeEx(lpdword_t user_index_ptr, dword_t flags,
DECLARE_XAM_EXPORT(XamInputGetKeystrokeEx,
ExportTag::kInput | ExportTag::kImplemented);
dword_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk,
lpdword_t out_ptr) {
X_HRESULT_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk,
lpdword_t out_ptr) {
// Games check the result - usually with some masking.
// If this function fails they assume zero, so let's fail AND
// set zero just to be safe.
*out_ptr = 0;
if (!user_index || (user_index & 0xFF) == 0xFF) {
return 0;
return X_E_SUCCESS;
} else {
return -1;
return X_E_DEVICE_NOT_CONNECTED;
}
}
DECLARE_XAM_EXPORT(XamUserGetDeviceContext,