Release 950901

Thu Aug 31 17:19:57 1995  Alexandre Julliard  <julliard@sunsite.unc.edu>

	* [Configure]
	Added compile-time option for IPC.

	* [configure.in]
	Added command-line options for language, IPC and malloc
	debugging.

	* [controls/menu.c]
	WM_MENUSELECT was sometimes sent to the wrong window.

	* [debugger/break.c]
	For the 'next' command, only step over instruction that require
	it. This allows 'next' to do the right thing with jmp and ret
	instructions.

	* [ipc/*.c] [memory/atom.c] [memory/global.c]
	IPC can now be configured out at compile-time.

	* [loader/task.c]
	Bug fix in TASK_Reschedule() that could cause a task to be deleted
	twice.

	* [miscemu/dosmem.c] (New file)
	Partial emulation of the BIOS data segment.

	* [miscemu/instr.c]
	Trap attempts to access selector 0x40 and remap the access to
	segment __0040H.

	* [tools/build.c]
	Fixed bug in CallTo32_LargeStack() that caused problems when
	compiling Wine with the -fomit-frame-pointer option.

	* [windows/message.c]
	Fixed bug in hardware event handling that could cause some events
	to get ignored.

Sat Aug 26 13:12:59 IST 1995 Michael Veksler <mveksler@vnet.ibm.com>

	* [ipc/README] [ipc/dde.tex]
	LaTeX documentation for the ipc and DDE stuff.

Wed Aug 23 22:01:23 GMT 1995 Michael Veksler <mveksler@vnet.ibm.com>

	* [ipc/Imakefile] [ipc/wine_test_stub.c]
	Fixed IPC testing. Now it can be compiled with "make tests"

Wed Aug 23 21:04:14 1995  Fons Botman  <botman@wab-tis.rabobank.nl>

	* [if1632/kernel.spec] [include/windows.h] [misc/main.c]
	Added GetWinDebugInfo/SetWinDebugInfo stub for player.exe

Sun Aug  20 13:49:42 1995  Marcus Meissner  <msmeissn@faui01.informatik.uni-erlangen.de>

	* [miscemu/int21.c]
	Misc fix to int21,ah=40 (write) to match _lwrite().
	AX=0x440A (check if handle is remote) added.

	* [multimedia/mmsystem.c]
	Moved mciSendString to mcistring.c.

	* [multimedia/mcistring.c]
	New file, string interface for MCI (not complete, not thoroughly
	tested).

	* [multimedia/audio.c]
	IOCTL prints errors; one paranoid check disabled.

	* [misc/file.c]
	Misc operator precedence fixes.

	* [if1632/gdi.spec] [objects/bitblt.c]
	Stub for FastWindowFrame (parameters not correct).

Sat Aug 19 01:31:23 1995  Graham Menhennitt <gfm@werple.mira.net.au>

	* [loader/ne_image.c]
	Preliminary support for iterated segments.

Sat Aug 19 00:43:04 1995  Andrew Taylor  (andrew@riscan.com)

	* [windows/mapping.c]
	In function MAPPING_FixIsotropic(), VportExt[XY] is multiplied by
 	the absolute value of (ydim / xdim) or (xdim / ydim).

Thu Aug 15 23:00:16  Gregory Trubetskoy  <grisha@mira.com>

	* [objects/oembitmap.c]
	Added some includes for Windows 95.

	* [include/sysmetrics.h]
	Added some sysmetrics for Windows 95.

	* [include/bitmaps/*95]
	New files: obm_close_95, obm_closed_95, obm_reduce_95, obm_reduced_95
	obm_zoom_95, obm_zoomd_95 - these are some pixmaps for Windows 95.

Thu Aug 10 12:00:00 1995  Jan Willamowius  (jan@janhh.shnet.org)

	* [misc/shell.c] [rc/sysres*.rc]
	The caption of the ShellAbout dialog box is language specific and
 	should be defined in the resources.
diff --git a/windows/message.c b/windows/message.c
index 0457e36..72cb9ab 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -28,15 +28,6 @@
 #define MAX_QUEUE_SIZE   120  /* Max. size of a message queue */
 
 
-/* used for passing message information when sending message */ 
-typedef struct {
-    LONG lParam;
-    WORD wParam;
-    WORD wMsg;
-    WORD hWnd;
-} msgstruct;
-
-
 extern BOOL TIMER_CheckTimer( LONG *next, MSG *msg,
 			      HWND hwnd, BOOL remove );  /* timer.c */
 
@@ -146,8 +137,8 @@
 {
     int i, pos = msgQueue->nextMessage;
 
-    dprintf_msg(stddeb,"MSG_FindMsg: hwnd=0x%04x, proc=%d\n",
-		hwnd, curr_proc_idx);
+    dprintf_msg(stddeb,"MSG_FindMsg: hwnd=0x%04x\n\n", hwnd );
+
     if (!msgQueue->msgCount) return -1;
     if (!hwnd && !first && !last) return pos;
         
@@ -436,6 +427,7 @@
 
     for (i = 0; i < sysMsgQueue->msgCount; i++, pos++)
     {
+        if (pos >= sysMsgQueue->queueSize) pos = 0;
 	*msg = sysMsgQueue->messages[pos].msg;
 
           /* Translate message */
@@ -455,7 +447,8 @@
         if (hwnd && (msg->hwnd != hwnd)) continue;
         if ((first || last) && 
             ((msg->message < first) || (msg->message > last))) continue;
-        if (GetWindowTask(msg->hwnd) != GetCurrentTask())
+        if ((msg->hwnd != GetDesktopWindow()) && 
+            (GetWindowTask(msg->hwnd) != GetCurrentTask()))
             continue;  /* Not for this task */
         if (remove) MSG_RemoveMsg( sysMsgQueue, pos );
         return TRUE;
@@ -734,12 +727,16 @@
     XEvent event;
     int fd = ConnectionNumber(display);
 
-    if (!XPending(display))
+    if (!XPending(display) && (maxWait != -1))
     {
         FD_ZERO( &read_set );
         FD_SET( fd, &read_set );
+
+	timeout.tv_usec = (maxWait % 1000) * 1000;
+	timeout.tv_sec = maxWait / 1000;
+
+#ifdef CONFIG_IPC
 	sigsetjmp(env_wait_x, 1);
-	
 	stop_wait_op= CONT;
 	    
 	if (DDE_GetRemoteMessage()) {
@@ -747,10 +744,6 @@
 		;
 	    return TRUE;
 	}
-
-	timeout.tv_usec = (maxWait % 1000) * 1000;
-	timeout.tv_sec = maxWait / 1000;
-
 	stop_wait_op= STOP_WAIT_X;
 	/* The code up to the next "stop_wait_op= CONT" must be reentrant  */
 	if (select( fd+1, &read_set, NULL, NULL, &timeout ) != 1 &&
@@ -760,17 +753,25 @@
 	} else {
 	    stop_wait_op= CONT;
 	}
-	    
+#else  /* CONFIG_IPC */
+	if (select( fd+1, &read_set, NULL, NULL, &timeout ) != 1)
+            return FALSE;  /* Timeout or error */
+#endif  /* CONFIG_IPC */
+
     }
 
     /* Process the event (and possibly others that occurred in the meantime) */
     do
     {
-	if (DDE_GetRemoteMessage()) {
-	    while(DDE_GetRemoteMessage())
-		;
+
+#ifdef CONFIG_IPC
+	if (DDE_GetRemoteMessage())
+        {
+	    while(DDE_GetRemoteMessage()) ;
 	    return TRUE;
 	}
+#endif  /* CONFIG_IPC */
+
         XNextEvent( display, &event );
         EVENT_ProcessEvent( &event );
     }
@@ -789,8 +790,10 @@
     MESSAGEQUEUE *msgQueue;
     LONG nextExp;  /* Next timer expiration time */
 
+#ifdef CONFIG_IPC
     DDE_TestDDE(hwnd);	/* do we have dde handling in the window ?*/
     DDE_GetRemoteMessage();
+#endif  /* CONFIG_IPC */
     
     if (first || last)
     {
@@ -974,8 +977,10 @@
     msg.pt.x    = 0;
     msg.pt.y    = 0;
 
+#ifdef CONFIG_IPC
     if (DDE_PostMessage(&msg))
        return TRUE;
+#endif  /* CONFIG_IPC */
     
     if (hwnd == HWND_BROADCAST) {
       dprintf_msg(stddeb,"PostMessage // HWND_BROADCAST !\n");
@@ -1026,7 +1031,6 @@
 {
     WND * wndPtr;
     LONG ret;
-    MSG DDE_msg;
     struct
     {
 	LONG lParam;
@@ -1035,11 +1039,10 @@
 	WORD hWnd;
     } msgstruct = { lParam, wParam, msg, hwnd };
 
-    DDE_msg.hwnd    = hwnd;
-    DDE_msg.message = msg;
-    DDE_msg.wParam  = wParam;
-    DDE_msg.lParam  = lParam;
+#ifdef CONFIG_IPC
+    MSG DDE_msg = { hwnd, msg, wParam, lParam };
     if (DDE_SendMessage(&DDE_msg)) return TRUE;
+#endif  /* CONFIG_IPC */
 
     if (hwnd == HWND_BROADCAST)
     {
@@ -1080,7 +1083,9 @@
     MESSAGEQUEUE *queue;
     LONG nextExp = -1;  /* Next timer expiration time */
 
+#ifdef CONFIG_IPC
     DDE_GetRemoteMessage();
+#endif  /* CONFIG_IPC */
     
     if (!(queue = (MESSAGEQUEUE *)GlobalLock( GetTaskQueue(0) ))) return;
     if ((queue->wPostQMsg) || 
@@ -1197,7 +1202,7 @@
 WORD RegisterWindowMessage( SEGPTR str )
 {
     dprintf_msg(stddeb, "RegisterWindowMessage: '%08lx'\n", str );
-    return LocalAddAtom( str );
+    return GlobalAddAtom( str );
 }