From ed79ddab1d8dcc8835020f656cb39302c00230c9 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sun, 13 May 2007 22:18:11 +0100 Subject: [PATCH] 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 file changed, 14 insertions(+) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 614b4266f56..b0720265b41 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)