SHELL32: fix crash

Alberto Massari alby at
Tue Jan 14 08:41:38 CST 2003

Shell32 loads some entry points from ole32 at runtime; to detect if they have already being loaded, it tests for the value of the hShellOle32 variable. But the same variable is used by SHCoCreateInstance for a similar purpose. So, if the code performs a call to SHCoCreateInstance *before* the call to GetShellOle, the latter function will not load the ole32 API, leading to a crash when pRegisterDragDrop, pRevokeDragDrop, etc.. functions will be used.

- make GetShellOle work on a global variable different from the one used by SHCoCreateInstance


Index: clipboard.c
RCS file: /home/wine/wine/dlls/shell32/clipboard.c,v
retrieving revision 1.13
diff -u -r1.13 clipboard.c
--- clipboard.c	13 Dec 2002 00:36:52 -0000	1.13
+++ clipboard.c	14 Jan 2003 14:36:03 -0000
@@ -56,6 +56,8 @@
 HRESULT (WINAPI *pOleSetClipboard)(IDataObject* pDataObj);
 HRESULT (WINAPI *pOleGetClipboard)(IDataObject** ppDataObj);
+static HINSTANCE hShellOle32=NULL;
  * GetShellOle

More information about the wine-patches mailing list