reactos/subsys/win32k/ntuser
diff -u -r1.32 -r1.33
--- scrollbar.c 10 May 2004 17:07:18 -0000 1.32
+++ scrollbar.c 12 May 2004 09:47:16 -0000 1.33
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: scrollbar.c,v 1.32 2004/05/10 17:07:18 weiden Exp $
+/* $Id: scrollbar.c,v 1.33 2004/05/12 09:47:16 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -203,10 +203,10 @@
UINT Mask;
LPSCROLLINFO psi;
- if(!SBID_IS_VAILD(nBar))
+ if(!SBID_IS_VALID(nBar))
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
- DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d", nBar);
+ DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d\n", nBar);
return FALSE;
}
@@ -263,7 +263,7 @@
/* UINT new_flags;*/
BOOL bChangeParams = FALSE; /* don't show/hide scrollbar if params don't change */
- if(!SBID_IS_VAILD(nBar))
+ if(!SBID_IS_VALID(nBar))
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", nBar);
@@ -414,10 +414,10 @@
Bar = SBOBJ_TO_SBID(idObject);
- if(!SBID_IS_VAILD(Bar))
+ if(!SBID_IS_VALID(Bar))
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
- DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d", Bar);
+ DPRINT1("Trying to get scrollinfo for unknown scrollbar type %d\n", Bar);
return FALSE;
}
@@ -453,7 +453,7 @@
}
/* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
- Size = 2 * (sizeof(WINDOW_SCROLLINFO));
+ Size = 3 * (sizeof(WINDOW_SCROLLINFO));
if(!(Window->Scroll = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
{
DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->Self);
@@ -604,14 +604,8 @@
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return FALSE;
}
-
- if(fnBar == SB_CTL)
- {
- IntSendMessage(Window->Self, SBM_GETSCROLLINFO, 0, (LPARAM)lpsi);
- Ret = TRUE;
- }
- else
- Ret = IntGetScrollInfo(Window, fnBar, &psi);
+
+ Ret = IntGetScrollInfo(Window, fnBar, &psi);
IntReleaseWindowObject(Window);
@@ -652,7 +646,7 @@
return FALSE;
}
- if(wSBflags != SB_BOTH && !SBID_IS_VAILD(wSBflags))
+ if(wSBflags != SB_BOTH && !SBID_IS_VALID(wSBflags))
{
IntReleaseWindowObject(Window);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
@@ -718,7 +712,7 @@
}
Obj = SBOBJ_TO_SBID(idObject);
- if(!SBID_IS_VAILD(Obj))
+ if(!SBID_IS_VALID(Obj))
{
IntReleaseWindowObject(Window);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
@@ -772,13 +766,6 @@
return 0;
}
- if(fnBar == SB_CTL)
- {
- Ret = IntSendMessage(hwnd, SBM_SETSCROLLINFO, (WPARAM)bRedraw, (LPARAM)lpsi);
- IntReleaseWindowObject(Window);
- return Ret;
- }
-
Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos));
if(!NT_SUCCESS(Status))
{
reactos/lib/user32/controls
diff -u -r1.27 -r1.28
--- scrollbar.c 9 Apr 2004 20:03:13 -0000 1.27
+++ scrollbar.c 12 May 2004 09:47:16 -0000 1.28
@@ -88,7 +88,7 @@
CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC, /* style */
ScrollBarWndProc, /* procW */
NULL, /* procA (winproc is Unicode only) */
- sizeof(SCROLLBARINFO) + sizeof(SCROLLINFO), /* extra */
+ 0, /* extra */
IDC_ARROW, /* cursor */
0 /* brush */
};
@@ -1422,7 +1422,7 @@
return 0;
case SBM_SETSCROLLINFO:
- return SetScrollInfo(Wnd, SB_CTL, (SCROLLINFO *) lParam, wParam);
+ return NtUserSetScrollInfo(Wnd, SB_CTL, (SCROLLINFO *) lParam, wParam);
case SBM_GETSCROLLINFO:
return NtUserGetScrollInfo(Wnd, SB_CTL, (SCROLLINFO *) lParam);
@@ -1475,9 +1475,16 @@
* @implemented
*/
BOOL STDCALL
-GetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO lpsi)
+GetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO Info)
{
- return NtUserGetScrollInfo(Wnd, SBType, lpsi);
+ if (SB_CTL == SBType)
+ {
+ return SendMessageW(Wnd, SBM_GETSCROLLINFO, 0, (LPARAM) Info);
+ }
+ else
+ {
+ return NtUserGetScrollInfo(Wnd, SBType, Info);
+ }
}
/*
@@ -1522,9 +1529,16 @@
* @implemented
*/
INT STDCALL
-SetScrollInfo(HWND hWnd, int nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
+SetScrollInfo(HWND Wnd, int SBType, LPCSCROLLINFO Info, BOOL bRedraw)
{
- return NtUserSetScrollInfo(hWnd, nBar, lpsi, bRedraw);
+ if (SB_CTL == SBType)
+ {
+ return SendMessageW(Wnd, SBM_SETSCROLLINFO, (WPARAM) bRedraw, (LPARAM) Info);
+ }
+ else
+ {
+ return NtUserSetScrollInfo(Wnd, SBType, Info, bRedraw);
+ }
}
/*