IOS/ES: Implement ES_DeleteStreamKey (0x3d)

This commit is contained in:
Léo Lam 2017-05-22 11:22:53 +02:00
parent 90d590d1f3
commit 57ce091ef5
2 changed files with 14 additions and 2 deletions

View File

@ -514,9 +514,11 @@ IPCCommandResult ES::IOCtlV(const IOCtlVRequest& request)
case IOCTL_ES_GET_TICKET_FROM_VIEW: case IOCTL_ES_GET_TICKET_FROM_VIEW:
return GetTicketFromView(request); return GetTicketFromView(request);
case IOCTL_ES_DELETE_STREAM_KEY:
return DeleteStreamKey(request);
case IOCTL_ES_VERIFYSIGN: case IOCTL_ES_VERIFYSIGN:
case IOCTL_ES_UNKNOWN_3C: case IOCTL_ES_UNKNOWN_3C:
case IOCTL_ES_UNKNOWN_3D:
case IOCTL_ES_UNKNOWN_41: case IOCTL_ES_UNKNOWN_41:
case IOCTL_ES_UNKNOWN_42: case IOCTL_ES_UNKNOWN_42:
PanicAlert("IOS-ES: Unimplemented ioctlv 0x%x (%zu in vectors, %zu io vectors)", PanicAlert("IOS-ES: Unimplemented ioctlv 0x%x (%zu in vectors, %zu io vectors)",
@ -643,6 +645,15 @@ s32 ES::DIVerify(const IOS::ES::TMDReader& tmd, const IOS::ES::TicketReader& tic
return IPC_SUCCESS; return IPC_SUCCESS;
} }
IPCCommandResult ES::DeleteStreamKey(const IOCtlVRequest& request)
{
if (!request.HasNumberOfValidVectors(1, 0) || request.in_vectors[0].size != sizeof(u32))
return GetDefaultReply(ES_EINVAL);
const u32 handle = Memory::Read_U32(request.in_vectors[0].address);
return GetDefaultReply(m_ios.GetIOSC().DeleteObject(handle, PID_ES));
}
} // namespace Device } // namespace Device
} // namespace HLE } // namespace HLE
} // namespace IOS } // namespace IOS

View File

@ -184,7 +184,7 @@ private:
IOCTL_ES_DIGETTMD = 0x3A, IOCTL_ES_DIGETTMD = 0x3A,
IOCTL_ES_DIVERIFY_WITH_VIEW = 0x3B, IOCTL_ES_DIVERIFY_WITH_VIEW = 0x3B,
IOCTL_ES_UNKNOWN_3C = 0x3C, IOCTL_ES_UNKNOWN_3C = 0x3C,
IOCTL_ES_UNKNOWN_3D = 0x3D, IOCTL_ES_DELETE_STREAM_KEY = 0x3D,
IOCTL_ES_DELETE_CONTENT = 0x3E, IOCTL_ES_DELETE_CONTENT = 0x3E,
IOCTL_ES_INVALID_3F = 0x3F, IOCTL_ES_INVALID_3F = 0x3F,
IOCTL_ES_GET_V0_TICKET_FROM_VIEW = 0x40, IOCTL_ES_GET_V0_TICKET_FROM_VIEW = 0x40,
@ -234,6 +234,7 @@ private:
IPCCommandResult Launch(const IOCtlVRequest& request); IPCCommandResult Launch(const IOCtlVRequest& request);
IPCCommandResult LaunchBC(const IOCtlVRequest& request); IPCCommandResult LaunchBC(const IOCtlVRequest& request);
IPCCommandResult DIVerify(const IOCtlVRequest& request); IPCCommandResult DIVerify(const IOCtlVRequest& request);
IPCCommandResult DeleteStreamKey(const IOCtlVRequest& request);
// Title contents // Title contents
IPCCommandResult OpenTitleContent(u32 uid, const IOCtlVRequest& request); IPCCommandResult OpenTitleContent(u32 uid, const IOCtlVRequest& request);