diff --git a/reactos/include/funcs.h b/reactos/include/funcs.h index 09dbacc52ea..8457d73312a 100644 --- a/reactos/include/funcs.h +++ b/reactos/include/funcs.h @@ -6757,6 +6757,10 @@ STDCALL MessageBeep( UINT uType); +HCURSOR +STDCALL +CopyCursor(HCURSOR pcur); + int STDCALL ShowCursor( diff --git a/reactos/include/user32/callback.h b/reactos/include/user32/callback.h index 3e8ec9a7dcb..b45e56c4430 100644 --- a/reactos/include/user32/callback.h +++ b/reactos/include/user32/callback.h @@ -12,7 +12,8 @@ #define USER32_CALLBACK_SENDSTYLECHANGING (8) #define USER32_CALLBACK_SENDSTYLECHANGED (9) #define USER32_CALLBACK_LOADSYSMENUTEMPLATE (10) -#define USER32_CALLBACK_MAXIMUM (10) +#define USER32_CALLBACK_LOADDEFAULTCURSORS (11) +#define USER32_CALLBACK_MAXIMUM (11) typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS { diff --git a/reactos/lib/user32/include/user32.h b/reactos/lib/user32/include/user32.h index de948e4d863..c4921fb9b2a 100644 --- a/reactos/lib/user32/include/user32.h +++ b/reactos/lib/user32/include/user32.h @@ -15,3 +15,6 @@ typedef struct _USER32_THREAD_DATA PUSER32_THREAD_DATA User32GetThreadData(); VOID DeleteFrameBrushes(VOID); + +BOOL FASTCALL +User32SetupDefaultCursors(void); diff --git a/reactos/lib/user32/misc/dllmain.c b/reactos/lib/user32/misc/dllmain.c index 9e83ee01539..611cb1eec78 100644 --- a/reactos/lib/user32/misc/dllmain.c +++ b/reactos/lib/user32/misc/dllmain.c @@ -75,6 +75,8 @@ Init(VOID) (PVOID)User32SendSTYLECHANGEDMessageForKernel; NtCurrentPeb()->KernelCallbackTable[USER32_CALLBACK_LOADSYSMENUTEMPLATE] = (PVOID)User32LoadSysMenuTemplateForKernel; + NtCurrentPeb()->KernelCallbackTable[USER32_CALLBACK_LOADDEFAULTCURSORS] = + (PVOID)User32SetupDefaultCursors; /* Allocate an index for user32 thread local data. */ User32TlsIndex = TlsAlloc(); diff --git a/reactos/lib/user32/user32.def b/reactos/lib/user32/user32.def index eced5f6155c..7773a958d33 100644 --- a/reactos/lib/user32/user32.def +++ b/reactos/lib/user32/user32.def @@ -73,6 +73,7 @@ CloseWindow@4 CloseWindowStation@4 CopyAcceleratorTableA@12 CopyAcceleratorTableW@12 +CopyCursor@4 CopyIcon@4 CopyImage@20 CopyRect@8 diff --git a/reactos/lib/user32/user32.edf b/reactos/lib/user32/user32.edf index 41995540d5a..2fb94ab3c05 100644 --- a/reactos/lib/user32/user32.edf +++ b/reactos/lib/user32/user32.edf @@ -73,6 +73,7 @@ CloseWindow=CloseWindow@4 CloseWindowStation=CloseWindowStation@4 CopyAcceleratorTableA=CopyAcceleratorTableA@12 CopyAcceleratorTableW=CopyAcceleratorTableW@12 +CopyCursor=CopyCursor@4 CopyIcon=CopyIcon@4 CopyImage=CopyImage@20 CopyRect=CopyRect@8 diff --git a/reactos/lib/user32/windows/cursor.c b/reactos/lib/user32/windows/cursor.c index 53fb480ea84..c57a93fe316 100644 --- a/reactos/lib/user32/windows/cursor.c +++ b/reactos/lib/user32/windows/cursor.c @@ -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: cursor.c,v 1.10 2003/08/24 18:52:18 weiden Exp $ +/* $Id: cursor.c,v 1.11 2003/08/29 00:24:42 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/cursor.c @@ -33,9 +33,33 @@ #include #include +/* INTERNAL ******************************************************************/ + +/* This callback routine is called directly after switching to gui mode */ +BOOL FASTCALL +User32SetupDefaultCursors(void) +{ + LRESULT Result = TRUE; + + /* FIXME load system cursor scheme */ + + return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS)); +} + /* FUNCTIONS *****************************************************************/ +/* + * @unimplemented + */ +HCURSOR STDCALL +CopyCursor(HCURSOR pcur) +{ + UNIMPLEMENTED; + return (HCURSOR)0; +} + + /* * @unimplemented */ diff --git a/reactos/lib/user32/windows/icon.c b/reactos/lib/user32/windows/icon.c index 1db57831e6c..ee26894e8b1 100644 --- a/reactos/lib/user32/windows/icon.c +++ b/reactos/lib/user32/windows/icon.c @@ -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: icon.c,v 1.10 2003/08/22 20:50:44 weiden Exp $ +/* $Id: icon.c,v 1.11 2003/08/29 00:24:42 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/icon.c @@ -459,14 +459,14 @@ GetIconInfo( return FALSE; } - RtlCopyMemory(&IconInfo, piconinfo, sizeof(ICONINFO)); res = NtUserGetIconInfo(hIcon, &piconinfo->fIcon, &piconinfo->xHotspot, &piconinfo->yHotspot, &piconinfo->hbmMask, &piconinfo->hbmColor); - RtlCopyMemory(piconinfo, &IconInfo, sizeof(ICONINFO)); + if(res) + RtlCopyMemory(piconinfo, &IconInfo, sizeof(ICONINFO)); return res; } diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index 73ff67d1ef3..28204e96dc0 100644 --- a/reactos/subsys/win32k/eng/mouse.c +++ b/reactos/subsys/win32k/eng/mouse.c @@ -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: mouse.c,v 1.38 2003/08/28 16:33:22 weiden Exp $ +/* $Id: mouse.c,v 1.39 2003/08/29 00:24:42 weiden Exp $ * * PROJECT: ReactOS kernel * PURPOSE: Mouse @@ -598,7 +598,7 @@ EnableMouse(HDC hDisplayDC) hMouseSurf = EngCreateBitmap(MouseSize, 4, BMF_1BPP, BMF_TOPDOWN, DefaultCursor); MouseSurf = (PSURFOBJ)AccessUserObject((ULONG) hMouseSurf); - DbgPrint("Setting Cursor up at 0x%x, 0x%x\n", CurInfo->x, CurInfo->y); + DPRINT("Setting Cursor up at 0x%x, 0x%x\n", CurInfo->x, CurInfo->y); IntCheckClipCursor(&CurInfo->x, &CurInfo->y, CurInfo); diff --git a/reactos/subsys/win32k/include/callback.h b/reactos/subsys/win32k/include/callback.h index 5e82752b41e..d2e52740143 100644 --- a/reactos/subsys/win32k/include/callback.h +++ b/reactos/subsys/win32k/include/callback.h @@ -44,4 +44,7 @@ IntSendSTYLECHANGEDMessage(HWND Wnd, DWORD WhichStyle, STYLESTRUCT* Style); HMENU STDCALL IntLoadSysMenuTemplate(); +BOOL STDCALL +IntLoadDefaultCursors(); + #endif /* __SUBSYS_WIN32K_INCLUDE_CALLBACK_H */ diff --git a/reactos/subsys/win32k/ntuser/callback.c b/reactos/subsys/win32k/ntuser/callback.c index 4f5ccb03085..0cc26754503 100644 --- a/reactos/subsys/win32k/ntuser/callback.c +++ b/reactos/subsys/win32k/ntuser/callback.c @@ -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: callback.c,v 1.13 2003/08/21 20:29:43 weiden Exp $ +/* $Id: callback.c,v 1.14 2003/08/29 00:24:42 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -402,4 +402,26 @@ IntLoadSysMenuTemplate() return (HMENU)Result; } +BOOL STDCALL +IntLoadDefaultCursors() +{ + LRESULT Result; + NTSTATUS Status; + PVOID ResultPointer; + ULONG ResultLength; + + ResultPointer = &Result; + ResultLength = sizeof(LRESULT); + Status = NtW32Call(USER32_CALLBACK_LOADDEFAULTCURSORS, + NULL, + 0, + &ResultPointer, + &ResultLength); + if (!NT_SUCCESS(Status)) + { + return(0); + } + return (BOOL)Result; +} + /* EOF */ diff --git a/reactos/subsys/win32k/objects/cursoricon.c b/reactos/subsys/win32k/objects/cursoricon.c index 6164e665555..64ae337756d 100644 --- a/reactos/subsys/win32k/objects/cursoricon.c +++ b/reactos/subsys/win32k/objects/cursoricon.c @@ -398,7 +398,7 @@ NtUserSetCursorIconData( /* - * @unimplemented + * @implemented */ BOOL STDCALL @@ -406,7 +406,7 @@ NtUserSetSystemCursor( HCURSOR hcur, DWORD id) { - UNIMPLEMENTED + BOOL res = FALSE; - return 0; + return res; }