public virtual int sceKernelCreateMsgPipe(string name, int partitionid, int attr, int size, TPointer option) { if (option.NotNull) { int optionSize = option.getValue32(); Console.WriteLine(string.Format("sceKernelCreateMsgPipe option at {0}, size={1:D}", option, optionSize)); } int memType = PSP_SMEM_Low; if ((attr & PSP_MPP_ATTR_ADDR_HIGH) == PSP_MPP_ATTR_ADDR_HIGH) { memType = PSP_SMEM_High; } SceKernelMppInfo info = new SceKernelMppInfo(name, partitionid, attr, size, memType); if (!info.MemoryAllocated) { Console.WriteLine(string.Format("sceKernelCreateMsgPipe name='{0}', partitionId={1:D}, attr=0x{2:X}, size=0x{3:X}, option={4} not enough memory", name, partitionid, attr, size, option)); info.delete(); return(SceKernelErrors.ERROR_KERNEL_NO_MEMORY); } //if (log.DebugEnabled) { Console.WriteLine(string.Format("sceKernelCreateMsgPipe returning {0}", info)); } msgMap[info.uid] = info; return(info.uid); }
public virtual int sceKernelDeleteMsgPipe(int uid) { SceKernelMppInfo info = msgMap.Remove(uid); info.delete(); onMsgPipeDeleted(uid); return(0); }