From 04d3ba5b35c133852fb368caa3da998868a332e0 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 30 Nov 2012 21:11:07 +1100 Subject: [PATCH] oleaut32: Fail if we cannot find the TYPELIB resource. --- 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 83ea7e1f0f4..fa9b0501ecb 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; -- 2.11.4.GIT