user32: Keep track of whether the app has asked for the text buffer handle.
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 @@
 #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 @@
 	    hLocal = es->hloc32A;
 	}
 
+        es->flags |= EF_APP_HAS_HANDLE;
 	TRACE("Returning %p, LocalSize() = %ld\n", hLocal, LocalSize(hLocal));
 	return hLocal;
 }
@@ -2777,6 +2779,7 @@
 
 	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 @@
 
 	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 @@
 
 	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;