[PATCH 1/3] [Kernel32]: don't force winedbg startup when no AeDebug key is present (#24524)

Eric Pouech eric.pouech at orange.fr
Sun Oct 24 15:07:24 CDT 2010




A+
---

 dlls/kernel32/except.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)


diff --git a/dlls/kernel32/except.c b/dlls/kernel32/except.c
index de07442..bea96b2 100644
--- a/dlls/kernel32/except.c
+++ b/dlls/kernel32/except.c
@@ -191,6 +191,7 @@ static BOOL	start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
     char*		format = NULL;
     BOOL		ret = FALSE;
     char buffer[256];
+    DWORD               format_size;
 
     static const WCHAR AeDebugW[] = {'M','a','c','h','i','n','e','\\',
                                      'S','o','f','t','w','a','r','e','\\',
@@ -216,7 +217,8 @@ static BOOL	start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
     {
         char buffer[64];
         KEY_VALUE_PARTIAL_INFORMATION *info;
-        DWORD format_size = 0;
+
+        format_size = 0;
 
         RtlInitUnicodeString( &nameW, DebuggerW );
         if (NtQueryValueKey( hDbgConf, &nameW, KeyValuePartialInformation,
@@ -263,20 +265,17 @@ static BOOL	start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
        NtClose(hDbgConf);
     }
 
-    if (format)
-    {
-        size_t format_size = strlen(format) + 2*20;
-        cmdline = HeapAlloc(GetProcessHeap(), 0, format_size);
-        snprintf(cmdline, format_size, format, (long)GetCurrentProcessId(), (long)HandleToLong(hEvent));
-        HeapFree(GetProcessHeap(), 0, format);
-    }
-    else
+    if (!format)
     {
-        cmdline = HeapAlloc(GetProcessHeap(), 0, 80);
-        snprintf(cmdline, 80, "winedbg --auto %ld %ld", /* as in tools/wine.inf */
-                 (long)GetCurrentProcessId(), (long)HandleToLong(hEvent));
+        /* no AeDebug key present, just kill the program */
+        return FALSE;
     }
 
+    format_size = strlen(format) + 2*20;
+    cmdline = HeapAlloc(GetProcessHeap(), 0, format_size);
+    snprintf(cmdline, format_size, format, (long)GetCurrentProcessId(), (long)HandleToLong(hEvent));
+    HeapFree(GetProcessHeap(), 0, format);
+
     if (!bAuto)
     {
 	HMODULE			mod = GetModuleHandleA( "user32.dll" );






More information about the wine-patches mailing list