Author: tfaber
Date: Sun Jul 30 16:34:27 2017
New Revision: 75459
URL:
http://svn.reactos.org/svn/reactos?rev=75459&view=rev
Log:
[0.4.6]
- Merge regedit fix (r75458) by Joachim & Mark
CORE-13071
Modified:
branches/ros-branch-0_4_6/ (props changed)
branches/ros-branch-0_4_6/reactos/ (props changed)
branches/ros-branch-0_4_6/reactos/base/applications/regedit/CMakeLists.txt
branches/ros-branch-0_4_6/reactos/base/applications/regedit/framewnd.c
branches/ros-branch-0_4_6/reactos/base/applications/regedit/settings.c
Propchange: branches/ros-branch-0_4_6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jul 30 16:34:27 2017
@@ -1,2 +1,2 @@
/branches/colins-printing-for-freedom:67543-68405,68407-68414,68417-70595
-/trunk:75451
+/trunk:75451,75458
Propchange: branches/ros-branch-0_4_6/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jul 30 16:34:27 2017
@@ -23,4 +23,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:75451
+/trunk/reactos:75451,75458
Modified: branches/ros-branch-0_4_6/reactos/base/applications/regedit/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_6/reactos/base/a…
==============================================================================
---
branches/ros-branch-0_4_6/reactos/base/applications/regedit/CMakeLists.txt [iso-8859-1]
(original)
+++
branches/ros-branch-0_4_6/reactos/base/applications/regedit/CMakeLists.txt [iso-8859-1]
Sun Jul 30 16:34:27 2017
@@ -23,7 +23,7 @@
add_executable(regedit ${SOURCE} regedit.rc)
set_module_type(regedit win32gui UNICODE)
target_link_libraries(regedit uuid)
-add_importlibs(regedit user32 gdi32 advapi32 ole32 shell32 comctl32 comdlg32 shlwapi
msvcrt kernel32)
+add_importlibs(regedit user32 gdi32 advapi32 ole32 shell32 comctl32 comdlg32 shlwapi
msvcrt kernel32 ntdll)
add_pch(regedit regedit.h SOURCE)
add_cd_file(TARGET regedit DESTINATION reactos FOR all)
#add_subdirectory(clb)
Modified: branches/ros-branch-0_4_6/reactos/base/applications/regedit/framewnd.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_6/reactos/base/a…
==============================================================================
--- branches/ros-branch-0_4_6/reactos/base/applications/regedit/framewnd.c [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_6/reactos/base/applications/regedit/framewnd.c [iso-8859-1]
Sun Jul 30 16:34:27 2017
@@ -1033,7 +1033,6 @@
LPCWSTR valueName;
BOOL result = TRUE;
REGSAM regsam = KEY_READ;
- LONG lRet;
int item;
UNREFERENCED_PARAMETER(lParam);
@@ -1125,13 +1124,11 @@
keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
valueName = GetValueName(g_pChildWnd->hListWnd, -1);
-
- if (!keyPath)
- return TRUE;
-
- lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey);
- if (lRet != ERROR_SUCCESS)
- hKey = 0;
+ if (keyPath)
+ {
+ if (RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey) != ERROR_SUCCESS)
+ hKey = 0;
+ }
switch (LOWORD(wParam))
{
@@ -1165,7 +1162,7 @@
break;
case ID_EDIT_DELETE:
{
- if (GetFocus() == g_pChildWnd->hListWnd)
+ if (GetFocus() == g_pChildWnd->hListWnd && hKey)
{
UINT nSelected = ListView_GetSelectedCount(g_pChildWnd->hListWnd);
if(nSelected >= 1)
@@ -1201,7 +1198,7 @@
}
else if (GetFocus() == g_pChildWnd->hTreeWnd)
{
- if (keyPath == 0 || *keyPath == 0)
+ if (keyPath == NULL || *keyPath == UNICODE_NULL)
{
MessageBeep(MB_ICONHAND);
}
Modified: branches/ros-branch-0_4_6/reactos/base/applications/regedit/settings.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_6/reactos/base/a…
==============================================================================
--- branches/ros-branch-0_4_6/reactos/base/applications/regedit/settings.c [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_6/reactos/base/applications/regedit/settings.c [iso-8859-1]
Sun Jul 30 16:34:27 2017
@@ -23,6 +23,7 @@
#include <strsafe.h>
const WCHAR g_szGeneralRegKey[] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit";
+DECLSPEC_IMPORT ULONG WINAPIV DbgPrint(PCH Format,...);
/*
VV,VV,VV,VV,WA,WA,WA,WA,WB,WB,WB,WB,R1,R1,R1,R1
@@ -122,25 +123,31 @@
{
RegistryBinaryConfig tConfig;
DWORD iBufferSize = sizeof(tConfig);
- WCHAR szBuffer[MAX_PATH];
+ WCHAR szBuffer[MAX_PATH]; /* FIXME: a complete registry path can be longer than
that */
LPCWSTR keyPath, rootName;
HKEY hRootKey;
/* Save key position */
keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
- if (keyPath)
+ rootName = get_root_key_name(hRootKey);
+
+ /* Load "My Computer" string and complete it */
+ if (LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer)) &&
+ SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\"))
&&
+ SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), rootName)) &&
+ SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\")))
{
- rootName = get_root_key_name(hRootKey);
-
- /* Load "My Computer" string and complete it */
- if (LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer))
&&
- SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\"))
&&
- SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), rootName)) &&
- SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\"))
&&
- SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), keyPath)))
- {
+ HRESULT hr = S_OK;
+ if (keyPath)
+ hr = StringCbCatW(szBuffer, sizeof(szBuffer), keyPath);
+ if (SUCCEEDED(hr))
RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE)szBuffer,
(DWORD)wcslen(szBuffer) * sizeof(WCHAR));
- }
+ else
+ DbgPrint("err: (%s:%d): Buffer not big enough for '%S +
%S'\n", __FILE__, __LINE__, rootName, keyPath);
+ }
+ else
+ {
+ DbgPrint("err: (%s:%d): Buffer not big enough for '%S'\n",
__FILE__, __LINE__, rootName);
}
/* Get statusbar settings */