Author: hbelusca
Date: Tue Dec 16 23:09:29 2014
New Revision: 65693
URL:
http://svn.reactos.org/svn/reactos?rev=65693&view=rev
Log:
[WIN32K]
Stubplement NtUserQueryInformationThread and NtUserSetInformationThread that will be used
for:
- shutdown support: CORE-8322
- communicating a CSR Port handle to win32k: CORE-7505
CORE-7505 CORE-8322
Modified:
trunk/reactos/win32ss/user/ntuser/ntstubs.c
Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntstub…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] Tue Dec 16 23:09:29 2014
@@ -761,8 +761,39 @@
OUT PVOID ThreadInformation,
IN ULONG ThreadInformationLength)
{
- STUB;
- return STATUS_SUCCESS;
+ NTSTATUS Status = STATUS_SUCCESS;
+ PETHREAD Thread;
+
+ /* Allow only CSRSS to perform this operation */
+ if (PsGetCurrentProcess() != gpepCSRSS)
+ return STATUS_ACCESS_DENIED;
+
+ UserEnterExclusive();
+
+ /* Get the Thread */
+ Status = ObReferenceObjectByHandle(ThreadHandle,
+ THREAD_QUERY_INFORMATION,
+ *PsThreadType,
+ UserMode,
+ (PVOID)&Thread,
+ NULL);
+ if (!NT_SUCCESS(Status)) goto Quit;
+
+ switch (ThreadInformationClass)
+ {
+ default:
+ {
+ STUB;
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
+ }
+
+ ObDereferenceObject(Thread);
+
+Quit:
+ UserLeave();
+ return Status;
}
DWORD
@@ -861,20 +892,63 @@
IN ULONG ThreadInformationLength)
{
- if (ThreadInformationClass == UserThreadInitiateShutdown)
+ NTSTATUS Status = STATUS_SUCCESS;
+ PETHREAD Thread;
+
+ /* Allow only CSRSS to perform this operation */
+ if (PsGetCurrentProcess() != gpepCSRSS)
+ 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)
{
- ERR("Shutdown initiated\n");
+ case UserThreadInitiateShutdown:
+ {
+ ERR("Shutdown initiated\n");
+ STUB;
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
+
+ case UserThreadEndShutdown:
+ {
+ ERR("Shutdown ended\n");
+ STUB;
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
+
+ case UserThreadCsrApiPort:
+ {
+ ERR("Set CSR API Port for Win32k\n");
+ STUB;
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
+
+ default:
+ {
+ STUB;
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
}
- else if (ThreadInformationClass == UserThreadEndShutdown)
- {
- ERR("Shutdown ended\n");
- }
- else
- {
- STUB;
- }
-
- return STATUS_SUCCESS;
+
+ ObDereferenceObject(Thread);
+
+Quit:
+ UserLeave();
+ return Status;
}
DWORD