mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Added patch for implementation of BindImageEx.
This commit is contained in:
parent
36dafc95aa
commit
6c4eb0bb53
@ -35,12 +35,13 @@ Wine. All those differences are also documented on the
|
||||
Included bugfixes and improvements
|
||||
==================================
|
||||
|
||||
**Bugfixes and features included in the next upcoming release [9]:**
|
||||
**Bugfixes and features included in the next upcoming release [10]:**
|
||||
|
||||
* Add partially support for sessionStorage
|
||||
* Anno 1602 installer depends on Windows 98 behavior of SHFileOperationW
|
||||
* FEAR 1 installer expects basic_string_wchar_dtor to return NULL ([Wine Bug #37358](http://bugs.winehq.org/show_bug.cgi?id=37358))
|
||||
* Multiple applications need EnumDisplayDevicesW implementation ([Wine Bug #34978](http://bugs.winehq.org/show_bug.cgi?id=34978))
|
||||
* Support for BindImageEx ([Wine Bug #3591](http://bugs.winehq.org/show_bug.cgi?id=3591))
|
||||
* Support for D3DXGetShaderInputSemantics ([Wine Bug #22682](http://bugs.winehq.org/show_bug.cgi?id=22682))
|
||||
* Support for ID3DXSkinInfoImpl_UpdateSkinnedMesh ([Wine Bug #32572](http://bugs.winehq.org/show_bug.cgi?id=32572))
|
||||
* Support for UTF7 encoding/decoding ([Wine Bug #27388](http://bugs.winehq.org/show_bug.cgi?id=27388))
|
||||
|
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -12,6 +12,8 @@ wine-compholio (1.7.29) UNRELEASED; urgency=low
|
||||
* Added patch to add partially support for sessionStorage.
|
||||
* Added patch for implementation of GetNumaProcessorNode.
|
||||
* Added patch for wine64 support on FreeBSD/PC-BSD.
|
||||
* Added patch for improved multi monitor support.
|
||||
* Added patch for implementation of BindImageEx.
|
||||
* Removed patch to fix issues with drag image in ImageLists (accepted upstream).
|
||||
* Removed patch to set ldr.EntryPoint for main executable (accepted upstream).
|
||||
* Removed patch to implement stubs for [Get|Set]SystemFileCacheSize (accepted upstream).
|
||||
|
@ -32,6 +32,7 @@ PATCHLIST := \
|
||||
dsound-Fast_Mixer.ok \
|
||||
fonts-Missing_Fonts.ok \
|
||||
gdi32-MultiMonitor.ok \
|
||||
imagehlp-BindImageEx.ok \
|
||||
imm32-Cross_Thread_Access.ok \
|
||||
iphlpapi-TCP_Table.ok \
|
||||
kernel32-FindFirstFile.ok \
|
||||
@ -416,6 +417,24 @@ gdi32-MultiMonitor.ok:
|
||||
echo '+ { "gdi32-MultiMonitor", "Ken Thomases", "Add multi monitor support to gdi32." },'; \
|
||||
) > gdi32-MultiMonitor.ok
|
||||
|
||||
# Patchset imagehlp-BindImageEx
|
||||
# |
|
||||
# | Included patches:
|
||||
# | * Partial implementation of BindImageEx. [by Bernhard Reiter]
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#3591] Support for BindImageEx
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/imagehlp/modify.c, dlls/imagehlp/tests/image.c
|
||||
# |
|
||||
.INTERMEDIATE: imagehlp-BindImageEx.ok
|
||||
imagehlp-BindImageEx.ok:
|
||||
$(call APPLY_FILE,imagehlp-BindImageEx/0001-imagehlp-Implement-parts-of-BindImageEx-to-make-free.patch)
|
||||
@( \
|
||||
echo '+ { "imagehlp-BindImageEx", "Bernhard Reiter", "Partial implementation of BindImageEx." },'; \
|
||||
) > imagehlp-BindImageEx.ok
|
||||
|
||||
# Patchset imm32-Cross_Thread_Access
|
||||
# |
|
||||
# | Included patches:
|
||||
|
@ -0,0 +1,190 @@
|
||||
From 3bcb00b0a38488cec401dc8dca93968b03fb3144 Mon Sep 17 00:00:00 2001
|
||||
From: Bernhard Reiter <ockham@raz.or.at>
|
||||
Date: Wed, 9 Apr 2014 00:52:31 +0200
|
||||
Subject: imagehlp: Implement parts of BindImageEx to make freezing Python
|
||||
scripts work.
|
||||
|
||||
Fixes http://bugs.winehq.org/show_bug.cgi?id=3591
|
||||
---
|
||||
dlls/imagehlp/modify.c | 111 +++++++++++++++++++++++++++++++++++++++++---
|
||||
dlls/imagehlp/tests/image.c | 18 +++----
|
||||
2 files changed, 114 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/imagehlp/modify.c b/dlls/imagehlp/modify.c
|
||||
index debccc0..0de1fb3 100644
|
||||
--- a/dlls/imagehlp/modify.c
|
||||
+++ b/dlls/imagehlp/modify.c
|
||||
@@ -31,9 +31,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(imagehlp);
|
||||
|
||||
static WORD CalcCheckSum(DWORD StartValue, LPVOID BaseAddress, DWORD WordCount);
|
||||
|
||||
-
|
||||
/***********************************************************************
|
||||
* BindImage (IMAGEHLP.@)
|
||||
+ *
|
||||
+ * NOTES
|
||||
+ * See BindImageEx
|
||||
*/
|
||||
BOOL WINAPI BindImage(
|
||||
PCSTR ImageName, PCSTR DllPath, PCSTR SymbolPath)
|
||||
@@ -43,16 +45,113 @@ BOOL WINAPI BindImage(
|
||||
|
||||
/***********************************************************************
|
||||
* BindImageEx (IMAGEHLP.@)
|
||||
+ *
|
||||
+ * Compute the virtual address of each function imported by a PE image
|
||||
+ *
|
||||
+ * PARAMS
|
||||
+ *
|
||||
+ * Flags [in] Bind options
|
||||
+ * ImageName [in] File name of the image to be bound
|
||||
+ * DllPath [in] Root of the fallback search path in case the ImageName file cannot be opened
|
||||
+ * SymbolPath [in] Symbol file root search path
|
||||
+ * StatusRoutine [in] Pointer to a status routine which will be called during the binding process
|
||||
+ *
|
||||
+ * RETURNS
|
||||
+ * Success: TRUE
|
||||
+ * Failure: FALSE
|
||||
+ *
|
||||
+ * NOTES
|
||||
+ * Binding is not implemented yet, so far this function only enumerates
|
||||
+ * all imported dlls/functions and returns TRUE.
|
||||
*/
|
||||
BOOL WINAPI BindImageEx(
|
||||
DWORD Flags, PCSTR ImageName, PCSTR DllPath, PCSTR SymbolPath,
|
||||
PIMAGEHLP_STATUS_ROUTINE StatusRoutine)
|
||||
{
|
||||
- FIXME("(%d, %s, %s, %s, %p): stub\n",
|
||||
- Flags, debugstr_a(ImageName), debugstr_a(DllPath),
|
||||
- debugstr_a(SymbolPath), StatusRoutine
|
||||
- );
|
||||
- return TRUE;
|
||||
+ LOADED_IMAGE loaded_image;
|
||||
+ const IMAGE_IMPORT_DESCRIPTOR *import_desc;
|
||||
+ ULONG size;
|
||||
+
|
||||
+ FIXME("(%d, %s, %s, %s, %p): semi-stub\n",
|
||||
+ Flags, debugstr_a(ImageName), debugstr_a(DllPath),
|
||||
+ debugstr_a(SymbolPath), StatusRoutine
|
||||
+ );
|
||||
+
|
||||
+ if (!(MapAndLoad(ImageName, DllPath, &loaded_image, TRUE, TRUE))) return FALSE;
|
||||
+
|
||||
+ if (!(import_desc = RtlImageDirectoryEntryToData((HMODULE)loaded_image.MappedAddress, FALSE,
|
||||
+ IMAGE_DIRECTORY_ENTRY_IMPORT, &size)))
|
||||
+ {
|
||||
+ UnMapAndLoad(&loaded_image);
|
||||
+ return TRUE; /* No imported modules means nothing to bind, so we're done. */
|
||||
+ }
|
||||
+
|
||||
+ /* FIXME: Does native imagehlp support both 32-bit and 64-bit PE executables? */
|
||||
+#ifdef _WIN64
|
||||
+ if (loaded_image.FileHeader->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC)
|
||||
+#else
|
||||
+ if (loaded_image.FileHeader->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC)
|
||||
+#endif
|
||||
+ {
|
||||
+ FIXME("Wrong architecture in PE header, unable to enumerate imports\n");
|
||||
+ UnMapAndLoad(&loaded_image);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ for (; import_desc->Name && import_desc->FirstThunk; ++import_desc)
|
||||
+ {
|
||||
+ IMAGE_THUNK_DATA *thunk;
|
||||
+ char dll_fullname[MAX_PATH];
|
||||
+ const char *dll_name;
|
||||
+
|
||||
+ if (!(dll_name = ImageRvaToVa(loaded_image.FileHeader, loaded_image.MappedAddress,
|
||||
+ import_desc->Name, 0)))
|
||||
+ {
|
||||
+ UnMapAndLoad(&loaded_image);
|
||||
+ SetLastError(ERROR_INVALID_ACCESS); /* FIXME */
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (StatusRoutine)
|
||||
+ StatusRoutine(BindImportModule, ImageName, dll_name, 0, 0);
|
||||
+
|
||||
+ if (!SearchPathA(DllPath, dll_name, 0, sizeof(dll_fullname), dll_fullname, 0))
|
||||
+ {
|
||||
+ UnMapAndLoad(&loaded_image);
|
||||
+ SetLastError(ERROR_FILE_NOT_FOUND);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (!(thunk = ImageRvaToVa(loaded_image.FileHeader, loaded_image.MappedAddress,
|
||||
+ import_desc->OriginalFirstThunk ? import_desc->OriginalFirstThunk :
|
||||
+ import_desc->FirstThunk, 0)))
|
||||
+ {
|
||||
+ ERR("Can't grab thunk data of %s, going to next imported DLL\n");
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ for (; thunk->u1.Ordinal; ++thunk)
|
||||
+ {
|
||||
+ /* Ignoring ordinal imports for now */
|
||||
+ if(!IMAGE_SNAP_BY_ORDINAL(thunk->u1.Ordinal))
|
||||
+ {
|
||||
+ IMAGE_IMPORT_BY_NAME *iibn;
|
||||
+
|
||||
+ if (!(iibn = ImageRvaToVa(loaded_image.FileHeader, loaded_image.MappedAddress,
|
||||
+ thunk->u1.AddressOfData, 0)))
|
||||
+ {
|
||||
+ ERR("Can't grab import by name info, skipping to next ordinal\n");
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (StatusRoutine)
|
||||
+ StatusRoutine(BindImportProcedure, ImageName, dll_fullname, 0, (ULONG_PTR)iibn->Name);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ UnMapAndLoad(&loaded_image);
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
|
||||
diff --git a/dlls/imagehlp/tests/image.c b/dlls/imagehlp/tests/image.c
|
||||
index 48443f5..4a19c16 100644
|
||||
--- a/dlls/imagehlp/tests/image.c
|
||||
+++ b/dlls/imagehlp/tests/image.c
|
||||
@@ -390,10 +390,10 @@ static void test_bind_image_ex(void)
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = pBindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES, "nonexistent.dll", 0, 0,
|
||||
testing_status_routine);
|
||||
- todo_wine ok(!ret && ((GetLastError() == ERROR_FILE_NOT_FOUND) ||
|
||||
- (GetLastError() == ERROR_INVALID_PARAMETER)),
|
||||
- "expected ERROR_FILE_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n",
|
||||
- GetLastError());
|
||||
+ ok(!ret && ((GetLastError() == ERROR_FILE_NOT_FOUND) ||
|
||||
+ (GetLastError() == ERROR_INVALID_PARAMETER)),
|
||||
+ "expected ERROR_FILE_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n",
|
||||
+ GetLastError());
|
||||
|
||||
file = create_temp_file(temp_file);
|
||||
if (file == INVALID_HANDLE_VALUE)
|
||||
@@ -415,14 +415,14 @@ static void test_bind_image_ex(void)
|
||||
testing_status_routine);
|
||||
ok(ret, "BindImageEx failed: %d\n", GetLastError());
|
||||
|
||||
- todo_wine ok(status_routine_called[BindImportModule] == 1,
|
||||
- "StatusRoutine was called %d times\n", status_routine_called[BindImportModule]);
|
||||
+ ok(status_routine_called[BindImportModule] == 1,
|
||||
+ "StatusRoutine was called %d times\n", status_routine_called[BindImportModule]);
|
||||
|
||||
- todo_wine ok((status_routine_called[BindImportProcedure] == 1)
|
||||
+ ok((status_routine_called[BindImportProcedure] == 1)
|
||||
#if defined(_WIN64)
|
||||
- || broken(status_routine_called[BindImportProcedure] == 0) /* < Win8 */
|
||||
+ || broken(status_routine_called[BindImportProcedure] == 0) /* < Win8 */
|
||||
#endif
|
||||
- , "StatusRoutine was called %d times\n", status_routine_called[BindImportProcedure]);
|
||||
+ , "StatusRoutine was called %d times\n", status_routine_called[BindImportProcedure]);
|
||||
|
||||
DeleteFileA(temp_file);
|
||||
}
|
||||
--
|
||||
2.1.2
|
||||
|
4
patches/imagehlp-BindImageEx/definition
Normal file
4
patches/imagehlp-BindImageEx/definition
Normal file
@ -0,0 +1,4 @@
|
||||
Author: Bernhard Reiter
|
||||
Subject: Partial implementation of BindImageEx.
|
||||
Revision: 1
|
||||
Fixes: [3591] Support for BindImageEx
|
Loading…
x
Reference in New Issue
Block a user