Huw Davies : user32: Keep track of whether the app has asked for the text buffer handle.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 20 07:11:03 CDT 2007


Module: wine
Branch: master
Commit: c79ce3cdbe84f8b02938748a05fe89f722278370
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c79ce3cdbe84f8b02938748a05fe89f722278370

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Apr 19 14:47:12 2007 +0100

user32: Keep track of whether the app has asked for the text buffer handle.

---

 dlls/user32/edit.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index bbd8a05..1207d05 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -83,7 +83,8 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
 #define EF_AFTER_WRAP		0x0080	/* the caret is displayed after the last character of a
 					   wrapped line, instead of in front of the next character */
 #define EF_USE_SOFTBRK		0x0100	/* Enable soft breaks in text. */
-
+#define EF_APP_HAS_HANDLE       0x0200  /* Set when an app sends EM_[G|S]ETHANDLE.  We are in sole control of
+                                           the text buffer if this is clear. */
 typedef enum
 {
 	END_0 = 0,			/* line ends with terminating '\0' character */
@@ -2713,6 +2714,7 @@ static HLOCAL EDIT_EM_GetHandle(EDITSTATE *es)
 	    hLocal = es->hloc32A;
 	}
 
+        es->flags |= EF_APP_HAS_HANDLE;
 	TRACE("Returning %p, LocalSize() = %ld\n", hLocal, LocalSize(hLocal));
 	return hLocal;
 }
@@ -2777,6 +2779,7 @@ static HLOCAL16 EDIT_EM_GetHandle16(EDITSTATE *es)
 
 	WideCharToMultiByte(CP_ACP, 0, es->text, -1, textA, countA, NULL, NULL);
 	LocalUnlock16(es->hloc16);
+        es->flags |= EF_APP_HAS_HANDLE;
 
 	TRACE("Returning %04X, LocalSize() = %d\n", es->hloc16, LocalSize16(es->hloc16));
 
@@ -3534,6 +3537,7 @@ static void EDIT_EM_SetHandle(EDITSTATE *es, HLOCAL hloc)
 
 	es->buffer_size = LocalSize(es->hloc32W)/sizeof(WCHAR) - 1;
 
+        es->flags |= EF_APP_HAS_HANDLE;
 	EDIT_LockBuffer(es);
 
 	es->x_offset = es->y_offset = 0;
@@ -3605,6 +3609,7 @@ static void EDIT_EM_SetHandle16(EDITSTATE *es, HLOCAL16 hloc)
 
 	es->buffer_size = LocalSize(es->hloc32W)/sizeof(WCHAR) - 1;
 
+        es->flags |= EF_APP_HAS_HANDLE;
 	EDIT_LockBuffer(es);
 
 	es->x_offset = es->y_offset = 0;




More information about the wine-cvs mailing list