Exemplo n.º 1
0
        private NvInternalResult FromId(ref NvMapFromId arguments)
        {
            NvMapHandle map = GetMapFromHandle(Owner, arguments.Id);

            if (map == null)
            {
                Logger.Warning?.Print(LogClass.ServiceNv, $"Invalid handle 0x{arguments.Handle:x8}!");

                return(NvInternalResult.InvalidInput);
            }

            map.IncrementRefCount();

            arguments.Handle = arguments.Id;

            return(NvInternalResult.Success);
        }
Exemplo n.º 2
0
        private static int FromId(ServiceCtx context)
        {
            long inputPosition  = context.Request.GetBufferType0x21().Position;
            long outputPosition = context.Request.GetBufferType0x22().Position;

            NvMapFromId args = MemoryHelper.Read <NvMapFromId>(context.Memory, inputPosition);

            NvMapHandle map = GetNvMap(context, args.Id);

            if (map == null)
            {
                Logger.PrintWarning(LogClass.ServiceNv, $"Invalid handle 0x{args.Handle:x8}!");

                return(NvResult.InvalidInput);
            }

            map.IncrementRefCount();

            args.Handle = args.Id;

            MemoryHelper.Write(context.Memory, outputPosition, args);

            return(NvResult.Success);
        }