mirror of
https://github.com/reactos/reactos.git
synced 2024-10-20 16:06:27 +00:00
- Fixed handling of WM_GETICON message.
- Don't allow destroying icons of foreign processes. svn path=/trunk/; revision=8917
This commit is contained in:
parent
a1f1c3b257
commit
d6c2152ba9
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: defwnd.c,v 1.124 2004/02/22 23:40:58 gvg Exp $
|
/* $Id: defwnd.c,v 1.125 2004/03/29 06:38:50 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -1384,7 +1384,7 @@ User32DefWindowProc(HWND hWnd,
|
||||||
|
|
||||||
case WM_GETICON:
|
case WM_GETICON:
|
||||||
{
|
{
|
||||||
INT Index = (wParam != 0) ? GCL_HICON : GCL_HICONSM;
|
INT Index = (wParam == ICON_BIG) ? GCL_HICON : GCL_HICONSM;
|
||||||
return (GetClassLongW(hWnd, Index));
|
return (GetClassLongW(hWnd, Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.51 2004/03/15 20:21:51 navaraf Exp $ */
|
/* $Id: cursoricon.c,v 1.52 2004/03/29 06:38:50 navaraf Exp $ */
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
|
@ -368,7 +368,12 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle, BOOL Rem
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(WinStaObject->SystemCursor.CurrentCursorObject == Object)
|
if (Object->Process != PsGetWin32Process())
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WinStaObject->SystemCursor.CurrentCursorObject == Object)
|
||||||
{
|
{
|
||||||
/* Hide the cursor if we're destroying the current cursor */
|
/* Hide the cursor if we're destroying the current cursor */
|
||||||
IntSetCursor(WinStaObject, NULL, TRUE);
|
IntSetCursor(WinStaObject, NULL, TRUE);
|
||||||
|
@ -377,16 +382,13 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle, BOOL Rem
|
||||||
bmpMask = Object->IconInfo.hbmMask;
|
bmpMask = Object->IconInfo.hbmMask;
|
||||||
bmpColor = Object->IconInfo.hbmColor;
|
bmpColor = Object->IconInfo.hbmColor;
|
||||||
|
|
||||||
|
if (Object->Process && RemoveFromProcess)
|
||||||
if(Object->Process && RemoveFromProcess)
|
|
||||||
{
|
{
|
||||||
IntLockProcessCursorIcons(Object->Process);
|
IntLockProcessCursorIcons(Object->Process);
|
||||||
RemoveEntryList(&Object->ListEntry);
|
RemoveEntryList(&Object->ListEntry);
|
||||||
IntUnLockProcessCursorIcons(Object->Process);
|
IntUnLockProcessCursorIcons(Object->Process);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObmDereferenceObject(Object);
|
|
||||||
|
|
||||||
Ret = NT_SUCCESS(ObmCloseHandle(HandleTable, Handle));
|
Ret = NT_SUCCESS(ObmCloseHandle(HandleTable, Handle));
|
||||||
|
|
||||||
/* delete bitmaps */
|
/* delete bitmaps */
|
||||||
|
@ -395,6 +397,8 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle, BOOL Rem
|
||||||
if(bmpColor)
|
if(bmpColor)
|
||||||
NtGdiDeleteObject(bmpColor);
|
NtGdiDeleteObject(bmpColor);
|
||||||
|
|
||||||
|
/* ObmDereferenceObject(Object);*/
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue