Exemple #1
0
        [CommandHipc(7)] // 9.0.0+
        // SetDeviceLocationNameWithTimeZoneRule(nn::time::LocationName locationName, buffer<nn::time::TimeZoneBinary, 0x21> timeZoneBinary)
        public ResultCode SetDeviceLocationNameWithTimeZoneRule(ServiceCtx context)
        {
            if (!_writePermission)
            {
                return(ResultCode.PermissionDenied);
            }

            (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x21();

            string locationName = StringUtils.ReadInlinedAsciiString(context.RequestData, 0x24);

            ResultCode result;

            byte[] temp = new byte[bufferSize];

            context.Memory.Read(bufferPosition, temp);

            using (MemoryStream timeZoneBinaryStream = new MemoryStream(temp))
            {
                result = _timeZoneManager.SetDeviceLocationNameWithTimeZoneRule(locationName, timeZoneBinaryStream);
            }

            return(result);
        }
        [CommandHipc(7)] // 9.0.0+
        // SetDeviceLocationNameWithTimeZoneRule(nn::time::LocationName locationName, buffer<nn::time::TimeZoneBinary, 0x21> timeZoneBinary)
        public ResultCode SetDeviceLocationNameWithTimeZoneRule(ServiceCtx context)
        {
            if (!_writePermission)
            {
                return(ResultCode.PermissionDenied);
            }

            (long bufferPosition, long bufferSize) = context.Request.GetBufferType0x21();

            string locationName = Encoding.ASCII.GetString(context.RequestData.ReadBytes(0x24)).TrimEnd('\0');

            ResultCode result;

            byte[] temp = new byte[bufferSize];

            context.Memory.Read((ulong)bufferPosition, temp);

            using (MemoryStream timeZoneBinaryStream = new MemoryStream(temp))
            {
                result = _timeZoneManager.SetDeviceLocationNameWithTimeZoneRule(locationName, timeZoneBinaryStream);
            }

            return(result);
        }