[vlc-commits] Win32: display stacktrace before modules list

Jean-Baptiste Kempf git at videolan.org
Thu Aug 23 16:01:44 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Aug 23 16:01:27 2012 +0200| [9b77e1043394420137c674d47d9d9d265708eba2] | committer: Jean-Baptiste Kempf

Win32: display stacktrace before modules list

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b77e1043394420137c674d47d9d9d265708eba2
---

 bin/winvlc.c |   33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 9db5df1..ff50a00 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -357,23 +357,6 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
                         pContext->Ebp,pContext->Eip,pContext->Esp );
 #endif
 
-        HANDLE hpid = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
-                                        FALSE, GetCurrentProcessId());
-        if (hpid) {
-            HMODULE mods[1024];
-            DWORD size;
-            if (EnumProcessModules(hpid, mods, sizeof(mods), &size)) {
-                fwprintf( fd, L"\n\n[modules]\n" );
-                for (unsigned int i = 0; i < size / sizeof(HMODULE); i++) {
-                    wchar_t module[ 256 ];
-                    GetModuleFileName(mods[i], module, 256);
-                    fwprintf( fd, L"%p|%s\n", mods[i], module);
-                }
-            }
-            CloseHandle(hpid);
-        }
-
-
         fwprintf( fd, L"\n[stacktrace]\n#EIP|base|module\n" );
 
 #ifdef WIN64
@@ -398,6 +381,22 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
             pBase = *pBase;
         }
 
+        HANDLE hpid = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+                                        FALSE, GetCurrentProcessId());
+        if (hpid) {
+            HMODULE mods[1024];
+            DWORD size;
+            if (EnumProcessModules(hpid, mods, sizeof(mods), &size)) {
+                fwprintf( fd, L"\n\n[modules]\n" );
+                for (unsigned int i = 0; i < size / sizeof(HMODULE); i++) {
+                    wchar_t module[ 256 ];
+                    GetModuleFileName(mods[i], module, 256);
+                    fwprintf( fd, L"%p|%s\n", mods[i], module);
+                }
+            }
+            CloseHandle(hpid);
+        }
+
         fclose( fd );
         fflush( stderr );
         exit( 1 );



More information about the vlc-commits mailing list