mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 14:45:53 +00:00
fixes to cursors
svn path=/trunk/; revision=7007
This commit is contained in:
parent
d15b8ab119
commit
0d9840021e
6 changed files with 65 additions and 15 deletions
|
@ -19,6 +19,8 @@ typedef struct _W32PROCESS
|
||||||
LIST_ENTRY MenuListHead;
|
LIST_ENTRY MenuListHead;
|
||||||
FAST_MUTEX PrivateFontListLock;
|
FAST_MUTEX PrivateFontListLock;
|
||||||
LIST_ENTRY PrivateFontListHead;
|
LIST_ENTRY PrivateFontListHead;
|
||||||
|
FAST_MUTEX CursorIconListLock;
|
||||||
|
LIST_ENTRY CursorIconListHead;
|
||||||
struct _KBDTABLES* KeyboardLayout;
|
struct _KBDTABLES* KeyboardLayout;
|
||||||
struct _WINSTATION_OBJECT* WindowStation;
|
struct _WINSTATION_OBJECT* WindowStation;
|
||||||
WORD GDIObjects;
|
WORD GDIObjects;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: mouse.c,v 1.47 2003/12/07 19:29:33 weiden Exp $
|
/* $Id: mouse.c,v 1.48 2003/12/13 22:38:29 weiden Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Mouse
|
* PURPOSE: Mouse
|
||||||
|
@ -600,13 +600,14 @@ EnableMouse(HDC hDisplayDC)
|
||||||
InputWindowStation->SystemCursor.Enabled = FALSE;
|
InputWindowStation->SystemCursor.Enabled = FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IntSetCursor(InputWindowStation, NULL, TRUE);
|
|
||||||
|
|
||||||
dc = DC_LockDc(hDisplayDC);
|
dc = DC_LockDc(hDisplayDC);
|
||||||
SurfObj = (PSURFOBJ)AccessUserObject((ULONG) dc->Surface);
|
SurfObj = (PSURFOBJ)AccessUserObject((ULONG) dc->Surface);
|
||||||
SurfGDI = (PSURFGDI)AccessInternalObject((ULONG) dc->Surface);
|
SurfGDI = (PSURFGDI)AccessInternalObject((ULONG) dc->Surface);
|
||||||
DC_UnlockDc( hDisplayDC );
|
DC_UnlockDc( hDisplayDC );
|
||||||
|
|
||||||
|
IntSetCursor(InputWindowStation, NULL, TRUE);
|
||||||
|
|
||||||
InputWindowStation->SystemCursor.Enabled = (SPS_ACCEPT_EXCLUDE == SurfGDI->PointerStatus ||
|
InputWindowStation->SystemCursor.Enabled = (SPS_ACCEPT_EXCLUDE == SurfGDI->PointerStatus ||
|
||||||
SPS_ACCEPT_NOEXCLUDE == SurfGDI->PointerStatus);
|
SPS_ACCEPT_NOEXCLUDE == SurfGDI->PointerStatus);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
typedef struct _CURICON_OBJECT
|
typedef struct _CURICON_OBJECT
|
||||||
{
|
{
|
||||||
HANDLE Handle;
|
HANDLE Self;
|
||||||
|
LIST_ENTRY ListEntry;
|
||||||
PW32PROCESS Process;
|
PW32PROCESS Process;
|
||||||
HMODULE hModule;
|
HMODULE hModule;
|
||||||
HRSRC hRsrc;
|
HRSRC hRsrc;
|
||||||
|
@ -20,6 +21,7 @@ BOOL FASTCALL IntSetupCurIconHandles(PWINSTATION_OBJECT WinStaObject);
|
||||||
PCURICON_OBJECT FASTCALL IntGetCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle);
|
PCURICON_OBJECT FASTCALL IntGetCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle);
|
||||||
VOID FASTCALL IntReleaseCurIconObject(PCURICON_OBJECT Object);
|
VOID FASTCALL IntReleaseCurIconObject(PCURICON_OBJECT Object);
|
||||||
PCURICON_OBJECT FASTCALL IntCreateCurIconHandle(PWINSTATION_OBJECT WinStaObject);
|
PCURICON_OBJECT FASTCALL IntCreateCurIconHandle(PWINSTATION_OBJECT WinStaObject);
|
||||||
|
VOID FASTCALL IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process);
|
||||||
|
|
||||||
#endif /* _WIN32K_CURSORICON_H */
|
#endif /* _WIN32K_CURSORICON_H */
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: dllmain.c,v 1.61 2003/12/12 23:49:48 weiden Exp $
|
/* $Id: dllmain.c,v 1.62 2003/12/13 22:38:29 weiden Exp $
|
||||||
*
|
*
|
||||||
* Entry Point for win32k.sys
|
* Entry Point for win32k.sys
|
||||||
*/
|
*/
|
||||||
|
@ -42,6 +42,7 @@
|
||||||
#include <include/caret.h>
|
#include <include/caret.h>
|
||||||
#include <include/hotkey.h>
|
#include <include/hotkey.h>
|
||||||
#include <include/accelerator.h>
|
#include <include/accelerator.h>
|
||||||
|
#include <include/cursoricon.h>
|
||||||
#include <include/guicheck.h>
|
#include <include/guicheck.h>
|
||||||
#include <include/hook.h>
|
#include <include/hook.h>
|
||||||
|
|
||||||
|
@ -78,6 +79,9 @@ Win32kProcessCallback (struct _EPROCESS *Process,
|
||||||
|
|
||||||
InitializeListHead(&Win32Process->PrivateFontListHead);
|
InitializeListHead(&Win32Process->PrivateFontListHead);
|
||||||
ExInitializeFastMutex(&Win32Process->PrivateFontListLock);
|
ExInitializeFastMutex(&Win32Process->PrivateFontListLock);
|
||||||
|
|
||||||
|
InitializeListHead(&Win32Process->CursorIconListHead);
|
||||||
|
ExInitializeFastMutex(&Win32Process->CursorIconListLock);
|
||||||
|
|
||||||
Win32Process->KeyboardLayout = W32kGetDefaultKeyLayout();
|
Win32Process->KeyboardLayout = W32kGetDefaultKeyLayout();
|
||||||
Win32Process->WindowStation = NULL;
|
Win32Process->WindowStation = NULL;
|
||||||
|
@ -106,6 +110,7 @@ Win32kProcessCallback (struct _EPROCESS *Process,
|
||||||
#endif
|
#endif
|
||||||
IntRemoveProcessWndProcHandles((HANDLE)Process->UniqueProcessId);
|
IntRemoveProcessWndProcHandles((HANDLE)Process->UniqueProcessId);
|
||||||
IntCleanupMenus(Process, Win32Process);
|
IntCleanupMenus(Process, Win32Process);
|
||||||
|
IntCleanupCurIcons(Process, Win32Process);
|
||||||
|
|
||||||
CleanupForProcess(Process, Process->UniqueProcessId);
|
CleanupForProcess(Process, Process->UniqueProcessId);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Id: winsta.c,v 1.53 2003/12/13 15:49:32 weiden Exp $
|
* $Id: winsta.c,v 1.54 2003/12/13 22:38:29 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -214,7 +214,9 @@ IntInitializeDesktopGraphics(VOID)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
DC_SetOwnership(ScreenDeviceContext, NULL);
|
DC_SetOwnership(ScreenDeviceContext, NULL);
|
||||||
|
|
||||||
EnableMouse(ScreenDeviceContext);
|
EnableMouse(ScreenDeviceContext);
|
||||||
|
|
||||||
/* not the best place to load the cursors but it's good for now */
|
/* not the best place to load the cursors but it's good for now */
|
||||||
IntLoadDefaultCursors(FALSE);
|
IntLoadDefaultCursors(FALSE);
|
||||||
NtUserAcquireOrReleaseInputOwnership(FALSE);
|
NtUserAcquireOrReleaseInputOwnership(FALSE);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: cursoricon.c,v 1.37 2003/12/13 19:53:17 weiden Exp $ */
|
/* $Id: cursoricon.c,v 1.38 2003/12/13 22:38:29 weiden Exp $ */
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL Fo
|
||||||
OldCursor = CurInfo->CurrentCursorObject;
|
OldCursor = CurInfo->CurrentCursorObject;
|
||||||
if(OldCursor)
|
if(OldCursor)
|
||||||
{
|
{
|
||||||
Ret = (HCURSOR)OldCursor->Handle;
|
Ret = (HCURSOR)OldCursor->Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ForceChange && (OldCursor == NewCursor))
|
if(!ForceChange && (OldCursor == NewCursor))
|
||||||
|
@ -288,6 +288,7 @@ IntCreateCurIconHandle(PWINSTATION_OBJECT WinStaObject)
|
||||||
PUSER_HANDLE_TABLE HandleTable;
|
PUSER_HANDLE_TABLE HandleTable;
|
||||||
PCURICON_OBJECT Object;
|
PCURICON_OBJECT Object;
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
|
PW32PROCESS Win32Process;
|
||||||
|
|
||||||
HandleTable = (PUSER_HANDLE_TABLE)WinStaObject->SystemCursor.CurIconHandleTable;
|
HandleTable = (PUSER_HANDLE_TABLE)WinStaObject->SystemCursor.CurIconHandleTable;
|
||||||
|
|
||||||
|
@ -299,14 +300,20 @@ IntCreateCurIconHandle(PWINSTATION_OBJECT WinStaObject)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object->Handle = Handle;
|
Win32Process = PsGetWin32Process();
|
||||||
|
|
||||||
|
ExAcquireFastMutex(&Win32Process->CursorIconListLock);
|
||||||
|
InsertTailList(&Win32Process->CursorIconListHead, &Object->ListEntry);
|
||||||
|
ExReleaseFastMutex(&Win32Process->CursorIconListLock);
|
||||||
|
|
||||||
|
Object->Self = Handle;
|
||||||
Object->Process = PsGetWin32Process();
|
Object->Process = PsGetWin32Process();
|
||||||
|
|
||||||
return Object;
|
return Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle)
|
IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle, BOOL RemoveFromProcess)
|
||||||
{
|
{
|
||||||
PUSER_HANDLE_TABLE HandleTable;
|
PUSER_HANDLE_TABLE HandleTable;
|
||||||
PCURICON_OBJECT Object;
|
PCURICON_OBJECT Object;
|
||||||
|
@ -324,13 +331,21 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle)
|
||||||
|
|
||||||
if(WinStaObject->SystemCursor.CurrentCursorObject == Object)
|
if(WinStaObject->SystemCursor.CurrentCursorObject == Object)
|
||||||
{
|
{
|
||||||
ObmDereferenceObject(Object);
|
/* Hide the cursor if we're destroying the current cursor */
|
||||||
return FALSE;
|
IntSetCursor(WinStaObject, NULL, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bmpMask = Object->IconInfo.hbmMask;
|
bmpMask = Object->IconInfo.hbmMask;
|
||||||
bmpColor = Object->IconInfo.hbmColor;
|
bmpColor = Object->IconInfo.hbmColor;
|
||||||
|
|
||||||
|
|
||||||
|
if(Object->Process && RemoveFromProcess)
|
||||||
|
{
|
||||||
|
ExAcquireFastMutex(&Object->Process->CursorIconListLock);
|
||||||
|
RemoveEntryList(&Object->ListEntry);
|
||||||
|
ExReleaseFastMutex(&Object->Process->CursorIconListLock);
|
||||||
|
}
|
||||||
|
|
||||||
ObmDereferenceObject(Object);
|
ObmDereferenceObject(Object);
|
||||||
|
|
||||||
Ret = NT_SUCCESS(ObmCloseHandle(HandleTable, Handle));
|
Ret = NT_SUCCESS(ObmCloseHandle(HandleTable, Handle));
|
||||||
|
@ -344,6 +359,29 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle)
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process)
|
||||||
|
{
|
||||||
|
PWINSTATION_OBJECT WinStaObject;
|
||||||
|
PCURICON_OBJECT Current;
|
||||||
|
PLIST_ENTRY CurrentEntry, NextEntry;
|
||||||
|
|
||||||
|
if(!(WinStaObject = Win32Process->WindowStation))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ExAcquireFastMutex(&Win32Process->CursorIconListLock);
|
||||||
|
CurrentEntry = Win32Process->CursorIconListHead.Flink;
|
||||||
|
while(CurrentEntry != &Win32Process->CursorIconListHead)
|
||||||
|
{
|
||||||
|
NextEntry = CurrentEntry->Flink;
|
||||||
|
Current = CONTAINING_RECORD(CurrentEntry, CURICON_OBJECT, ListEntry);
|
||||||
|
RemoveEntryList(&Current->ListEntry);
|
||||||
|
IntDestroyCurIconObject(WinStaObject, Current->Self, FALSE);
|
||||||
|
CurrentEntry = NextEntry;
|
||||||
|
}
|
||||||
|
ExReleaseFastMutex(&Win32Process->CursorIconListLock);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -371,7 +409,7 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo, BOOL Indirect)
|
||||||
CurIconObject = IntCreateCurIconHandle(WinStaObject);
|
CurIconObject = IntCreateCurIconHandle(WinStaObject);
|
||||||
if(CurIconObject)
|
if(CurIconObject)
|
||||||
{
|
{
|
||||||
Ret = CurIconObject->Handle;
|
Ret = CurIconObject->Self;
|
||||||
|
|
||||||
if(IconInfo)
|
if(IconInfo)
|
||||||
{
|
{
|
||||||
|
@ -598,7 +636,7 @@ NtUserGetCursorInfo(
|
||||||
CursorObject = (PCURICON_OBJECT)CurInfo->CurrentCursorObject;
|
CursorObject = (PCURICON_OBJECT)CurInfo->CurrentCursorObject;
|
||||||
|
|
||||||
SafeCi.flags = ((CurInfo->ShowingCursor && CursorObject) ? CURSOR_SHOWING : 0);
|
SafeCi.flags = ((CurInfo->ShowingCursor && CursorObject) ? CURSOR_SHOWING : 0);
|
||||||
SafeCi.hCursor = (CursorObject ? (HCURSOR)CursorObject->Handle : (HCURSOR)0);
|
SafeCi.hCursor = (CursorObject ? (HCURSOR)CursorObject->Self : (HCURSOR)0);
|
||||||
SafeCi.ptScreenPos.x = CurInfo->x;
|
SafeCi.ptScreenPos.x = CurInfo->x;
|
||||||
SafeCi.ptScreenPos.y = CurInfo->y;
|
SafeCi.ptScreenPos.y = CurInfo->y;
|
||||||
|
|
||||||
|
@ -697,7 +735,7 @@ NtUserDestroyCursorIcon(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IntDestroyCurIconObject(WinStaObject, Handle))
|
if(IntDestroyCurIconObject(WinStaObject, Handle, TRUE))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(WinStaObject);
|
ObDereferenceObject(WinStaObject);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -739,7 +777,7 @@ NtUserFindExistingCursorIcon(
|
||||||
CurIconObject = IntFindExistingCurIconObject(WinStaObject, hModule, hRsrc, cx, cy);
|
CurIconObject = IntFindExistingCurIconObject(WinStaObject, hModule, hRsrc, cx, cy);
|
||||||
if(CurIconObject)
|
if(CurIconObject)
|
||||||
{
|
{
|
||||||
Ret = CurIconObject->Handle;
|
Ret = CurIconObject->Self;
|
||||||
|
|
||||||
IntReleaseCurIconObject(CurIconObject);
|
IntReleaseCurIconObject(CurIconObject);
|
||||||
ObDereferenceObject(WinStaObject);
|
ObDereferenceObject(WinStaObject);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue