Something wrong with this patch ?

Stefan Siebert stefan.siebert at
Thu Aug 10 06:54:07 CDT 2006

I assume there's something wrong with my patch ?

I've did some research lately on how 32 Bit programs interact with 16Bit 
windows. This patch doesn't help if a SendMessage was sent from a 32Bit 
application because it gets dispatched from the 16Bit thread. So 
NtCurrentTeb doesn't work. At least it fixes uncaught WM_USER messages 
in the current process.

 >user - EditWndProc_common - Ignore WM_USER messages which are not sent 
 >from a vdm


 >this patch fixes a Notes Client crash when building the server console
 >tab (administration client). After creating a text control for console
 >commands it sends uncaught WM_USER messages which get interpreted by
 >Wine as 16Bit messages and crashes badly due to NULL pointers.

 >Changelog: user/edit.c - EditWndProc_common - Ignore WM_USER messages
 >which are not sent from a vdm

Stefan Siebert

-------------- next part --------------
diff --git a/dlls/user/edit.c b/dlls/user/edit.c
old mode 100644
new mode 100755
index c4f95e4..fd74183
--- a/dlls/user/edit.c
+++ b/dlls/user/edit.c
@@ -439,6 +439,10 @@ static LRESULT WINAPI EditWndProc_common
 	LRESULT result = 0;
         TRACE("hwnd=%p msg=%x (%s) wparam=%x lparam=%lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), wParam, lParam);
+	/* Ignore WM_USER messages which are not sent from a vdm */
+	if ((msg >= WM_USER) && (!NtCurrentTeb()->Tib.SubSystemTib))
+		return 0;
 	if (!es && msg != WM_NCCREATE)
 		return DefWindowProcT(hwnd, msg, wParam, lParam, unicode);

More information about the wine-devel mailing list