From 8ba2cd78ae167fd71c64073acfcb81f2ce64a851 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Thu, 27 Feb 2025 23:18:02 -0700 Subject: [PATCH] [0.4.15][CALC][SECLOGON][REGEDIT] Various small bugfixes Fixes CORE-19745, CORE-19793, CORE-19743 This is a squashed backport of the following commits: 30b4024 [CALC] Fix copy command when output is NaN (#7496) 0e462a3 [SECLOGON] Add missing service status updates 17eff53 [REGEDIT] Add ES_AUTOHSCROLL to address bar window (#7638) Co-Authored-By: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com> Co-Authored-By: Eric Kohl <32571919+EricKohl@users.noreply.github.com> Co-Authored-By: Katayama Hirofumi MZ --- base/applications/calc/winmain.c | 10 ++++++++-- base/applications/regedit/childwnd.c | 3 ++- base/services/seclogon/seclogon.c | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/base/applications/calc/winmain.c b/base/applications/calc/winmain.c index b2ab16cd0e2..54025b64999 100644 --- a/base/applications/calc/winmain.c +++ b/base/applications/calc/winmain.c @@ -1015,10 +1015,16 @@ static void handle_copy_command(HWND hWnd) TCHAR display[MAX_CALC_SIZE]; UINT n; + // Read current text from output display n = GetDlgItemText(hWnd, IDC_TEXT_OUTPUT, display, SIZEOF(display)); - if (calc.base == IDC_RADIO_DEC && _tcschr(calc.buffer, _T('.')) == NULL) - display[n - calc.sDecimal_len] = _T('\0'); + // Check if result is a true number + if (!calc.is_nan) + { + // Remove trailing decimal point if no decimal digits exist + if (calc.base == IDC_RADIO_DEC && _tcschr(calc.buffer, _T('.')) == NULL) + display[n - calc.sDecimal_len] = _T('\0'); + } CopyMemToClipboard(display); } diff --git a/base/applications/regedit/childwnd.c b/base/applications/regedit/childwnd.c index b08736e5322..1cd0dc787ed 100644 --- a/base/applications/regedit/childwnd.c +++ b/base/applications/regedit/childwnd.c @@ -388,7 +388,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa g_pChildWnd->nSplitPos = 190; g_pChildWnd->hWnd = hWnd; - style = WS_CHILD | WS_VISIBLE | WS_TABSTOP; + /* ES_AUTOHSCROLL style enables horizontal scrolling and shrinking */ + style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL; g_pChildWnd->hAddressBarWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Edit", NULL, style, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hWnd, (HMENU)0, hInst, 0); diff --git a/base/services/seclogon/seclogon.c b/base/services/seclogon/seclogon.c index efe5ce4f853..b15fb22aa03 100644 --- a/base/services/seclogon/seclogon.c +++ b/base/services/seclogon/seclogon.c @@ -74,6 +74,7 @@ ServiceControlHandlerEx( TRACE(" SERVICE_CONTROL_STOP received\n"); UpdateServiceStatus(SERVICE_STOP_PENDING); StopRpcServer(); + UpdateServiceStatus(SERVICE_STOPPED); return ERROR_SUCCESS; case SERVICE_CONTROL_PAUSE: @@ -100,6 +101,7 @@ ServiceControlHandlerEx( TRACE(" SERVICE_CONTROL_SHUTDOWN received\n"); UpdateServiceStatus(SERVICE_STOP_PENDING); StopRpcServer(); + UpdateServiceStatus(SERVICE_STOPPED); return ERROR_SUCCESS; default :