Release 960712

Fri Jul 12 17:43:05 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [controls/scroll.c]
	Use Win32 heap functions to allocate scroll-bar info structure.

	* [debugger/dbg.y] [debugger/registers.c]
	Added support for FS and GS segment registers.
	Check that segment registers value are OK before returning from
	the signal handler.

	* [tools/build.c] [if1632/relay.c] [loader/builtin.c]
	Changed relay debugging for Win32 function: the relay code now
	passes the entry point address instead of the function name.

	* [tools/build.c] [miscemu/*.c]
	Added support for data entry points in Win32 DLLs.
	Added 'cdecl' function type for Win32.
	For 'register' function, the relay code now passes a pointer to
	the SIGCONTEXT structure.
	
	* [include/registers.h] [include/wine.h]
	Moved SIGCONTEXT structure definition in registers.h.

	* [loader/pe_image.c]
	Don't die at once if some Win32 entry points cannot be found, but
	set them to NULL, just like we do for Win16. This allows some
	programs to go further before crashing.

	* [loader/task.c] [loader/main.c]
	Moved global initializations from InitTask() to MAIN_Init(), as
	they no longer need a task context with the new SEGPTR heap functions.

	* [memory/string.c]
	Added lstrcpynAtoW and lstrcpynWtoA; not real API functions, but
 	very convenient.

	* [windows/graphics.c]
	Partially implemented DrawEdge().

	* [windows/timer.c] [windows/caret.c]
	Implemented Win32 timer handling. Updated caret management to use
	Win32 timers (avoids having to use a Win16 callback).

	* [windows/win.c]
	Prevent programs from setting some style bits with
	SetWindowLong(). This should fix some BadMatch crashes.
	Link new windows at the end of the linked list.

	* [windows/winpos.c]
	Don't try to activate a child window in ShowWindow().

	* [windows/winproc.c]
	Added a 32->32 thunk to support Ansi-Unicode translation.

Wed Jul 10 22:11:12 1996  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [files/directory.c]
	Additional (undocumented) return value for GetTempDrive() added.

	* [files/dos_fs.c] [files/file.c] [include/windows.h]
	GetTempFileName32* added.
	GetShortPathName* added.

	* [memory/string.c]
	Win16 lstrcpy() can get NULL ptrs as argument and survive.

	* [misc/lzexpand.c]
	LZOpenFile(): also try opening with compressed filename if normal
 	open fails.

	* [misc/ole2nls.c] [misc/lstr.c] [include/windows.h]
	Char* added.
	CompareString* added.

Sun Jul  7 01:22:14 1996  Jukka Iivonen <iivonen@cc.helsinki.fi>

	* [objects/font.c] [if1632/gdi32.spec]
	CreateFontIndirect32A and CreateFontIndirect32W added.

	* [misc/ole2nls.c]
	GetUserDefaultLCID return values updated for new languages.
	Finnish support added for GetLocaleInfoA.

	* [object/palette] [gdi32.spec]
	RealizePalette32 and SelectPalette32 added.
	
Sat Jul  6 17:27:30 1996  Ronan Waide  <root@waider.ie>

	* [misc/shell.c]
	Fixup for SHELL_FindExecutable so that File->Run from progman
	works once more. Still needs some more fixups - grep for FIXME in
	this file.
diff --git a/controls/scroll.c b/controls/scroll.c
index 4bf9479..04321df 100644
--- a/controls/scroll.c
+++ b/controls/scroll.c
@@ -16,11 +16,10 @@
 #include "syscolor.h"
 #include "sysmetrics.h"
 #include "scroll.h"
-#include "user.h"
 #include "graphics.h"
+#include "heap.h"
 #include "win.h"
 #include "stddebug.h"
-/* #define DEBUG_SCROLL */
 #include "debug.h"
 
 
@@ -94,38 +93,39 @@
     hRgArrowI = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWI));
 }
 
+
 /***********************************************************************
  *           SCROLL_GetPtrScrollInfo
  */
 static SCROLLINFO *SCROLL_GetPtrScrollInfo( WND* wndPtr, int nBar )
 {
-    HANDLE handle;
+    SCROLLINFO *infoPtr;
 
     if (!wndPtr) return NULL;
     switch(nBar)
     {
-        case SB_HORZ: handle = wndPtr->hHScroll; break;
-        case SB_VERT: handle = wndPtr->hVScroll; break;
-        case SB_CTL:  return (SCROLLINFO *)wndPtr->wExtra;
+        case SB_HORZ: infoPtr = (SCROLLINFO *)wndPtr->pHScroll; break;
+        case SB_VERT: infoPtr = (SCROLLINFO *)wndPtr->pVScroll; break;
+        case SB_CTL:  infoPtr = (SCROLLINFO *)wndPtr->wExtra; break;
         default:      return NULL;
     }
 
-    if (!handle)  /* Create the info structure if needed */
+    if (!infoPtr)  /* Create the info structure if needed */
     {
-        if ((handle = USER_HEAP_ALLOC( sizeof(SCROLLINFO) )))
+        if ((infoPtr = HeapAlloc( SystemHeap, 0, sizeof(SCROLLINFO) )))
         {
-            SCROLLINFO *infoPtr = (SCROLLINFO *) USER_HEAP_LIN_ADDR( handle );
             infoPtr->MinVal = infoPtr->CurVal = 0;
             infoPtr->MaxVal = 100;
             infoPtr->flags  = ESB_ENABLE_BOTH;
-            if (nBar == SB_HORZ) wndPtr->hHScroll = handle;
-            else wndPtr->hVScroll = handle;
+            if (nBar == SB_HORZ) wndPtr->pHScroll = infoPtr;
+            else wndPtr->pVScroll = infoPtr;
         }
         if (!hUpArrow) SCROLL_LoadBitmaps();
     }
-    return (SCROLLINFO *) USER_HEAP_LIN_ADDR( handle );
+    return infoPtr;
 }
 
+
 /***********************************************************************
  *           SCROLL_GetScrollInfo
  */
@@ -364,13 +364,8 @@
     {
         if (nBar == SB_CTL)  /* Only scrollbar controls send WM_CTLCOLOR */
         {
-#ifdef WINELIB32
-            HBRUSH hbrush = SendMessage32A( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
-                                         hdc, hwnd );
-#else
-            HBRUSH hbrush = SendMessage16( GetParent(hwnd), WM_CTLCOLOR, hdc,
-                                          MAKELONG(hwnd, CTLCOLOR_SCROLLBAR) );
-#endif
+            HBRUSH hbrush = SendMessage32A( GetParent(hwnd),
+                                            WM_CTLCOLORSCROLLBAR, hdc, hwnd );
             SelectObject( hdc, hbrush );
         }
         else SelectObject( hdc, sysColorObjects.hbrushScrollbar );
@@ -524,15 +519,9 @@
     default:
         return;
     }
-#ifdef WINELIB32
     SendMessage32A( GetParent(hwnd),
-                 (wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
-                 msg, hwnd );
-#else
-    SendMessage16( GetParent(hwnd),
-                 (wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
-                 msg, MAKELONG( 0, hwnd ));
-#endif
+                    (wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
+                    msg, hwnd );
 }
 
 
@@ -619,19 +608,14 @@
         {
             if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
             {
-#ifdef WINELIB32
                 SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_LINEUP, hwndCtl );
-#else
-                SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_LINEUP, MAKELONG( 0, hwndCtl ));
-#endif
-                SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
-                                SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
-                                (FARPROC)0 );
+                                SB_LINEUP, hwndCtl );
+                SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
+                                  SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
+                                  (TIMERPROC32)0 );
             }
         }
-        else KillSystemTimer( hwnd, SCROLL_TIMER );
+        else KillSystemTimer32( hwnd, SCROLL_TIMER );
         break;
 
     case SCROLL_TOP_RECT:
@@ -642,19 +626,14 @@
         {
             if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
             {
-#ifdef WINELIB32
                 SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_PAGEUP, hwndCtl );
-#else
-                SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_PAGEUP, MAKELONG( 0, hwndCtl ));
-#endif
-                SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
-                                SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
-                                (FARPROC)0 );
+                                SB_PAGEUP, hwndCtl );
+                SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
+                                  SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
+                                  (TIMERPROC32)0 );
             }
         }
-        else KillSystemTimer( hwnd, SCROLL_TIMER );
+        else KillSystemTimer32( hwnd, SCROLL_TIMER );
         break;
 
     case SCROLL_THUMB:
@@ -686,13 +665,8 @@
                                  trackThumbPos + lastMousePos - lastClickPos );
                 /* Save tracking info */
                 uTrackingPos = trackThumbPos + pos - lastClickPos;
-#ifdef WINELIB32
                 SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             MAKEWPARAM(SB_THUMBTRACK,val), hwndCtl );
-#else
-                SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_THUMBTRACK, MAKELONG( val, hwndCtl ));
-#endif
+                                MAKEWPARAM( SB_THUMBTRACK, val ), hwndCtl );
                 SCROLL_DrawMovingThumb( hdc, &rect, vertical,
                                         arrowSize, uTrackingPos );
             }
@@ -707,19 +681,14 @@
         {
             if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
             {
-#ifdef WINELIB32
                 SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_PAGEDOWN, hwndCtl );
-#else
-                SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_PAGEDOWN, MAKELONG( 0, hwndCtl ));
-#endif
-                SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
-                                SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
-                                (FARPROC)0 );
+                                SB_PAGEDOWN, hwndCtl );
+                SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
+                                  SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
+                                  (TIMERPROC32)0 );
             }
         }
-        else KillSystemTimer( hwnd, SCROLL_TIMER );
+        else KillSystemTimer32( hwnd, SCROLL_TIMER );
         break;
         
     case SCROLL_BOTTOM_ARROW:
@@ -729,19 +698,14 @@
         {
             if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
             {
-#ifdef WINELIB32
                 SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_LINEDOWN, hwndCtl );
-#else
-                SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                             SB_LINEDOWN, MAKELONG( 0, hwndCtl ));
-#endif
-                SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
-                                SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
-                                (FARPROC)0 );
+                                SB_LINEDOWN, hwndCtl );
+                SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
+                                  SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
+                                  (TIMERPROC32)0 );
             }
         }
-        else KillSystemTimer( hwnd, SCROLL_TIMER );
+        else KillSystemTimer32( hwnd, SCROLL_TIMER );
         break;
     }
 
@@ -751,22 +715,12 @@
         {
             UINT val = SCROLL_GetThumbVal( infoPtr, &rect, vertical,
                                  trackThumbPos + lastMousePos - lastClickPos );
-#ifdef WINELIB32
             SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                         MAKEWPARAM(SB_THUMBPOSITION,val), hwndCtl );
-#else
-            SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                         SB_THUMBPOSITION, MAKELONG( val, hwndCtl ) );
-#endif
+                            MAKEWPARAM( SB_THUMBPOSITION, val ), hwndCtl );
         }
         else
-#ifdef WINELIB32
             SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                         SB_ENDSCROLL, hwndCtl );
-#else
-            SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
-                         SB_ENDSCROLL, MAKELONG( 0, hwndCtl ) );
-#endif
+                            SB_ENDSCROLL, hwndCtl );
         trackHitTest = SCROLL_NOWHERE;  /* Terminate tracking */
     }