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.
This commit is contained in:
Léo Lam 2017-01-08 20:58:52 +01:00
parent 45b59f01b8
commit c761ac4f08
5 changed files with 5 additions and 18 deletions

View File

@ -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();
}

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;