mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
Autosyncing with Wine HEAD
svn path=/trunk/; revision=27914
This commit is contained in:
@@ -34,8 +34,6 @@
|
||||
#include "objbase.h"
|
||||
#include "oleauto.h"
|
||||
#include "winerror.h"
|
||||
#include "winreg.h"
|
||||
#include "winnls.h" /* for PRIMARYLANGID */
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
|
||||
* string.
|
||||
*/
|
||||
stringBuffer = (WCHAR*)newBuffer;
|
||||
stringBuffer[len] = L'\0';
|
||||
stringBuffer[len] = '\0';
|
||||
|
||||
return (LPWSTR)stringBuffer;
|
||||
}
|
||||
@@ -691,8 +691,8 @@ HRESULT WINAPI OleTranslateColor(
|
||||
|
||||
extern HRESULT OLEAUTPS_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
|
||||
|
||||
extern void _get_STDFONT_CF(LPVOID);
|
||||
extern void _get_STDPIC_CF(LPVOID);
|
||||
extern void _get_STDFONT_CF(LPVOID *);
|
||||
extern void _get_STDPIC_CF(LPVOID *);
|
||||
|
||||
static HRESULT WINAPI PSDispatchFacBuf_QueryInterface(IPSFactoryBuffer *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
|
||||
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ Index: oleaut32_Ja.rc
|
||||
--- oleaut32_Ja.rc (revision 23782)
|
||||
+++ oleaut32_Ja.rc (working copy)
|
||||
@@ -0,0 +1,11 @@
|
||||
+LANGUAGE LANG_JAPANESE, SUBLANG_NEUTRAL
|
||||
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
||||
+
|
||||
+STRINGTABLE DISCARDABLE
|
||||
+{
|
||||
@@ -109,3 +109,15 @@ Index: oleaut32.rc
|
||||
|
||||
/*
|
||||
* FIXME:
|
||||
Index: oleaut32.rbuild
|
||||
===================================================================
|
||||
--- oleaut32.rbuild (revision 23782)
|
||||
+++ oleaut32.rbuild (working copy)
|
||||
@@ -20,6 +20,7 @@
|
||||
<library>comctl32</library>
|
||||
<library>urlmon</library>
|
||||
<library>uuid</library>
|
||||
+ <library>pseh</library>
|
||||
<file>connpt.c</file>
|
||||
<file>dispatch.c</file>
|
||||
<file>hash.c</file>
|
||||
|
||||
@@ -176,7 +176,7 @@ static inline OLEFontImpl *impl_from_IPersistStreamInit( IPersistStreamInit *ifa
|
||||
* Prototypes for the implementation functions for the IFont
|
||||
* interface
|
||||
*/
|
||||
static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc);
|
||||
static OLEFontImpl* OLEFontImpl_Construct(const FONTDESC *fontDesc);
|
||||
static void OLEFontImpl_Destroy(OLEFontImpl* fontDesc);
|
||||
static ULONG WINAPI OLEFontImpl_AddRef(IFont* iface);
|
||||
|
||||
@@ -2201,7 +2201,7 @@ static const IPersistStreamInitVtbl OLEFontImpl_IPersistStreamInit_VTable =
|
||||
* The caller of this method must release the object when it's
|
||||
* done with it.
|
||||
*/
|
||||
static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc)
|
||||
static OLEFontImpl* OLEFontImpl_Construct(const FONTDESC *fontDesc)
|
||||
{
|
||||
OLEFontImpl* newObject = 0;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
#include "wine/wingdi16.h"
|
||||
|
||||
#ifdef HAVE_JPEGLIB_H
|
||||
#ifdef SONAME_LIBJPEG
|
||||
/* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
|
||||
#define XMD_H
|
||||
#define UINT8 JPEG_UINT8
|
||||
@@ -77,9 +77,11 @@
|
||||
# include <jpeglib.h>
|
||||
#undef jpeg_boolean
|
||||
#undef UINT16
|
||||
#ifndef SONAME_LIBJPEG
|
||||
#define SONAME_LIBJPEG "libjpeg.so"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PNG_H
|
||||
#undef FAR
|
||||
#include <png.h>
|
||||
#endif
|
||||
|
||||
#include "ungif.h"
|
||||
@@ -365,6 +367,7 @@ static void OLEPictureImpl_Destroy(OLEPictureImpl* Obj)
|
||||
DeleteEnhMetaFile(Obj->desc.u.emf.hemf);
|
||||
break;
|
||||
case PICTYPE_NONE:
|
||||
case PICTYPE_UNINITIALIZED:
|
||||
/* Nothing to do */
|
||||
break;
|
||||
default:
|
||||
@@ -505,6 +508,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface,
|
||||
TRACE("(%p)->(%p)\n", This, phandle);
|
||||
switch(This->desc.picType) {
|
||||
case PICTYPE_NONE:
|
||||
case PICTYPE_UNINITIALIZED:
|
||||
*phandle = 0;
|
||||
break;
|
||||
case PICTYPE_BITMAP:
|
||||
@@ -674,7 +678,16 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
|
||||
break;
|
||||
|
||||
case PICTYPE_METAFILE:
|
||||
PlayMetaFile(hdc, This->desc.u.wmf.hmeta);
|
||||
break;
|
||||
|
||||
case PICTYPE_ENHMETAFILE:
|
||||
{
|
||||
RECT rc = { x, y, cx, cy };
|
||||
PlayEnhMetaFile(hdc, This->desc.u.emf.hemf, &rc);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
FIXME("type %d not implemented\n", This->desc.picType);
|
||||
return E_NOTIMPL;
|
||||
@@ -795,6 +808,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
|
||||
switch (This->desc.picType) {
|
||||
case PICTYPE_BITMAP: if (This->hbmMask) *pdwAttr = PICTURE_TRANSPARENT; break; /* not 'truly' scalable, see MSDN. */
|
||||
case PICTYPE_ICON: *pdwAttr = PICTURE_TRANSPARENT;break;
|
||||
case PICTYPE_ENHMETAFILE: /* fall through */
|
||||
case PICTYPE_METAFILE: *pdwAttr = PICTURE_TRANSPARENT|PICTURE_SCALABLE;break;
|
||||
default:FIXME("Unknown pictype %d\n",This->desc.picType);break;
|
||||
}
|
||||
@@ -925,7 +939,7 @@ static HRESULT WINAPI OLEPictureImpl_IsDirty(
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_JPEGLIB_H
|
||||
#ifdef SONAME_LIBJPEG
|
||||
|
||||
static void *libjpeg_handle;
|
||||
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
|
||||
@@ -979,7 +993,7 @@ static boolean _jpeg_resync_to_restart(j_decompress_ptr cinfo, int desired) {
|
||||
return FALSE;
|
||||
}
|
||||
static void _jpeg_term_source(j_decompress_ptr cinfo) { }
|
||||
#endif /* HAVE_JPEGLIB_H */
|
||||
#endif /* SONAME_LIBJPEG */
|
||||
|
||||
struct gifdata {
|
||||
unsigned char *data;
|
||||
@@ -1198,7 +1212,7 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
|
||||
|
||||
static HRESULT OLEPictureImpl_LoadJpeg(OLEPictureImpl *This, BYTE *xbuf, ULONG xread)
|
||||
{
|
||||
#ifdef HAVE_JPEGLIB_H
|
||||
#ifdef SONAME_LIBJPEG
|
||||
struct jpeg_decompress_struct jd;
|
||||
struct jpeg_error_mgr jerr;
|
||||
int ret;
|
||||
@@ -1325,6 +1339,193 @@ static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* start of PNG-specific code
|
||||
* currently only supports colortype PNG_COLOR_TYPE_RGB
|
||||
*/
|
||||
#ifdef SONAME_LIBPNG
|
||||
typedef struct{
|
||||
ULONG position;
|
||||
ULONG size;
|
||||
BYTE * buff;
|
||||
} png_io;
|
||||
|
||||
static void png_stream_read_data(png_structp png_ptr, png_bytep data,
|
||||
png_size_t length)
|
||||
{
|
||||
png_io * io_ptr = png_ptr->io_ptr;
|
||||
|
||||
if(length + io_ptr->position > io_ptr->size){
|
||||
length = io_ptr->size - io_ptr->position;
|
||||
}
|
||||
|
||||
memcpy(data, io_ptr->buff + io_ptr->position, length);
|
||||
|
||||
io_ptr->position += length;
|
||||
}
|
||||
|
||||
static void *libpng_handle;
|
||||
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
|
||||
MAKE_FUNCPTR(png_create_read_struct);
|
||||
MAKE_FUNCPTR(png_create_info_struct);
|
||||
MAKE_FUNCPTR(png_set_read_fn);
|
||||
MAKE_FUNCPTR(png_read_info);
|
||||
MAKE_FUNCPTR(png_read_image);
|
||||
MAKE_FUNCPTR(png_get_rowbytes);
|
||||
MAKE_FUNCPTR(png_set_bgr);
|
||||
MAKE_FUNCPTR(png_destroy_read_struct);
|
||||
MAKE_FUNCPTR(png_set_palette_to_rgb);
|
||||
MAKE_FUNCPTR(png_read_update_info);
|
||||
#undef MAKE_FUNCPTR
|
||||
|
||||
static void *load_libpng(void)
|
||||
{
|
||||
if((libpng_handle = wine_dlopen(SONAME_LIBPNG, RTLD_NOW, NULL, 0)) != NULL) {
|
||||
|
||||
#define LOAD_FUNCPTR(f) \
|
||||
if((p##f = wine_dlsym(libpng_handle, #f, NULL, 0)) == NULL) { \
|
||||
libpng_handle = NULL; \
|
||||
return NULL; \
|
||||
}
|
||||
LOAD_FUNCPTR(png_create_read_struct);
|
||||
LOAD_FUNCPTR(png_create_info_struct);
|
||||
LOAD_FUNCPTR(png_set_read_fn);
|
||||
LOAD_FUNCPTR(png_read_info);
|
||||
LOAD_FUNCPTR(png_read_image);
|
||||
LOAD_FUNCPTR(png_get_rowbytes);
|
||||
LOAD_FUNCPTR(png_set_bgr);
|
||||
LOAD_FUNCPTR(png_destroy_read_struct);
|
||||
LOAD_FUNCPTR(png_set_palette_to_rgb);
|
||||
LOAD_FUNCPTR(png_read_update_info);
|
||||
|
||||
#undef LOAD_FUNCPTR
|
||||
}
|
||||
return libpng_handle;
|
||||
}
|
||||
#endif /* SONAME_LIBPNG */
|
||||
|
||||
static HRESULT OLEPictureImpl_LoadPNG(OLEPictureImpl *This, BYTE *xbuf, ULONG xread)
|
||||
{
|
||||
#ifdef SONAME_LIBPNG
|
||||
png_io io;
|
||||
png_structp png_ptr = NULL;
|
||||
png_infop info_ptr = NULL;
|
||||
INT row, rowsize, height, width;
|
||||
png_bytep* row_pointers = NULL;
|
||||
png_bytep pngdata = NULL;
|
||||
BITMAPINFOHEADER bmi;
|
||||
HDC hdcref = NULL;
|
||||
HRESULT ret;
|
||||
BOOL set_bgr = FALSE;
|
||||
|
||||
if(!libpng_handle) {
|
||||
if(!load_libpng()) {
|
||||
ERR("Failed reading PNG because unable to find %s\n",SONAME_LIBPNG);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
io.size = xread;
|
||||
io.position = 0;
|
||||
io.buff = xbuf;
|
||||
|
||||
png_ptr = ppng_create_read_struct(PNG_LIBPNG_VER_STRING,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if(setjmp(png_jmpbuf(png_ptr))){
|
||||
TRACE("Error in libpng\n");
|
||||
ret = E_FAIL;
|
||||
goto pngend;
|
||||
}
|
||||
|
||||
info_ptr = ppng_create_info_struct(png_ptr);
|
||||
ppng_set_read_fn(png_ptr, &io, png_stream_read_data);
|
||||
ppng_read_info(png_ptr, info_ptr);
|
||||
|
||||
if(!(png_ptr->color_type == PNG_COLOR_TYPE_RGB ||
|
||||
png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)){
|
||||
FIXME("Unsupported .PNG type: %d\n", png_ptr->color_type);
|
||||
ret = E_FAIL;
|
||||
goto pngend;
|
||||
}
|
||||
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE){
|
||||
ppng_set_palette_to_rgb(png_ptr);
|
||||
set_bgr = TRUE;
|
||||
}
|
||||
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_RGB ||
|
||||
png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
|
||||
set_bgr){
|
||||
ppng_set_bgr(png_ptr);
|
||||
}
|
||||
|
||||
ppng_read_update_info(png_ptr, info_ptr);
|
||||
|
||||
rowsize = ppng_get_rowbytes(png_ptr, info_ptr);
|
||||
/* align rowsize to 4-byte boundary */
|
||||
rowsize = (rowsize + 3) & ~3;
|
||||
height = info_ptr->height;
|
||||
width = info_ptr->width;
|
||||
|
||||
pngdata = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, height * rowsize);
|
||||
row_pointers = HeapAlloc(GetProcessHeap(), 0, height * (sizeof(VOID *)));
|
||||
|
||||
if(!pngdata || !row_pointers){
|
||||
ret = E_FAIL;
|
||||
goto pngend;
|
||||
}
|
||||
|
||||
for (row = 0; row < height; row++){
|
||||
row_pointers[row] = pngdata + row * rowsize;
|
||||
}
|
||||
|
||||
ppng_read_image(png_ptr, row_pointers);
|
||||
|
||||
bmi.biSize = sizeof(bmi);
|
||||
bmi.biWidth = width;
|
||||
bmi.biHeight = -height;
|
||||
bmi.biPlanes = 1;
|
||||
bmi.biBitCount = info_ptr->channels * 8;
|
||||
bmi.biCompression = BI_RGB;
|
||||
bmi.biSizeImage = height * rowsize;
|
||||
bmi.biXPelsPerMeter = 0;
|
||||
bmi.biYPelsPerMeter = 0;
|
||||
bmi.biClrUsed = 0;
|
||||
bmi.biClrImportant = 0;
|
||||
|
||||
hdcref = GetDC(0);
|
||||
This->desc.u.bmp.hbitmap = CreateDIBitmap(
|
||||
hdcref,
|
||||
&bmi,
|
||||
CBM_INIT,
|
||||
pngdata,
|
||||
(BITMAPINFO*)&bmi,
|
||||
DIB_RGB_COLORS
|
||||
);
|
||||
ReleaseDC(0, hdcref);
|
||||
This->desc.picType = PICTYPE_BITMAP;
|
||||
OLEPictureImpl_SetBitmap(This);
|
||||
ret = S_OK;
|
||||
|
||||
pngend:
|
||||
if(png_ptr)
|
||||
ppng_destroy_read_struct(&png_ptr,
|
||||
(info_ptr ? &info_ptr : (png_infopp) NULL),
|
||||
(png_infopp)NULL);
|
||||
HeapFree(GetProcessHeap(), 0, row_pointers);
|
||||
HeapFree(GetProcessHeap(), 0, pngdata);
|
||||
return ret;
|
||||
#else /* SONAME_LIBPNG */
|
||||
ERR("Trying to load PNG picture, but PNG supported not compiled in.\n");
|
||||
return E_FAIL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* start of Icon-specific code
|
||||
*/
|
||||
|
||||
static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG xread)
|
||||
{
|
||||
HICON hicon;
|
||||
@@ -1385,6 +1586,43 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT OLEPictureImpl_LoadMetafile(OLEPictureImpl *This,
|
||||
const BYTE *data, ULONG size)
|
||||
{
|
||||
HMETAFILE hmf;
|
||||
HENHMETAFILE hemf;
|
||||
|
||||
/* SetMetaFileBitsEx performs data check on its own */
|
||||
hmf = SetMetaFileBitsEx(size, data);
|
||||
if (hmf)
|
||||
{
|
||||
This->desc.picType = PICTYPE_METAFILE;
|
||||
This->desc.u.wmf.hmeta = hmf;
|
||||
This->desc.u.wmf.xExt = 0;
|
||||
This->desc.u.wmf.yExt = 0;
|
||||
|
||||
This->origWidth = 0;
|
||||
This->origHeight = 0;
|
||||
This->himetricWidth = 0;
|
||||
This->himetricHeight = 0;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
hemf = SetEnhMetaFileBits(size, data);
|
||||
if (!hemf) return E_FAIL;
|
||||
|
||||
This->desc.picType = PICTYPE_ENHMETAFILE;
|
||||
This->desc.u.emf.hemf = hemf;
|
||||
|
||||
This->origWidth = 0;
|
||||
This->origHeight = 0;
|
||||
This->himetricWidth = 0;
|
||||
This->himetricHeight = 0;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* OLEPictureImpl_IPersistStream_Load (IUnknown)
|
||||
*
|
||||
@@ -1393,7 +1631,7 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
|
||||
* DWORD magic;
|
||||
* DWORD len;
|
||||
*
|
||||
* Currently implemented: BITMAP, ICON, JPEG, GIF
|
||||
* Currently implemented: BITMAP, ICON, JPEG, GIF, WMF, EMF
|
||||
*/
|
||||
static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
|
||||
HRESULT hr = E_FAIL;
|
||||
@@ -1527,6 +1765,8 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
|
||||
*/
|
||||
|
||||
magic = xbuf[0] + (xbuf[1]<<8);
|
||||
This->loadtime_format = magic;
|
||||
|
||||
switch (magic) {
|
||||
case 0x4947: /* GIF */
|
||||
hr = OLEPictureImpl_LoadGif(This, xbuf, xread);
|
||||
@@ -1537,6 +1777,9 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
|
||||
case 0x4d42: /* Bitmap */
|
||||
hr = OLEPictureImpl_LoadDIB(This, xbuf, xread);
|
||||
break;
|
||||
case 0x5089: /* PNG */
|
||||
hr = OLEPictureImpl_LoadPNG(This, xbuf, xread);
|
||||
break;
|
||||
case 0x0000: { /* ICON , first word is dwReserved */
|
||||
hr = OLEPictureImpl_LoadIcon(This, xbuf, xread);
|
||||
break;
|
||||
@@ -1544,6 +1787,11 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
|
||||
default:
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
/* let's see if it's a metafile */
|
||||
hr = OLEPictureImpl_LoadMetafile(This, xbuf, xread);
|
||||
if (hr == S_OK) break;
|
||||
|
||||
FIXME("Unknown magic %04x, %d read bytes:\n",magic,xread);
|
||||
hr=E_FAIL;
|
||||
for (i=0;i<xread+8;i++) {
|
||||
@@ -1827,6 +2075,9 @@ static HRESULT WINAPI OLEPictureImpl_Save(
|
||||
case 0x4947:
|
||||
FIXME("(%p,%p,%d), PICTYPE_BITMAP (format GIF) not implemented!\n",This,pStm,fClearDirty);
|
||||
break;
|
||||
case 0x5089:
|
||||
FIXME("(%p,%p,%d), PICTYPE_BITMAP (format PNG) not implemented!\n",This,pStm,fClearDirty);
|
||||
break;
|
||||
default:
|
||||
FIXME("(%p,%p,%d), PICTYPE_BITMAP (format UNKNOWN, using BMP?) not implemented!\n",This,pStm,fClearDirty);
|
||||
break;
|
||||
|
||||
@@ -204,7 +204,7 @@ static void SAFEARRAY_SetFeatures(VARTYPE vt, SAFEARRAY *psa)
|
||||
}
|
||||
|
||||
/* Create an array */
|
||||
static SAFEARRAY* SAFEARRAY_Create(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound, ULONG ulSize)
|
||||
static SAFEARRAY* SAFEARRAY_Create(VARTYPE vt, UINT cDims, const SAFEARRAYBOUND *rgsabound, ULONG ulSize)
|
||||
{
|
||||
SAFEARRAY *psa = NULL;
|
||||
int i;
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "winuser.h"
|
||||
#include "excpt.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "propidl.h" /* for LPSAFEARRAY_User* functions */
|
||||
@@ -97,7 +96,7 @@ xbuf_resize(marshal_state *buf, DWORD newsize)
|
||||
}
|
||||
|
||||
static HRESULT
|
||||
xbuf_add(marshal_state *buf, LPBYTE stuff, DWORD size)
|
||||
xbuf_add(marshal_state *buf, const BYTE *stuff, DWORD size)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
@@ -286,14 +285,12 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) {
|
||||
ERR("No %s key found.\n",interfacekey);
|
||||
return E_FAIL;
|
||||
}
|
||||
type = (1<<REG_SZ);
|
||||
tlguidlen = sizeof(tlguid);
|
||||
if (RegQueryValueExA(ikey,NULL,NULL,&type,(LPBYTE)tlguid,&tlguidlen)) {
|
||||
ERR("Getting typelib guid failed.\n");
|
||||
RegCloseKey(ikey);
|
||||
return E_FAIL;
|
||||
}
|
||||
type = (1<<REG_SZ);
|
||||
verlen = sizeof(ver);
|
||||
if (RegQueryValueExA(ikey,"Version",NULL,&type,(LPBYTE)ver,&verlen)) {
|
||||
ERR("Could not get version value?\n");
|
||||
@@ -323,49 +320,49 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) {
|
||||
return hres;
|
||||
}
|
||||
|
||||
/* Determine nr of functions. Since we use the toplevel interface and all
|
||||
* inherited ones have lower numbers, we are ok to not to descent into
|
||||
* the inheritance tree I think.
|
||||
/*
|
||||
* Determine the number of functions including all inherited functions.
|
||||
* Note for non-dual dispinterfaces we simply return the size of IDispatch.
|
||||
*/
|
||||
static int _nroffuncs(ITypeInfo *tinfo) {
|
||||
int n, i, j;
|
||||
const FUNCDESC *fdesc;
|
||||
HRESULT hres;
|
||||
static HRESULT num_of_funcs(ITypeInfo *tinfo, unsigned int *num)
|
||||
{
|
||||
HRESULT hres;
|
||||
TYPEATTR *attr;
|
||||
ITypeInfo *tinfo2;
|
||||
|
||||
n=0;
|
||||
*num = 0;
|
||||
hres = ITypeInfo_GetTypeAttr(tinfo, &attr);
|
||||
if (hres) {
|
||||
ERR("GetTypeAttr failed with %x\n",hres);
|
||||
return hres;
|
||||
}
|
||||
/* look in inherited ifaces. */
|
||||
for (j=0;j<attr->cImplTypes;j++) {
|
||||
|
||||
if(attr->typekind == TKIND_DISPATCH && (attr->wTypeFlags & TYPEFLAG_FDUAL))
|
||||
{
|
||||
HREFTYPE href;
|
||||
hres = ITypeInfo_GetRefTypeOfImplType(tinfo, j, &href);
|
||||
if (hres) {
|
||||
ERR("Did not find a reftype for interface offset %d?\n",j);
|
||||
break;
|
||||
hres = ITypeInfo_GetRefTypeOfImplType(tinfo, -1, &href);
|
||||
if(FAILED(hres))
|
||||
{
|
||||
ERR("Unable to get interface href from dual dispinterface\n");
|
||||
goto end;
|
||||
}
|
||||
hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
|
||||
if (hres) {
|
||||
ERR("Did not find a typeinfo for reftype %d?\n",href);
|
||||
continue;
|
||||
if(FAILED(hres))
|
||||
{
|
||||
ERR("Unable to get interface from dual dispinterface\n");
|
||||
goto end;
|
||||
}
|
||||
n += _nroffuncs(tinfo2);
|
||||
hres = num_of_funcs(tinfo2, num);
|
||||
ITypeInfo_Release(tinfo2);
|
||||
}
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
i = 0;
|
||||
while (1) {
|
||||
hres = ITypeInfoImpl_GetInternalFuncDesc(tinfo,i,&fdesc);
|
||||
if (hres)
|
||||
return n;
|
||||
n++;
|
||||
i++;
|
||||
else
|
||||
{
|
||||
*num = attr->cbSizeVft / 4;
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
|
||||
end:
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
return hres;
|
||||
}
|
||||
|
||||
#ifdef __i386__
|
||||
@@ -526,7 +523,7 @@ _argsize(DWORD vt) {
|
||||
}
|
||||
|
||||
static int
|
||||
_xsize(TYPEDESC *td) {
|
||||
_xsize(const TYPEDESC *td) {
|
||||
switch (td->vt) {
|
||||
case VT_DATE:
|
||||
return sizeof(DATE);
|
||||
@@ -534,7 +531,7 @@ _xsize(TYPEDESC *td) {
|
||||
return sizeof(VARIANT)+3;
|
||||
case VT_CARRAY: {
|
||||
int i, arrsize = 1;
|
||||
ARRAYDESC *adesc = td->u.lpadesc;
|
||||
const ARRAYDESC *adesc = td->u.lpadesc;
|
||||
|
||||
for (i=0;i<adesc->cDims;i++)
|
||||
arrsize *= adesc->rgbounds[i].cElements;
|
||||
@@ -1198,63 +1195,99 @@ deserialize_param(
|
||||
}
|
||||
}
|
||||
|
||||
/* Searches function, also in inherited interfaces */
|
||||
static HRESULT
|
||||
_get_funcdesc(
|
||||
ITypeInfo *tinfo, int iMethod, ITypeInfo **tactual, const FUNCDESC **fdesc, BSTR *iname, BSTR *fname)
|
||||
/* Retrieves a function's funcdesc, searching back into inherited interfaces. */
|
||||
static HRESULT get_funcdesc(ITypeInfo *tinfo, int iMethod, ITypeInfo **tactual, const FUNCDESC **fdesc,
|
||||
BSTR *iname, BSTR *fname, UINT *num)
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
HRESULT hres;
|
||||
HRESULT hr;
|
||||
UINT i, impl_types;
|
||||
UINT inherited_funcs = 0;
|
||||
TYPEATTR *attr;
|
||||
|
||||
if (fname) *fname = NULL;
|
||||
if (iname) *iname = NULL;
|
||||
if (num) *num = 0;
|
||||
*tactual = NULL;
|
||||
|
||||
while (1) {
|
||||
hres = ITypeInfoImpl_GetInternalFuncDesc(tinfo, i, fdesc);
|
||||
|
||||
if (hres) {
|
||||
ITypeInfo *tinfo2;
|
||||
HREFTYPE href;
|
||||
TYPEATTR *attr;
|
||||
|
||||
hres = ITypeInfo_GetTypeAttr(tinfo, &attr);
|
||||
if (hres) {
|
||||
ERR("GetTypeAttr failed with %x\n",hres);
|
||||
return hres;
|
||||
}
|
||||
/* Not found, so look in inherited ifaces. */
|
||||
for (j=0;j<attr->cImplTypes;j++) {
|
||||
hres = ITypeInfo_GetRefTypeOfImplType(tinfo, j, &href);
|
||||
if (hres) {
|
||||
ERR("Did not find a reftype for interface offset %d?\n",j);
|
||||
break;
|
||||
}
|
||||
hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
|
||||
if (hres) {
|
||||
ERR("Did not find a typeinfo for reftype %d?\n",href);
|
||||
continue;
|
||||
}
|
||||
hres = _get_funcdesc(tinfo2,iMethod,tactual,fdesc,iname,fname);
|
||||
ITypeInfo_Release(tinfo2);
|
||||
if (!hres) {
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
return hres;
|
||||
}
|
||||
if (((*fdesc)->oVft/4) == iMethod) {
|
||||
if (fname)
|
||||
ITypeInfo_GetDocumentation(tinfo,(*fdesc)->memid,fname,NULL,NULL,NULL);
|
||||
if (iname)
|
||||
ITypeInfo_GetDocumentation(tinfo,-1,iname,NULL,NULL,NULL);
|
||||
*tactual = tinfo;
|
||||
ITypeInfo_AddRef(*tactual);
|
||||
return S_OK;
|
||||
}
|
||||
i++;
|
||||
hr = ITypeInfo_GetTypeAttr(tinfo, &attr);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERR("GetTypeAttr failed with %x\n",hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
if(attr->typekind == TKIND_DISPATCH)
|
||||
{
|
||||
if(attr->wTypeFlags & TYPEFLAG_FDUAL)
|
||||
{
|
||||
HREFTYPE href;
|
||||
ITypeInfo *tinfo2;
|
||||
|
||||
hr = ITypeInfo_GetRefTypeOfImplType(tinfo, -1, &href);
|
||||
if(FAILED(hr))
|
||||
{
|
||||
ERR("Cannot get interface href from dual dispinterface\n");
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
return hr;
|
||||
}
|
||||
hr = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
|
||||
if(FAILED(hr))
|
||||
{
|
||||
ERR("Cannot get interface from dual dispinterface\n");
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
return hr;
|
||||
}
|
||||
hr = get_funcdesc(tinfo2, iMethod, tactual, fdesc, iname, fname, num);
|
||||
ITypeInfo_Release(tinfo2);
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
return hr;
|
||||
}
|
||||
ERR("Shouldn't be called with a non-dual dispinterface\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
impl_types = attr->cImplTypes;
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, attr);
|
||||
|
||||
for (i = 0; i < impl_types; i++)
|
||||
{
|
||||
HREFTYPE href;
|
||||
ITypeInfo *pSubTypeInfo;
|
||||
UINT sub_funcs;
|
||||
|
||||
hr = ITypeInfo_GetRefTypeOfImplType(tinfo, i, &href);
|
||||
if (FAILED(hr)) return hr;
|
||||
hr = ITypeInfo_GetRefTypeInfo(tinfo, href, &pSubTypeInfo);
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
hr = get_funcdesc(pSubTypeInfo, iMethod, tactual, fdesc, iname, fname, &sub_funcs);
|
||||
inherited_funcs += sub_funcs;
|
||||
ITypeInfo_Release(pSubTypeInfo);
|
||||
if(SUCCEEDED(hr)) return hr;
|
||||
}
|
||||
if(iMethod < inherited_funcs)
|
||||
{
|
||||
ERR("shouldn't be here\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
for(i = inherited_funcs; i <= iMethod; i++)
|
||||
{
|
||||
hr = ITypeInfoImpl_GetInternalFuncDesc(tinfo, i - inherited_funcs, fdesc);
|
||||
if(FAILED(hr))
|
||||
{
|
||||
if(num) *num = i;
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
/* found it. We don't care about num so zero it */
|
||||
if(num) *num = 0;
|
||||
*tactual = tinfo;
|
||||
ITypeInfo_AddRef(*tactual);
|
||||
if (fname) ITypeInfo_GetDocumentation(tinfo,(*fdesc)->memid,fname,NULL,NULL,NULL);
|
||||
if (iname) ITypeInfo_GetDocumentation(tinfo,-1,iname,NULL,NULL,NULL);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static inline BOOL is_in_elem(const ELEMDESC *elem)
|
||||
@@ -1286,10 +1319,9 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
|
||||
|
||||
EnterCriticalSection(&tpinfo->crit);
|
||||
|
||||
hres = _get_funcdesc(tpinfo->tinfo,method,&tinfo,&fdesc,&iname,&fname);
|
||||
hres = get_funcdesc(tpinfo->tinfo,method,&tinfo,&fdesc,&iname,&fname,NULL);
|
||||
if (hres) {
|
||||
ERR("Did not find typeinfo/funcdesc entry for method %d!\n",method);
|
||||
ITypeInfo_Release(tinfo);
|
||||
LeaveCriticalSection(&tpinfo->crit);
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -1639,6 +1671,58 @@ static inline HRESULT get_facbuf_for_iid(REFIID riid, IPSFactoryBuffer **facbuf)
|
||||
&IID_IPSFactoryBuffer, (LPVOID*)facbuf);
|
||||
}
|
||||
|
||||
static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
|
||||
{
|
||||
int j;
|
||||
/* nrofargs without This */
|
||||
int nrofargs;
|
||||
ITypeInfo *tinfo2;
|
||||
TMAsmProxy *xasm = proxy->asmstubs + num;
|
||||
HRESULT hres;
|
||||
const FUNCDESC *fdesc;
|
||||
|
||||
hres = get_funcdesc(proxy->tinfo, num, &tinfo2, &fdesc, NULL, NULL, NULL);
|
||||
if (hres) {
|
||||
ERR("GetFuncDesc %x should not fail here.\n",hres);
|
||||
return hres;
|
||||
}
|
||||
ITypeInfo_Release(tinfo2);
|
||||
/* some args take more than 4 byte on the stack */
|
||||
nrofargs = 0;
|
||||
for (j=0;j<fdesc->cParams;j++)
|
||||
nrofargs += _argsize(fdesc->lprgelemdescParam[j].tdesc.vt);
|
||||
|
||||
#ifdef __i386__
|
||||
if (fdesc->callconv != CC_STDCALL) {
|
||||
ERR("calling convention is not stdcall????\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
/* popl %eax - return ptr
|
||||
* pushl <nr>
|
||||
* pushl %eax
|
||||
* call xCall
|
||||
* lret <nr> (+4)
|
||||
*
|
||||
*
|
||||
* arg3 arg2 arg1 <method> <returnptr>
|
||||
*/
|
||||
xasm->popleax = 0x58;
|
||||
xasm->pushlval = 0x6a;
|
||||
xasm->nr = num;
|
||||
xasm->pushleax = 0x50;
|
||||
xasm->lcall = 0xe8; /* relative jump */
|
||||
xasm->xcall = (DWORD)xCall;
|
||||
xasm->xcall -= (DWORD)&(xasm->lret);
|
||||
xasm->lret = 0xc2;
|
||||
xasm->bytestopop = (nrofargs+2)*4; /* pop args, This, iMethod */
|
||||
proxy->lpvtbl[num] = xasm;
|
||||
#else
|
||||
FIXME("not implemented on non i386\n");
|
||||
return E_FAIL;
|
||||
#endif
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
PSFacBuf_CreateProxy(
|
||||
LPPSFACTORYBUFFER iface, IUnknown* pUnkOuter, REFIID riid,
|
||||
@@ -1646,10 +1730,10 @@ PSFacBuf_CreateProxy(
|
||||
{
|
||||
HRESULT hres;
|
||||
ITypeInfo *tinfo;
|
||||
int i, nroffuncs;
|
||||
const FUNCDESC *fdesc;
|
||||
unsigned int i, nroffuncs;
|
||||
TMProxyImpl *proxy;
|
||||
TYPEATTR *typeattr;
|
||||
BOOL defer_to_dispatch = FALSE;
|
||||
|
||||
TRACE("(...%s...)\n",debugstr_guid(riid));
|
||||
hres = _get_typeinfo_for_iid(riid,&tinfo);
|
||||
@@ -1657,7 +1741,14 @@ PSFacBuf_CreateProxy(
|
||||
ERR("No typeinfo for %s?\n",debugstr_guid(riid));
|
||||
return hres;
|
||||
}
|
||||
nroffuncs = _nroffuncs(tinfo);
|
||||
|
||||
hres = num_of_funcs(tinfo, &nroffuncs);
|
||||
if (FAILED(hres)) {
|
||||
ERR("Cannot get number of functions for typeinfo %s\n",debugstr_guid(riid));
|
||||
ITypeInfo_Release(tinfo);
|
||||
return hres;
|
||||
}
|
||||
|
||||
proxy = CoTaskMemAlloc(sizeof(TMProxyImpl));
|
||||
if (!proxy) return E_OUTOFMEMORY;
|
||||
|
||||
@@ -1683,67 +1774,6 @@ PSFacBuf_CreateProxy(
|
||||
proxy->crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": TMProxyImpl.crit");
|
||||
|
||||
proxy->lpvtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPBYTE)*nroffuncs);
|
||||
for (i=0;i<nroffuncs;i++) {
|
||||
TMAsmProxy *xasm = proxy->asmstubs+i;
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
proxy->lpvtbl[i] = ProxyIUnknown_QueryInterface;
|
||||
break;
|
||||
case 1:
|
||||
proxy->lpvtbl[i] = ProxyIUnknown_AddRef;
|
||||
break;
|
||||
case 2:
|
||||
proxy->lpvtbl[i] = ProxyIUnknown_Release;
|
||||
break;
|
||||
default: {
|
||||
int j;
|
||||
/* nrofargs without This */
|
||||
int nrofargs;
|
||||
ITypeInfo *tinfo2;
|
||||
hres = _get_funcdesc(tinfo,i,&tinfo2,&fdesc,NULL,NULL);
|
||||
ITypeInfo_Release(tinfo2);
|
||||
if (hres) {
|
||||
ERR("GetFuncDesc %x should not fail here.\n",hres);
|
||||
return hres;
|
||||
}
|
||||
/* some args take more than 4 byte on the stack */
|
||||
nrofargs = 0;
|
||||
for (j=0;j<fdesc->cParams;j++)
|
||||
nrofargs += _argsize(fdesc->lprgelemdescParam[j].tdesc.vt);
|
||||
|
||||
#ifdef __i386__
|
||||
if (fdesc->callconv != CC_STDCALL) {
|
||||
ERR("calling convention is not stdcall????\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
/* popl %eax - return ptr
|
||||
* pushl <nr>
|
||||
* pushl %eax
|
||||
* call xCall
|
||||
* lret <nr> (+4)
|
||||
*
|
||||
*
|
||||
* arg3 arg2 arg1 <method> <returnptr>
|
||||
*/
|
||||
xasm->popleax = 0x58;
|
||||
xasm->pushlval = 0x6a;
|
||||
xasm->nr = i;
|
||||
xasm->pushleax = 0x50;
|
||||
xasm->lcall = 0xe8; /* relative jump */
|
||||
xasm->xcall = (DWORD)xCall;
|
||||
xasm->xcall -= (DWORD)&(xasm->lret);
|
||||
xasm->lret = 0xc2;
|
||||
xasm->bytestopop= (nrofargs+2)*4; /* pop args, This, iMethod */
|
||||
proxy->lpvtbl[i] = xasm;
|
||||
break;
|
||||
#else
|
||||
FIXME("not implemented on non i386\n");
|
||||
return E_FAIL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* if we derive from IDispatch then defer to its proxy for its methods */
|
||||
hres = ITypeInfo_GetTypeAttr(tinfo, &typeattr);
|
||||
@@ -1767,15 +1797,61 @@ PSFacBuf_CreateProxy(
|
||||
}
|
||||
if (hres == S_OK)
|
||||
{
|
||||
proxy->lpvtbl[3] = ProxyIDispatch_GetTypeInfoCount;
|
||||
proxy->lpvtbl[4] = ProxyIDispatch_GetTypeInfo;
|
||||
proxy->lpvtbl[5] = ProxyIDispatch_GetIDsOfNames;
|
||||
proxy->lpvtbl[6] = ProxyIDispatch_Invoke;
|
||||
defer_to_dispatch = TRUE;
|
||||
}
|
||||
}
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo, typeattr);
|
||||
}
|
||||
|
||||
for (i=0;i<nroffuncs;i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
proxy->lpvtbl[i] = ProxyIUnknown_QueryInterface;
|
||||
break;
|
||||
case 1:
|
||||
proxy->lpvtbl[i] = ProxyIUnknown_AddRef;
|
||||
break;
|
||||
case 2:
|
||||
proxy->lpvtbl[i] = ProxyIUnknown_Release;
|
||||
break;
|
||||
case 3:
|
||||
if(!defer_to_dispatch)
|
||||
{
|
||||
hres = init_proxy_entry_point(proxy, i);
|
||||
if(FAILED(hres)) return hres;
|
||||
}
|
||||
else proxy->lpvtbl[3] = ProxyIDispatch_GetTypeInfoCount;
|
||||
break;
|
||||
case 4:
|
||||
if(!defer_to_dispatch)
|
||||
{
|
||||
hres = init_proxy_entry_point(proxy, i);
|
||||
if(FAILED(hres)) return hres;
|
||||
}
|
||||
else proxy->lpvtbl[4] = ProxyIDispatch_GetTypeInfo;
|
||||
break;
|
||||
case 5:
|
||||
if(!defer_to_dispatch)
|
||||
{
|
||||
hres = init_proxy_entry_point(proxy, i);
|
||||
if(FAILED(hres)) return hres;
|
||||
}
|
||||
else proxy->lpvtbl[5] = ProxyIDispatch_GetIDsOfNames;
|
||||
break;
|
||||
case 6:
|
||||
if(!defer_to_dispatch)
|
||||
{
|
||||
hres = init_proxy_entry_point(proxy, i);
|
||||
if(FAILED(hres)) return hres;
|
||||
}
|
||||
else proxy->lpvtbl[6] = ProxyIDispatch_Invoke;
|
||||
break;
|
||||
default:
|
||||
hres = init_proxy_entry_point(proxy, i);
|
||||
if(FAILED(hres)) return hres;
|
||||
}
|
||||
}
|
||||
|
||||
if (hres == S_OK)
|
||||
{
|
||||
*ppv = (LPVOID)proxy;
|
||||
@@ -1917,7 +1993,7 @@ TMStubImpl_Invoke(
|
||||
memcpy(buf.base, xmsg->Buffer, xmsg->cbBuffer);
|
||||
buf.curoff = 0;
|
||||
|
||||
hres = _get_funcdesc(This->tinfo,xmsg->iMethod,&tinfo,&fdesc,&iname,NULL);
|
||||
hres = get_funcdesc(This->tinfo,xmsg->iMethod,&tinfo,&fdesc,&iname,NULL,NULL);
|
||||
if (hres) {
|
||||
ERR("GetFuncDesc on method %d failed with %x\n",xmsg->iMethod,hres);
|
||||
return hres;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,6 @@
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "winuser.h"
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
|
||||
@@ -277,14 +277,14 @@ static unsigned int get_type_alignment(ULONG *pFlags, VARIANT *pvar)
|
||||
return 7;
|
||||
}
|
||||
|
||||
static unsigned interface_variant_size(ULONG *pFlags, REFIID riid, VARIANT *pvar)
|
||||
static unsigned interface_variant_size(ULONG *pFlags, REFIID riid, IUnknown *punk)
|
||||
{
|
||||
ULONG size;
|
||||
HRESULT hr;
|
||||
/* find the buffer size of the marshalled dispatch interface */
|
||||
hr = CoGetMarshalSizeMax(&size, riid, V_UNKNOWN(pvar), LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL);
|
||||
hr = CoGetMarshalSizeMax(&size, riid, punk, LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL);
|
||||
if (FAILED(hr)) {
|
||||
if (!V_DISPATCH(pvar))
|
||||
if (!punk)
|
||||
WARN("NULL dispatch pointer\n");
|
||||
else
|
||||
ERR("Dispatch variant buffer size calculation failed, HRESULT=0x%x\n", hr);
|
||||
@@ -313,9 +313,13 @@ static ULONG wire_extra_user_size(ULONG *pFlags, ULONG Start, VARIANT *pvar)
|
||||
case VT_VARIANT | VT_BYREF:
|
||||
return VARIANT_UserSize(pFlags, Start, V_VARIANTREF(pvar));
|
||||
case VT_UNKNOWN:
|
||||
return Start + interface_variant_size(pFlags, &IID_IUnknown, pvar);
|
||||
return Start + interface_variant_size(pFlags, &IID_IUnknown, V_UNKNOWN(pvar));
|
||||
case VT_UNKNOWN | VT_BYREF:
|
||||
return Start + interface_variant_size(pFlags, &IID_IUnknown, *V_UNKNOWNREF(pvar));
|
||||
case VT_DISPATCH:
|
||||
return Start + interface_variant_size(pFlags, &IID_IDispatch, pvar);
|
||||
return Start + interface_variant_size(pFlags, &IID_IDispatch, (IUnknown*)V_DISPATCH(pvar));
|
||||
case VT_DISPATCH | VT_BYREF:
|
||||
return Start + interface_variant_size(pFlags, &IID_IDispatch, (IUnknown*)*V_DISPATCHREF(pvar));
|
||||
case VT_RECORD:
|
||||
FIXME("wire-size record\n");
|
||||
return Start;
|
||||
@@ -329,7 +333,7 @@ static ULONG wire_extra_user_size(ULONG *pFlags, ULONG Start, VARIANT *pvar)
|
||||
}
|
||||
|
||||
/* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer. returns Buffer on failure, new position otherwise */
|
||||
static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Buffer, REFIID riid, VARIANT *pvar)
|
||||
static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Buffer, REFIID riid, IUnknown *punk)
|
||||
{
|
||||
IStream *working;
|
||||
HGLOBAL working_mem;
|
||||
@@ -338,7 +342,7 @@ static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Bu
|
||||
ULONG size;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("pFlags=%d, Buffer=%p, pvar=%p\n", *pFlags, Buffer, pvar);
|
||||
TRACE("pFlags=%d, Buffer=%p, pUnk=%p\n", *pFlags, Buffer, punk);
|
||||
|
||||
oldpos = Buffer;
|
||||
|
||||
@@ -348,7 +352,7 @@ static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Bu
|
||||
* but that would be overkill here, hence this implementation. We save the size because the unmarshal
|
||||
* code has no way to know how long the marshalled buffer is. */
|
||||
|
||||
size = wire_extra_user_size(pFlags, 0, pvar);
|
||||
size = interface_variant_size(pFlags, riid, punk);
|
||||
|
||||
working_mem = GlobalAlloc(0, size);
|
||||
if (!working_mem) return oldpos;
|
||||
@@ -359,7 +363,7 @@ static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Bu
|
||||
return oldpos;
|
||||
}
|
||||
|
||||
hr = CoMarshalInterface(working, riid, V_UNKNOWN(pvar), LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL);
|
||||
hr = CoMarshalInterface(working, riid, punk, LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL);
|
||||
if (hr != S_OK) {
|
||||
IStream_Release(working); /* this also releases the hglobal */
|
||||
return oldpos;
|
||||
@@ -378,7 +382,7 @@ static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Bu
|
||||
}
|
||||
|
||||
/* helper: called for VT_DISPATCH / VT_UNKNOWN variants to unmarshal the buffer. returns Buffer on failure, new position otherwise */
|
||||
static unsigned char *interface_variant_unmarshal(ULONG *pFlags, unsigned char *Buffer, REFIID riid, VARIANT *pvar)
|
||||
static unsigned char *interface_variant_unmarshal(ULONG *pFlags, unsigned char *Buffer, REFIID riid, IUnknown **ppunk)
|
||||
{
|
||||
IStream *working;
|
||||
HGLOBAL working_mem;
|
||||
@@ -387,10 +391,10 @@ static unsigned char *interface_variant_unmarshal(ULONG *pFlags, unsigned char *
|
||||
ULONG size;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("pFlags=%d, Buffer=%p, pvar=%p\n", *pFlags, Buffer, pvar);
|
||||
TRACE("pFlags=%d, Buffer=%p, ppUnk=%p\n", *pFlags, Buffer, ppunk);
|
||||
|
||||
oldpos = Buffer;
|
||||
|
||||
|
||||
/* get the buffersize */
|
||||
memcpy(&size, Buffer, sizeof(ULONG));
|
||||
TRACE("buffersize=%d\n", size);
|
||||
@@ -410,7 +414,7 @@ static unsigned char *interface_variant_unmarshal(ULONG *pFlags, unsigned char *
|
||||
memcpy(working_memlocked, Buffer + sizeof(ULONG), size);
|
||||
GlobalUnlock(working_mem);
|
||||
|
||||
hr = CoUnmarshalInterface(working, riid, (void**)&V_UNKNOWN(pvar));
|
||||
hr = CoUnmarshalInterface(working, riid, (void**)ppunk);
|
||||
if (hr != S_OK) {
|
||||
IStream_Release(working);
|
||||
return oldpos;
|
||||
@@ -520,16 +524,21 @@ unsigned char * WINAPI VARIANT_UserMarshal(ULONG *pFlags, unsigned char *Buffer,
|
||||
case VT_VARIANT | VT_BYREF:
|
||||
Pos = VARIANT_UserMarshal(pFlags, Pos, V_VARIANTREF(pvar));
|
||||
break;
|
||||
case VT_DISPATCH | VT_BYREF:
|
||||
FIXME("handle DISPATCH by ref\n");
|
||||
break;
|
||||
case VT_UNKNOWN:
|
||||
/* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */
|
||||
Pos = interface_variant_marshal(pFlags, Pos, &IID_IUnknown, pvar);
|
||||
Pos = interface_variant_marshal(pFlags, Pos, &IID_IUnknown, V_UNKNOWN(pvar));
|
||||
break;
|
||||
case VT_UNKNOWN | VT_BYREF:
|
||||
/* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */
|
||||
Pos = interface_variant_marshal(pFlags, Pos, &IID_IUnknown, *V_UNKNOWNREF(pvar));
|
||||
break;
|
||||
case VT_DISPATCH:
|
||||
/* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */
|
||||
Pos = interface_variant_marshal(pFlags, Pos, &IID_IDispatch, pvar);
|
||||
Pos = interface_variant_marshal(pFlags, Pos, &IID_IDispatch, (IUnknown*)V_DISPATCH(pvar));
|
||||
break;
|
||||
case VT_DISPATCH | VT_BYREF:
|
||||
/* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */
|
||||
Pos = interface_variant_marshal(pFlags, Pos, &IID_IDispatch, (IUnknown*)*V_DISPATCHREF(pvar));
|
||||
break;
|
||||
case VT_RECORD:
|
||||
FIXME("handle BRECORD by val\n");
|
||||
@@ -609,16 +618,21 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffe
|
||||
case VT_VARIANT | VT_BYREF:
|
||||
Pos = VARIANT_UserUnmarshal(pFlags, Pos, V_VARIANTREF(pvar));
|
||||
break;
|
||||
case VT_DISPATCH | VT_BYREF:
|
||||
FIXME("handle DISPATCH by ref\n");
|
||||
break;
|
||||
case VT_UNKNOWN:
|
||||
/* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */
|
||||
Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IUnknown, pvar);
|
||||
Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IUnknown, &V_UNKNOWN(pvar));
|
||||
break;
|
||||
case VT_UNKNOWN | VT_BYREF:
|
||||
/* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */
|
||||
Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IUnknown, V_UNKNOWNREF(pvar));
|
||||
break;
|
||||
case VT_DISPATCH:
|
||||
/* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */
|
||||
Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IDispatch, pvar);
|
||||
Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IDispatch, (IUnknown**)&V_DISPATCH(pvar));
|
||||
break;
|
||||
case VT_DISPATCH | VT_BYREF:
|
||||
/* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */
|
||||
Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IDispatch, (IUnknown**)V_DISPATCHREF(pvar));
|
||||
break;
|
||||
case VT_RECORD:
|
||||
FIXME("handle BRECORD by val\n");
|
||||
@@ -697,6 +711,8 @@ static inline SF_TYPE SAFEARRAY_GetUnionType(SAFEARRAY *psa)
|
||||
hr = SafeArrayGetVartype(psa, &vt);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if(psa->fFeatures & FADF_VARIANT) return SF_VARIANT;
|
||||
|
||||
switch(psa->cbElements)
|
||||
{
|
||||
case 1: vt = VT_I1; break;
|
||||
|
||||
@@ -2929,7 +2929,7 @@ HRESULT WINAPI VarAnd(LPVARIANT left, LPVARIANT right, LPVARIANT result)
|
||||
}
|
||||
ExtraFlags = leftExtraFlags;
|
||||
|
||||
/* Native VarAnd always returns a error when using any extra
|
||||
/* Native VarAnd always returns an error when using extra
|
||||
* flags or if the variant combination is I8 and INT.
|
||||
*/
|
||||
if ((leftvt == VT_I8 && rightvt == VT_INT) ||
|
||||
@@ -3563,7 +3563,7 @@ HRESULT WINAPI VarDiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
|
||||
}
|
||||
ExtraFlags = leftExtraFlags;
|
||||
|
||||
/* Native VarDiv always returns a error when using any extra flags */
|
||||
/* Native VarDiv always returns an error when using extra flags */
|
||||
if (ExtraFlags != 0)
|
||||
{
|
||||
hres = DISP_E_BADVARTYPE;
|
||||
@@ -4273,15 +4273,28 @@ HRESULT WINAPI VarAbs(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
{
|
||||
VARIANT varIn;
|
||||
HRESULT hRet = S_OK;
|
||||
VARIANT temp;
|
||||
|
||||
VariantInit(&temp);
|
||||
|
||||
TRACE("(%p->(%s%s),%p)\n", pVarIn, debugstr_VT(pVarIn),
|
||||
debugstr_VF(pVarIn), pVarOut);
|
||||
|
||||
/* Handle VT_DISPATCH by storing and taking address of returned value */
|
||||
if ((V_VT(pVarIn) & VT_TYPEMASK) == VT_DISPATCH && ((V_VT(pVarIn) & ~VT_TYPEMASK) == 0))
|
||||
{
|
||||
hRet = VARIANT_FetchDispatchValue(pVarIn, &temp);
|
||||
if (FAILED(hRet)) goto VarAbs_Exit;
|
||||
pVarIn = &temp;
|
||||
}
|
||||
|
||||
if (V_ISARRAY(pVarIn) || V_VT(pVarIn) == VT_UNKNOWN ||
|
||||
V_VT(pVarIn) == VT_DISPATCH || V_VT(pVarIn) == VT_RECORD ||
|
||||
V_VT(pVarIn) == VT_ERROR)
|
||||
return DISP_E_TYPEMISMATCH;
|
||||
|
||||
{
|
||||
hRet = DISP_E_TYPEMISMATCH;
|
||||
goto VarAbs_Exit;
|
||||
}
|
||||
*pVarOut = *pVarIn; /* Shallow copy the value, and invert it if needed */
|
||||
|
||||
#define ABS_CASE(typ,min) \
|
||||
@@ -4331,6 +4344,8 @@ HRESULT WINAPI VarAbs(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
hRet = DISP_E_BADVARTYPE;
|
||||
}
|
||||
|
||||
VarAbs_Exit:
|
||||
VariantClear(&temp);
|
||||
return hRet;
|
||||
}
|
||||
|
||||
@@ -4362,10 +4377,20 @@ HRESULT WINAPI VarAbs(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
HRESULT WINAPI VarFix(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
{
|
||||
HRESULT hRet = S_OK;
|
||||
VARIANT temp;
|
||||
|
||||
VariantInit(&temp);
|
||||
|
||||
TRACE("(%p->(%s%s),%p)\n", pVarIn, debugstr_VT(pVarIn),
|
||||
debugstr_VF(pVarIn), pVarOut);
|
||||
|
||||
/* Handle VT_DISPATCH by storing and taking address of returned value */
|
||||
if ((V_VT(pVarIn) & VT_TYPEMASK) == VT_DISPATCH && ((V_VT(pVarIn) & ~VT_TYPEMASK) == 0))
|
||||
{
|
||||
hRet = VARIANT_FetchDispatchValue(pVarIn, &temp);
|
||||
if (FAILED(hRet)) goto VarFix_Exit;
|
||||
pVarIn = &temp;
|
||||
}
|
||||
V_VT(pVarOut) = V_VT(pVarIn);
|
||||
|
||||
switch (V_VT(pVarIn))
|
||||
@@ -4423,8 +4448,10 @@ HRESULT WINAPI VarFix(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
else
|
||||
hRet = DISP_E_TYPEMISMATCH;
|
||||
}
|
||||
VarFix_Exit:
|
||||
if (FAILED(hRet))
|
||||
V_VT(pVarOut) = VT_EMPTY;
|
||||
VariantClear(&temp);
|
||||
|
||||
return hRet;
|
||||
}
|
||||
@@ -4457,10 +4484,20 @@ HRESULT WINAPI VarFix(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
HRESULT WINAPI VarInt(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
{
|
||||
HRESULT hRet = S_OK;
|
||||
VARIANT temp;
|
||||
|
||||
VariantInit(&temp);
|
||||
|
||||
TRACE("(%p->(%s%s),%p)\n", pVarIn, debugstr_VT(pVarIn),
|
||||
debugstr_VF(pVarIn), pVarOut);
|
||||
|
||||
/* Handle VT_DISPATCH by storing and taking address of returned value */
|
||||
if ((V_VT(pVarIn) & VT_TYPEMASK) == VT_DISPATCH && ((V_VT(pVarIn) & ~VT_TYPEMASK) == 0))
|
||||
{
|
||||
hRet = VARIANT_FetchDispatchValue(pVarIn, &temp);
|
||||
if (FAILED(hRet)) goto VarInt_Exit;
|
||||
pVarIn = &temp;
|
||||
}
|
||||
V_VT(pVarOut) = V_VT(pVarIn);
|
||||
|
||||
switch (V_VT(pVarIn))
|
||||
@@ -4484,8 +4521,10 @@ HRESULT WINAPI VarInt(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
hRet = VarDecInt(&V_DECIMAL(pVarIn), &V_DECIMAL(pVarOut));
|
||||
break;
|
||||
default:
|
||||
return VarFix(pVarIn, pVarOut);
|
||||
hRet = VarFix(pVarIn, pVarOut);
|
||||
}
|
||||
VarInt_Exit:
|
||||
VariantClear(&temp);
|
||||
|
||||
return hRet;
|
||||
}
|
||||
@@ -4758,10 +4797,20 @@ HRESULT WINAPI VarEqv(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut
|
||||
HRESULT WINAPI VarNeg(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
{
|
||||
HRESULT hRet = S_OK;
|
||||
VARIANT temp;
|
||||
|
||||
VariantInit(&temp);
|
||||
|
||||
TRACE("(%p->(%s%s),%p)\n", pVarIn, debugstr_VT(pVarIn),
|
||||
debugstr_VF(pVarIn), pVarOut);
|
||||
|
||||
/* Handle VT_DISPATCH by storing and taking address of returned value */
|
||||
if ((V_VT(pVarIn) & VT_TYPEMASK) == VT_DISPATCH && ((V_VT(pVarIn) & ~VT_TYPEMASK) == 0))
|
||||
{
|
||||
hRet = VARIANT_FetchDispatchValue(pVarIn, &temp);
|
||||
if (FAILED(hRet)) goto VarNeg_Exit;
|
||||
pVarIn = &temp;
|
||||
}
|
||||
V_VT(pVarOut) = V_VT(pVarIn);
|
||||
|
||||
switch (V_VT(pVarIn))
|
||||
@@ -4833,8 +4882,10 @@ HRESULT WINAPI VarNeg(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
else
|
||||
hRet = DISP_E_TYPEMISMATCH;
|
||||
}
|
||||
VarNeg_Exit:
|
||||
if (FAILED(hRet))
|
||||
V_VT(pVarOut) = VT_EMPTY;
|
||||
VariantClear(&temp);
|
||||
|
||||
return hRet;
|
||||
}
|
||||
@@ -4876,10 +4927,21 @@ HRESULT WINAPI VarNot(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
{
|
||||
VARIANT varIn;
|
||||
HRESULT hRet = S_OK;
|
||||
VARIANT temp;
|
||||
|
||||
VariantInit(&temp);
|
||||
|
||||
TRACE("(%p->(%s%s),%p)\n", pVarIn, debugstr_VT(pVarIn),
|
||||
debugstr_VF(pVarIn), pVarOut);
|
||||
|
||||
/* Handle VT_DISPATCH by storing and taking address of returned value */
|
||||
if ((V_VT(pVarIn) & VT_TYPEMASK) == VT_DISPATCH && ((V_VT(pVarIn) & ~VT_TYPEMASK) == 0))
|
||||
{
|
||||
hRet = VARIANT_FetchDispatchValue(pVarIn, &temp);
|
||||
if (FAILED(hRet)) goto VarNot_Exit;
|
||||
pVarIn = &temp;
|
||||
}
|
||||
|
||||
V_VT(pVarOut) = V_VT(pVarIn);
|
||||
|
||||
switch (V_VT(pVarIn))
|
||||
@@ -4951,8 +5013,10 @@ HRESULT WINAPI VarNot(LPVARIANT pVarIn, LPVARIANT pVarOut)
|
||||
else
|
||||
hRet = DISP_E_TYPEMISMATCH;
|
||||
}
|
||||
VarNot_Exit:
|
||||
if (FAILED(hRet))
|
||||
V_VT(pVarOut) = VT_EMPTY;
|
||||
VariantClear(&temp);
|
||||
|
||||
return hRet;
|
||||
}
|
||||
@@ -4981,9 +5045,20 @@ HRESULT WINAPI VarRound(LPVARIANT pVarIn, int deci, LPVARIANT pVarOut)
|
||||
VARIANT varIn;
|
||||
HRESULT hRet = S_OK;
|
||||
float factor;
|
||||
VARIANT temp;
|
||||
|
||||
VariantInit(&temp);
|
||||
|
||||
TRACE("(%p->(%s%s),%d)\n", pVarIn, debugstr_VT(pVarIn), debugstr_VF(pVarIn), deci);
|
||||
|
||||
/* Handle VT_DISPATCH by storing and taking address of returned value */
|
||||
if ((V_VT(pVarIn) & VT_TYPEMASK) == VT_DISPATCH && ((V_VT(pVarIn) & ~VT_TYPEMASK) == 0))
|
||||
{
|
||||
hRet = VARIANT_FetchDispatchValue(pVarIn, &temp);
|
||||
if (FAILED(hRet)) goto VarRound_Exit;
|
||||
pVarIn = &temp;
|
||||
}
|
||||
|
||||
switch (V_VT(pVarIn))
|
||||
{
|
||||
/* cases that fail on windows */
|
||||
@@ -5074,9 +5149,10 @@ HRESULT WINAPI VarRound(LPVARIANT pVarIn, int deci, LPVARIANT pVarOut)
|
||||
V_VT(pVarIn) & VT_TYPEMASK, deci);
|
||||
hRet = DISP_E_BADVARTYPE;
|
||||
}
|
||||
|
||||
VarRound_Exit:
|
||||
if (FAILED(hRet))
|
||||
V_VT(pVarOut) = VT_EMPTY;
|
||||
VariantClear(&temp);
|
||||
|
||||
TRACE("returning 0x%08x (%s%s),%f\n", hRet, debugstr_VT(pVarOut),
|
||||
debugstr_VF(pVarOut), (V_VT(pVarOut) == VT_R4) ? V_R4(pVarOut) :
|
||||
@@ -5131,7 +5207,7 @@ HRESULT WINAPI VarIdiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
|
||||
}
|
||||
ExtraFlags = leftExtraFlags;
|
||||
|
||||
/* Native VarIdiv always returns a error when using any extra
|
||||
/* Native VarIdiv always returns an error when using extra
|
||||
* flags or if the variant combination is I8 and INT.
|
||||
*/
|
||||
if ((leftvt == VT_I8 && rightvt == VT_INT) ||
|
||||
@@ -5543,7 +5619,7 @@ HRESULT WINAPI VarPow(LPVARIANT left, LPVARIANT right, LPVARIANT result)
|
||||
}
|
||||
ExtraFlags = leftExtraFlags;
|
||||
|
||||
/* Native VarPow always returns a error when using any extra flags */
|
||||
/* Native VarPow always returns an error when using extra flags */
|
||||
if (ExtraFlags != 0)
|
||||
{
|
||||
hr = DISP_E_BADVARTYPE;
|
||||
@@ -5659,7 +5735,7 @@ HRESULT WINAPI VarImp(LPVARIANT left, LPVARIANT right, LPVARIANT result)
|
||||
}
|
||||
ExtraFlags = leftExtraFlags;
|
||||
|
||||
/* Native VarImp always returns a error when using any extra
|
||||
/* Native VarImp always returns an error when using extra
|
||||
* flags or if the variants are I8 and INT.
|
||||
*/
|
||||
if ((leftvt == VT_I8 && rightvt == VT_INT) ||
|
||||
|
||||
@@ -3523,7 +3523,6 @@ HRESULT WINAPI VarCyFromR8(double dblIn, CY* pCyOut)
|
||||
|
||||
if (result_fpstatus & 0x9) /* Overflow | Invalid */
|
||||
return DISP_E_OVERFLOW;
|
||||
return S_OK;
|
||||
#else
|
||||
/* This version produces slightly different results for boundary cases */
|
||||
if (dblIn < -922337203685477.5807 || dblIn >= 922337203685477.5807)
|
||||
@@ -7425,7 +7424,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
|
||||
/* Parse the string into our structure */
|
||||
while (*strIn)
|
||||
{
|
||||
if (dp.dwCount > 6)
|
||||
if (dp.dwCount >= 6)
|
||||
break;
|
||||
|
||||
if (isdigitW(*strIn))
|
||||
|
||||
Reference in New Issue
Block a user