From e54416f256042d432f31c0b1b611917288b2dcc5 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Tue, 1 Jan 2013 11:28:25 +0000 Subject: [PATCH] [REGEDIT] - Check if the new name equals the old name. In that case don't rename key. - Fixes regedit accidentaly deleting keys when a key is clicked and the rename field appears CORE-6205 #resolve #comment finally regedit is usable svn path=/trunk/; revision=58079 --- reactos/base/applications/regedit/edit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/base/applications/regedit/edit.c b/reactos/base/applications/regedit/edit.c index 4ff2ec94844..6ff13f0e3a3 100644 --- a/reactos/base/applications/regedit/edit.c +++ b/reactos/base/applications/regedit/edit.c @@ -1399,6 +1399,12 @@ static LONG MoveKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR l if (!lpSrcSubKey) return ERROR_INVALID_FUNCTION; + if (wcscmp(lpDestSubKey, lpSrcSubKey) == 0) + { + /* destination name equals source name */ + return ERROR_SUCCESS; + } + lResult = CopyKey(hDestKey, lpDestSubKey, hSrcKey, lpSrcSubKey); if (lResult == ERROR_SUCCESS) SHDeleteKey(hSrcKey, lpSrcSubKey);