subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1755982 - in /subversion/trunk/subversion/libsvn_subr: win32_crashrpt.c win32_crashrpt_dll.h
Date Thu, 11 Aug 2016 13:40:48 GMT
Author: ivan
Date: Thu Aug 11 13:40:47 2016
New Revision: 1755982

URL: http://svn.apache.org/viewvc?rev=1755982&view=rev
Log:
Use IsDebuggerPresent() Windows API directly instead of
LoadLibrary()/GetProcAddress(). IsDebuggerPresent is available since
Windows NT 4.0 because it's defined with _WIN32_WINNT >= 0x0400.

* subversion/libsvn_subr/win32_crashrpt.c
  (is_debugger_present): Use IsDebuggerPresent() directly.

* subversion/libsvn_subr/win32_crashrpt_dll.h
  (ISDEBUGGERPRESENT): Remove.

Modified:
    subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c
    subversion/trunk/subversion/libsvn_subr/win32_crashrpt_dll.h

Modified: subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c?rev=1755982&r1=1755981&r2=1755982&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/trunk/subversion/libsvn_subr/win32_crashrpt.c Thu Aug 11 13:40:47 2016
@@ -599,20 +599,7 @@ write_stacktrace(CONTEXT *context, FILE
 static BOOL
 is_debugger_present()
 {
-  HANDLE kernel32_dll = LoadLibrary("kernel32.dll");
-  BOOL result;
-
-  ISDEBUGGERPRESENT IsDebuggerPresent_ =
-          (ISDEBUGGERPRESENT)GetProcAddress(kernel32_dll, "IsDebuggerPresent");
-
-  if (IsDebuggerPresent_ && IsDebuggerPresent_())
-    result = TRUE;
-  else
-    result = FALSE;
-
-  FreeLibrary(kernel32_dll);
-
-  return result;
+  return IsDebuggerPresent();
 }
 
 /* Load the dbghelp.dll file, try to find a version that matches our

Modified: subversion/trunk/subversion/libsvn_subr/win32_crashrpt_dll.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/win32_crashrpt_dll.h?rev=1755982&r1=1755981&r2=1755982&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/win32_crashrpt_dll.h (original)
+++ subversion/trunk/subversion/libsvn_subr/win32_crashrpt_dll.h Thu Aug 11 13:40:47 2016
@@ -69,9 +69,6 @@ typedef PVOID (WINAPI * SYMFUNCTIONTABLE
 
 typedef DWORD64 (WINAPI * SYMGETMODULEBASE64)(HANDLE hProcess, DWORD64 dwAddr);
 
-/* public functions in kernel32.dll */
-typedef BOOL  (WINAPI * ISDEBUGGERPRESENT)(VOID);
-
 /* function pointers */
 MINIDUMPWRITEDUMP        MiniDumpWriteDump_;
 SYMINITIALIZE            SymInitialize_;



Mime
View raw message