From 94fc56c038879a6e97c0a8997bebac6884abe6be Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 24 Apr 2025 19:21:22 +0900 Subject: [PATCH] [COMCTL32][USER32] Edit: Don't unlock if unlocked on EM_SETHANDLE (#7886) JIRA issue: CORE-18944 EDIT_EM_GetHandle unlocks the handle, so the next EM_SETHANDLE handler shouldn't unlock the unlocked text. Don't unlock the handle when es->text was NULL on EM_SETHANDLE message handling. --- dll/win32/comctl32/edit.c | 3 +++ win32ss/user/user32/controls/edit.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dll/win32/comctl32/edit.c b/dll/win32/comctl32/edit.c index 36286b92161..9756d32f3f4 100644 --- a/dll/win32/comctl32/edit.c +++ b/dll/win32/comctl32/edit.c @@ -2715,6 +2715,9 @@ static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc) if (!hloc) return; +#ifdef __REACTOS__ + if (es->text) +#endif EDIT_UnlockBuffer(es, TRUE); es->hloc32W = hloc; diff --git a/win32ss/user/user32/controls/edit.c b/win32ss/user/user32/controls/edit.c index 9b0eac86988..a19690f8cd7 100644 --- a/win32ss/user/user32/controls/edit.c +++ b/win32ss/user/user32/controls/edit.c @@ -2898,6 +2898,9 @@ static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc) return; } +#ifdef __REACTOS__ + if (es->text) +#endif EDIT_UnlockBuffer(es, TRUE); if(es->is_unicode)