Fix a weird sceKernelTrySendMsgPipe() edge case.

This commit is contained in:
Unknown W. Brackets 2013-08-18 14:57:30 -07:00
parent 769bac3acf
commit 6750794c8a

View File

@ -477,7 +477,12 @@ int __KernelSendMsgPipe(MsgPipe *m, u32 sendBufAddr, u32 sendSize, int waitMode,
if (sendSize != 0 && (waitMode != SCE_KERNEL_MPW_ASAP || curSendAddr == sendBufAddr))
{
if (poll)
{
// Generally, result is not set to 0 in this case. But for a 0 size buffer in ASAP mode, it is.
if (Memory::IsValidAddress(resultAddr) && waitMode == SCE_KERNEL_MPW_ASAP)
Memory::Write_U32(curSendAddr - sendBufAddr, resultAddr);
return SCE_KERNEL_ERROR_MPP_FULL;
}
else
{
m->AddSendWaitingThread(__KernelGetCurThread(), curSendAddr, sendSize, waitMode, resultAddr);