[Wine-patches] ntoskrnl.exe: Fix the stack overflow bugs in raising exceptions (DLL_PROCESS_DETACH processing for DllMain in ntoskrnl.c) (eterbug 2399)

Anton Rudnev =?iso-8859-1?q?mibori_=CE=C1_etersoft=2Eru?=
Пн Окт 13 16:27:28 MSD 2008


ntoskrnl.exe: Fix the stack overflow bugs in raising exceptions 
(DLL_PROCESS_DETACH processing for DllMain in ntoskrnl.c) (eterbug 2399)
----------- следующая часть -----------
From 0f01539158527aa7f567762f1a12c45e17476d45 Mon Sep 17 00:00:00 2001
From: Anton Rudnev <mibori на builder.office.etersoft.ru>
Date: Tue, 7 Oct 2008 17:58:46 +0400
Subject: [PATCH] ntoskrnl.exe: Fix the stack overflow bugs in raising exceptions (DLL_PROCESS_DETACH processing for DllMain in ntoskrnl.c)
 eterbug 2399

---
 dlls/ntoskrnl.exe/ntoskrnl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 123a558..bb40a58 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -886,14 +886,17 @@ NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine( PCREATE_PROCESS_NOTIFY_ROUTINE
 BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
 {
     LARGE_INTEGER count;
+    static vectored_handler_added;
 
     switch(reason)
     {
     case DLL_PROCESS_ATTACH:
         DisableThreadLibraryCalls( inst );
-        RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
+        vectored_handler_added = RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
         KeQueryTickCount( &count );  /* initialize the global KeTickCount */
         break;
+    case DLL_PROCESS_DETACH:
+        RtlRemoveVectoredExceptionHandler(vectored_handler_added);
     }
     return TRUE;
 }
-- 
1.5.6.5.GIT



Подробная информация о списке рассылки Wine-patches