Update ISystemSettingsServer.cs

This commit is contained in:
Ac_K 2018-04-26 02:41:20 +02:00 committed by GitHub
parent 4bcf8239de
commit 90ce629417
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,9 +110,14 @@ namespace Ryujinx.Core.OsHle.Services.Set
if (NxSetting is string StringValue)
{
//Ain't be able to test, so we need to know what the size of ReplySize is...
//Array.Resize(ref SettingBuffer, StringValue.Length);
SettingBuffer = Encoding.ASCII.GetBytes(StringValue);
if (StringValue.Length + 1 > ReplySize)
{
Context.Ns.Log.PrintError(Logging.LogClass.ServiceSet, $"{AskedSetting} String value size is too big!");
}
else
{
SettingBuffer = Encoding.ASCII.GetBytes(StringValue);
}
}
if (NxSetting is int IntValue)
{
@ -129,9 +134,12 @@ namespace Ryujinx.Core.OsHle.Services.Set
AMemoryHelper.WriteBytes(Context.Memory, ReplyPos, SettingBuffer);
Context.Ns.Log.PrintInfo(Logging.LogClass.ServiceSet, $"{AskedSetting} set value: {NxSetting} as {NxSetting.GetType()}");
Context.Ns.Log.PrintDebug(Logging.LogClass.ServiceSet, $"{AskedSetting} set value: {NxSetting} as {NxSetting.GetType()}");
}
else
{
Context.Ns.Log.PrintError(Logging.LogClass.ServiceSet, $"{AskedSetting} not found!");
}
else Context.Ns.Log.PrintError(Logging.LogClass.ServiceSet, $"{AskedSetting} not found!");
return 0;
}