Added patch for TLB dependencies lookup in resources.

This commit is contained in:
Sebastian Lackner 2014-11-01 08:59:45 +01:00
parent 212f94bb9f
commit 61769b2227
5 changed files with 153 additions and 1 deletions

View File

@ -35,7 +35,7 @@ Wine. All those differences are also documented on the
Included bugfixes and improvements
==================================
**Bugfixes and features included in the next upcoming release [8]:**
**Bugfixes and features included in the next upcoming release [9]:**
* Cinema 4D needs NotifyIpInterfaceChange ([Wine Bug #34573](https://bugs.winehq.org/show_bug.cgi?id=34573))
* D3DCompileShader should filter specific warning messages ([Wine Bug #33770](https://bugs.winehq.org/show_bug.cgi?id=33770))
@ -43,6 +43,7 @@ Included bugfixes and improvements
* Support for D3DXCreatePolygon ([Wine Bug #13632](https://bugs.winehq.org/show_bug.cgi?id=13632))
* Support for GdipCreateRegionRgnData ([Wine Bug #34843](https://bugs.winehq.org/show_bug.cgi?id=34843))
* Support for RtlDecompressBuffer ([Wine Bug #37449](https://bugs.winehq.org/show_bug.cgi?id=37449))
* Support for TLB dependencies lookup in resources ([Wine Bug #34184](https://bugs.winehq.org/show_bug.cgi?id=34184))
* Support for pasting HTML from Unix applications ([Wine Bug #7372](https://bugs.winehq.org/show_bug.cgi?id=7372))
* Tumblebugs 2 requires DXTn software encoding support ([Wine Bug #29586](https://bugs.winehq.org/show_bug.cgi?id=29586))

1
debian/changelog vendored
View File

@ -8,6 +8,7 @@ wine-compholio (1.7.30) UNRELEASED; urgency=low
* Added patch to emulate write to CR4 register.
* Added patch for implementation of GdipCreateRegionRgnData.
* Added patch for implementation of D3DXCreatePolygon.
* Added patch for TLB dependencies lookup in resources.
* Removed patch to avoid Clang compiler warning because of unused Vtable (accepted upstream).
* Removed patch for additional ATL thunks (accepted upstream).
* Removed patch to ímplement IRichEditOle and ITextDocument support for ITextServices (accepted upstream).

View File

@ -65,6 +65,7 @@ PATCHLIST := \
ntdll-WRITECOPY.ok \
ntoskrnl-Irp_Status.ok \
ntoskrnl-Write_CR4.ok \
oleaut32-TLB_Resource.ok \
quartz-MediaSeeking_Positions.ok \
riched20-IText_Interface.ok \
server-ACL_Compat.ok \
@ -1042,6 +1043,24 @@ ntoskrnl-Write_CR4.ok:
echo '+ { "ntoskrnl-Write_CR4", "Stefan Leichter", "Emulate write to CR4 register." },'; \
) > ntoskrnl-Write_CR4.ok
# Patchset oleaut32-TLB_Resource
# |
# | Included patches:
# | * Implement TLB dependencies lookup in resources. [by Guillaume Charifi]
# |
# | This patchset fixes the following Wine bugs:
# | * [#34184] Support for TLB dependencies lookup in resources
# |
# | Modified files:
# | * dlls/oleaut32/tests/typelib.c, dlls/oleaut32/typelib.c
# |
.INTERMEDIATE: oleaut32-TLB_Resource.ok
oleaut32-TLB_Resource.ok:
$(call APPLY_FILE,oleaut32-TLB_Resource/0001-oleaut32-Implement-TLB-dependencies-lookup-in-resour.patch)
@( \
echo '+ { "oleaut32-TLB_Resource", "Guillaume Charifi", "Implement TLB dependencies lookup in resources." },'; \
) > oleaut32-TLB_Resource.ok
# Patchset quartz-MediaSeeking_Positions
# |
# | Included patches:

View File

@ -0,0 +1,127 @@
From ad5b73eba53261f5821493068386c41a8d072751 Mon Sep 17 00:00:00 2001
From: Guillaume Charifi <guillaume.charifi@sfr.fr>
Date: Sat, 1 Nov 2014 08:47:44 +0100
Subject: oleaut32: Implement TLB dependencies lookup in resources.
Changes by Sebastian Lackner <sebastian@fds-team.de>:
* Avoid duplicating code for loading typelibs.
* Avoid casts from const to non-const variables.
* Simplify logic to generate filename.
* Use appropriate function for UUID comparison.
---
dlls/oleaut32/tests/typelib.c | 2 +-
dlls/oleaut32/typelib.c | 73 +++++++++++++++++++++++++++++++++++++------
2 files changed, 65 insertions(+), 10 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 728185a..45a56ea 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -5594,7 +5594,7 @@ static void test_dep(void) {
ok(hr == S_OK, "got: %x\n", hr);
hr = ITypeInfo_GetRefTypeInfo(ptInfo, refType, &ptInfoExt);
- todo_wine ok(hr == S_OK || broken(hr == TYPE_E_CANTLOADLIBRARY) /* win 2000 */, "got: %x\n", hr);
+ ok(hr == S_OK || broken(hr == TYPE_E_CANTLOADLIBRARY) /* win 2000 */, "got: %x\n", hr);
ITypeInfo_Release(ptInfo);
if(ptInfoExt)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 00f5043..6497313 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -7572,6 +7572,48 @@ static HRESULT ITypeInfoImpl_GetDispatchRefTypeInfo( ITypeInfo *iface,
return E_FAIL;
}
+struct search_res_tlb_params
+{
+ const GUID *guid;
+ ITypeLib *pTLib;
+};
+
+static BOOL CALLBACK search_res_tlb(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
+{
+ struct search_res_tlb_params *params = (LPVOID)lParam;
+ static const WCHAR formatW[] = {'\\','%','d',0};
+ WCHAR szPath[MAX_PATH+1];
+ ITypeLib2 *pTLib = NULL;
+ HRESULT ret;
+ DWORD len;
+
+ if (IS_INTRESOURCE(lpszName) == FALSE)
+ return TRUE;
+
+ if (!(len = GetModuleFileNameW(hModule, szPath, MAX_PATH)))
+ return TRUE;
+
+ if (snprintfW(szPath + len, sizeof(szPath)/sizeof(WCHAR) - len,
+ formatW, PtrToInt(lpszName)) < 0)
+ {
+ return TRUE;
+ }
+
+ ret = LoadTypeLibEx(szPath, REGKIND_NONE, (ITypeLib **)&pTLib);
+ if (SUCCEEDED(ret))
+ {
+ ITypeLibImpl *impl = impl_from_ITypeLib2(pTLib);
+ if (IsEqualGUID(params->guid, impl->guid))
+ {
+ params->pTLib = (ITypeLib *)pTLib;
+ return FALSE; /* stop enumeration */
+ }
+ ITypeLib_Release((ITypeLib *)pTLib);
+ }
+
+ return TRUE;
+}
+
/* ITypeInfo::GetRefTypeInfo
*
* If a type description references other type descriptions, it retrieves
@@ -7665,20 +7707,33 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
ITypeLib_AddRef(pTLib);
result = S_OK;
} else {
+ static const WCHAR TYPELIBW[] = {'T','Y','P','E','L','I','B',0};
+ struct search_res_tlb_params params;
BSTR libnam;
TRACE("typeinfo in imported typelib that isn't already loaded\n");
- result = query_typelib_path(TLB_get_guid_null(ref_type->pImpTLInfo->guid),
- ref_type->pImpTLInfo->wVersionMajor,
- ref_type->pImpTLInfo->wVersionMinor,
- This->pTypeLib->syskind,
- ref_type->pImpTLInfo->lcid, &libnam, TRUE);
- if(FAILED(result))
- libnam = SysAllocString(ref_type->pImpTLInfo->name);
+ /* Search in resource table */
+ params.guid = TLB_get_guid_null(ref_type->pImpTLInfo->guid);
+ params.pTLib = NULL;
+ EnumResourceNamesW(NULL, TYPELIBW, search_res_tlb, (LONG_PTR)&params);
+ pTLib = params.pTLib;
+ result = S_OK;
- result = LoadTypeLib(libnam, &pTLib);
- SysFreeString(libnam);
+ if (!pTLib)
+ {
+ /* Search on disk */
+ result = query_typelib_path(TLB_get_guid_null(ref_type->pImpTLInfo->guid),
+ ref_type->pImpTLInfo->wVersionMajor,
+ ref_type->pImpTLInfo->wVersionMinor,
+ This->pTypeLib->syskind,
+ ref_type->pImpTLInfo->lcid, &libnam, TRUE);
+ if (FAILED(result))
+ libnam = SysAllocString(ref_type->pImpTLInfo->name);
+
+ result = LoadTypeLib(libnam, &pTLib);
+ SysFreeString(libnam);
+ }
if(SUCCEEDED(result)) {
ref_type->pImpTLInfo->pImpTypeLib = impl_from_ITypeLib(pTLib);
--
2.1.2

View File

@ -0,0 +1,4 @@
Author: Guillaume Charifi
Subject: Implement TLB dependencies lookup in resources.
Revision: 1
Fixes: [34184] Support for TLB dependencies lookup in resources