[Wine-patches] [eter-1.0.12] [eterhack] Fix installing Garant 7.4.1 data (eterbug #5455).

Alexander Morozov amorozov на etersoft.ru
Ср Май 26 17:35:26 MSD 2010


----------- следующая часть -----------
From f568bbdb8a8b8610f84fd1fe691d062a5b0cf100 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 26 May 2010 16:07:38 +0400
Subject: [PATCH] Fix installing Garant 7.4.1 data (eterbug #5455).

---
 dlls/ntdll/loader.c     |   15 +++++++++++++++
 include/wine/etersoft.h |    4 ++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 26e9701..6a78a22 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -46,6 +46,7 @@
 #include "ddk/wdm.h"
 
 #define ETERSOFT_FUNC_PROTECT
+#define ETERSOFT_FUNC_GARANT
 #include "wine/etersoft.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(module);
@@ -1972,6 +1973,12 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
             if (nts == STATUS_INVALID_FILE_FOR_SECTION)
                 /* not in PE format, maybe it's a builtin */
                 nts = load_builtin_dll( load_path, filename, handle, flags, pwm );
+            if (nts != STATUS_SUCCESS)
+            {
+                LOADETER_FUNC( etersoft_garant_fix );
+                if (etersoft_garant_fix && !etersoft_garant_fix( &handle ))
+                    nts = load_native_dll( load_path, filename, handle, flags, pwm );
+            }
         }
         if (nts == STATUS_DLL_NOT_FOUND && loadorder == LO_NATIVE_BUILTIN)
             nts = load_builtin_dll( load_path, filename, 0, flags, pwm );
@@ -1993,7 +2000,15 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
             nts = STATUS_DLL_NOT_FOUND;
         }
         if (nts == STATUS_DLL_NOT_FOUND && loadorder != LO_BUILTIN)
+        {
             nts = load_native_dll( load_path, filename, handle, flags, pwm );
+            if (nts != STATUS_SUCCESS)
+            {
+                LOADETER_FUNC( etersoft_garant_fix );
+                if (etersoft_garant_fix && ! etersoft_garant_fix( &handle ))
+                    nts = load_native_dll( load_path, filename, handle, flags, pwm );
+            }
+        }
         break;
     }
 
diff --git a/include/wine/etersoft.h b/include/wine/etersoft.h
index b7d5152..8af36a6 100644
--- a/include/wine/etersoft.h
+++ b/include/wine/etersoft.h
@@ -185,4 +185,8 @@ static int (*etersoft_ischarlower)(unsigned int cp, char x);
 static int (*etersoft_ischarupper)(unsigned int cp, char x);
 #endif
 
+#ifdef ETERSOFT_FUNC_GARANT
+static int (*etersoft_garant_fix)(void **handle);
+#endif
+
 #endif
-- 
1.6.5.8



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