Module: wine Branch: master Commit: ed79ddab1d8dcc8835020f656cb39302c00230c9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ed79ddab1d8dcc8835020f656c...
Author: Rob Shearman rob@codeweavers.com Date: Sun May 13 22:18:11 2007 +0100
ole32: Don't lookup the address for the DllGetClassObject function for ole32.dll in the apartment loaded dll list.
Call the function directly for a small performance boost.
---
dlls/ole32/compobj.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 614b426..b072026 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -594,10 +594,24 @@ void apartment_joinmta(void) static HRESULT apartment_getclassobject(struct apartment *apt, LPCWSTR dllpath, REFCLSID rclsid, REFIID riid, void **ppv) { + static const WCHAR wszOle32[] = {'o','l','e','3','2','.','d','l','l',0}; HRESULT hr = S_OK; BOOL found = FALSE; struct apartment_loaded_dll *apartment_loaded_dll;
+ if (!strcmpiW(dllpath, wszOle32)) + { + /* we don't need to control the lifetime of this dll, so use the local + * implementation of DllGetClassObject directly */ + TRACE("calling ole32!DllGetClassObject\n"); + hr = DllGetClassObject(rclsid, riid, ppv); + + if (hr != S_OK) + ERR("DllGetClassObject returned error 0x%08x\n", hr); + + return hr; + } + EnterCriticalSection(&apt->cs);
LIST_FOR_EACH_ENTRY(apartment_loaded_dll, &apt->loaded_dlls, struct apartment_loaded_dll, entry)