This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Drop use_dont_resolve_hack flag


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=105f79b489d5128ffda50d80fbdcccd8645fe788

commit 105f79b489d5128ffda50d80fbdcccd8645fe788
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Jun 24 15:42:06 2016 +0200

    Drop use_dont_resolve_hack flag
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/autoload.cc | 20 +++-----------------
 winsup/cygwin/wincap.cc   |  7 -------
 winsup/cygwin/wincap.h    |  2 --
 3 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 5c8dcd8..d8e6e79 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -332,31 +332,17 @@ union retchain
 /* This function handles the problem described here:
 
   http://www.microsoft.com/technet/security/advisory/2269637.mspx
-  https://msdn.microsoft.com/library/ff919712
-
-  It also contains a workaround for the problem reported here:
-  http://cygwin.com/ml/cygwin/2011-02/msg00552.html
-  and discussed here:
-  http://cygwin.com/ml/cygwin-developers/2011-02/threads.html#00007
-
-  To wit: winmm.dll calls FreeLibrary in its DllMain and that can result
-  in LoadLibraryExW returning an ERROR_INVALID_ADDRESS. */
+  https://msdn.microsoft.com/library/ff919712 */
 static __inline bool
 dll_load (HANDLE& handle, PWCHAR name)
 {
   HANDLE h = NULL;
   WCHAR dll_path[MAX_PATH];
 
-  /* If that failed, try loading with full path, which sometimes
-     fails for no good reason. */
+  /* Try loading with full path, which sometimes fails for no good reason. */
   wcpcpy (wcpcpy (dll_path, windows_system_directory), name);
   h = LoadLibraryW (dll_path);
-  /* If that failed according to the second problem outlined in the
-     comment preceeding this function. */
-  if (!h && handle && wincap.use_dont_resolve_hack ()
-      && GetLastError () == ERROR_INVALID_ADDRESS)
-    h = LoadLibraryExW (dll_path, NULL, DONT_RESOLVE_DLL_REFERENCES);
-  /* Last resort: Try loading just by name. */
+  /* If it failed, try loading just by name. */
   if (!h)
     h = LoadLibraryW (name);
   if (!h)
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 5c62ea1..0f38b6a 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -24,7 +24,6 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
   needs_count_in_si_lpres2:false,
   has_gaa_largeaddress_bug:false,
   has_broken_alloc_console:false,
-  use_dont_resolve_hack:true,
   has_console_logon_sid:false,
   wow64_has_secondary_stack:false,
   has_program_compatibility_assistant:false,
@@ -47,7 +46,6 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
   needs_count_in_si_lpres2:false,
   has_gaa_largeaddress_bug:false,
   has_broken_alloc_console:false,
-  use_dont_resolve_hack:true,
   has_console_logon_sid:false,
   wow64_has_secondary_stack:true,
   has_program_compatibility_assistant:false,
@@ -70,7 +68,6 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
   needs_count_in_si_lpres2:true,
   has_gaa_largeaddress_bug:true,
   has_broken_alloc_console:false,
-  use_dont_resolve_hack:false,
   has_console_logon_sid:false,
   wow64_has_secondary_stack:false,
   has_program_compatibility_assistant:true,
@@ -93,7 +90,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
   needs_count_in_si_lpres2:false,
   has_gaa_largeaddress_bug:true,
   has_broken_alloc_console:true,
-  use_dont_resolve_hack:false,
   has_console_logon_sid:true,
   wow64_has_secondary_stack:false,
   has_program_compatibility_assistant:true,
@@ -116,7 +112,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
   needs_count_in_si_lpres2:false,
   has_gaa_largeaddress_bug:false,
   has_broken_alloc_console:true,
-  use_dont_resolve_hack:false,
   has_console_logon_sid:true,
   wow64_has_secondary_stack:false,
   has_program_compatibility_assistant:true,
@@ -139,7 +134,6 @@ wincaps wincap_10 __attribute__((section (".cygwin_dll_common"), shared)) = {
   needs_count_in_si_lpres2:false,
   has_gaa_largeaddress_bug:false,
   has_broken_alloc_console:true,
-  use_dont_resolve_hack:false,
   has_console_logon_sid:true,
   wow64_has_secondary_stack:false,
   has_program_compatibility_assistant:true,
@@ -162,7 +156,6 @@ wincaps wincap_10_1511 __attribute__((section (".cygwin_dll_common"), shared)) =
   needs_count_in_si_lpres2:false,
   has_gaa_largeaddress_bug:false,
   has_broken_alloc_console:true,
-  use_dont_resolve_hack:false,
   has_console_logon_sid:true,
   wow64_has_secondary_stack:false,
   has_program_compatibility_assistant:true,
diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h
index e8983c4..bdbb0f2 100644
--- a/winsup/cygwin/wincap.h
+++ b/winsup/cygwin/wincap.h
@@ -17,7 +17,6 @@ struct wincaps
   unsigned needs_count_in_si_lpres2			: 1;
   unsigned has_gaa_largeaddress_bug			: 1;
   unsigned has_broken_alloc_console			: 1;
-  unsigned use_dont_resolve_hack			: 1;
   unsigned has_console_logon_sid			: 1;
   unsigned wow64_has_secondary_stack			: 1;
   unsigned has_program_compatibility_assistant		: 1;
@@ -65,7 +64,6 @@ public:
   bool	IMPLEMENT (needs_count_in_si_lpres2)
   bool	IMPLEMENT (has_gaa_largeaddress_bug)
   bool	IMPLEMENT (has_broken_alloc_console)
-  bool	IMPLEMENT (use_dont_resolve_hack)
   bool	IMPLEMENT (has_console_logon_sid)
   bool	IMPLEMENT (wow64_has_secondary_stack)
   bool	IMPLEMENT (has_program_compatibility_assistant)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]