[OLEAUT32] Sync with Wine Staging 1.7.37. CORE-9246

svn path=/trunk/; revision=67203
This commit is contained in:
Amine Khaldi 2015-04-15 18:09:13 +00:00
parent 7b4184bd06
commit e4b0e7aa74
8 changed files with 85 additions and 79 deletions

View file

@ -375,7 +375,7 @@
420 stdcall OleCreateFontIndirect(ptr ptr ptr) 420 stdcall OleCreateFontIndirect(ptr ptr ptr)
421 stdcall OleTranslateColor(long long long) 421 stdcall OleTranslateColor(long long long)
422 stub OleLoadPictureFile 422 stub OleLoadPictureFile
423 stub OleSavePictureFile 423 stdcall OleSavePictureFile(ptr wstr)
424 stdcall OleLoadPicturePath(wstr ptr long long ptr ptr) 424 stdcall OleLoadPicturePath(wstr ptr long long ptr ptr)
425 stdcall VarUI4FromI8(int64 ptr) 425 stdcall VarUI4FromI8(int64 ptr)
426 stdcall VarUI4FromUI8(int64 ptr) 426 stdcall VarUI4FromUI8(int64 ptr)

View file

@ -2280,6 +2280,15 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
return hr; return hr;
} }
/***********************************************************************
* 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) * OleLoadPicturePath (OLEAUT32.424)
*/ */

View file

@ -83,18 +83,18 @@ static const USHORT ignored_copy_features =
FADF_CREATEVECTOR; FADF_CREATEVECTOR;
/* Allocate memory */ /* Allocate memory */
static inline LPVOID SAFEARRAY_Malloc(ULONG ulSize) static inline void* SAFEARRAY_Malloc(ULONG size)
{ {
/* FIXME: Memory should be allocated and freed using a per-thread IMalloc void *ret = CoTaskMemAlloc(size);
* instance returned from CoGetMalloc(). if (ret)
*/ memset(ret, 0, size);
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ulSize); return ret;
} }
/* Free memory */ /* Free memory */
static inline BOOL SAFEARRAY_Free(LPVOID lpData) static inline void SAFEARRAY_Free(void *ptr)
{ {
return HeapFree(GetProcessHeap(), 0, lpData); CoTaskMemFree(ptr);
} }
/* Get the size of a supported VT type (0 means unsupported) */ /* Get the size of a supported VT type (0 means unsupported) */
@ -760,8 +760,7 @@ HRESULT WINAPI SafeArrayDestroyDescriptor(SAFEARRAY *psa)
!(psa->fFeatures & FADF_DATADELETED)) !(psa->fFeatures & FADF_DATADELETED))
SAFEARRAY_DestroyData(psa, 0); /* Data not previously deleted */ SAFEARRAY_DestroyData(psa, 0); /* Data not previously deleted */
if (!SAFEARRAY_Free(lpv)) SAFEARRAY_Free(lpv);
return E_UNEXPECTED;
} }
return S_OK; return S_OK;
} }
@ -1271,8 +1270,7 @@ HRESULT WINAPI SafeArrayDestroyData(SAFEARRAY *psa)
/* If this is not a vector, free the data memory block */ /* If this is not a vector, free the data memory block */
if (!(psa->fFeatures & FADF_CREATEVECTOR)) if (!(psa->fFeatures & FADF_CREATEVECTOR))
{ {
if (!SAFEARRAY_Free(psa->pvData)) SAFEARRAY_Free(psa->pvData);
return E_UNEXPECTED;
psa->pvData = NULL; psa->pvData = NULL;
} }
else else

View file

@ -176,8 +176,6 @@ _marshal_interface(marshal_state *buf, REFIID riid, LPUNKNOWN pUnk) {
return xbuf_add(buf,(LPBYTE)&xsize,sizeof(xsize)); return xbuf_add(buf,(LPBYTE)&xsize,sizeof(xsize));
} }
hres = E_FAIL;
TRACE("...%s...\n",debugstr_guid(riid)); TRACE("...%s...\n",debugstr_guid(riid));
hres = CreateStreamOnHGlobal(0,TRUE,&pStm); hres = CreateStreamOnHGlobal(0,TRUE,&pStm);

View file

@ -1765,18 +1765,6 @@ static inline TLBFuncDesc *TLB_get_funcdesc_by_memberid(TLBFuncDesc *funcdescs,
return NULL; 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;
}
return NULL;
}
static inline TLBVarDesc *TLB_get_vardesc_by_memberid(TLBVarDesc *vardescs, static inline TLBVarDesc *TLB_get_vardesc_by_memberid(TLBVarDesc *vardescs,
UINT n, MEMBERID memid) UINT n, MEMBERID memid)
{ {
@ -2102,10 +2090,6 @@ static HRESULT TLB_size_instance(ITypeInfoImpl *info, SYSKIND sys,
* *
* Functions for reading MSFT typelibs (those created by CreateTypeLib2) * 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) static inline void MSFT_Seek(TLBContext *pcx, LONG where)
{ {
@ -7611,6 +7595,45 @@ static HRESULT ITypeInfoImpl_GetDispatchRefTypeInfo( ITypeInfo *iface,
return E_FAIL; 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 /* ITypeInfo::GetRefTypeInfo
* *
* If a type description references other type descriptions, it retrieves * If a type description references other type descriptions, it retrieves
@ -7704,10 +7727,22 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
ITypeLib_AddRef(pTLib); ITypeLib_AddRef(pTLib);
result = S_OK; result = S_OK;
} else { } else {
static const WCHAR TYPELIBW[] = {'T','Y','P','E','L','I','B',0};
struct search_res_tlb_params params;
BSTR libnam; BSTR libnam;
TRACE("typeinfo in imported typelib that isn't already loaded\n"); TRACE("typeinfo in imported typelib that isn't already loaded\n");
/* 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)&params);
pTLib = params.pTLib;
result = S_OK;
if (!pTLib)
{
/* Search on disk */
result = query_typelib_path(TLB_get_guid_null(ref_type->pImpTLInfo->guid), result = query_typelib_path(TLB_get_guid_null(ref_type->pImpTLInfo->guid),
ref_type->pImpTLInfo->wVersionMajor, ref_type->pImpTLInfo->wVersionMajor,
ref_type->pImpTLInfo->wVersionMinor, ref_type->pImpTLInfo->wVersionMinor,
@ -7718,6 +7753,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
result = LoadTypeLib(libnam, &pTLib); result = LoadTypeLib(libnam, &pTLib);
SysFreeString(libnam); SysFreeString(libnam);
}
if(SUCCEEDED(result)) { if(SUCCEEDED(result)) {
ref_type->pImpTLInfo->pImpTypeLib = impl_from_ITypeLib(pTLib); ref_type->pImpTLInfo->pImpTypeLib = impl_from_ITypeLib(pTLib);
@ -9183,7 +9219,7 @@ static DWORD WMSFT_append_arraydesc(ARRAYDESC *desc, WMSFT_TLBFile *file)
file->arraydesc_seg.data = heap_alloc(file->arraydesc_seg.len); file->arraydesc_seg.data = heap_alloc(file->arraydesc_seg.len);
else else
file->arraydesc_seg.data = heap_realloc(file->arraydesc_seg.data, file->arraydesc_seg.len); 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[0] = WMSFT_append_typedesc(&desc->tdescElem, file, NULL, NULL);
encoded[1] = desc->cDims | ((desc->cDims * 2 * sizeof(DWORD)) << 16); encoded[1] = desc->cDims | ((desc->cDims * 2 * sizeof(DWORD)) << 16);

View file

@ -2312,7 +2312,7 @@ HRESULT WINAPI VarFormatNumber(LPVARIANT pVarIn, INT nDigits, INT nLeading, INT
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal, GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal,
sizeof(decimal)/sizeof(WCHAR)); sizeof(decimal)/sizeof(WCHAR));
numfmt.lpThousandSep = thousands; numfmt.lpThousandSep = thousands;
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands, GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousands,
sizeof(thousands)/sizeof(WCHAR)); sizeof(thousands)/sizeof(WCHAR));
if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt, if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt,

View file

@ -29,40 +29,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(variant); 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 */ /* Convert a variant from one type to another */
static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags, static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
VARIANTARG* ps, VARTYPE vt) VARIANTARG* ps, VARTYPE vt)
@ -1754,9 +1720,8 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
} }
else else
{ {
if ((dwState & B_PROCESSING_OCT) && ((*lpszStr == '8') || (*lpszStr == '9'))) { if ((dwState & B_PROCESSING_OCT) && ((*lpszStr == '8') || (*lpszStr == '9')))
return DISP_E_TYPEMISMATCH; break;
}
if (pNumprs->dwOutFlags & NUMPRS_DECIMAL) if (pNumprs->dwOutFlags & NUMPRS_DECIMAL)
pNumprs->nPwr10--; /* Count decimal points in nPwr10 */ pNumprs->nPwr10--; /* Count decimal points in nPwr10 */

View file

@ -147,7 +147,7 @@ reactos/dll/win32/odbc32 # Synced to WineStaging-1.7.37. Depends on
reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.37 reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.37
reactos/dll/win32/ole32 # 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/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/olecli32 # Synced to Wine-1.7.27
reactos/dll/win32/oledlg # 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 reactos/dll/win32/olepro32 # Synced to Wine-1.7.27