10 modified files
reactos/include
diff -u -r1.54 -r1.55
--- funcs.h 13 Apr 2004 16:48:44 -0000 1.54
+++ funcs.h 1 May 2004 16:43:13 -0000 1.55
@@ -4624,7 +4624,7 @@
DWORD reserved
);
-DWORD
+BOOL
STDCALL
RegisterLogonProcess(
HANDLE hprocess,
reactos/include/win32k
diff -u -r1.130 -r1.131
--- ntuser.h 1 May 2004 09:31:58 -0000 1.130
+++ ntuser.h 1 May 2004 16:43:14 -0000 1.131
@@ -206,6 +206,7 @@
#define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0x58
#define TWOPARAM_ROUTINE_SETCARETPOS 0x60
#define TWOPARAM_ROUTINE_GETWINDOWINFO 0x61
+#define TWOPARAM_ROUTINE_REGISTERLOGONPROC 0x62
DWORD
STDCALL
NtUserCallTwoParam(
reactos/lib/user32/include
diff -u -r1.23 -r1.24
--- user32.h 1 May 2004 09:31:58 -0000 1.23
+++ user32.h 1 May 2004 16:43:14 -0000 1.24
@@ -52,6 +52,9 @@
#define NtUserGetWindowInfo(hwnd, pwi) \
(BOOL)NtUserCallTwoParam((DWORD)hwnd, (DWORD)pwi, TWOPARAM_ROUTINE_GETWINDOWINFO)
+#define NtUserRegisterLogonProcess(hproc, x) \
+ (BOOL)NtUserCallTwoParam((DWORD)hproc, (DWORD)x, TWOPARAM_ROUTINE_REGISTERLOGONPROC)
+
#define NtUserSetCaretBlinkTime(uMSeconds) \
(BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME)
reactos/lib/user32/misc
diff -u -r1.3 -r1.4
--- misc.c 7 Dec 2003 23:02:57 -0000 1.3
+++ misc.c 1 May 2004 16:43:14 -0000 1.4
@@ -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: misc.c,v 1.3 2003/12/07 23:02:57 gvg Exp $
+/* $Id: misc.c,v 1.4 2004/05/01 16:43:14 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/misc.c
@@ -56,3 +56,13 @@
{
NtUserManualGuiCheck(Check);
}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+RegisterLogonProcess ( HANDLE hprocess, BOOL x )
+{
+ return NtUserRegisterLogonProcess(hprocess, x);
+}
reactos/lib/user32/misc
diff -u -r1.59 -r1.60
--- stubs.c 29 Apr 2004 20:26:35 -0000 1.59
+++ stubs.c 1 May 2004 16:43:14 -0000 1.60
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.59 2004/04/29 20:26:35 weiden Exp $
+/* $Id: stubs.c,v 1.60 2004/05/01 16:43:14 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@@ -377,17 +377,6 @@
*/
DWORD
STDCALL
-RegisterLogonProcess ( HANDLE hprocess, BOOL x )
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
RegisterTasklist ( DWORD x )
{
UNIMPLEMENTED;
reactos/ntoskrnl/include/internal
diff -u -r1.35 -r1.36
--- ex.h 29 Apr 2004 20:26:35 -0000 1.35
+++ ex.h 1 May 2004 16:43:14 -0000 1.36
@@ -59,7 +59,7 @@
UINT CaretBlinkRate;
HANDLE ShellWindow;
HANDLE ShellListView;
- BOOL DesktopLocked;
+ ULONG Flags;
struct _DESKTOP_OBJECT* ActiveDesktop;
/* FIXME: Clipboard */
LIST_ENTRY HotKeyListHead;
reactos/subsys/win32k/include
diff -u -r1.24 -r1.25
--- winsta.h 7 Dec 2003 19:29:33 -0000 1.24
+++ winsta.h 1 May 2004 16:43:14 -0000 1.25
@@ -16,7 +16,12 @@
#define WINSTA_ROOT_NAME L"\\Windows\\WindowStations"
#define WINSTA_ROOT_NAME_LENGTH 23
+/* Window Station Status Flags */
+#define WSS_LOCKED (1)
+#define WSS_NOINTERACTIVE (2)
+
extern WINSTATION_OBJECT *InputWindowStation;
+extern PW32PROCESS LogonProcess;
NTSTATUS FASTCALL
InitWindowStationImpl(VOID);
reactos/subsys/win32k/main
diff -u -r1.69 -r1.70
--- dllmain.c 29 Apr 2004 20:26:35 -0000 1.69
+++ dllmain.c 1 May 2004 16:43:14 -0000 1.70
@@ -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: dllmain.c,v 1.69 2004/04/29 20:26:35 weiden Exp $
+/* $Id: dllmain.c,v 1.70 2004/05/01 16:43:14 weiden Exp $
*
* Entry Point for win32k.sys
*/
@@ -138,6 +138,14 @@
CleanupForProcess(Process, Process->UniqueProcessId);
IntGraphicsCheck(FALSE);
+
+ /*
+ * Deregister logon application automatically
+ */
+ if(LogonProcess == Win32Process)
+ {
+ LogonProcess = NULL;
+ }
}
return STATUS_SUCCESS;
reactos/subsys/win32k/ntuser
diff -u -r1.10 -r1.11
--- desktop.c 9 Apr 2004 20:03:19 -0000 1.10
+++ desktop.c 1 May 2004 16:43:15 -0000 1.11
@@ -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: desktop.c,v 1.10 2004/04/09 20:03:19 navaraf Exp $
+ * $Id: desktop.c,v 1.11 2004/05/01 16:43:15 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -719,7 +719,19 @@
DPRINT("Validation of desktop handle (0x%X) failed\n", hDesktop);
return FALSE;
}
-
+
+ /*
+ * Don't allow applications switch the desktop if it's locked, unless the caller
+ * is the logon application itself
+ */
+ if((DesktopObject->WindowStation->Flags & WSS_LOCKED) &&
+ LogonProcess != NULL && LogonProcess != PsGetWin32Process())
+ {
+ ObDereferenceObject(DesktopObject);
+ DPRINT1("Switching desktop 0x%x denied because the work station is locked!\n", hDesktop);
+ return FALSE;
+ }
+
/* FIXME: Fail if the desktop belong to an invisible window station */
/* FIXME: Fail if the process is associated with a secured
desktop such as Winlogon or Screen-Saver */
reactos/subsys/win32k/ntuser
diff -u -r1.66 -r1.67
--- misc.c 1 May 2004 11:38:28 -0000 1.66
+++ misc.c 1 May 2004 16:43:15 -0000 1.67
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.66 2004/05/01 11:38:28 weiden Exp $
+/* $Id: misc.c,v 1.67 2004/05/01 16:43:15 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -36,6 +36,9 @@
#define NDEBUG
#include <debug.h>
+/* registered Logon process */
+PW32PROCESS LogonProcess = NULL;
+
/* FIXME - not yet defined in w32api :( */
#define SPI_GETFOCUSBORDERWIDTH (8206)
#define SPI_SETFOCUSBORDERWIDTH (8207)
@@ -61,6 +64,43 @@
return pmPrimitiveMessageQueue;
}
+BOOL FASTCALL
+IntRegisterLogonProcess(HANDLE hProcess, BOOL x)
+{
+ PEPROCESS Process;
+ NTSTATUS Status;
+
+ if(LogonProcess != NULL && LogonProcess != PsGetWin32Process())
+ {
+ SetLastWin32Error(ERROR_ACCESS_DENIED);
+ return FALSE;
+ }
+
+ if(hProcess)
+ {
+ Status = ObReferenceObjectByHandle(hProcess,
+ PROCESS_QUERY_INFORMATION,
+ PsProcessType,
+ ExGetPreviousMode(),
+ (PVOID*)&Process,
+ NULL);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ return 0;
+ }
+
+ LogonProcess = Process->Win32Process;
+ ObDereferenceObject(Process);
+ }
+ else
+ {
+ /* deregister the logon process */
+ LogonProcess = NULL;
+ }
+ return TRUE;
+}
+
/*
* @unimplemented
*/
@@ -94,7 +134,7 @@
break;
default:
- DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam\n");
+ DPRINT1("Calling invalid routine number 0x%x in NtUserCallNoParam\n");
SetLastWin32Error(ERROR_INVALID_PARAMETER);
break;
}
@@ -223,7 +263,7 @@
return (DWORD)TRUE;
}
}
- DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam()\n Param=0x%x\n",
+ DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
Routine, Param);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return 0;
@@ -394,8 +434,12 @@
IntReleaseWindowObject(WindowObject);
return Ret;
}
+
+ case TWOPARAM_ROUTINE_REGISTERLOGONPROC:
+ return (DWORD)IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2);
+
}
- DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam()\n Param1=0x%x Parm2=0x%x\n",
+ DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
Routine, Param1, Param2);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return 0;
CVSspam 0.2.8