Author: fireball
Date: Sun Dec 13 22:29:04 2015
New Revision: 70341
URL:
http://svn.reactos.org/svn/reactos?rev=70341&view=rev
Log:
[WIN32K]
- Add NtUserSetInformationThread stub, thanks to Konstantin Shkil.
The general direction is that it's fine to add syscalls to Arwinss' win32k which
are called by other components like usersrv/consrv, as the list is quite small really, and
NtUserInitialize is already there.
Added:
branches/arwinss/arwinss/server/main/misc.c (with props)
Modified:
branches/arwinss/arwinss/server/CMakeLists.txt
branches/arwinss/arwinss/server/w32ksvc.db
branches/arwinss/arwinss/server/w32ksvc.h
Modified: branches/arwinss/arwinss/server/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/CMakeLis…
==============================================================================
--- branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] (original)
+++ branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] Sun Dec 13 22:29:04 2015
@@ -87,6 +87,7 @@
main/monitor.c
main/kbdlayout.c
main/keyboard.c
+ main/misc.c
swm/winman.c
wine/atom.c
wine/class.c
Added: branches/arwinss/arwinss/server/main/misc.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/mis…
==============================================================================
--- branches/arwinss/arwinss/server/main/misc.c (added)
+++ branches/arwinss/arwinss/server/main/misc.c [iso-8859-1] Sun Dec 13 22:29:04 2015
@@ -0,0 +1,167 @@
+/*
+ * PROJECT: ReactOS Win32K
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: server/main/misc.c
+ * PURPOSE: Misc stuff
+ * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <win32k.h>
+
+//#define NDEBUG
+#include <debug.h>
+
+#include <ntstatus.h>
+//#include <shutdown.h>
+#include <csr.h>
+
+extern PEPROCESS CsrProcess;
+
+NTSTATUS
+APIENTRY
+NtUserSetInformationThread(IN HANDLE ThreadHandle,
+ IN USERTHREADINFOCLASS ThreadInformationClass,
+ IN PVOID ThreadInformation,
+ IN ULONG ThreadInformationLength)
+{
+ NTSTATUS Status = STATUS_SUCCESS;
+ PETHREAD Thread;
+
+ /* Allow only CSRSS to perform this operation */
+ if (PsGetCurrentProcess() != CsrProcess)
+ return STATUS_ACCESS_DENIED;
+
+ UserEnterExclusive();
+
+ /* Get the Thread */
+ Status = ObReferenceObjectByHandle(ThreadHandle,
+ THREAD_SET_INFORMATION,
+ *PsThreadType,
+ UserMode,
+ (PVOID)&Thread,
+ NULL);
+ if (!NT_SUCCESS(Status)) goto Quit;
+
+ switch (ThreadInformationClass)
+ {
+ case UserThreadInitiateShutdown:
+ {
+ ULONG CapturedFlags = 0;
+
+ DPRINT("Shutdown initiated\n");
+
+ if (ThreadInformationLength != sizeof(ULONG))
+ {
+ Status = STATUS_INFO_LENGTH_MISMATCH;
+ break;
+ }
+
+ /* Capture the caller value */
+ Status = STATUS_SUCCESS;
+ _SEH2_TRY
+ {
+ ProbeForWrite(ThreadInformation, sizeof(CapturedFlags), sizeof(PVOID));
+ CapturedFlags = *(PULONG)ThreadInformation;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ _SEH2_YIELD(break);
+ }
+ _SEH2_END;
+
+ Status = STATUS_NOT_IMPLEMENTED; //UserInitiateShutdown(Thread,
&CapturedFlags);
+ UNIMPLEMENTED;
+
+ /* Return the modified value to the caller */
+ _SEH2_TRY
+ {
+ *(PULONG)ThreadInformation = CapturedFlags;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
+
+ break;
+ }
+
+ case UserThreadEndShutdown:
+ {
+ NTSTATUS ShutdownStatus;
+
+ DPRINT("Shutdown ended\n");
+
+ if (ThreadInformationLength != sizeof(ShutdownStatus))
+ {
+ Status = STATUS_INFO_LENGTH_MISMATCH;
+ break;
+ }
+
+ /* Capture the caller value */
+ Status = STATUS_SUCCESS;
+ _SEH2_TRY
+ {
+ ProbeForRead(ThreadInformation, sizeof(ShutdownStatus), sizeof(PVOID));
+ ShutdownStatus = *(NTSTATUS*)ThreadInformation;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ _SEH2_YIELD(break);
+ }
+ _SEH2_END;
+
+ Status = STATUS_NOT_IMPLEMENTED; //UserEndShutdown(Thread, ShutdownStatus);
+ UNIMPLEMENTED;
+ break;
+ }
+
+ case UserThreadCsrApiPort:
+ {
+ HANDLE CsrPortHandle;
+
+ DPRINT("Set CSR API Port for Win32k\n");
+
+ if (ThreadInformationLength != sizeof(CsrPortHandle))
+ {
+ Status = STATUS_INFO_LENGTH_MISMATCH;
+ break;
+ }
+
+ /* Capture the caller value */
+ Status = STATUS_SUCCESS;
+ _SEH2_TRY
+ {
+ ProbeForRead(ThreadInformation, sizeof(CsrPortHandle), sizeof(PVOID));
+ CsrPortHandle = *(PHANDLE)ThreadInformation;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ _SEH2_YIELD(break);
+ }
+ _SEH2_END;
+
+ Status = STATUS_NOT_IMPLEMENTED;//InitCsrApiPort(CsrPortHandle);
+ UNIMPLEMENTED;
+ break;
+ }
+
+ default:
+ {
+ UNIMPLEMENTED;
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
+ }
+
+ ObDereferenceObject(Thread);
+
+Quit:
+ UserLeave();
+ return Status;
+}
Propchange: branches/arwinss/arwinss/server/main/misc.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/arwinss/arwinss/server/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/w32ksvc.…
==============================================================================
--- branches/arwinss/arwinss/server/w32ksvc.db [iso-8859-1] (original)
+++ branches/arwinss/arwinss/server/w32ksvc.db [iso-8859-1] Sun Dec 13 22:29:04 2015
@@ -92,4 +92,5 @@
SwmPosChanged 5
SwmGetWindowFromPoint 2
SwmShowWindow 3
-NtUserInitialize 3
+NtUserInitialize 3
+NtUserSetInformationThread 4
Modified: branches/arwinss/arwinss/server/w32ksvc.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/w32ksvc.…
==============================================================================
--- branches/arwinss/arwinss/server/w32ksvc.h [iso-8859-1] (original)
+++ branches/arwinss/arwinss/server/w32ksvc.h [iso-8859-1] Sun Dec 13 22:29:04 2015
@@ -96,3 +96,4 @@
SVC_(SwmGetWindowFromPoint, 2)
SVC_(SwmShowWindow, 3)
SVC_(NtUserInitialize, 3)
+SVC_(NtUserSetInformationThread, 4)