Author: hbelusca
Date: Tue Jan 1 16:06:02 2013
New Revision: 58087
URL:
http://svn.reactos.org/svn/reactos?rev=58087&view=rev
Log:
[REGEDIT]
- Use REG_OPTION_NON_VOLATILE instead of 0 in RegCreateKeyEx.
- Do not rename keys when they have the same name, case-insensitive (as Windows does), fix
for r58079 / CORE-6205.
Modified:
trunk/reactos/base/applications/regedit/edit.c
trunk/reactos/base/applications/regedit/find.c
trunk/reactos/base/applications/regedit/regproc.c
trunk/reactos/base/applications/regedit/treeview.c
Modified: trunk/reactos/base/applications/regedit/edit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] Tue Jan 1 16:06:02 2013
@@ -1344,7 +1344,7 @@
}
/* create the destination subkey */
- lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, 0, KEY_WRITE, NULL,
+ lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE, NULL,
&hDestSubKey, &dwDisposition);
if (lResult)
goto done;
@@ -1399,11 +1399,11 @@
if (!lpSrcSubKey)
return ERROR_INVALID_FUNCTION;
- if (wcscmp(lpDestSubKey, lpSrcSubKey) == 0)
- {
- /* destination name equals source name */
- return ERROR_SUCCESS;
- }
+ if (_wcsicmp(lpDestSubKey, lpSrcSubKey) == 0)
+ {
+ /* Destination name equals source name */
+ return ERROR_SUCCESS;
+ }
lResult = CopyKey(hDestKey, lpDestSubKey, hSrcKey, lpSrcSubKey);
if (lResult == ERROR_SUCCESS)
Modified: trunk/reactos/base/applications/regedit/find.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/find.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/find.c [iso-8859-1] Tue Jan 1 16:06:02 2013
@@ -586,7 +586,7 @@
DWORD dwDisposition;
DWORD dwData;
- if (RegCreateKeyExW(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, NULL, 0, KEY_ALL_ACCESS,
NULL, &hKey, &dwDisposition) == ERROR_SUCCESS)
+ if (RegCreateKeyExW(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition) ==
ERROR_SUCCESS)
{
dwData = (dwFlags >> 0) & 0x0000FFFF;
RegSetValueExW(hKey, s_szFindFlags, 0, REG_DWORD, (const BYTE *) &dwData,
sizeof(dwData));
Modified: trunk/reactos/base/applications/regedit/regproc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/regproc.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/regproc.c [iso-8859-1] Tue Jan 1 16:06:02
2013
@@ -458,17 +458,16 @@
if (!parseKeyName(stdInput, &keyClass, &keyPath))
return ERROR_INVALID_PARAMETER;
- res = RegCreateKeyExW(
- keyClass, /* Class */
- keyPath, /* Sub Key */
- 0, /* MUST BE 0 */
- NULL, /* object type */
- REG_OPTION_NON_VOLATILE, /* option, REG_OPTION_NON_VOLATILE ... */
- KEY_ALL_ACCESS, /* access mask, KEY_ALL_ACCESS */
- NULL, /* security attribute */
- ¤tKeyHandle, /* result */
- &dwDisp); /* disposition, REG_CREATED_NEW_KEY or
- REG_OPENED_EXISTING_KEY */
+ res = RegCreateKeyExW(keyClass, /* Class */
+ keyPath, /* Sub Key */
+ 0, /* MUST BE 0 */
+ NULL, /* object type */
+ REG_OPTION_NON_VOLATILE, /* option, REG_OPTION_NON_VOLATILE
... */
+ KEY_ALL_ACCESS, /* access mask, KEY_ALL_ACCESS */
+ NULL, /* security attribute */
+ ¤tKeyHandle, /* result */
+ &dwDisp); /* disposition,
REG_CREATED_NEW_KEY or
+
REG_OPENED_EXISTING_KEY */
if (res == ERROR_SUCCESS)
currentKeyName = GetMultiByteString(stdInput);
Modified: trunk/reactos/base/applications/regedit/treeview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/treeview.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/treeview.c [iso-8859-1] Tue Jan 1 16:06:02
2013
@@ -593,7 +593,7 @@
do
{
wsprintf(szNewKey, szNewKeyFormat, iIndex++);
- nResult = RegCreateKeyExW(hKey, szNewKey, 0, NULL, 0, KEY_WRITE, NULL,
&hNewKey, &dwDisposition);
+ nResult = RegCreateKeyExW(hKey, szNewKey, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE, NULL, &hNewKey, &dwDisposition);
if (hNewKey && dwDisposition == REG_OPENED_EXISTING_KEY)
{
RegCloseKey(hNewKey);