Author: gadamopoulos
Date: Sun Feb 19 23:29:28 2012
New Revision: 55726
URL: http://svn.reactos.org/svn/reactos?rev=55726&view=rev
Log:
[win32k]
- remove assertions from the process callout checking that ppiCurrent->rpdeskStartup and ppiCurrent->hdeskStartup are valid. This can happen in case we fail to open the initial desktop or window station
Modified:
trunk/reactos/subsystems/win32/win32k/main/dllmain.c
Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ma…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] Sun Feb 19 23:29:28 2012
@@ -187,10 +187,10 @@
}
/* Close the startup desktop */
- ASSERT(ppiCurrent->rpdeskStartup);
- ASSERT(ppiCurrent->hdeskStartup);
- ObDereferenceObject(ppiCurrent->rpdeskStartup);
- ZwClose(ppiCurrent->hdeskStartup);
+ if(ppiCurrent->rpdeskStartup)
+ ObDereferenceObject(ppiCurrent->rpdeskStartup);
+ if(ppiCurrent->hdeskStartup)
+ ZwClose(ppiCurrent->hdeskStartup);
/* Close the current window station */
UserSetProcessWindowStation(NULL);
Author: gadamopoulos
Date: Sun Feb 19 22:05:25 2012
New Revision: 55724
URL: http://svn.reactos.org/svn/reactos?rev=55724&view=rev
Log:
[ntoskrnl]
- Fix a crash in KiSystemCall that was caused because PsConvertToGuiThread may have switched to a large kernel stack, but still returned with failure because win32k did not succeed. To fix it reload the trap frame after the call before checking for success.
Modified:
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Sun Feb 19 22:05:25 2012
@@ -1556,17 +1556,18 @@
/* Convert us to a GUI thread -- must wrap in ASM to get new EBP */
Result = KiConvertToGuiThread();
+
+ /* Reload trap frame and descriptor table pointer from new stack */
+ TrapFrame = *(volatile PVOID*)&Thread->TrapFrame;
+ DescriptorTable = (PVOID)(*(volatile ULONG_PTR*)&Thread->ServiceTable + Offset);
+
if (!NT_SUCCESS(Result))
{
/* Set the last error and fail */
//SetLastWin32Error(RtlNtStatusToDosError(Result));
goto ExitCall;
}
-
- /* Reload trap frame and descriptor table pointer from new stack */
- TrapFrame = *(volatile PVOID*)&Thread->TrapFrame;
- DescriptorTable = (PVOID)(*(volatile ULONG_PTR*)&Thread->ServiceTable + Offset);
-
+
/* Validate the system call number again */
if (Id >= DescriptorTable->Limit)
{
Author: ion
Date: Sun Feb 19 20:08:11 2012
New Revision: 55719
URL: http://svn.reactos.org/svn/reactos?rev=55719&view=rev
Log:
[NTOSKRNL]: The ExitTime in ETHREAD is unionized and only valid if the thread actually exited, so don't always return the raw value -- return 0 if the thread is still alive. Fixes code which uses ExitTime != 0 to tell if a thread is still alive or not -- everyone always thought all ReactOS threads are always dead.
Modified:
trunk/reactos/ntoskrnl/ps/query.c
Modified: trunk/reactos/ntoskrnl/ps/query.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=55…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] Sun Feb 19 20:08:11 2012
@@ -2279,12 +2279,19 @@
_SEH2_TRY
{
/* Copy time information from ETHREAD/KTHREAD */
- ThreadTime->KernelTime.QuadPart = Thread->Tcb.KernelTime *
- 100000LL;
- ThreadTime->UserTime.QuadPart = Thread->Tcb.UserTime *
- 100000LL;
+ ThreadTime->KernelTime.QuadPart = Thread->Tcb.KernelTime * KeMaximumIncrement;
+ ThreadTime->UserTime.QuadPart = Thread->Tcb.UserTime * KeMaximumIncrement;
ThreadTime->CreateTime = Thread->CreateTime;
- ThreadTime->ExitTime = Thread->ExitTime;
+
+ /* Exit time is in a union and only valid on actual exit! */
+ if (KeReadStateThread(&Thread->Tcb))
+ {
+ ThreadTime->ExitTime = Thread->ExitTime;
+ }
+ else
+ {
+ ThreadTime->ExitTime.QuadPart = 0;
+ }
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{