Author: akhaldi Date: Wed Apr 15 18:09:13 2015 New Revision: 67203
URL: http://svn.reactos.org/svn/reactos?rev=67203&view=rev Log: [OLEAUT32] Sync with Wine Staging 1.7.37. CORE-9246
Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.spec trunk/reactos/dll/win32/oleaut32/olepicture.c trunk/reactos/dll/win32/oleaut32/safearray.c trunk/reactos/dll/win32/oleaut32/tmarshal.c trunk/reactos/dll/win32/oleaut32/typelib.c trunk/reactos/dll/win32/oleaut32/varformat.c trunk/reactos/dll/win32/oleaut32/variant.c trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut32... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut32.spec [iso-8859-1] Wed Apr 15 18:09:13 2015 @@ -375,7 +375,7 @@ 420 stdcall OleCreateFontIndirect(ptr ptr ptr) 421 stdcall OleTranslateColor(long long long) 422 stub OleLoadPictureFile -423 stub OleSavePictureFile +423 stdcall OleSavePictureFile(ptr wstr) 424 stdcall OleLoadPicturePath(wstr ptr long long ptr ptr) 425 stdcall VarUI4FromI8(int64 ptr) 426 stdcall VarUI4FromUI8(int64 ptr)
Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepictu... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Wed Apr 15 18:09:13 2015 @@ -2281,6 +2281,15 @@ }
/*********************************************************************** + * OleSavePictureFile (OLEAUT32.423) + */ +HRESULT WINAPI OleSavePictureFile(IDispatch *picture, BSTR filename) +{ + FIXME("(%p %s): stub\n", picture, debugstr_w(filename)); + return CTL_E_FILENOTFOUND; +} + +/*********************************************************************** * OleLoadPicturePath (OLEAUT32.424) */ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
Modified: trunk/reactos/dll/win32/oleaut32/safearray.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/safearra... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/safearray.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/safearray.c [iso-8859-1] Wed Apr 15 18:09:13 2015 @@ -83,18 +83,18 @@ FADF_CREATEVECTOR;
/* Allocate memory */ -static inline LPVOID SAFEARRAY_Malloc(ULONG ulSize) -{ - /* FIXME: Memory should be allocated and freed using a per-thread IMalloc - * instance returned from CoGetMalloc(). - */ - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ulSize); +static inline void* SAFEARRAY_Malloc(ULONG size) +{ + void *ret = CoTaskMemAlloc(size); + if (ret) + memset(ret, 0, size); + return ret; }
/* Free memory */ -static inline BOOL SAFEARRAY_Free(LPVOID lpData) -{ - return HeapFree(GetProcessHeap(), 0, lpData); +static inline void SAFEARRAY_Free(void *ptr) +{ + CoTaskMemFree(ptr); }
/* Get the size of a supported VT type (0 means unsupported) */ @@ -760,8 +760,7 @@ !(psa->fFeatures & FADF_DATADELETED)) SAFEARRAY_DestroyData(psa, 0); /* Data not previously deleted */
- if (!SAFEARRAY_Free(lpv)) - return E_UNEXPECTED; + SAFEARRAY_Free(lpv); } return S_OK; } @@ -1271,8 +1270,7 @@ /* If this is not a vector, free the data memory block */ if (!(psa->fFeatures & FADF_CREATEVECTOR)) { - if (!SAFEARRAY_Free(psa->pvData)) - return E_UNEXPECTED; + SAFEARRAY_Free(psa->pvData); psa->pvData = NULL; } else
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] Wed Apr 15 18:09:13 2015 @@ -175,8 +175,6 @@ xsize = 0; return xbuf_add(buf,(LPBYTE)&xsize,sizeof(xsize)); } - - hres = E_FAIL;
TRACE("...%s...\n",debugstr_guid(riid));
Modified: trunk/reactos/dll/win32/oleaut32/typelib.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Wed Apr 15 18:09:13 2015 @@ -1758,18 +1758,6 @@ { while(n){ if(funcdescs->funcdesc.memid == memid) - return funcdescs; - ++funcdescs; - --n; - } - return NULL; -} - -static inline TLBFuncDesc *TLB_get_funcdesc_by_name(TLBFuncDesc *funcdescs, - UINT n, const OLECHAR *name) -{ - while(n){ - if(!lstrcmpiW(TLB_get_bstr(funcdescs->Name), name)) return funcdescs; ++funcdescs; --n; @@ -2102,10 +2090,6 @@ * * Functions for reading MSFT typelibs (those created by CreateTypeLib2) */ -static inline unsigned int MSFT_Tell(const TLBContext *pcx) -{ - return pcx->pos; -}
static inline void MSFT_Seek(TLBContext *pcx, LONG where) { @@ -7611,6 +7595,45 @@ return E_FAIL; }
+struct search_res_tlb_params +{ + const GUID *guid; + ITypeLib *pTLib; +}; + +static BOOL CALLBACK search_res_tlb(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam) +{ + struct search_res_tlb_params *params = (LPVOID)lParam; + static const WCHAR formatW[] = {'\','%','d',0}; + WCHAR szPath[MAX_PATH+1]; + ITypeLib *pTLib = NULL; + HRESULT ret; + DWORD len; + + if (IS_INTRESOURCE(lpszName) == FALSE) + return TRUE; + + if (!(len = GetModuleFileNameW(hModule, szPath, MAX_PATH))) + return TRUE; + + if (snprintfW(szPath + len, sizeof(szPath)/sizeof(WCHAR) - len, formatW, LOWORD(lpszName)) < 0) + return TRUE; + + ret = LoadTypeLibEx(szPath, REGKIND_NONE, &pTLib); + if (SUCCEEDED(ret)) + { + ITypeLibImpl *impl = impl_from_ITypeLib(pTLib); + if (IsEqualGUID(params->guid, impl->guid)) + { + params->pTLib = pTLib; + return FALSE; /* stop enumeration */ + } + ITypeLib_Release(pTLib); + } + + return TRUE; +} + /* ITypeInfo::GetRefTypeInfo * * If a type description references other type descriptions, it retrieves @@ -7704,20 +7727,33 @@ ITypeLib_AddRef(pTLib); result = S_OK; } else { + static const WCHAR TYPELIBW[] = {'T','Y','P','E','L','I','B',0}; + struct search_res_tlb_params params; BSTR libnam;
TRACE("typeinfo in imported typelib that isn't already loaded\n");
- result = query_typelib_path(TLB_get_guid_null(ref_type->pImpTLInfo->guid), - ref_type->pImpTLInfo->wVersionMajor, - ref_type->pImpTLInfo->wVersionMinor, - This->pTypeLib->syskind, - ref_type->pImpTLInfo->lcid, &libnam, TRUE); - if(FAILED(result)) - libnam = SysAllocString(ref_type->pImpTLInfo->name); - - result = LoadTypeLib(libnam, &pTLib); - SysFreeString(libnam); + /* Search in resource table */ + params.guid = TLB_get_guid_null(ref_type->pImpTLInfo->guid); + params.pTLib = NULL; + EnumResourceNamesW(NULL, TYPELIBW, search_res_tlb, (LONG_PTR)¶ms); + pTLib = params.pTLib; + result = S_OK; + + if (!pTLib) + { + /* Search on disk */ + result = query_typelib_path(TLB_get_guid_null(ref_type->pImpTLInfo->guid), + ref_type->pImpTLInfo->wVersionMajor, + ref_type->pImpTLInfo->wVersionMinor, + This->pTypeLib->syskind, + ref_type->pImpTLInfo->lcid, &libnam, TRUE); + if (FAILED(result)) + libnam = SysAllocString(ref_type->pImpTLInfo->name); + + result = LoadTypeLib(libnam, &pTLib); + SysFreeString(libnam); + }
if(SUCCEEDED(result)) { ref_type->pImpTLInfo->pImpTypeLib = impl_from_ITypeLib(pTLib); @@ -9183,7 +9219,7 @@ file->arraydesc_seg.data = heap_alloc(file->arraydesc_seg.len); else file->arraydesc_seg.data = heap_realloc(file->arraydesc_seg.data, file->arraydesc_seg.len); - encoded = (DWORD*)((char *)file->arraydesc_seg.data) + offs; + encoded = (DWORD*)((char *)file->arraydesc_seg.data + offs);
encoded[0] = WMSFT_append_typedesc(&desc->tdescElem, file, NULL, NULL); encoded[1] = desc->cDims | ((desc->cDims * 2 * sizeof(DWORD)) << 16);
Modified: trunk/reactos/dll/win32/oleaut32/varformat.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/varforma... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] Wed Apr 15 18:09:13 2015 @@ -2312,7 +2312,7 @@ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal, sizeof(decimal)/sizeof(WCHAR)); numfmt.lpThousandSep = thousands; - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands, + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousands, sizeof(thousands)/sizeof(WCHAR));
if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt,
Modified: trunk/reactos/dll/win32/oleaut32/variant.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] Wed Apr 15 18:09:13 2015 @@ -28,40 +28,6 @@ #include "precomp.h"
WINE_DEFAULT_DEBUG_CHANNEL(variant); - -static const char * const variant_types[] = -{ - "VT_EMPTY","VT_NULL","VT_I2","VT_I4","VT_R4","VT_R8","VT_CY","VT_DATE", - "VT_BSTR","VT_DISPATCH","VT_ERROR","VT_BOOL","VT_VARIANT","VT_UNKNOWN", - "VT_DECIMAL","15","VT_I1","VT_UI1","VT_UI2","VT_UI4","VT_I8","VT_UI8", - "VT_INT","VT_UINT","VT_VOID","VT_HRESULT","VT_PTR","VT_SAFEARRAY", - "VT_CARRAY","VT_USERDEFINED","VT_LPSTR","VT_LPWSTR","32","33","34","35", - "VT_RECORD","VT_INT_PTR","VT_UINT_PTR","39","40","41","42","43","44","45", - "46","47","48","49","50","51","52","53","54","55","56","57","58","59","60", - "61","62","63","VT_FILETIME","VT_BLOB","VT_STREAM","VT_STORAGE", - "VT_STREAMED_OBJECT","VT_STORED_OBJECT","VT_BLOB_OBJECT","VT_CF","VT_CLSID", - "VT_VERSIONED_STREAM" -}; - -static const char * const variant_flags[16] = -{ - "", - "|VT_VECTOR", - "|VT_ARRAY", - "|VT_VECTOR|VT_ARRAY", - "|VT_BYREF", - "|VT_VECTOR|VT_ARRAY", - "|VT_ARRAY|VT_BYREF", - "|VT_VECTOR|VT_ARRAY|VT_BYREF", - "|VT_RESERVED", - "|VT_VECTOR|VT_RESERVED", - "|VT_ARRAY|VT_RESERVED", - "|VT_VECTOR|VT_ARRAY|VT_RESERVED", - "|VT_BYREF|VT_RESERVED", - "|VT_VECTOR|VT_ARRAY|VT_RESERVED", - "|VT_ARRAY|VT_BYREF|VT_RESERVED", - "|VT_VECTOR|VT_ARRAY|VT_BYREF|VT_RESERVED", -};
/* Convert a variant from one type to another */ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags, @@ -1754,9 +1720,8 @@ } else { - if ((dwState & B_PROCESSING_OCT) && ((*lpszStr == '8') || (*lpszStr == '9'))) { - return DISP_E_TYPEMISMATCH; - } + if ((dwState & B_PROCESSING_OCT) && ((*lpszStr == '8') || (*lpszStr == '9'))) + break;
if (pNumprs->dwOutFlags & NUMPRS_DECIMAL) pNumprs->nPwr10--; /* Count decimal points in nPwr10 */
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] Wed Apr 15 18:09:13 2015 @@ -147,7 +147,7 @@ reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.37 reactos/dll/win32/ole32 # Synced to WineStaging-1.7.37 reactos/dll/win32/oleacc # Synced to WineStaging-1.7.37 -reactos/dll/win32/oleaut32 # Synced to Wine-1.7.27 +reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.37 reactos/dll/win32/olecli32 # Synced to Wine-1.7.27 reactos/dll/win32/oledlg # Synced to Wine-1.7.27 reactos/dll/win32/olepro32 # Synced to Wine-1.7.27