oleaut32: Fail if we cannot find the TYPELIB resource
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Fri Nov 30 04:14:49 CST 2012
Hi,
If a DLL doesn't have a TYPELIB resource we should just fail straight
away. This stops an error message appearing about an unsupported
typelib type.
Changelog:
oleaut32: Fail if we cannot find the TYPELIB resource
Best Regards
Alistair Leslie-Hughes
-------------- next part --------------
>From 74829c368d872534b2ec421bb0269a0c76bb8384 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Fri, 30 Nov 2012 21:11:07 +1100
Subject: [PATCH] Fail if we cannot find the TYPELIB resource
To: wine-patches <wine-patches at winehq.org>
---
dlls/oleaut32/typelib.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 83ea7e1..fa9b050 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -2509,6 +2509,7 @@ static const IUnknownVtbl TLB_PEFile_Vtable =
static HRESULT TLB_PEFile_Open(LPCWSTR path, INT index, LPVOID *ppBase, DWORD *pdwTLBLength, IUnknown **ppFile)
{
TLB_PEFile *This;
+ HRESULT hr = TYPE_E_CANTLOADLIBRARY;
This = heap_alloc(sizeof(TLB_PEFile));
if (!This)
@@ -2543,11 +2544,13 @@ static HRESULT TLB_PEFile_Open(LPCWSTR path, INT index, LPVOID *ppBase, DWORD *p
return S_OK;
}
}
+
+ hr = E_FAIL;
}
}
TLB_PEFile_Release((IUnknown *)&This->lpvtbl);
- return TYPE_E_CANTLOADLIBRARY;
+ return hr;
}
typedef struct TLB_NEFile
@@ -2946,6 +2949,8 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
ret = TYPE_E_CANTLOADLIBRARY;
IUnknown_Release(pFile);
}
+ else
+ ret = TYPE_E_CANTLOADLIBRARY;
if(*ppTypeLib) {
ITypeLibImpl *impl = (ITypeLibImpl*)*ppTypeLib;
--
1.7.10.4
More information about the wine-patches
mailing list