You can ask for e.g. GWL_STYLE for the desktop window,

but GWL_WNDPROC is off-limits for all windows if your
process didn't create it

svn path=/trunk/; revision=14709
This commit is contained in:
Gé van Geldorp 2005-04-20 07:25:14 +00:00
parent 6ba7e5d2cd
commit 7792b4bfea

View file

@ -16,8 +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$ /*
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* PURPOSE: Windows * PURPOSE: Windows
@ -26,7 +25,9 @@
* REVISION HISTORY: * REVISION HISTORY:
* 06-06-2001 CSH Created * 06-06-2001 CSH Created
*/ */
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
#include <w32k.h> #include <w32k.h>
static WndProcHandle *WndProcHandlesArray = 0; static WndProcHandle *WndProcHandlesArray = 0;
@ -3204,12 +3205,12 @@ NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi)
} }
/* /*
* Only allow CSRSS to mess with the desktop window * WndProc is only available to the owner process
*/ */
if (hWnd == IntGetDesktopWindow() if (GWL_WNDPROC == Index
&& WindowObject->OwnerThread->ThreadsProcess != PsGetCurrentProcess()) && WindowObject->OwnerThread->ThreadsProcess != PsGetCurrentProcess())
{ {
SetLastWin32Error(STATUS_ACCESS_DENIED); SetLastWin32Error(ERROR_ACCESS_DENIED);
return 0; return 0;
} }