DWORD reserved
);
-DWORD
+BOOL
STDCALL
RegisterLogonProcess(
HANDLE hprocess,
#define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0x58
#define TWOPARAM_ROUTINE_SETCARETPOS 0x60
#define TWOPARAM_ROUTINE_GETWINDOWINFO 0x61
+#define TWOPARAM_ROUTINE_REGISTERLOGONPROC 0x62
DWORD
STDCALL
NtUserCallTwoParam(
#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)
* 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
{
NtUserManualGuiCheck(Check);
}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+RegisterLogonProcess ( HANDLE hprocess, BOOL x )
+{
+ return NtUserRegisterLogonProcess(hprocess, x);
+}
-/* $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
UNIMPLEMENTED;
}
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-RegisterLogonProcess ( HANDLE hprocess, BOOL x )
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
/*
* @unimplemented
*/
UINT CaretBlinkRate;
HANDLE ShellWindow;
HANDLE ShellListView;
- BOOL DesktopLocked;
+ ULONG Flags;
struct _DESKTOP_OBJECT* ActiveDesktop;
/* FIXME: Clipboard */
LIST_ENTRY HotKeyListHead;
#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);
* 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
*/
CleanupForProcess(Process, Process->UniqueProcessId);
IntGraphicsCheck(FALSE);
+
+ /*
+ * Deregister logon application automatically
+ */
+ if(LogonProcess == Win32Process)
+ {
+ LogonProcess = NULL;
+ }
}
return STATUS_SUCCESS;
* 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
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 */
-/* $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
#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)
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
*/
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;
}
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;
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;