Fixed convertion problem in FrmRegValueEditWord.cs

This commit is contained in:
StingRaptor 2016-02-07 14:33:29 +01:00
parent 150a5ab962
commit b8616f97f8
1 changed files with 7 additions and 5 deletions

View File

@ -164,20 +164,22 @@ private void okButton_Click(object sender, EventArgs e)
string text = GetDataAsString(DEC_BASE);
if (text != null)
{
//Make sure not same as before
if (text != ((uint)_value.Data).ToString())
if (_value.Kind == RegistryValueKind.DWord)
{
if (_value.Kind == RegistryValueKind.DWord)
if (text != ((uint)(int)_value.Data).ToString())
{
uint unsignedValue = Convert.ToUInt32(text);
object valueData = (int)(unsignedValue);
new xServer.Core.Packets.ServerPackets.DoChangeRegistryValue(_keyPath, new RegValueData(_value.Name, _value.Kind, valueData)).Execute(_connectClient);
}
else if (_value.Kind == RegistryValueKind.QWord)
}
else if (_value.Kind == RegistryValueKind.QWord)
{
if (text != ((ulong)(long)_value.Data).ToString())
{
ulong unsignedValue = Convert.ToUInt64(text);
object valueData = (int)(unsignedValue);
object valueData = (long)(unsignedValue);
new xServer.Core.Packets.ServerPackets.DoChangeRegistryValue(_keyPath, new RegValueData(_value.Name, _value.Kind, valueData)).Execute(_connectClient);
}