Author: dchapyshev Date: Sat May 9 13:23:08 2009 New Revision: 40849
URL: http://svn.reactos.org/svn/reactos?rev=40849&view=rev Log: - Sync ole32, oleacc, oleaut32 with Wine 1.1.21
Added: trunk/reactos/dll/win32/oleacc/oleacc_Pl.rc (with props) Modified: trunk/reactos/dll/win32/ole32/clipboard.c trunk/reactos/dll/win32/ole32/compobj.c trunk/reactos/dll/win32/ole32/memlockbytes.c trunk/reactos/dll/win32/ole32/rpc.c trunk/reactos/dll/win32/ole32/storage32.c trunk/reactos/dll/win32/oleacc/oleacc.rc trunk/reactos/dll/win32/oleaut32/tmarshal.c
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] Sat May 9 13:23:08 2009 @@ -1197,7 +1197,7 @@ hr = get_stgmed_for_stream(h, med); else { - FIXME("Unhandled tymed - emum tymed %x req tymed %x\n", entry->fmtetc.tymed, fmt->tymed); + FIXME("Unhandled tymed - mask %x req tymed %x\n", mask, fmt->tymed); hr = E_FAIL; goto end; } @@ -1214,8 +1214,108 @@ static HRESULT WINAPI snapshot_GetDataHere(IDataObject *iface, FORMATETC *fmt, STGMEDIUM *med) { - FIXME("(%p, %p {%s}, %p): stub\n", iface, fmt, dump_fmtetc(fmt), med); - return E_NOTIMPL; + snapshot *This = impl_from_IDataObject(iface); + HANDLE h; + HRESULT hr; + ole_priv_data *enum_data = NULL; + ole_priv_data_entry *entry; + TYMED supported; + + TRACE("(%p, %p {%s}, %p (tymed %x)\n", iface, fmt, dump_fmtetc(fmt), med, med->tymed); + + if ( !fmt || !med ) return E_INVALIDARG; + + if ( !OpenClipboard(NULL)) return CLIPBRD_E_CANT_OPEN; + + if(!This->data) + hr = get_current_dataobject(&This->data); + + if(This->data) + { + hr = IDataObject_GetDataHere(This->data, fmt, med); + if(SUCCEEDED(hr)) + { + CloseClipboard(); + return hr; + } + } + + h = GetClipboardData(fmt->cfFormat); + if(!h) + { + hr = DV_E_FORMATETC; + goto end; + } + + hr = get_priv_data(&enum_data); + if(FAILED(hr)) goto end; + + entry = find_format_in_list(enum_data->entries, enum_data->count, fmt->cfFormat); + if(entry) + { + if(!td_equal(fmt->ptd, entry->fmtetc.ptd)) + { + hr = DV_E_FORMATETC; + goto end; + } + supported = entry->fmtetc.tymed; + } + else /* non-Ole format */ + supported = TYMED_HGLOBAL; + + switch(med->tymed) + { + case TYMED_HGLOBAL: + { + DWORD src_size = GlobalSize(h); + DWORD dst_size = GlobalSize(med->u.hGlobal); + hr = E_FAIL; + if(dst_size >= src_size) + { + void *src = GlobalLock(h); + void *dst = GlobalLock(med->u.hGlobal); + + memcpy(dst, src, src_size); + GlobalUnlock(med->u.hGlobal); + GlobalUnlock(h); + hr = S_OK; + } + break; + } + case TYMED_ISTREAM: + { + DWORD src_size = GlobalSize(h); + void *src = GlobalLock(h); + hr = IStream_Write(med->u.pstm, src, src_size, NULL); + GlobalUnlock(h); + break; + } + case TYMED_ISTORAGE: + { + STGMEDIUM copy; + if(!(supported & TYMED_ISTORAGE)) + { + hr = E_FAIL; + goto end; + } + hr = get_stgmed_for_storage(h, ©); + if(SUCCEEDED(hr)) + { + hr = IStorage_CopyTo(copy.u.pstg, 0, NULL, NULL, med->u.pstg); + ReleaseStgMedium(©); + } + break; + } + default: + FIXME("Unhandled tymed - supported %x req tymed %x\n", supported, med->tymed); + hr = E_FAIL; + goto end; + } + +end: + HeapFree(GetProcessHeap(), 0, enum_data); + if ( !CloseClipboard() ) hr = CLIPBRD_E_CANT_CLOSE; + return hr; }
/************************************************************************
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] Sat May 9 13:23:08 2009 @@ -490,6 +490,31 @@
LeaveCriticalSection(&csApartment);
+ return result; +} + +/* gets the multi-threaded apartment if it exists. The caller must + * release the reference from the apartment as soon as the apartment pointer + * is no longer required. */ +static APARTMENT *apartment_find_multi_threaded(void) +{ + APARTMENT *result = NULL; + struct list *cursor; + + EnterCriticalSection(&csApartment); + + LIST_FOR_EACH( cursor, &apts ) + { + struct apartment *apt = LIST_ENTRY( cursor, struct apartment, entry ); + if (apt->multi_threaded) + { + result = apt; + apartment_addref(result); + break; + } + } + + LeaveCriticalSection(&csApartment); return result; }
@@ -2237,6 +2262,7 @@ LPUNKNOWN regClassObject; HRESULT hres = E_UNEXPECTED; APARTMENT *apt; + BOOL release_apt = FALSE;
TRACE("\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid), debugstr_guid(iid));
@@ -2245,11 +2271,14 @@
*ppv = NULL;
- apt = COM_CurrentApt(); - if (!apt) - { - ERR("apartment not initialised\n"); - return CO_E_NOTINITIALIZED; + if (!(apt = COM_CurrentApt())) + { + if (!(apt = apartment_find_multi_threaded())) + { + ERR("apartment not initialised\n"); + return CO_E_NOTINITIALIZED; + } + release_apt = TRUE; }
if (pServerInfo) { @@ -2273,7 +2302,7 @@ * is good since we are not returning it in the "out" parameter. */ IUnknown_Release(regClassObject); - + if (release_apt) apartment_release(apt); return hres; }
@@ -2284,7 +2313,10 @@ HKEY hkey;
if (IsEqualCLSID(rclsid, &CLSID_InProcFreeMarshaler)) + { + if (release_apt) apartment_release(apt); return FTMarshalCF_Create(iid, ppv); + }
hres = COM_OpenKeyForCLSID(rclsid, wszInprocServer32, KEY_READ, &hkey); if (FAILED(hres)) @@ -2308,7 +2340,10 @@ /* return if we got a class, otherwise fall through to one of the * other types */ if (SUCCEEDED(hres)) + { + if (release_apt) apartment_release(apt); return hres; + } }
/* Next try in-process handler */ @@ -2339,8 +2374,12 @@ /* return if we got a class, otherwise fall through to one of the * other types */ if (SUCCEEDED(hres)) + { + if (release_apt) apartment_release(apt); return hres; - } + } + } + if (release_apt) apartment_release(apt);
/* Next try out of process */ if (CLSCTX_LOCAL_SERVER & dwClsContext) @@ -2418,6 +2457,7 @@ { HRESULT hres; LPCLASSFACTORY lpclf = 0; + APARTMENT *apt;
TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid), pUnkOuter, dwClsContext, debugstr_guid(iid), ppv); @@ -2433,10 +2473,14 @@ */ *ppv = 0;
- if (!COM_CurrentApt()) + if (!(apt = COM_CurrentApt())) { + if (!(apt = apartment_find_multi_threaded())) + { ERR("apartment not initialised\n"); return CO_E_NOTINITIALIZED; + } + apartment_release(apt); }
/*
Modified: trunk/reactos/dll/win32/ole32/memlockbytes.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/memlockbyte... ============================================================================== --- trunk/reactos/dll/win32/ole32/memlockbytes.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/memlockbytes.c [iso-8859-1] Sat May 9 13:23:08 2009 @@ -160,7 +160,7 @@ return S_OK; } /* It is not our lockbytes implementation, so use a more generic way */ - hres = ILockBytes_Stat(plkbyt,&stbuf,0); + hres = ILockBytes_Stat(plkbyt,&stbuf,STATFLAG_NONAME); if (hres != S_OK) { ERR("Cannot ILockBytes_Stat, %x\n",hres); return hres;
Modified: trunk/reactos/dll/win32/ole32/rpc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/rpc.c?rev=4... ============================================================================== --- trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] Sat May 9 13:23:08 2009 @@ -1904,7 +1904,7 @@
TRACE("marshalling IClassFactory to client\n");
- hres = IStream_Stat(pStm,&ststg,0); + hres = IStream_Stat(pStm,&ststg,STATFLAG_NONAME); if (hres) return hres;
seekto.u.LowPart = 0;
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] Sat May 9 13:23:08 2009 @@ -6310,7 +6310,7 @@ /* * read a STATSTG structure (contains the clsid) from the storage */ - hRes=IStorage_Stat(pstg,&pstatstg,STATFLAG_DEFAULT); + hRes=IStorage_Stat(pstg,&pstatstg,STATFLAG_NONAME);
if(SUCCEEDED(hRes)) *pclsid=pstatstg.clsid;
Modified: trunk/reactos/dll/win32/oleacc/oleacc.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleacc/oleacc.rc?... ============================================================================== --- trunk/reactos/dll/win32/oleacc/oleacc.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleacc/oleacc.rc [iso-8859-1] Sat May 9 13:23:08 2009 @@ -25,3 +25,4 @@ #include "oleacc_Fr.rc" #include "oleacc_Ko.rc" #include "oleacc_Nl.rc" +#include "oleacc_Pl.rc"
Added: trunk/reactos/dll/win32/oleacc/oleacc_Pl.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleacc/oleacc_Pl.... ============================================================================== --- trunk/reactos/dll/win32/oleacc/oleacc_Pl.rc (added) +++ trunk/reactos/dll/win32/oleacc/oleacc_Pl.rc [iso-8859-1] Sat May 9 13:23:08 2009 @@ -1,0 +1,90 @@ +/* + * Polish resources for oleacc + * + * Copyright 2009 £ukasz Wojni³owicz + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_POLISH, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +{ + 0 "unknown object" /* undocumented */ + ROLE_SYSTEM_TITLEBAR "pasek tytu³u" + ROLE_SYSTEM_MENUBAR "pasek menu" + ROLE_SYSTEM_SCROLLBAR "pasek przewijania" + ROLE_SYSTEM_GRIP "grip" + ROLE_SYSTEM_SOUND "dwiêk" + ROLE_SYSTEM_CURSOR "kursor" + ROLE_SYSTEM_CARET "daszek" + ROLE_SYSTEM_ALERT "ostrze¿enie" + ROLE_SYSTEM_WINDOW "okno" + ROLE_SYSTEM_CLIENT "klient" + ROLE_SYSTEM_MENUPOPUP "menu rozwijane" + ROLE_SYSTEM_MENUITEM "element menu" + ROLE_SYSTEM_TOOLTIP "podpowied" + ROLE_SYSTEM_APPLICATION "aplikacja" + ROLE_SYSTEM_DOCUMENT "dokument" + ROLE_SYSTEM_PANE "pane" + ROLE_SYSTEM_CHART "wykres" + ROLE_SYSTEM_DIALOG "dialog" + ROLE_SYSTEM_BORDER "obramowanie" + ROLE_SYSTEM_GROUPING "grupowanie" + ROLE_SYSTEM_SEPARATOR "separator" + ROLE_SYSTEM_TOOLBAR "pasek narzêdzi" + ROLE_SYSTEM_STATUSBAR "pasek stanu" + ROLE_SYSTEM_TABLE "tabela" + ROLE_SYSTEM_COLUMNHEADER "nag³ówek kolumny" + ROLE_SYSTEM_ROWHEADER "nag³ówek wiersza" + ROLE_SYSTEM_COLUMN "kolumna" + ROLE_SYSTEM_ROW "wiersz" + ROLE_SYSTEM_CELL "komórka" + ROLE_SYSTEM_LINK "link" + ROLE_SYSTEM_HELPBALLOON "dymek pomocy" + ROLE_SYSTEM_CHARACTER "znak" + ROLE_SYSTEM_LIST "lista" + ROLE_SYSTEM_LISTITEM "element listy" + ROLE_SYSTEM_OUTLINE "zarys" + ROLE_SYSTEM_OUTLINEITEM "element zarysu" + ROLE_SYSTEM_PAGETAB "page tab" + ROLE_SYSTEM_PROPERTYPAGE "strona w³aciwoci" + ROLE_SYSTEM_INDICATOR "wskanik" + ROLE_SYSTEM_GRAPHIC "grafika" + ROLE_SYSTEM_STATICTEXT "tekst statyczny" + ROLE_SYSTEM_TEXT "tekst" + ROLE_SYSTEM_PUSHBUTTON "przycisk" + ROLE_SYSTEM_CHECKBUTTON "przycisk zaznaczany" + ROLE_SYSTEM_RADIOBUTTON "przycisk opcji" + ROLE_SYSTEM_COMBOBOX "pole kombi" + ROLE_SYSTEM_DROPLIST "lista rozwijana" + ROLE_SYSTEM_PROGRESSBAR "pasek postêpu" + ROLE_SYSTEM_DIAL "dial" + ROLE_SYSTEM_HOTKEYFIELD "hot key field" + ROLE_SYSTEM_SLIDER "suwak" + ROLE_SYSTEM_SPINBUTTON "spin box" + ROLE_SYSTEM_DIAGRAM "diagram" + ROLE_SYSTEM_ANIMATION "animacja" + ROLE_SYSTEM_EQUATION "równanie" + ROLE_SYSTEM_BUTTONDROPDOWN "przycisk rozwijany" + ROLE_SYSTEM_BUTTONMENU "przycisk menu" + ROLE_SYSTEM_BUTTONDROPDOWNGRID "siatka przycisków rozwijanych" + ROLE_SYSTEM_WHITESPACE "bia³a spacja" + ROLE_SYSTEM_PAGETABLIST "page tab list" + ROLE_SYSTEM_CLOCK "zegar" + ROLE_SYSTEM_SPLITBUTTON "przycisk rozdzielania" + ROLE_SYSTEM_IPADDRESS "adres IP" + ROLE_SYSTEM_OUTLINEBUTTON "przycisk zarysu" +}
Propchange: trunk/reactos/dll/win32/oleacc/oleacc_Pl.rc ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/dll/win32/oleaut32/tmarshal.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/tmarshal... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] Sat May 9 13:23:08 2009 @@ -213,7 +213,7 @@ goto fail; }
- hres = IStream_Stat(pStm,&ststg,0); + hres = IStream_Stat(pStm,&ststg,STATFLAG_NONAME); if (hres) { ERR("Stream stat failed\n"); goto fail;