oleaut32: Dont output an error when the typelib cannot be found

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon Dec 17 03:50:55 CST 2012


Hi,

Changelog:
     oleaut32: Don't output an error when the typelib cannot be found


Best Regards
  Alistair Leslie-Hughes
-------------- next part --------------
>From 9acb10c64451a9d9b7b338536b2eb55b80383120 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Fri, 14 Dec 2012 14:05:09 +1100
Subject: [PATCH] Dont output an error when typelib cannot be found
To: wine-patches <wine-patches at winehq.org>

---
 dlls/oleaut32/tests/typelib.c |    1 +
 dlls/oleaut32/typelib.c       |   10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 85fd965..b6afca6 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -2934,6 +2934,7 @@ static void test_LoadTypeLib(void)
     static const WCHAR kernel32_dllW[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
 
     hres = LoadTypeLib(kernel32_dllW, &tl);
+    ok(GetLastError() == 0, "GetLastError() = %d", GetLastError());
     ok(hres == TYPE_E_CANTLOADLIBRARY, "LoadTypeLib returned: %08x, expected TYPE_E_CANTLOADLIBRARY\n", hres);
 }
 
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index fa9b050..04914e0 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -2544,9 +2544,11 @@ static HRESULT TLB_PEFile_Open(LPCWSTR path, INT index, LPVOID *ppBase, DWORD *p
                     return S_OK;
                 }
             }
-
-            hr = E_FAIL;
         }
+
+        TRACE("No TYPELIB resource found\n");
+        hr = E_FAIL;
+        SetLastError(0);
     }
 
     TLB_PEFile_Release((IUnknown *)&This->lpvtbl);
@@ -2966,8 +2968,8 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath
         list_add_head(&tlb_cache, &impl->entry);
         LeaveCriticalSection(&cache_section);
         ret = S_OK;
-    } else
-	ERR("Loading of typelib %s failed with error %d\n", debugstr_w(pszFileName), GetLastError());
+    } else if(GetLastError() != 0)
+        ERR("Loading of typelib %s failed with error %d\n", debugstr_w(pszFileName), GetLastError());
 
     return ret;
 }
-- 
1.7.10.4



More information about the wine-patches mailing list