Author: akhaldi Date: Mon Mar 9 19:57:38 2015 New Revision: 66628
URL: http://svn.reactos.org/svn/reactos?rev=66628&view=rev Log: [OLE32] Sync with Wine Staging 1.7.37. CORE-9246
Modified: trunk/reactos/dll/win32/ole32/CMakeLists.txt trunk/reactos/dll/win32/ole32/clipboard.c trunk/reactos/dll/win32/ole32/compobj.c trunk/reactos/dll/win32/ole32/ole2.c trunk/reactos/dll/win32/ole32/ole32_ros.diff trunk/reactos/dll/win32/ole32/storage32.c trunk/reactos/dll/win32/ole32/storage32.h trunk/reactos/dll/win32/ole32/usrmarshal.c trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/ole32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/CMakeLists.... ============================================================================== --- trunk/reactos/dll/win32/ole32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/CMakeLists.txt [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -80,7 +80,7 @@
set_module_type(ole32 win32dll) target_link_libraries(ole32 wine uuid ${PSEH_LIB}) -add_importlibs(ole32 advapi32 user32 gdi32 rpcrt4 msvcrt kernel32 ntdll) +add_importlibs(ole32 advapi32 user32 gdi32 rpcrt4 msvcrt kernel32 kernel32_vista ntdll) add_delay_importlibs(ole32 oleaut32) add_dependencies(ole32 ole32idl) add_pch(ole32 precomp.h SOURCE)
Modified: trunk/reactos/dll/win32/ole32/clipboard.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/clipboard.c... ============================================================================== --- trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -174,8 +174,6 @@ */ static const WCHAR clipbrd_wndclass[] = {'C','L','I','P','B','R','D','W','N','D','C','L','A','S','S',0};
-static const WCHAR wine_marshal_dataobject[] = {'W','i','n','e',' ','m','a','r','s','h','a','l',' ','d','a','t','a','o','b','j','e','c','t',0}; - UINT ownerlink_clipboard_format = 0; UINT filename_clipboard_format = 0; UINT filenameW_clipboard_format = 0; @@ -190,13 +188,11 @@
static UINT wine_marshal_clipboard_format;
-static inline char *dump_fmtetc(FORMATETC *fmt) -{ - static char buf[100]; - - snprintf(buf, sizeof(buf), "cf %04x ptd %p aspect %x lindex %d tymed %x", - fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed); - return buf; +static inline const char *dump_fmtetc(FORMATETC *fmt) +{ + if (!fmt) return "(null)"; + return wine_dbg_sprintf("cf %04x ptd %p aspect %x lindex %d tymed %x", + fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed); }
/*---------------------------------------------------------------------* @@ -1113,6 +1109,8 @@ return TYMED_ENHMF; case CF_METAFILEPICT: return TYMED_MFPICT; + case CF_BITMAP: + return TYMED_GDI; default: FIXME("returning TYMED_NULL for cf %04x\n", cf); return TYMED_NULL; @@ -1290,6 +1288,27 @@ return S_OK; }
+/************************************************************************ + * get_stgmed_for_bitmap + * + * Returns a stg medium with a bitmap based on the handle + */ +static HRESULT get_stgmed_for_bitmap(HBITMAP hbmp, STGMEDIUM *med) +{ + HRESULT hr; + + med->pUnkForRelease = NULL; + med->tymed = TYMED_NULL; + + hr = dup_bitmap(hbmp, &med->u.hBitmap); + + if (FAILED(hr)) + return hr; + + med->tymed = TYMED_GDI; + return S_OK; +} + static inline BOOL string_off_equal(const DVTARGETDEVICE *t1, WORD off1, const DVTARGETDEVICE *t2, WORD off2) { const WCHAR *str1, *str2; @@ -1381,6 +1400,8 @@ hr = get_stgmed_for_stream(h, med); else if(mask & TYMED_ENHMF) hr = get_stgmed_for_emf((HENHMETAFILE)h, med); + else if(mask & TYMED_GDI) + hr = get_stgmed_for_bitmap((HBITMAP)h, med); else { FIXME("Unhandled tymed - mask %x req tymed %x\n", mask, fmt->tymed);
Modified: trunk/reactos/dll/win32/ole32/compobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj.c?r... ============================================================================== --- trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -1628,7 +1628,6 @@ return hr; }
-#ifndef __REACTOS__ static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context ) { WNDCLASSW wclass; @@ -1649,33 +1648,24 @@ RegisterClassW(&wclass); return TRUE; } -#endif
/* create a window for the apartment or return the current one if one has * already been created */ HRESULT apartment_createwindowifneeded(struct apartment *apt) { -#ifndef __REACTOS__ static INIT_ONCE class_init_once = INIT_ONCE_STATIC_INIT; -#endif
if (apt->multi_threaded) return S_OK;
if (!apt->win) { -#ifndef __REACTOS__ HWND hwnd;
InitOnceExecuteOnce( &class_init_once, register_class, NULL, NULL );
hwnd = CreateWindowW(wszAptWinClass, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hProxyDll, NULL); -#else - HWND hwnd = CreateWindowW(wszAptWinClass, NULL, 0, - 0, 0, 0, 0, - HWND_MESSAGE, 0, hProxyDll, NULL); -#endif if (!hwnd) { ERR("CreateWindow failed with error %d\n", GetLastError()); @@ -1701,35 +1691,6 @@ apartment_addref(MTA); COM_CurrentInfo()->apt = MTA; } - -#ifdef __REACTOS__ - -static void COMPOBJ_InitProcess( void ) -{ - WNDCLASSW wclass; - - /* Dispatching to the correct thread in an apartment is done through - * window messages rather than RPC transports. When an interface is - * marshalled into another apartment in the same process, a window of the - * following class is created. The *caller* of CoMarshalInterface (i.e., the - * application) is responsible for pumping the message loop in that thread. - * The WM_USER messages which point to the RPCs are then dispatched to - * apartment_wndproc by the user's code from the apartment in which the - * interface was unmarshalled. - */ - memset(&wclass, 0, sizeof(wclass)); - wclass.lpfnWndProc = apartment_wndproc; - wclass.hInstance = hProxyDll; - wclass.lpszClassName = wszAptWinClass; - RegisterClassW(&wclass); -} - -static void COMPOBJ_UninitProcess( void ) -{ - UnregisterClassW(wszAptWinClass, hProxyDll); -} - -#endif
static void COM_TlsDestroy(void) { @@ -1964,7 +1925,7 @@ * SEE ALSO * CoInitializeEx */ -void WINAPI CoUninitialize(void) +void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void) { struct oletls * info = COM_CurrentInfo(); LONG lCOMRefCnt; @@ -4443,10 +4404,22 @@ DWORD start_time = GetTickCount(); APARTMENT *apt = COM_CurrentApt(); BOOL message_loop = apt && !apt->multi_threaded; + BOOL check_apc = (dwFlags & COWAIT_ALERTABLE) != 0;
TRACE("(0x%08x, 0x%08x, %d, %p, %p)\n", dwFlags, dwTimeout, cHandles, pHandles, lpdwindex);
+ if (!lpdwindex) + return E_INVALIDARG; + + *lpdwindex = 0; + + if (!pHandles) + return E_INVALIDARG; + + if (!cHandles) + return RPC_E_NO_SYNC; + while (TRUE) { DWORD now = GetTickCount(); @@ -4465,9 +4438,19 @@
TRACE("waiting for rpc completion or window message\n");
- res = MsgWaitForMultipleObjectsEx(cHandles, pHandles, - (dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now, - QS_SENDMESSAGE | QS_ALLPOSTMESSAGE | QS_PAINT, wait_flags); + res = WAIT_TIMEOUT; + + if (check_apc) + { + res = WaitForMultipleObjectsEx(cHandles, pHandles, + (dwFlags & COWAIT_WAITALL) != 0, 0, TRUE); + check_apc = FALSE; + } + + if (res == WAIT_TIMEOUT) + res = MsgWaitForMultipleObjectsEx(cHandles, pHandles, + (dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now, + QS_SENDMESSAGE | QS_ALLPOSTMESSAGE | QS_PAINT, wait_flags);
if (res == WAIT_OBJECT_0 + cHandles) /* messages available */ { @@ -5047,19 +5030,12 @@ switch(fdwReason) { case DLL_PROCESS_ATTACH: hProxyDll = hinstDLL; -#ifdef __REACTOS__ - COMPOBJ_InitProcess(); -#endif break;
case DLL_PROCESS_DETACH: if (reserved) break; release_std_git(); -#ifdef __REACTOS__ - COMPOBJ_UninitProcess(); -#else UnregisterClassW( wszAptWinClass, hProxyDll ); -#endif RPC_UnregisterAllChannelHooks(); COMPOBJ_DllList_Free(); DeleteCriticalSection(&csRegisteredClassList);
Modified: trunk/reactos/dll/win32/ole32/ole2.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole2.c?rev=... ============================================================================== --- trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -205,7 +205,7 @@ /****************************************************************************** * OleUninitialize [OLE32.@] */ -void WINAPI OleUninitialize(void) +void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void) { TRACE("()\n");
@@ -2381,11 +2381,12 @@ */ case DRAGDROP_S_DROP: if (*trackerInfo->pdwEffect != DROPEFFECT_NONE) - trackerInfo->returnValue = IDropTarget_Drop(trackerInfo->curDragTarget, - trackerInfo->dataObject, - trackerInfo->dwKeyState, - trackerInfo->curMousePos, - trackerInfo->pdwEffect); + { + hr = IDropTarget_Drop(trackerInfo->curDragTarget, trackerInfo->dataObject, + trackerInfo->dwKeyState, trackerInfo->curMousePos, trackerInfo->pdwEffect); + if (FAILED(hr)) + trackerInfo->returnValue = hr; + } else IDropTarget_DragLeave(trackerInfo->curDragTarget); break;
Modified: trunk/reactos/dll/win32/ole32/ole32_ros.diff URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32_ros.d... ============================================================================== --- trunk/reactos/dll/win32/ole32/ole32_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole32_ros.diff [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -1,7 +1,7 @@ -diff -prudN e:\Wine\dlls\ole32/compobj.c e:\reactos\dll\win32\ole32/compobj.c ---- e:\Wine\dlls\ole32/compobj.c 2014-04-04 14:12:42.091208400 +0100 -+++ e:\reactos\dll\win32\ole32/compobj.c 2014-04-24 12:30:07.466625200 +0100 -@@ -331,8 +303,12 @@ static NTSTATUS create_key( HKEY *retkey +diff -prudN e:\wine\dlls\ole32/compobj.c dll\win32\ole32/compobj.c +--- e:\wine\dlls\ole32/compobj.c 2015-02-21 17:13:09.561542200 +0100 ++++ dll\win32\ole32/compobj.c 2015-02-28 13:26:29.259662000 +0100 +@@ -331,8 +304,12 @@ static NTSTATUS create_key( HKEY *retkey return status; }
@@ -14,135 +14,9 @@
static HKEY classes_root_hkey;
-@@ -1635,6 +1611,7 @@ static HRESULT apartment_hostobject_in_h - return hr; - } - -+#ifndef __REACTOS__ - static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context ) - { - WNDCLASSW wclass; -@@ -1655,24 +1632,20 @@ static BOOL WINAPI register_class( INIT_ - RegisterClassW(&wclass); - return TRUE; - } -+#endif - - /* create a window for the apartment or return the current one if one has - * already been created */ - HRESULT apartment_createwindowifneeded(struct apartment *apt) - { -- static INIT_ONCE class_init_once = INIT_ONCE_STATIC_INIT; -- - if (apt->multi_threaded) - return S_OK; - - if (!apt->win) - { -- HWND hwnd; -- -- InitOnceExecuteOnce( &class_init_once, register_class, NULL, NULL ); -- -- hwnd = CreateWindowW(wszAptWinClass, NULL, 0, 0, 0, 0, 0, -- HWND_MESSAGE, 0, hProxyDll, NULL); -+ HWND hwnd = CreateWindowW(wszAptWinClass, NULL, 0, -+ 0, 0, 0, 0, -+ HWND_MESSAGE, 0, hProxyDll, NULL); - if (!hwnd) - { - ERR("CreateWindow failed with error %d\n", GetLastError()); -@@ -1699,6 +1672,35 @@ void apartment_joinmta(void) - COM_CurrentInfo()->apt = MTA; - } - -+#ifdef __REACTOS__ -+ -+static void COMPOBJ_InitProcess( void ) -+{ -+ WNDCLASSW wclass; -+ -+ /* Dispatching to the correct thread in an apartment is done through -+ * window messages rather than RPC transports. When an interface is -+ * marshalled into another apartment in the same process, a window of the -+ * following class is created. The *caller* of CoMarshalInterface (i.e., the -+ * application) is responsible for pumping the message loop in that thread. -+ * The WM_USER messages which point to the RPCs are then dispatched to -+ * apartment_wndproc by the user's code from the apartment in which the -+ * interface was unmarshalled. -+ */ -+ memset(&wclass, 0, sizeof(wclass)); -+ wclass.lpfnWndProc = apartment_wndproc; -+ wclass.hInstance = hProxyDll; -+ wclass.lpszClassName = wszAptWinClass; -+ RegisterClassW(&wclass); -+} -+ -+static void COMPOBJ_UninitProcess( void ) -+{ -+ UnregisterClassW(wszAptWinClass, hProxyDll); -+} -+ -+#endif -+ - static void COM_TlsDestroy(void) - { - struct oletls *info = NtCurrentTeb()->ReservedForOle; -@@ -4984,12 +4986,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, - switch(fdwReason) { - case DLL_PROCESS_ATTACH: - hProxyDll = hinstDLL; -+ COMPOBJ_InitProcess(); - break; - - case DLL_PROCESS_DETACH: - if (reserved) break; - release_std_git(); -- UnregisterClassW( wszAptWinClass, hProxyDll ); -+ COMPOBJ_UninitProcess(); - RPC_UnregisterAllChannelHooks(); - COMPOBJ_DllList_Free(); - DeleteCriticalSection(&csRegisteredClassList); -diff -prudN e:\Wine\dlls\ole32/stg_prop.c e:\reactos\dll\win32\ole32/stg_prop.c ---- e:\Wine\dlls\ole32/stg_prop.c 2014-04-04 14:12:42.103216400 +0100 -+++ e:\reactos\dll\win32\ole32/stg_prop.c 2014-04-08 19:21:32.097336500 +0100 -@@ -36,32 +36,15 @@ - * PropertyStorage_ReadFromStream - */ - --#include "config.h" --#include "wine/port.h" -- --#include <assert.h> --#include <stdarg.h> --#include <stdio.h> --#include <stdlib.h> --#include <string.h> -- --#define COBJMACROS --#define NONAMELESSUNION --#define NONAMELESSSTRUCT -- --#include "windef.h" --#include "winbase.h" --#include "winnls.h" --#include "winuser.h" --#include "wine/unicode.h" --#include "wine/debug.h" --#include "dictionary.h" -+#include "precomp.h" - #include "storage32.h" --#include "enumx.h" --#include "oleauto.h" - - WINE_DEFAULT_DEBUG_CHANNEL(storage); - -+#ifdef _MSC_VER -+#define __ASM_STDCALL_FUNC(name,args,code) -+#endif -+ - static inline StorageImpl *impl_from_IPropertySetStorage( IPropertySetStorage *iface ) - { - return CONTAINING_RECORD(iface, StorageImpl, base.IPropertySetStorage_iface); +diff -prudN e:\wine\dlls\ole32/stg_prop.c dll\win32\ole32/stg_prop.c +--- e:\wine\dlls\ole32/stg_prop.c 2015-02-21 17:13:09.569542200 +0100 ++++ dll\win32\ole32/stg_prop.c 2014-04-08 19:21:32.097336500 +0100 @@ -1035,12 +1018,12 @@ static HRESULT PropertyStorage_ReadDicti }
@@ -184,4 +58,3 @@ + void* (__cdecl *fn)(void*,ULONG) = **(void***)this; return fn(this, cbSize); } -
Modified: trunk/reactos/dll/win32/ole32/storage32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.c... ============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -2950,7 +2950,7 @@ hr = S_OK;
/* First check for any conflicting locks. */ - if (SUCCEEDED(hr) && (openFlags & STGM_PRIORITY) == STGM_PRIORITY) + if ((openFlags & STGM_PRIORITY) == STGM_PRIORITY) hr = StorageImpl_CheckLockRange(This, RANGELOCK_COMMIT, RANGELOCK_COMMIT, STG_E_LOCKVIOLATION);
if (SUCCEEDED(hr) && (STGM_ACCESS_MODE(openFlags) != STGM_WRITE)) @@ -6976,10 +6976,8 @@ This->ownerDirEntry, &chainEntry);
- if (SUCCEEDED(hr)) - { + if (SUCCEEDED(hr) && chainEntry.startingBlock < BLOCK_FIRST_SPECIAL) return chainEntry.startingBlock; - } }
return BLOCK_END_OF_CHAIN; @@ -7501,11 +7499,8 @@ This->ownerDirEntry, &chainEntry);
- if (SUCCEEDED(hr)) - { + if (SUCCEEDED(hr) && chainEntry.startingBlock < BLOCK_FIRST_SPECIAL) return chainEntry.startingBlock; - } - }
return BLOCK_END_OF_CHAIN;
Modified: trunk/reactos/dll/win32/ole32/storage32.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.h... ============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -69,6 +69,7 @@ static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006; static const WORD DEF_BIG_BLOCK_SIZE = 0x0200; static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040; +static const ULONG BLOCK_FIRST_SPECIAL = 0xFFFFFFFB; static const ULONG BLOCK_EXTBBDEPOT = 0xFFFFFFFC; static const ULONG BLOCK_SPECIAL = 0xFFFFFFFD; static const ULONG BLOCK_END_OF_CHAIN = 0xFFFFFFFE;
Modified: trunk/reactos/dll/win32/ole32/usrmarshal.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/usrmarshal.... ============================================================================== --- trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -1622,7 +1622,7 @@ if(CoMarshalInterface(stm, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL) != S_OK) { IStream_Release(stm); - return NULL; + return pBuffer; }
ALIGN_POINTER(pBuffer, 3);
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=6... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -151,7 +151,7 @@ reactos/dll/win32/objsel # Synced to Wine-1.7.27 reactos/dll/win32/odbc32 # Synced to Wine-1.7.27. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to Wine-1.7.27 -reactos/dll/win32/ole32 # Synced to Wine-1.7.27 +reactos/dll/win32/ole32 # Synced to WineStaging-1.7.37 reactos/dll/win32/oleacc # Synced to Wine-1.7.27 reactos/dll/win32/oleaut32 # Synced to Wine-1.7.27 reactos/dll/win32/olecli32 # Synced to Wine-1.7.27