- 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.
svn path=/trunk/; revision=58087
}
/* 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;
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)
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));
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);
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);