[ros-diffs] [rharabien] 56153: [NTOSKRNL] - Always set response in ExpRaiseHardError. Fixes ntoskrnl:ExHardError kmtest [WIN32CSR] - Don't corrupt memory. Fixes random crashes when running ntoskrnl:ExHardError...

rharabien at svn.reactos.org rharabien at svn.reactos.org
Wed Mar 14 23:08:48 UTC 2012


Author: rharabien
Date: Wed Mar 14 23:08:48 2012
New Revision: 56153

URL: http://svn.reactos.org/svn/reactos?rev=56153&view=rev
Log:
[NTOSKRNL]
- Always set response in ExpRaiseHardError. Fixes ntoskrnl:ExHardError kmtest
[WIN32CSR]
- Don't corrupt memory. Fixes random crashes when running ntoskrnl:ExHardError kmtest

Modified:
    trunk/reactos/ntoskrnl/ex/harderr.c
    trunk/reactos/subsystems/win32/csrss/win32csr/harderror.c

Modified: trunk/reactos/ntoskrnl/ex/harderr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/harderr.c?rev=56153&r1=56152&r2=56153&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ex/harderr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/harderr.c [iso-8859-1] Wed Mar 14 23:08:48 2012
@@ -136,6 +136,7 @@
         if (!SeSinglePrivilegeCheck(SeShutdownPrivilege, PreviousMode))
         {
             /* No rights */
+            *Response = ResponseNotHandled;
             return STATUS_PRIVILEGE_NOT_HELD;
         }
 
@@ -248,6 +249,11 @@
             /* Set the response */
             *Response = Message->Response;
         }
+        else
+        {
+            /* Set the response */
+            *Response = ResponseReturnToCaller;
+        }
     }
     else
     {

Modified: trunk/reactos/subsystems/win32/csrss/win32csr/harderror.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win32csr/harderror.c?rev=56153&r1=56152&r2=56153&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/harderror.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/harderror.c [iso-8859-1] Wed Mar 14 23:08:48 2012
@@ -323,7 +323,7 @@
     RtlAppendUnicodeStringToString(CaptionStringU, &TempStringU);
 
     /* Zero terminate the buffer */
-    CaptionStringU->Buffer[CaptionStringU->Length] = 0;
+    CaptionStringU->Buffer[CaptionStringU->Length / sizeof(WCHAR)] = 0;
 
     /* Free the file name buffer */
     RtlFreeUnicodeString(&FileNameU);




More information about the Ros-diffs mailing list