mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 12:40:33 +00:00
[OLEAUT32] Sync with Wine Staging 1.9.11. CORE-11368
svn path=/trunk/; revision=71581
This commit is contained in:
parent
902eeb69b2
commit
f7918981cf
8 changed files with 276 additions and 131 deletions
|
@ -100,7 +100,7 @@ static inline size_t bstr_alloc_size(size_t size)
|
|||
|
||||
static inline bstr_t *bstr_from_str(BSTR str)
|
||||
{
|
||||
return CONTAINING_RECORD(str, bstr_t, u.str);
|
||||
return CONTAINING_RECORD((void *)str, bstr_t, u.str);
|
||||
}
|
||||
|
||||
static inline bstr_cache_entry_t *get_cache_entry_from_idx(unsigned cache_idx)
|
||||
|
|
|
@ -374,7 +374,7 @@
|
|||
419 stdcall OleCreatePictureIndirect(ptr ptr long ptr)
|
||||
420 stdcall OleCreateFontIndirect(ptr ptr ptr)
|
||||
421 stdcall OleTranslateColor(long long long)
|
||||
422 stub OleLoadPictureFile
|
||||
422 stdcall OleLoadPictureFile(int128 ptr)
|
||||
423 stdcall OleSavePictureFile(ptr wstr)
|
||||
424 stdcall OleLoadPicturePath(wstr ptr long long ptr ptr)
|
||||
425 stdcall VarUI4FromI8(int64 ptr)
|
||||
|
|
|
@ -246,6 +246,18 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This)
|
|||
}
|
||||
}
|
||||
|
||||
static void OLEPictureImpl_SetEMF(OLEPictureImpl *This)
|
||||
{
|
||||
ENHMETAHEADER emh;
|
||||
|
||||
GetEnhMetaFileHeader(This->desc.u.emf.hemf, sizeof(emh), &emh);
|
||||
|
||||
This->origWidth = 0;
|
||||
This->origHeight = 0;
|
||||
This->himetricWidth = emh.rclFrame.right - emh.rclFrame.left;
|
||||
This->himetricHeight = emh.rclFrame.bottom - emh.rclFrame.top;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* OLEPictureImpl_Construct
|
||||
*
|
||||
|
@ -326,7 +338,11 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
|
|||
case PICTYPE_ICON:
|
||||
OLEPictureImpl_SetIcon(newObject);
|
||||
break;
|
||||
|
||||
case PICTYPE_ENHMETAFILE:
|
||||
OLEPictureImpl_SetEMF(newObject);
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("Unsupported type %d\n", pictDesc->picType);
|
||||
newObject->himetricWidth = newObject->himetricHeight = 0;
|
||||
|
@ -616,8 +632,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
|
|||
TRACE("(%p)->(%p, (%d,%d), (%d,%d) <- (%d,%d), (%d,%d), %p)\n",
|
||||
This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, prcWBounds);
|
||||
if(prcWBounds)
|
||||
TRACE("prcWBounds (%d,%d) - (%d,%d)\n", prcWBounds->left, prcWBounds->top,
|
||||
prcWBounds->right, prcWBounds->bottom);
|
||||
TRACE("prcWBounds %s\n", wine_dbgstr_rect(prcWBounds));
|
||||
|
||||
if(cx == 0 || cy == 0 || cxSrc == 0 || cySrc == 0){
|
||||
return CTL_E_INVALIDPROPERTYVALUE;
|
||||
|
@ -813,19 +828,6 @@ static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* OLEPictureImpl_SaveAsFile
|
||||
*/
|
||||
static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface,
|
||||
IStream *pstream,
|
||||
BOOL SaveMemCopy,
|
||||
LONG *pcbSize)
|
||||
{
|
||||
OLEPictureImpl *This = impl_from_IPicture(iface);
|
||||
FIXME("(%p)->(%p, %d, %p), hacked stub.\n", This, pstream, SaveMemCopy, pcbSize);
|
||||
return IStream_Write(pstream,This->data,This->datalen,(ULONG*)pcbSize);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* OLEPictureImpl_get_Attributes
|
||||
*/
|
||||
|
@ -979,23 +981,16 @@ static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
|
|||
{
|
||||
BITMAPFILEHEADER *bfh = (BITMAPFILEHEADER*)xbuf;
|
||||
BITMAPINFO *bi = (BITMAPINFO*)(bfh+1);
|
||||
HDC hdcref;
|
||||
void *bits;
|
||||
BITMAP bmp;
|
||||
|
||||
/* Does not matter whether this is a coreheader or not, we only use
|
||||
* components which are in both
|
||||
*/
|
||||
hdcref = GetDC(0);
|
||||
This->desc.u.bmp.hbitmap = CreateDIBitmap(
|
||||
hdcref,
|
||||
&(bi->bmiHeader),
|
||||
CBM_INIT,
|
||||
xbuf+bfh->bfOffBits,
|
||||
bi,
|
||||
DIB_RGB_COLORS
|
||||
);
|
||||
ReleaseDC(0, hdcref);
|
||||
This->desc.u.bmp.hbitmap = CreateDIBSection(0, bi, DIB_RGB_COLORS, &bits, NULL, 0);
|
||||
if (This->desc.u.bmp.hbitmap == 0)
|
||||
return E_FAIL;
|
||||
|
||||
GetObjectA(This->desc.u.bmp.hbitmap, sizeof(bmp), &bmp);
|
||||
memcpy(bits, xbuf + bfh->bfOffBits, bmp.bmHeight * bmp.bmWidthBytes);
|
||||
|
||||
This->desc.picType = PICTYPE_BITMAP;
|
||||
OLEPictureImpl_SetBitmap(This);
|
||||
return S_OK;
|
||||
|
@ -1005,10 +1000,9 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
|
|||
{
|
||||
HRESULT hr;
|
||||
BITMAPINFOHEADER bih;
|
||||
HDC hdcref;
|
||||
UINT width, height;
|
||||
UINT stride, buffersize;
|
||||
LPBYTE bits=NULL;
|
||||
BYTE *bits;
|
||||
WICRect rc;
|
||||
IWICBitmapSource *real_source;
|
||||
UINT x, y;
|
||||
|
@ -1036,10 +1030,10 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
|
|||
stride = 4 * width;
|
||||
buffersize = stride * height;
|
||||
|
||||
bits = HeapAlloc(GetProcessHeap(), 0, buffersize);
|
||||
if (!bits)
|
||||
This->desc.u.bmp.hbitmap = CreateDIBSection(0, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void **)&bits, NULL, 0);
|
||||
if (This->desc.u.bmp.hbitmap == 0)
|
||||
{
|
||||
hr = E_OUTOFMEMORY;
|
||||
hr = E_FAIL;
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
@ -1049,21 +1043,8 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
|
|||
rc.Height = height;
|
||||
hr = IWICBitmapSource_CopyPixels(real_source, &rc, stride, buffersize, bits);
|
||||
if (FAILED(hr))
|
||||
goto end;
|
||||
|
||||
hdcref = GetDC(0);
|
||||
This->desc.u.bmp.hbitmap = CreateDIBitmap(
|
||||
hdcref,
|
||||
&bih,
|
||||
CBM_INIT,
|
||||
bits,
|
||||
(BITMAPINFO*)&bih,
|
||||
DIB_RGB_COLORS);
|
||||
|
||||
if (This->desc.u.bmp.hbitmap == 0)
|
||||
{
|
||||
hr = E_FAIL;
|
||||
ReleaseDC(0, hdcref);
|
||||
DeleteObject(This->desc.u.bmp.hbitmap);
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
@ -1086,9 +1067,11 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
|
|||
|
||||
if (has_alpha)
|
||||
{
|
||||
HDC hdcBmp, hdcXor, hdcMask;
|
||||
HDC hdcref, hdcBmp, hdcXor, hdcMask;
|
||||
HBITMAP hbmoldBmp, hbmoldXor, hbmoldMask;
|
||||
|
||||
hdcref = GetDC(0);
|
||||
|
||||
This->hbmXor = CreateDIBitmap(
|
||||
hdcref,
|
||||
&bih,
|
||||
|
@ -1118,12 +1101,10 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
|
|||
DeleteDC(hdcBmp);
|
||||
DeleteDC(hdcXor);
|
||||
DeleteDC(hdcMask);
|
||||
ReleaseDC(0, hdcref);
|
||||
}
|
||||
|
||||
ReleaseDC(0, hdcref);
|
||||
|
||||
end:
|
||||
HeapFree(GetProcessHeap(), 0, bits);
|
||||
IWICBitmapSource_Release(real_source);
|
||||
return hr;
|
||||
}
|
||||
|
@ -1742,6 +1723,17 @@ static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
|
|||
return success;
|
||||
}
|
||||
|
||||
static BOOL serializeEMF(HENHMETAFILE hemf, void **buf, unsigned *size)
|
||||
{
|
||||
*size = GetEnhMetaFileBits(hemf, 0, NULL);
|
||||
if (!*size) return FALSE;
|
||||
|
||||
*buf = HeapAlloc(GetProcessHeap(), 0, *size);
|
||||
if (!*buf) return FALSE;
|
||||
|
||||
return GetEnhMetaFileBits(hemf, *size, *buf) != 0;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OLEPictureImpl_Save(
|
||||
IPersistStream* iface,IStream*pStm,BOOL fClearDirty)
|
||||
{
|
||||
|
@ -1817,12 +1809,31 @@ static HRESULT WINAPI OLEPictureImpl_Save(
|
|||
IStream_Write(pStm, This->data, This->datalen, &dummy);
|
||||
hResult = S_OK;
|
||||
break;
|
||||
|
||||
case PICTYPE_ENHMETAFILE:
|
||||
if (This->bIsDirty || !This->data)
|
||||
{
|
||||
serializeResult = serializeEMF(This->desc.u.emf.hemf, &pIconData, &iDataSize);
|
||||
if (!serializeResult)
|
||||
{
|
||||
hResult = E_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->data);
|
||||
This->data = pIconData;
|
||||
This->datalen = iDataSize;
|
||||
}
|
||||
header[0] = 0x0000746c;
|
||||
header[1] = This->datalen;
|
||||
IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy);
|
||||
IStream_Write(pStm, This->data, This->datalen, &dummy);
|
||||
hResult = S_OK;
|
||||
break;
|
||||
|
||||
case PICTYPE_METAFILE:
|
||||
FIXME("(%p,%p,%d), PICTYPE_METAFILE not implemented!\n",This,pStm,fClearDirty);
|
||||
break;
|
||||
case PICTYPE_ENHMETAFILE:
|
||||
FIXME("(%p,%p,%d),PICTYPE_ENHMETAFILE not implemented!\n",This,pStm,fClearDirty);
|
||||
break;
|
||||
default:
|
||||
FIXME("(%p,%p,%d), [unknown type] not implemented!\n",This,pStm,fClearDirty);
|
||||
break;
|
||||
|
@ -1839,6 +1850,98 @@ static HRESULT WINAPI OLEPictureImpl_GetSizeMax(
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* OLEPictureImpl_SaveAsFile
|
||||
*/
|
||||
static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface,
|
||||
IStream *stream, BOOL mem_copy, LONG *size)
|
||||
{
|
||||
OLEPictureImpl *This = impl_from_IPicture(iface);
|
||||
void *data;
|
||||
unsigned data_size;
|
||||
ULONG written;
|
||||
HRESULT hr;
|
||||
|
||||
FIXME("(%p)->(%p,%d,%p): semi-stub\n", This, stream, mem_copy, size);
|
||||
|
||||
switch (This->desc.picType)
|
||||
{
|
||||
case PICTYPE_NONE:
|
||||
return S_OK;
|
||||
|
||||
case PICTYPE_ICON:
|
||||
if (!mem_copy) return E_FAIL;
|
||||
|
||||
if (This->bIsDirty || !This->data)
|
||||
{
|
||||
if (!serializeIcon(This->desc.u.icon.hicon, &data, &data_size))
|
||||
return E_FAIL;
|
||||
HeapFree(GetProcessHeap(), 0, This->data);
|
||||
This->data = data;
|
||||
This->datalen = data_size;
|
||||
}
|
||||
hr = IStream_Write(stream, This->data, This->datalen, &written);
|
||||
if (hr == S_OK && size) *size = written;
|
||||
return hr;
|
||||
|
||||
case PICTYPE_BITMAP:
|
||||
if (!mem_copy) return E_FAIL;
|
||||
|
||||
if (This->bIsDirty || !This->data)
|
||||
{
|
||||
switch (This->keepOrigFormat ? This->loadtime_format : BITMAP_FORMAT_BMP)
|
||||
{
|
||||
case BITMAP_FORMAT_BMP:
|
||||
if (!serializeBMP(This->desc.u.bmp.hbitmap, &data, &data_size))
|
||||
return E_FAIL;
|
||||
break;
|
||||
case BITMAP_FORMAT_JPEG:
|
||||
FIXME("BITMAP_FORMAT_JPEG is not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
case BITMAP_FORMAT_GIF:
|
||||
FIXME("BITMAP_FORMAT_GIF is not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
case BITMAP_FORMAT_PNG:
|
||||
FIXME("BITMAP_FORMAT_PNG is not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
default:
|
||||
FIXME("PICTYPE_BITMAP/%#x is not implemented\n", This->loadtime_format);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->data);
|
||||
This->data = data;
|
||||
This->datalen = data_size;
|
||||
}
|
||||
hr = IStream_Write(stream, This->data, This->datalen, &written);
|
||||
if (hr == S_OK && size) *size = written;
|
||||
return hr;
|
||||
|
||||
case PICTYPE_METAFILE:
|
||||
FIXME("PICTYPE_METAFILE is not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
|
||||
case PICTYPE_ENHMETAFILE:
|
||||
if (!mem_copy) return E_FAIL;
|
||||
|
||||
if (This->bIsDirty || !This->data)
|
||||
{
|
||||
if (!serializeEMF(This->desc.u.emf.hemf, &data, &data_size))
|
||||
return E_FAIL;
|
||||
HeapFree(GetProcessHeap(), 0, This->data);
|
||||
This->data = data;
|
||||
This->datalen = data_size;
|
||||
}
|
||||
hr = IStream_Write(stream, This->data, This->datalen, &written);
|
||||
if (hr == S_OK && size) *size = written;
|
||||
return hr;
|
||||
|
||||
default:
|
||||
FIXME("%#x is not implemented\n", This->desc.picType);
|
||||
break;
|
||||
}
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* IDispatch
|
||||
|
@ -2295,6 +2398,72 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT create_stream(const WCHAR *filename, IStream **stream)
|
||||
{
|
||||
HANDLE hFile;
|
||||
DWORD dwFileSize;
|
||||
HGLOBAL hGlobal = NULL;
|
||||
DWORD dwBytesRead;
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
hFile = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
|
||||
dwFileSize = GetFileSize(hFile, NULL);
|
||||
if (dwFileSize != INVALID_FILE_SIZE)
|
||||
{
|
||||
hGlobal = GlobalAlloc(GMEM_FIXED, dwFileSize);
|
||||
if (!hGlobal)
|
||||
hr = E_OUTOFMEMORY;
|
||||
else
|
||||
{
|
||||
if (!ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL))
|
||||
{
|
||||
GlobalFree(hGlobal);
|
||||
hr = HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
hr = CreateStreamOnHGlobal(hGlobal, TRUE, stream);
|
||||
if (FAILED(hr))
|
||||
GlobalFree(hGlobal);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* OleLoadPictureFile (OLEAUT32.422)
|
||||
*/
|
||||
HRESULT WINAPI OleLoadPictureFile(VARIANT filename, IDispatch **picture)
|
||||
{
|
||||
IStream *stream;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%s,%p)\n", wine_dbgstr_variant(&filename), picture);
|
||||
|
||||
if (V_VT(&filename) != VT_BSTR)
|
||||
return CTL_E_FILENOTFOUND;
|
||||
|
||||
hr = create_stream(V_BSTR(&filename), &stream);
|
||||
if (hr != S_OK)
|
||||
{
|
||||
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
|
||||
return CTL_E_FILENOTFOUND;
|
||||
|
||||
return CTL_E_PATHFILEACCESSERROR;
|
||||
}
|
||||
|
||||
hr = OleLoadPicture(stream, 0, FALSE, &IID_IDispatch, (void **)picture);
|
||||
IStream_Release(stream);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* OleSavePictureFile (OLEAUT32.423)
|
||||
*/
|
||||
|
@ -2312,16 +2481,8 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
|||
LPVOID *ppvRet )
|
||||
{
|
||||
static const WCHAR file[] = { 'f','i','l','e',':',0 };
|
||||
IPicture *ipicture;
|
||||
HANDLE hFile;
|
||||
DWORD dwFileSize;
|
||||
HGLOBAL hGlobal = NULL;
|
||||
DWORD dwBytesRead;
|
||||
IStream *stream;
|
||||
BOOL bRead;
|
||||
IPersistStream *pStream;
|
||||
HRESULT hRes;
|
||||
HRESULT init_res;
|
||||
WCHAR *file_candidate;
|
||||
WCHAR path_buf[MAX_PATH];
|
||||
|
||||
|
@ -2349,36 +2510,9 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
|||
|
||||
/* Handle candidate DOS paths separately. */
|
||||
if (file_candidate[1] == ':') {
|
||||
hFile = CreateFileW(file_candidate, GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
||||
0, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return INET_E_RESOURCE_NOT_FOUND;
|
||||
|
||||
dwFileSize = GetFileSize(hFile, NULL);
|
||||
if (dwFileSize != INVALID_FILE_SIZE )
|
||||
{
|
||||
hGlobal = GlobalAlloc(GMEM_FIXED,dwFileSize);
|
||||
if ( hGlobal)
|
||||
{
|
||||
bRead = ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL) && dwBytesRead == dwFileSize;
|
||||
if (!bRead)
|
||||
{
|
||||
GlobalFree(hGlobal);
|
||||
hGlobal = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
|
||||
if (!hGlobal)
|
||||
return INET_E_RESOURCE_NOT_FOUND;
|
||||
|
||||
hRes = CreateStreamOnHGlobal(hGlobal, TRUE, &stream);
|
||||
hRes = create_stream(file_candidate, &stream);
|
||||
if (FAILED(hRes))
|
||||
{
|
||||
GlobalFree(hGlobal);
|
||||
return hRes;
|
||||
}
|
||||
return INET_E_RESOURCE_NOT_FOUND;
|
||||
} else {
|
||||
IMoniker *pmnk;
|
||||
IBindCtx *pbc;
|
||||
|
@ -2398,32 +2532,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
|||
return hRes;
|
||||
}
|
||||
|
||||
init_res = CoInitialize(NULL);
|
||||
|
||||
hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER,
|
||||
&IID_IPicture, (LPVOID*)&ipicture);
|
||||
if (SUCCEEDED(hRes)) {
|
||||
hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream);
|
||||
|
||||
if (SUCCEEDED(hRes)) {
|
||||
hRes = IPersistStream_Load(pStream, stream);
|
||||
|
||||
if (SUCCEEDED(hRes)) {
|
||||
hRes = IPicture_QueryInterface(ipicture, riid, ppvRet);
|
||||
|
||||
if (FAILED(hRes))
|
||||
ERR("Failed to get interface %s from IPicture.\n", debugstr_guid(riid));
|
||||
}
|
||||
IPersistStream_Release(pStream);
|
||||
}
|
||||
IPicture_Release(ipicture);
|
||||
}
|
||||
hRes = OleLoadPicture(stream, 0, FALSE, riid, ppvRet);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
||||
if (SUCCEEDED(init_res))
|
||||
CoUninitialize();
|
||||
|
||||
return hRes;
|
||||
}
|
||||
|
||||
|
|
|
@ -3536,6 +3536,10 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
|
|||
/* name, eventually add to a hash table */
|
||||
pTypeLibImpl->Name = MSFT_ReadName(&cx, tlbHeader.NameOffset);
|
||||
|
||||
TRACE("%s, syskind %d, version %d.%d, flags %04x\n",
|
||||
debugstr_w(pTypeLibImpl->Name->str), pTypeLibImpl->syskind,
|
||||
pTypeLibImpl->ver_major, pTypeLibImpl->ver_minor, pTypeLibImpl->libflags);
|
||||
|
||||
/* help info */
|
||||
pTypeLibImpl->DocString = MSFT_ReadString(&cx, tlbHeader.helpstring);
|
||||
pTypeLibImpl->HelpFile = MSFT_ReadString(&cx, tlbHeader.helpfile);
|
||||
|
@ -7080,6 +7084,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
|
|||
UINT cNamedArgs = pDispParams->cNamedArgs;
|
||||
DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs;
|
||||
UINT vargs_converted=0;
|
||||
ULONG_PTR offset;
|
||||
|
||||
hres = S_OK;
|
||||
|
||||
|
@ -7327,7 +7332,11 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (FAILED(hres)) goto func_fail; /* FIXME: we don't free changed types here */
|
||||
if (FAILED(hres))
|
||||
{
|
||||
ERR("failed: %08x\n", hres);
|
||||
goto func_fail; /* FIXME: we don't free changed types here */
|
||||
}
|
||||
|
||||
/* VT_VOID is a special case for return types, so it is not
|
||||
* handled in the general function */
|
||||
|
@ -7340,7 +7349,16 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
|
|||
if (FAILED(hres)) goto func_fail; /* FIXME: we don't free changed types here */
|
||||
}
|
||||
|
||||
hres = DispCallFunc(pIUnk, func_desc->oVft & 0xFFFC, func_desc->callconv,
|
||||
offset = func_desc->oVft & 0xFFFC;
|
||||
#ifdef _WIN64
|
||||
if (This->pTypeLib->syskind == SYS_WIN32)
|
||||
{
|
||||
offset *= 2;
|
||||
TRACE("extended offset to %#lx for SYS_WIN32\n", offset);
|
||||
}
|
||||
#endif
|
||||
TRACE("func_desc->oVft %#x, offset %#lx\n", func_desc->oVft, offset);
|
||||
hres = DispCallFunc(pIUnk, offset, func_desc->callconv,
|
||||
V_VT(&varresult), func_desc->cParams, rgvt,
|
||||
prgpvarg, &varresult);
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ typedef struct {
|
|||
|
||||
/* after this may follow an array with default value pointers if the
|
||||
* appropriate bit in the FKCCIC field has been set:
|
||||
* INT oDefautlValue[nrargs];
|
||||
* INT oDefaultValue[nrargs];
|
||||
*/
|
||||
|
||||
/* Parameter info one per argument*/
|
||||
|
|
|
@ -29,6 +29,15 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(variant);
|
||||
|
||||
static CRITICAL_SECTION cache_cs;
|
||||
static CRITICAL_SECTION_DEBUG critsect_debug =
|
||||
{
|
||||
0, 0, &cache_cs,
|
||||
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
||||
0, 0, { (DWORD_PTR)(__FILE__ ": cache_cs") }
|
||||
};
|
||||
static CRITICAL_SECTION cache_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||
|
||||
/* Convert a variant from one type to another */
|
||||
static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
|
||||
VARIANTARG* ps, VARTYPE vt)
|
||||
|
@ -1474,7 +1483,6 @@ HRESULT WINAPI VarUdateFromDate(DATE dateIn, ULONG dwFlags, UDATE *lpUdate)
|
|||
static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID lcid, DWORD dwFlags)
|
||||
{
|
||||
static const VARIANT_NUMBER_CHARS defaultChars = { '-','+','.',',','$',0,'.',',' };
|
||||
static CRITICAL_SECTION csLastChars = { NULL, -1, 0, 0, 0, 0 };
|
||||
static VARIANT_NUMBER_CHARS lastChars;
|
||||
static LCID lastLcid = -1;
|
||||
static DWORD lastFlags = 0;
|
||||
|
@ -1482,14 +1490,14 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
|
|||
WCHAR buff[4];
|
||||
|
||||
/* To make caching thread-safe, a critical section is needed */
|
||||
EnterCriticalSection(&csLastChars);
|
||||
EnterCriticalSection(&cache_cs);
|
||||
|
||||
/* Asking for default locale entries is very expensive: It is a registry
|
||||
server call. So cache one locally, as Microsoft does it too */
|
||||
if(lcid == lastLcid && dwFlags == lastFlags)
|
||||
{
|
||||
memcpy(lpChars, &lastChars, sizeof(defaultChars));
|
||||
LeaveCriticalSection(&csLastChars);
|
||||
LeaveCriticalSection(&cache_cs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1516,7 +1524,7 @@ static void VARIANT_GetLocalisedNumberChars(VARIANT_NUMBER_CHARS *lpChars, LCID
|
|||
memcpy(&lastChars, lpChars, sizeof(defaultChars));
|
||||
lastLcid = lcid;
|
||||
lastFlags = dwFlags;
|
||||
LeaveCriticalSection(&csLastChars);
|
||||
LeaveCriticalSection(&cache_cs);
|
||||
}
|
||||
|
||||
/* Number Parsing States */
|
||||
|
|
|
@ -7658,11 +7658,13 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
|||
/* Parse the string into our structure */
|
||||
while (*strIn)
|
||||
{
|
||||
if (dp.dwCount >= 6)
|
||||
break;
|
||||
|
||||
if (isdigitW(*strIn))
|
||||
{
|
||||
if (dp.dwCount >= 6)
|
||||
{
|
||||
hRet = DISP_E_TYPEMISMATCH;
|
||||
break;
|
||||
}
|
||||
dp.dwValues[dp.dwCount] = strtoulW(strIn, &strIn, 10);
|
||||
dp.dwCount++;
|
||||
strIn--;
|
||||
|
@ -7677,11 +7679,16 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
|||
if (dwLen && !strncmpiW(strIn, tokens[i], dwLen))
|
||||
{
|
||||
if (i <= 25)
|
||||
{
|
||||
if (dp.dwCount >= 6)
|
||||
hRet = DISP_E_TYPEMISMATCH;
|
||||
else
|
||||
{
|
||||
dp.dwValues[dp.dwCount] = ParseDateMonths[i];
|
||||
dp.dwFlags[dp.dwCount] |= (DP_MONTH|DP_DATESEP);
|
||||
dp.dwCount++;
|
||||
}
|
||||
}
|
||||
else if (i > 39 && i < 42)
|
||||
{
|
||||
if (!dp.dwCount || dp.dwParseFlags & (DP_AM|DP_PM))
|
||||
|
|
|
@ -144,7 +144,7 @@ reactos/dll/win32/odbc32 # Synced to WineStaging-1.9.4. Depends on
|
|||
reactos/dll/win32/odbccp32 # Synced to WineStaging-1.9.4
|
||||
reactos/dll/win32/ole32 # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/oleacc # Synced to WineStaging-1.9.4
|
||||
reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.4
|
||||
reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.4
|
||||
reactos/dll/win32/oledlg # Synced to WineStaging-1.9.4
|
||||
reactos/dll/win32/olepro32 # Synced to WineStaging-1.9.4
|
||||
|
|
Loading…
Reference in a new issue