mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:23:34 +00:00
fix some bugs in regedit
like alloca -> HeapAlloc + HeapFree svn path=/trunk/; revision=18544
This commit is contained in:
parent
18d6c8993b
commit
25886dff5a
2 changed files with 15 additions and 6 deletions
|
@ -1620,17 +1620,26 @@ LONG RegRenameKey(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpNewName)
|
||||||
{
|
{
|
||||||
LPCTSTR s;
|
LPCTSTR s;
|
||||||
LPTSTR lpNewSubKey;
|
LPTSTR lpNewSubKey;
|
||||||
|
LONG Ret = 0;
|
||||||
|
|
||||||
s = _tcsrchr(lpSubKey, '\\');
|
s = _tcsrchr(lpSubKey, '\\');
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
s++;
|
s++;
|
||||||
lpNewSubKey = (LPTSTR) alloca((s - lpSubKey + _tcslen(lpNewName) + 1) * sizeof(TCHAR));
|
lpNewSubKey = (LPTSTR) HeapAlloc(GetProcessHeap(), 0, (s - lpSubKey + _tcslen(lpNewName) + 1) * sizeof(TCHAR));
|
||||||
memcpy(lpNewSubKey, lpSubKey, (s - lpSubKey) * sizeof(TCHAR));
|
if (lpNewName != NULL) {
|
||||||
_tcscpy(lpNewSubKey + (s - lpSubKey), lpNewName);
|
memcpy(lpNewSubKey, lpSubKey, (s - lpSubKey) * sizeof(TCHAR));
|
||||||
lpNewName = lpNewSubKey;
|
_tcscpy(lpNewSubKey + (s - lpSubKey), lpNewName);
|
||||||
|
lpNewName = lpNewSubKey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return RegMoveKey(hKey, lpNewName, hKey, lpSubKey);
|
if (lpNewName != NULL) {
|
||||||
|
Ret = RegMoveKey(hKey, lpNewName, hKey, lpSubKey);
|
||||||
|
if (s) {
|
||||||
|
HeapFree(GetProcessHeap(), 0, lpNewSubKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
LONG RegRenameValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpDestValue, LPCTSTR lpSrcValue)
|
LONG RegRenameValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpDestValue, LPCTSTR lpSrcValue)
|
||||||
|
|
|
@ -295,7 +295,7 @@ RegKeyEditPermissions(HWND hWndOwner,
|
||||||
LPCTSTR lpMachine,
|
LPCTSTR lpMachine,
|
||||||
LPCTSTR lpKeyName)
|
LPCTSTR lpKeyName)
|
||||||
{
|
{
|
||||||
BOOL Result;
|
BOOL Result = FALSE;
|
||||||
LPWSTR Machine, KeyName;
|
LPWSTR Machine, KeyName;
|
||||||
HKEY hInfoKey;
|
HKEY hInfoKey;
|
||||||
LPREGKEYSECURITY RegKeySecurity;
|
LPREGKEYSECURITY RegKeySecurity;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue