This fixes a bug in Shell32 where one function caused the function responsible for setting up the delay load function pointers to assume they had already been loaded, and they hadn't. Maybe we should make the hShellOle32 variable static so this can't happen again. ChangeLog: - Set up all delay load functions in GetShellOle() function to avoid GetShellOle assuming that they were all loaded when they weren't Rob
Index: wine/dlls/shell32/clipboard.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/clipboard.c,v retrieving revision 1.13 diff -u -r1.13 clipboard.c --- wine/dlls/shell32/clipboard.c 13 Dec 2002 00:36:52 -0000 1.13 +++ wine/dlls/shell32/clipboard.c 11 Jan 2003 21:07:13 -0000 @@ -55,6 +55,7 @@ void (WINAPI *pReleaseStgMedium)(STGMEDIUM* pmedium); HRESULT (WINAPI *pOleSetClipboard)(IDataObject* pDataObj); HRESULT (WINAPI *pOleGetClipboard)(IDataObject** ppDataObj); +HRESULT (WINAPI *pCoCreateInstance)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv) = NULL; /************************************************************************** * GetShellOle @@ -76,6 +77,7 @@ pReleaseStgMedium=(void*)GetProcAddress(hShellOle32,"ReleaseStgMedium"); pOleSetClipboard=(void*)GetProcAddress(hShellOle32,"OleSetClipboard"); pOleGetClipboard=(void*)GetProcAddress(hShellOle32,"OleGetClipboard"); + pCoCreateInstance=(void*)GetProcAddress(hShellOle32,"CoCreateInstance"); pOleInitialize(NULL); } Index: wine/dlls/shell32/shellole.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shellole.c,v retrieving revision 1.55 diff -u -r1.55 shellole.c --- wine/dlls/shell32/shellole.c 3 Jan 2003 03:07:21 -0000 1.55 +++ wine/dlls/shell32/shellole.c 11 Jan 2003 21:07:15 -0000 @@ -74,8 +74,6 @@ * wraper for late bound call to OLE32.DLL * */ -HRESULT (WINAPI *pCoCreateInstance)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv) = NULL; - void * __GetExternalFunc(HMODULE * phModule, LPCWSTR szModuleName, LPCSTR szProcName) { if (!*phModule) *phModule = GetModuleHandleW(szModuleName); @@ -86,8 +84,8 @@ HRESULT __CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv) { - if(!pCoCreateInstance) pCoCreateInstance = __GetExternalFunc(&hShellOle32, sOLE32, "CoCreateInstance"); - if(!pCoCreateInstance) return E_FAIL; + if(!GetShellOle()) + return E_FAIL; return pCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv); }