From c761ac4f08d43e98820b7b7f1f847d52c61a6c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 8 Jan 2017 20:58:52 +0100 Subject: [PATCH] IOS HLE: Set return value to EINVAL for unknown commands This matches IOS behaviour and allows getting rid of command handlers which merely set the return value to EINVAL. --- Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp | 5 +++++ .../Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp | 8 -------- Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h | 1 - .../Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp | 8 -------- Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h | 1 - 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp index 3e79ec5fe4..ef9ecd616c 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device.cpp @@ -81,30 +81,35 @@ IPCCommandResult IWII_IPC_HLE_Device::Close(u32 command_address, bool force) IPCCommandResult IWII_IPC_HLE_Device::Seek(u32 command_address) { WARN_LOG(WII_IPC_HLE, "%s does not support Seek()", m_name.c_str()); + Memory::Write_U32(IPC_EINVAL, command_address); return GetDefaultReply(); } IPCCommandResult IWII_IPC_HLE_Device::Read(u32 command_address) { WARN_LOG(WII_IPC_HLE, "%s does not support Read()", m_name.c_str()); + Memory::Write_U32(IPC_EINVAL, command_address); return GetDefaultReply(); } IPCCommandResult IWII_IPC_HLE_Device::Write(u32 command_address) { WARN_LOG(WII_IPC_HLE, "%s does not support Write()", m_name.c_str()); + Memory::Write_U32(IPC_EINVAL, command_address); return GetDefaultReply(); } IPCCommandResult IWII_IPC_HLE_Device::IOCtl(u32 command_address) { WARN_LOG(WII_IPC_HLE, "%s does not support IOCtl()", m_name.c_str()); + Memory::Write_U32(IPC_EINVAL, command_address); return GetDefaultReply(); } IPCCommandResult IWII_IPC_HLE_Device::IOCtlV(u32 command_address) { WARN_LOG(WII_IPC_HLE, "%s does not support IOCtlV()", m_name.c_str()); + Memory::Write_U32(IPC_EINVAL, command_address); return GetDefaultReply(); } diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp index 1c8192162c..4f6b9d77b0 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp @@ -50,14 +50,6 @@ void RestoreBTInfoSection(SysConf* sysconf) File::Delete(filename); } -IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_base::IOCtl(u32 command_address) -{ - // NeoGamma (homebrew) is known to use this path. - ERROR_LOG(WII_IPC_WIIMOTE, "Bad IOCtl to /dev/usb/oh1/57e/305"); - Memory::Write_U32(IPC_EINVAL, command_address + 4); - return GetDefaultReply(); -} - CWII_IPC_HLE_Device_usb_oh1_57e_305_base::CtrlMessage::CtrlMessage(const SIOCtlVBuffer& cmd_buffer) { request_type = Memory::Read_U8(cmd_buffer.InBuffer[0].m_Address); diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h index ffc1a32286..07a3807b7f 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h @@ -28,7 +28,6 @@ public: virtual IPCCommandResult Open(u32 command_address, u32 mode) override = 0; virtual IPCCommandResult Close(u32 command_address, bool force) override = 0; - IPCCommandResult IOCtl(u32 command_address) override; virtual IPCCommandResult IOCtlV(u32 command_address) override = 0; virtual void DoState(PointerWrap& p) override = 0; diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp index 1de1e473d6..1750cbf703 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp @@ -172,14 +172,6 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::Close(u32 _CommandAddr return GetDefaultReply(); } -IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::IOCtl(u32 _CommandAddress) -{ - // NeoGamma (homebrew) is known to use this path. - ERROR_LOG(WII_IPC_WIIMOTE, "Bad IOCtl in CWII_IPC_HLE_Device_usb_oh1_57e_305"); - Memory::Write_U32(IPC_EINVAL, _CommandAddress + 4); - return GetDefaultReply(); -} - IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::IOCtlV(u32 _CommandAddress) { bool _SendReply = false; diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h index 0fb8a4ef75..8161819ed1 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h @@ -47,7 +47,6 @@ public: IPCCommandResult Close(u32 _CommandAddress, bool _bForce) override; IPCCommandResult IOCtlV(u32 _CommandAddress) override; - IPCCommandResult IOCtl(u32 _CommandAddress) override; u32 Update() override;