winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
996 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Use the physdev picture directly for the SRCCOPY XRender optimization.
by Alexandre Julliard
16 Sep '11
16 Sep '11
Module: wine Branch: master Commit: a09753a34935c4379c021fe939c2e1fb64cb68c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a09753a34935c4379c021fe93…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 15 23:13:01 2011 +0200 winex11: Use the physdev picture directly for the SRCCOPY XRender optimization. --- dlls/winex11.drv/xrender.c | 41 ++++++++++++++++++++++++++--------------- 1 files changed, 26 insertions(+), 15 deletions(-) diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 3288787..77b0aeb 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -2340,16 +2340,11 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr int height = dst->visrect.bottom - dst->visrect.top; int x_src = physdev_src->x11dev->dc_rect.left + src->visrect.left; int y_src = physdev_src->x11dev->dc_rect.top + src->visrect.top; - int x_dst = physdev_dst->x11dev->dc_rect.left + dst->visrect.left; - int y_dst = physdev_dst->x11dev->dc_rect.top + dst->visrect.top; - Picture src_pict=0, dst_pict=0, mask_pict=0; + int x_dst, y_dst; + Picture src_pict = 0, dst_pict, mask_pict = 0; BOOL use_repeat; double xscale, yscale; - XRenderPictureAttributes pa; - pa.subwindow_mode = IncludeInferiors; - pa.repeat = RepeatNone; - use_repeat = use_source_repeat( physdev_src ); if (!use_repeat) { @@ -2358,7 +2353,22 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr } else xscale = yscale = 1; /* no scaling needed with a repeating source */ - if (drawable != physdev_dst->x11dev->drawable) x_dst = y_dst = 0; /* using an intermediate pixmap */ + if (drawable) /* using an intermediate pixmap */ + { + XRenderPictureAttributes pa; + + x_dst = y_dst = 0; + pa.repeat = RepeatNone; + wine_tsx11_lock(); + dst_pict = pXRenderCreatePicture( gdi_display, drawable, physdev_dst->pict_format, CPRepeat, &pa ); + wine_tsx11_unlock(); + } + else + { + x_dst = physdev_dst->x11dev->dc_rect.left + dst->visrect.left; + y_dst = physdev_dst->x11dev->dc_rect.top + dst->visrect.top; + dst_pict = get_xrender_picture( physdev_dst ); + } /* mono -> color */ if (physdev_src->format == WXR_FORMAT_MONO && physdev_dst->format != WXR_FORMAT_MONO) @@ -2377,14 +2387,11 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr /* Create a destination picture and fill it with textPixel color as the background color */ wine_tsx11_lock(); - dst_pict = pXRenderCreatePicture( gdi_display, drawable, physdev_dst->pict_format, - CPSubwindowMode|CPRepeat, &pa ); pXRenderFillRectangle( gdi_display, PictOpSrc, dst_pict, &fg, x_dst, y_dst, width, height ); xrender_mono_blit( src_pict, mask_pict, dst_pict, x_src, y_src, x_dst, y_dst, xscale, yscale, width, height ); - if (dst_pict) pXRenderFreePicture(gdi_display, dst_pict); wine_tsx11_unlock(); LeaveCriticalSection( &xrender_cs ); } @@ -2395,13 +2402,17 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr src_pict = get_xrender_picture_source( physdev_src, use_repeat ); wine_tsx11_lock(); - dst_pict = pXRenderCreatePicture( gdi_display, drawable, physdev_dst->pict_format, - CPSubwindowMode|CPRepeat, &pa ); xrender_blit( PictOpSrc, src_pict, mask_pict, dst_pict, x_src, y_src, x_dst, y_dst, xscale, yscale, width, height ); - if (dst_pict) pXRenderFreePicture(gdi_display, dst_pict); + wine_tsx11_unlock(); + } + + if (drawable) + { + wine_tsx11_lock(); + pXRenderFreePicture( gdi_display, dst_pict ); wine_tsx11_unlock(); } } @@ -2468,7 +2479,7 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, XFreeGC( gdi_display, tmpGC ); wine_tsx11_unlock(); } - else xrender_stretch_blit( physdev_src, physdev_dst, physdev_dst->x11dev->drawable, src, dst ); + else xrender_stretch_blit( physdev_src, physdev_dst, 0, src, dst ); if (physdev_dst != physdev_src) X11DRV_UnlockDIBSection( physdev_src->x11dev, FALSE ); X11DRV_UnlockDIBSection( physdev_dst->x11dev, TRUE );
1
0
0
0
Alexandre Julliard : winex11: Implement the CreateBitmap entry point in the XRender driver.
by Alexandre Julliard
16 Sep '11
16 Sep '11
Module: wine Branch: master Commit: 46cbdd0efc8140581249f6ce39f96c5b8fa4244e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46cbdd0efc8140581249f6ce3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 15 19:48:46 2011 +0200 winex11: Implement the CreateBitmap entry point in the XRender driver. --- dlls/winex11.drv/bitmap.c | 80 ++++++++++++++++++++++------------------- dlls/winex11.drv/x11drv.h | 2 + dlls/winex11.drv/xrender.c | 87 ++++++++++++++++++++++---------------------- 3 files changed, 88 insertions(+), 81 deletions(-) diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index 6c5eb26..2f5655e 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -122,6 +122,41 @@ HBITMAP X11DRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) } +/*********************************************************************** + * X11DRV_create_phys_bitmap + */ +BOOL X11DRV_create_phys_bitmap( HBITMAP hbitmap, const BITMAP *bitmap, int depth, + int true_color, const ColorShifts *shifts ) +{ + X_PHYSBITMAP *physBitmap; + + if (!(physBitmap = X11DRV_init_phys_bitmap( hbitmap ))) return FALSE; + + physBitmap->pixmap_depth = depth; + physBitmap->trueColor = true_color; + if (true_color) physBitmap->pixmap_color_shifts = *shifts; + + wine_tsx11_lock(); + physBitmap->pixmap = XCreatePixmap( gdi_display, root_window, + bitmap->bmWidth, bitmap->bmHeight, physBitmap->pixmap_depth ); + if (physBitmap->pixmap) + { + GC gc = get_bitmap_gc( depth ); + XSetFunction( gdi_display, gc, GXclear ); + XFillRectangle( gdi_display, physBitmap->pixmap, gc, 0, 0, bitmap->bmWidth, bitmap->bmHeight ); + XSetFunction( gdi_display, gc, GXcopy ); + } + wine_tsx11_unlock(); + if (!physBitmap->pixmap) + { + WARN("Can't create Pixmap\n"); + HeapFree( GetProcessHeap(), 0, physBitmap ); + return FALSE; + } + return TRUE; +} + + /**************************************************************************** * CreateBitmap (X11DRV.@) * @@ -131,7 +166,6 @@ HBITMAP X11DRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) */ BOOL X11DRV_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap ) { - X_PHYSBITMAP *physBitmap; BITMAP bitmap; if (!GetObjectW( hbitmap, sizeof(bitmap), &bitmap )) return FALSE; @@ -146,50 +180,22 @@ BOOL X11DRV_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap ) bitmap.bmPlanes, bitmap.bmBitsPixel); return FALSE; } - if (hbitmap == BITMAP_stock_phys_bitmap.hbitmap) - { - ERR( "called for stock bitmap, please report\n" ); - return FALSE; - } TRACE("(%p) %dx%d %d bpp\n", hbitmap, bitmap.bmWidth, bitmap.bmHeight, bitmap.bmBitsPixel); - if (!(physBitmap = X11DRV_init_phys_bitmap( hbitmap ))) return FALSE; - - if (!X11DRV_XRender_SetPhysBitmapDepth( physBitmap, bitmap.bmBitsPixel, NULL )) + if (bitmap.bmBitsPixel == 1) { - if(bitmap.bmBitsPixel == 1) - { - physBitmap->pixmap_depth = 1; - physBitmap->trueColor = FALSE; - } - else + if (hbitmap == BITMAP_stock_phys_bitmap.hbitmap) { - physBitmap->pixmap_depth = screen_depth; - physBitmap->pixmap_color_shifts = X11DRV_PALETTE_default_shifts; - physBitmap->trueColor = (visual->class == TrueColor || visual->class == DirectColor); + ERR( "called for stock bitmap, please report\n" ); + return FALSE; } + return X11DRV_create_phys_bitmap( hbitmap, &bitmap, 1, FALSE, NULL ); } - wine_tsx11_lock(); - /* Create the pixmap */ - physBitmap->pixmap = XCreatePixmap(gdi_display, root_window, - bitmap.bmWidth, bitmap.bmHeight, physBitmap->pixmap_depth); - if (physBitmap->pixmap) - { - GC gc = get_bitmap_gc(physBitmap->pixmap_depth); - XSetFunction( gdi_display, gc, GXclear ); - XFillRectangle( gdi_display, physBitmap->pixmap, gc, 0, 0, bitmap.bmWidth, bitmap.bmHeight ); - XSetFunction( gdi_display, gc, GXcopy ); - } - wine_tsx11_unlock(); - if (!physBitmap->pixmap) - { - WARN("Can't create Pixmap\n"); - HeapFree( GetProcessHeap(), 0, physBitmap ); - return FALSE; - } - return TRUE; + return X11DRV_create_phys_bitmap( hbitmap, &bitmap, screen_depth, + (visual->class == TrueColor || visual->class == DirectColor), + &X11DRV_PALETTE_default_shifts ); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 8be8a98..11e3e17 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -274,6 +274,8 @@ extern HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc) DECLSPEC_H extern Pixmap X11DRV_DIB_CreatePixmapFromDIB( HGLOBAL hPackedDIB, HDC hdc ) DECLSPEC_HIDDEN; extern X_PHYSBITMAP *X11DRV_get_phys_bitmap( HBITMAP hbitmap ) DECLSPEC_HIDDEN; extern X_PHYSBITMAP *X11DRV_init_phys_bitmap( HBITMAP hbitmap ) DECLSPEC_HIDDEN; +extern BOOL X11DRV_create_phys_bitmap( HBITMAP hbitmap, const BITMAP *bitmap, int depth, + int true_color, const ColorShifts *shifts ) DECLSPEC_HIDDEN; extern Pixmap X11DRV_get_pixmap( HBITMAP hbitmap ) DECLSPEC_HIDDEN; extern RGNDATA *X11DRV_GetRegionData( HRGN hrgn, HDC hdc_lptodp ) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 34a7bb5..3288787 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -1185,6 +1185,31 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID */ static BOOL xrenderdrv_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap ) { + XRenderPictFormat *pict_format = NULL; + ColorShifts shifts; + BITMAP bitmap; + + if (!GetObjectW( hbitmap, sizeof(bitmap), &bitmap )) return FALSE; + + if (bitmap.bmPlanes == 1 && bitmap.bmBitsPixel == screen_bpp) + { + switch (bitmap.bmBitsPixel) + { + case 16: pict_format = pict_formats[WXR_FORMAT_R5G6B5]; break; + case 24: pict_format = pict_formats[WXR_FORMAT_R8G8B8]; break; + case 32: pict_format = pict_formats[WXR_FORMAT_A8R8G8B8]; break; + } + } + + if (pict_format) + { + X11DRV_PALETTE_ComputeColorShifts( &shifts, + pict_format->direct.redMask << pict_format->direct.red, + pict_format->direct.greenMask << pict_format->direct.green, + pict_format->direct.blueMask << pict_format->direct.blue ); + return X11DRV_create_phys_bitmap( hbitmap, &bitmap, pict_format->depth, TRUE, &shifts ); + } + dev = GET_NEXT_PHYSDEV( dev, pCreateBitmap ); return dev->funcs->pCreateBitmap( dev, hbitmap ); } @@ -1253,8 +1278,12 @@ static void xrenderdrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_r BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, int bits_pixel, const DIBSECTION *dib) { - XRenderPictFormat *pict_format = NULL; + XRenderPictFormat *pict_format; ColorShifts shifts; + const DWORD *bitfields; + static const DWORD bitfields_32[3] = {0xff0000, 0x00ff00, 0x0000ff}; + static const DWORD bitfields_16[3] = {0x7c00, 0x03e0, 0x001f}; + /* When XRender is not around we can only use the screen_depth and when needed we perform depth conversion * in software. Further we also return the screen depth for paletted formats or TrueColor formats with a low @@ -1262,52 +1291,22 @@ BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, int bits_pixel, if (!X11DRV_XRender_Installed || bits_pixel <= 8) return FALSE; - if (dib) - { - const DWORD *bitfields; - static const DWORD bitfields_32[3] = {0xff0000, 0x00ff00, 0x0000ff}; - static const DWORD bitfields_16[3] = {0x7c00, 0x03e0, 0x001f}; - - if(dib->dsBmih.biCompression == BI_BITFIELDS) - bitfields = dib->dsBitfields; - else if(bits_pixel == 24 || bits_pixel == 32) - bitfields = bitfields_32; - else - bitfields = bitfields_16; - - X11DRV_PALETTE_ComputeColorShifts(&shifts, bitfields[0], bitfields[1], bitfields[2]); - pict_format = pict_formats[get_xrender_format_from_color_shifts(dib->dsBm.bmBitsPixel, &shifts)]; - - /* Common formats should be in our picture format table. */ - if (!pict_format) - { - TRACE("Unhandled dibsection format bpp=%d, redMask=%x, greenMask=%x, blueMask=%x\n", - dib->dsBm.bmBitsPixel, bitfields[0], bitfields[1], bitfields[2]); - return FALSE; - } - } + if(dib->dsBmih.biCompression == BI_BITFIELDS) + bitfields = dib->dsBitfields; + else if(bits_pixel == 24 || bits_pixel == 32) + bitfields = bitfields_32; else - { - int red_mask, green_mask, blue_mask; - - /* We are dealing with a DDB */ - switch (bits_pixel) - { - case 16: pict_format = pict_formats[WXR_FORMAT_R5G6B5]; break; - case 24: pict_format = pict_formats[WXR_FORMAT_R8G8B8]; break; - case 32: pict_format = pict_formats[WXR_FORMAT_A8R8G8B8]; break; - } + bitfields = bitfields_16; - if (!pict_format) - { - TRACE("Unhandled DDB bits_pixel=%d\n", bits_pixel); - return FALSE; - } + X11DRV_PALETTE_ComputeColorShifts(&shifts, bitfields[0], bitfields[1], bitfields[2]); + pict_format = pict_formats[get_xrender_format_from_color_shifts(dib->dsBm.bmBitsPixel, &shifts)]; - red_mask = pict_format->direct.redMask << pict_format->direct.red; - green_mask = pict_format->direct.greenMask << pict_format->direct.green; - blue_mask = pict_format->direct.blueMask << pict_format->direct.blue; - X11DRV_PALETTE_ComputeColorShifts(&shifts, red_mask, green_mask, blue_mask); + /* Common formats should be in our picture format table. */ + if (!pict_format) + { + TRACE("Unhandled dibsection format bpp=%d, redMask=%x, greenMask=%x, blueMask=%x\n", + dib->dsBm.bmBitsPixel, bitfields[0], bitfields[1], bitfields[2]); + return FALSE; } physBitmap->pixmap_depth = pict_format->depth;
1
0
0
0
Alistair Leslie-Hughes : msxml3: Move xmlparser.idl to msxml3.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 54b37b8c41206ab301fd04623d0a034ff543bc52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=54b37b8c41206ab301fd04623…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Thu Sep 15 22:18:28 2011 +1000 msxml3: Move xmlparser.idl to msxml3. --- .gitignore | 2 +- dlls/msxml3/Makefile.in | 2 ++ {include => dlls/msxml3}/xmlparser.idl | 0 include/Makefile.in | 3 +-- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b401369..b1d82eb 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,7 @@ dlls/msi/sql.tab.c dlls/msi/sql.tab.h dlls/mstask/mstask_local.h dlls/mstask/mstask_local_i.c +dlls/msxml3/xmlparser.h dlls/msxml3/xslpattern.tab.c dlls/msxml3/xslpattern.tab.h dlls/msxml3/xslpattern.yy.c @@ -234,7 +235,6 @@ include/wpcapi.h include/wtypes.h include/wuapi.h include/xmllite.h -include/xmlparser.h libs/wpp/ppl.yy.c libs/wpp/ppy.tab.c libs/wpp/ppy.tab.h diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in index 889ef64..7e0add1 100644 --- a/dlls/msxml3/Makefile.in +++ b/dlls/msxml3/Makefile.in @@ -44,6 +44,8 @@ RC_SRCS = \ schemas.rc \ version.rc +IDL_H_SRCS = xmlparser.idl + IDL_TLB_SRCS = msxml3_v1.idl @MAKE_DLL_RULES@ diff --git a/include/xmlparser.idl b/dlls/msxml3/xmlparser.idl similarity index 100% rename from include/xmlparser.idl rename to dlls/msxml3/xmlparser.idl diff --git a/include/Makefile.in b/include/Makefile.in index 5223e41..c405d64 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -104,8 +104,7 @@ PUBLIC_IDL_H_SRCS = \ wpcapi.idl \ wtypes.idl \ wuapi.idl \ - xmllite.idl \ - xmlparser.idl + xmllite.idl IDL_TLB_SRCS = \ stdole2.idl
1
0
0
0
Michael Stefaniuc : d3d8: Remove pointless casts to the type of the casted expression.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 99f770e4efd09dd5b9cecf9f9bb7d7bb2bd64659 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=99f770e4efd09dd5b9cecf9f9…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Sep 15 16:33:41 2011 +0200 d3d8: Remove pointless casts to the type of the casted expression. --- dlls/d3d8/cubetexture.c | 2 +- dlls/d3d8/surface.c | 2 +- dlls/d3d8/texture.c | 2 +- dlls/d3d8/volumetexture.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/d3d8/cubetexture.c b/dlls/d3d8/cubetexture.c index 6b8caf1..0f40a0d 100644 --- a/dlls/d3d8/cubetexture.c +++ b/dlls/d3d8/cubetexture.c @@ -97,7 +97,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(IDirect3DCubeTexture8 TRACE("iface %p, device %p.\n", iface, device); - *device = (IDirect3DDevice8 *)This->parentDevice; + *device = This->parentDevice; IDirect3DDevice8_AddRef(*device); TRACE("Returning device %p.\n", *device); diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index 3424dcb..23e5036 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -134,7 +134,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(IDirect3DSurface8 *iface, return hr; } - *device = (IDirect3DDevice8 *)This->parentDevice; + *device = This->parentDevice; IDirect3DDevice8_AddRef(*device); TRACE("Returning device %p.\n", *device); diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index b74a8e4..2f62017 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -96,7 +96,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetDevice(IDirect3DTexture8 *iface, TRACE("iface %p, device %p.\n", iface, device); - *device = (IDirect3DDevice8 *)This->parentDevice; + *device = This->parentDevice; IDirect3DDevice8_AddRef(*device); TRACE("Returning device %p.\n", *device); diff --git a/dlls/d3d8/volumetexture.c b/dlls/d3d8/volumetexture.c index 356b47b..2ab5be2 100644 --- a/dlls/d3d8/volumetexture.c +++ b/dlls/d3d8/volumetexture.c @@ -95,7 +95,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(IDirect3DVolumeTextu TRACE("iface %p, device %p.\n", iface, device); - *device = (IDirect3DDevice8 *)This->parentDevice; + *device = This->parentDevice; IDirect3DDevice8_AddRef(*device); TRACE("Returning device %p.\n", *device);
1
0
0
0
Jacek Caban : vbscript: Added stop statement semi-stub implementation.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 8de5db6030c2bd229fba529842efb3d749d505f1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8de5db6030c2bd229fba52984…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 15 14:22:27 2011 +0200 vbscript: Added stop statement semi-stub implementation. --- dlls/vbscript/compile.c | 3 +++ dlls/vbscript/interp.c | 8 ++++++++ dlls/vbscript/parse.h | 3 ++- dlls/vbscript/parser.y | 1 + dlls/vbscript/tests/lang.vbs | 3 +++ dlls/vbscript/vbscript.h | 1 + 6 files changed, 18 insertions(+), 1 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 32707dc..10b2a9d 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -615,6 +615,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat) case STAT_SET: hres = compile_assign_statement(ctx, (assign_statement_t*)stat, TRUE); break; + case STAT_STOP: + hres = push_instr(ctx, OP_stop) == -1 ? E_OUTOFMEMORY : S_OK; + break; default: FIXME("Unimplemented statement type %d\n", stat->type); hres = E_NOTIMPL; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index a0e926d..27da9d3 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -576,6 +576,14 @@ static HRESULT interp_ret(exec_ctx_t *ctx) return S_OK; } +static HRESULT interp_stop(exec_ctx_t *ctx) +{ + WARN("\n"); + + /* NOTE: this should have effect in debugging mode (that we don't support yet) */ + return S_OK; +} + static HRESULT interp_bool(exec_ctx_t *ctx) { const VARIANT_BOOL arg = ctx->instr->arg1.lng; diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 94ba0cf..918a6db 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -97,7 +97,8 @@ typedef enum { STAT_EXITSUB, STAT_FUNC, STAT_IF, - STAT_SET + STAT_SET, + STAT_STOP } statement_type_t; typedef struct _statement_t { diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 3eacf2f..63423d1 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -157,6 +157,7 @@ Statement | tEXIT tSUB { $$ = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; } | tSET MemberExpression Arguments_opt '=' Expression { $2->args = $3; $$ = new_set_statement(ctx, $2, $5); CHECK_ERROR; } + | tSTOP { $$ = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } MemberExpression : tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; } diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 9e4bc44..3511707 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -376,6 +376,9 @@ Private Function TestPrivateFunc End Function Call TestPrivateFunc +' Stop has an effect only in debugging mode +Stop + set x = testObj Call ok(getVT(x) = "VT_DISPATCH*", "getVT(x=testObj) = " & getVT(x)) diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 1dcbc15..26892db 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -169,6 +169,7 @@ typedef enum { X(set_ident, 1, ARG_BSTR, 0) \ X(set_member, 1, ARG_BSTR, 0) \ X(short, 1, ARG_INT, 0) \ + X(stop, 1, 0, 0) \ X(string, 1, ARG_STR, 0) \ X(sub, 1, 0, 0) \ X(xor, 1, 0, 0)
1
0
0
0
Jacek Caban : vbscript: Added this object to identifier lookup chanin.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 1e01a176a38f4792ea7589d05f991fa93960b947 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e01a176a38f4792ea7589d05…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 15 14:21:58 2011 +0200 vbscript: Added this object to identifier lookup chanin. --- dlls/vbscript/interp.c | 32 ++++++++++++++++++++++++++------ dlls/vbscript/tests/lang.vbs | 1 + dlls/vbscript/vbdisp.c | 32 +++++++++++++++++++++++--------- dlls/vbscript/vbscript.c | 2 +- dlls/vbscript/vbscript.h | 4 ++-- 5 files changed, 53 insertions(+), 18 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 2d0b7cb..a0e926d 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -30,6 +30,7 @@ typedef struct { instr_t *instr; script_ctx_t *script; function_t *func; + IDispatch *this_obj; VARIANT *args; VARIANT *vars; @@ -113,6 +114,14 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ } } + hres = disp_get_id(ctx->this_obj, name, TRUE, &id); + if(SUCCEEDED(hres)) { + ref->type = REF_DISP; + ref->u.d.disp = ctx->this_obj; + ref->u.d.id = id; + return S_OK; + } + if(lookup_dynamic_vars(ctx->script->global_vars, name, ref)) return S_OK; @@ -125,8 +134,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ } LIST_FOR_EACH_ENTRY(item, &ctx->script->named_items, named_item_t, entry) { - if(item->flags & SCRIPTITEM_GLOBALMEMBERS) { - hres = disp_get_id(item->disp, name, &id); + if((item->flags & SCRIPTITEM_GLOBALMEMBERS) && item->disp != ctx->this_obj) { + hres = disp_get_id(item->disp, name, FALSE, &id); if(SUCCEEDED(hres)) { ref->type = REF_DISP; ref->u.d.disp = item->disp; @@ -294,7 +303,7 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) return hres; break; case REF_FUNC: - hres = exec_script(ctx->script, ref.u.f, &dp, res); + hres = exec_script(ctx->script, ref.u.f, NULL, &dp, res); if(FAILED(hres)) return hres; break; @@ -347,7 +356,7 @@ static HRESULT do_mcall(exec_ctx_t *ctx, VARIANT *res) vbstack_to_dp(ctx, arg_cnt, &dp); - hres = disp_get_id(obj, identifier, &id); + hres = disp_get_id(obj, identifier, FALSE, &id); if(SUCCEEDED(hres)) hres = disp_call(ctx->script, obj, id, &dp, res); IDispatch_Release(obj); @@ -480,7 +489,7 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx) return hres; } - hres = disp_get_id(obj, identifier, &id); + hres = disp_get_id(obj, identifier, FALSE, &id); if(SUCCEEDED(hres)) hres = disp_propput(ctx->script, obj, id, val.v); @@ -1084,6 +1093,9 @@ static void release_exec(exec_ctx_t *ctx) VariantClear(&ctx->ret_val); + if(ctx->this_obj) + IDispatch_Release(ctx->this_obj); + if(ctx->args) { for(i=0; i < ctx->func->arg_cnt; i++) VariantClear(ctx->args+i); @@ -1099,7 +1111,7 @@ static void release_exec(exec_ctx_t *ctx) heap_free(ctx->stack); } -HRESULT exec_script(script_ctx_t *ctx, function_t *func, DISPPARAMS *dp, VARIANT *res) +HRESULT exec_script(script_ctx_t *ctx, function_t *func, IDispatch *this_obj, DISPPARAMS *dp, VARIANT *res) { exec_ctx_t exec = {func->code_ctx}; vbsop_t op; @@ -1159,6 +1171,14 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, DISPPARAMS *dp, VARIANT return E_OUTOFMEMORY; } + if(this_obj) + exec.this_obj = this_obj; + else if (ctx->host_global) + exec.this_obj = ctx->host_global; + else + exec.this_obj = (IDispatch*)&ctx->script_obj->IDispatchEx_iface; + IDispatch_AddRef(exec.this_obj); + exec.instr = exec.code->instrs + func->code_off; exec.script = ctx; exec.func = func; diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 06542cd..9e4bc44 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -388,6 +388,7 @@ End Class Class TestClass Public Function publicFunction() + privateSub() publicFunction = 4 End Function diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c index 2b60926..666d04a 100644 --- a/dlls/vbscript/vbdisp.c +++ b/dlls/vbscript/vbdisp.c @@ -46,6 +46,15 @@ static BOOL get_func_id(vbdisp_t *This, const WCHAR *name, BOOL search_private, return FALSE; } +static HRESULT vbdisp_get_id(vbdisp_t *This, BSTR name, BOOL search_private, DISPID *id) +{ + if(get_func_id(This, name, search_private, id)) + return S_OK; + + *id = -1; + return DISP_E_UNKNOWNNAME; +} + static inline vbdisp_t *impl_from_IDispatchEx(IDispatchEx *iface) { return CONTAINING_RECORD(iface, vbdisp_t, IDispatchEx_iface); @@ -144,11 +153,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW return E_NOTIMPL; } - if(get_func_id(This, bstrName, FALSE, pid)) - return S_OK; - - *pid = -1; - return DISP_E_UNKNOWNNAME; + return vbdisp_get_id(This, bstrName, FALSE, pid); } static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, @@ -176,7 +181,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc return DISP_E_MEMBERNOTFOUND; } - return exec_script(This->desc->ctx, func, pdp, pvarRes); + return exec_script(This->desc->ctx, func, (IDispatch*)&This->IDispatchEx_iface, pdp, pvarRes); default: FIXME("flags %x\n", wFlags); return DISP_E_MEMBERNOTFOUND; @@ -247,6 +252,13 @@ static IDispatchExVtbl DispatchExVtbl = { DispatchEx_GetNameSpaceParent }; +static inline vbdisp_t *unsafe_impl_from_IDispatch(IDispatch *iface) +{ + return iface->lpVtbl == (IDispatchVtbl*)&DispatchExVtbl + ? CONTAINING_RECORD(iface, vbdisp_t, IDispatchEx_iface) + : NULL; +} + HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret) { vbdisp_t *vbdisp; @@ -269,13 +281,15 @@ HRESULT init_global(script_ctx_t *ctx) return create_vbdisp(&ctx->script_desc, &ctx->script_obj); } -HRESULT disp_get_id(IDispatch *disp, BSTR name, DISPID *id) +HRESULT disp_get_id(IDispatch *disp, BSTR name, BOOL search_private, DISPID *id) { IDispatchEx *dispex; + vbdisp_t *vbdisp; HRESULT hres; - if(disp->lpVtbl == (IDispatchVtbl*)&DispatchExVtbl) - FIXME("properly handle builtin objects\n"); + vbdisp = unsafe_impl_from_IDispatch(disp); + if(vbdisp) + return vbdisp_get_id(vbdisp, name, search_private, id); hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); if(FAILED(hres)) { diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index cb28a9a..e0598a9 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -77,7 +77,7 @@ static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code) code->global_executed = TRUE; IActiveScriptSite_OnEnterScript(ctx->site); - hres = exec_script(ctx, &code->global_code, NULL, NULL); + hres = exec_script(ctx, &code->global_code, NULL, NULL, NULL); IActiveScriptSite_OnLeaveScript(ctx->site); return hres; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 11a5862..1dcbc15 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -85,7 +85,7 @@ typedef struct { } vbdisp_t; HRESULT create_vbdisp(const class_desc_t*,vbdisp_t**); -HRESULT disp_get_id(IDispatch*,BSTR,DISPID*); +HRESULT disp_get_id(IDispatch*,BSTR,BOOL,DISPID*); HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*); HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*); @@ -241,7 +241,7 @@ struct _vbscode_t { void release_vbscode(vbscode_t*) DECLSPEC_HIDDEN; HRESULT compile_script(script_ctx_t*,const WCHAR*,vbscode_t**) DECLSPEC_HIDDEN; -HRESULT exec_script(script_ctx_t*,function_t*,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN; +HRESULT exec_script(script_ctx_t*,function_t*,IDispatch*,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN; HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**);
1
0
0
0
Jacek Caban : vbscript: Added interp_mcall implementation.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 308b2641d929c88a80361d1077e4ab5c2d5fbea3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=308b2641d929c88a80361d107…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 15 14:21:44 2011 +0200 vbscript: Added interp_mcall implementation. --- dlls/vbscript/interp.c | 5 +++-- dlls/vbscript/tests/lang.vbs | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index beacfe9..2d0b7cb 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -374,8 +374,9 @@ static HRESULT interp_mcall(exec_ctx_t *ctx) static HRESULT interp_mcallv(exec_ctx_t *ctx) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + return do_mcall(ctx, NULL); } static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_val) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index ec85614..06542cd 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -405,4 +405,8 @@ Set obj = New TestClass Call ok(obj.publicFunction = 4, "obj.publicFunction = " & obj.publicFunction) Call ok(obj.publicFunction() = 4, "obj.publicFunction() = " & obj.publicFunction()) +obj.publicSub() +Call obj.publicSub +Call obj.publicFunction() + reportSuccess()
1
0
0
0
Jacek Caban : vbscript: Added beginning InvokeEx implementation.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 6ee2e3ac9122c251458f5f3a4bba641265893c22 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ee2e3ac9122c251458f5f3a4…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 15 14:21:33 2011 +0200 vbscript: Added beginning InvokeEx implementation. --- dlls/vbscript/tests/lang.vbs | 5 +++++ dlls/vbscript/tests/run.c | 26 ++++++++++++++++++++++++++ dlls/vbscript/vbdisp.c | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 1 deletions(-) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 3f39a4e..ec85614 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -400,4 +400,9 @@ End Class Call testDisp(new testClass) +Set obj = New TestClass + +Call ok(obj.publicFunction = 4, "obj.publicFunction = " & obj.publicFunction) +Call ok(obj.publicFunction() = 4, "obj.publicFunction() = " & obj.publicFunction()) + reportSuccess() diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index fb6302a..d98cf38 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -144,7 +144,11 @@ static BOOL is_english(void) static void test_disp(IDispatch *disp) { DISPID id, public_func_id, public_sub_id; + DISPID named_args[5] = {DISPID_PROPERTYPUT}; + VARIANT v, args[5]; + DISPPARAMS dp = {args, named_args}; IDispatchEx *dispex; + EXCEPINFO ei = {0}; BSTR str; HRESULT hres; @@ -163,6 +167,28 @@ static void test_disp(IDispatch *disp) ok(hres == S_OK, "GetDispID(publicSub) failed: %08x\n", hres); ok(public_sub_id != -1, "public_func_id = -1\n"); + dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v)); + + dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v)); + + dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v)); + + dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v)); + str = a2bstr("privateSub"); hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id); SysFreeString(str); diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c index 77837c6..2b60926 100644 --- a/dlls/vbscript/vbdisp.c +++ b/dlls/vbscript/vbdisp.c @@ -22,6 +22,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript); +static inline BOOL is_func_id(vbdisp_t *This, DISPID id) +{ + return id < This->desc->func_cnt; +} + static BOOL get_func_id(vbdisp_t *This, const WCHAR *name, BOOL search_private, DISPID *id) { unsigned i; @@ -150,7 +155,35 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { vbdisp_t *This = impl_from_IDispatchEx(iface); - FIXME("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + + TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + + if(pvarRes) + V_VT(pvarRes) = VT_EMPTY; + + if(id < 0) + return DISP_E_MEMBERNOTFOUND; + + if(is_func_id(This, id)) { + function_t *func; + + switch(wFlags) { + case DISPATCH_METHOD: + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + func = This->desc->funcs[id].entries[VBDISP_CALLGET]; + if(!func) { + FIXME("no invoke/getter\n"); + return DISP_E_MEMBERNOTFOUND; + } + + return exec_script(This->desc->ctx, func, pdp, pvarRes); + default: + FIXME("flags %x\n", wFlags); + return DISP_E_MEMBERNOTFOUND; + } + } + + FIXME("not implemented for non-function ids\n"); return DISP_E_MEMBERNOTFOUND; }
1
0
0
0
Jacek Caban : vbscript: Added beginning GetDispID implementation.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 8b4c560d756815b9632dcf99709e7a554e52ed46 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b4c560d756815b9632dcf997…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 15 14:21:13 2011 +0200 vbscript: Added beginning GetDispID implementation. --- dlls/vbscript/tests/lang.vbs | 4 ++- dlls/vbscript/tests/run.c | 62 ++++++++++++++++++++++++++++++++++++++++- dlls/vbscript/vbdisp.c | 34 +++++++++++++++++++++- 3 files changed, 95 insertions(+), 5 deletions(-) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 2f78403..3f39a4e 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -394,8 +394,10 @@ Class TestClass Public Sub publicSub End Sub - Public Sub privateSub + Private Sub privateSub End Sub End Class +Call testDisp(new testClass) + reportSuccess() diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index fa6eec1..fb6302a 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -73,6 +73,7 @@ DEFINE_EXPECT(testobj_propput_i); #define DISPID_GLOBAL_VBVAR 1005 #define DISPID_GLOBAL_TESTOBJ 1006 #define DISPID_GLOBAL_ISNULLDISP 1007 +#define DISPID_GLOBAL_TESTDISP 1008 #define DISPID_TESTOBJ_PROPGET 2000 #define DISPID_TESTOBJ_PROPPUT 2001 @@ -140,6 +141,46 @@ static BOOL is_english(void) && PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH; } +static void test_disp(IDispatch *disp) +{ + DISPID id, public_func_id, public_sub_id; + IDispatchEx *dispex; + BSTR str; + HRESULT hres; + + hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + + str = a2bstr("publicFunction"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_func_id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID(publicFunction) failed: %08x\n", hres); + ok(public_func_id != -1, "public_func_id = -1\n"); + + str = a2bstr("publicSub"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_sub_id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID(publicSub) failed: %08x\n", hres); + ok(public_sub_id != -1, "public_func_id = -1\n"); + + str = a2bstr("privateSub"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id); + SysFreeString(str); + ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateSub) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres); + ok(id == -1, "id = %d\n", id); + + str = a2bstr("dynprop"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive|fdexNameEnsure, &id); + ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres); + ok(id == -1, "id = %d\n", id); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameEnsure, &id); + ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres); + ok(id == -1, "id = %d\n", id); + SysFreeString(str); + + IDispatchEx_Release(dispex); +} + #define test_grfdex(a,b) _test_grfdex(__LINE__,a,b) static void _test_grfdex(unsigned line, DWORD grfdex, DWORD expect) { @@ -359,7 +400,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD *pid = DISPID_GLOBAL_ISNULLDISP; return S_OK; } - + if(!strcmp_wa(bstrName, "testDisp")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_TESTDISP; + return S_OK; + } if(strict_dispid_check && strcmp_wa(bstrName, "x")) ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); @@ -473,7 +518,6 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); ok(V_I2(pdp->rgvarg) == 3, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg)); - return S_OK; case DISPID_GLOBAL_TESTOBJ: @@ -512,6 +556,20 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, V_BOOL(pvarRes) = V_DISPATCH(v) ? VARIANT_FALSE : VARIANT_TRUE; return S_OK; } + + case DISPID_GLOBAL_TESTDISP: + ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); + test_disp(V_DISPATCH(pdp->rgvarg)); + return S_OK; } ok(0, "unexpected call %d\n", id); diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c index f1a323d..77837c6 100644 --- a/dlls/vbscript/vbdisp.c +++ b/dlls/vbscript/vbdisp.c @@ -22,6 +22,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript); +static BOOL get_func_id(vbdisp_t *This, const WCHAR *name, BOOL search_private, DISPID *id) +{ + unsigned i; + + for(i = 0; i < This->desc->func_cnt; i++) { + if(!search_private && !This->desc->funcs[i].is_public) + continue; + if(!This->desc->funcs[i].name) /* default value may not exist */ + continue; + + if(!strcmpiW(This->desc->funcs[i].name, name)) { + *id = i; + return TRUE; + } + } + + return FALSE; +} + static inline vbdisp_t *impl_from_IDispatchEx(IDispatchEx *iface) { return CONTAINING_RECORD(iface, vbdisp_t, IDispatchEx_iface); @@ -112,8 +131,19 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { vbdisp_t *This = impl_from_IDispatchEx(iface); - FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid); - return E_NOTIMPL; + + TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid); + + if(grfdex & ~(fdexNameEnsure|fdexNameCaseInsensitive)) { + FIXME("unsupported flags %x\n", grfdex); + return E_NOTIMPL; + } + + if(get_func_id(This, bstrName, FALSE, pid)) + return S_OK; + + *pid = -1; + return DISP_E_UNKNOWNNAME; } static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
1
0
0
0
Jacek Caban : vbscript: Added class function compiler implementation.
by Alexandre Julliard
15 Sep '11
15 Sep '11
Module: wine Branch: master Commit: 8fb2b985dc74714905c0593cfa826fb2cf9d3006 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8fb2b985dc74714905c0593cf…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 15 14:20:46 2011 +0200 vbscript: Added class function compiler implementation. --- dlls/vbscript/compile.c | 33 +++++++++++++++++++++++++++++++++ dlls/vbscript/vbscript.h | 22 +++++++++++++++------- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 5c7f7e3..32707dc 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -804,9 +804,26 @@ static BOOL lookup_class_name(compile_ctx_t *ctx, const WCHAR *name) return FALSE; } +static HRESULT create_class_funcprop(compile_ctx_t *ctx, function_decl_t *func_decl, vbdisp_funcprop_desc_t *desc) +{ + desc->name = compiler_alloc_string(ctx->code, func_decl->name); + if(!desc->name) + return E_OUTOFMEMORY; + + assert(!desc->entries[0]); + + if(func_decl->is_public) + desc->is_public = TRUE; + + return create_function(ctx, func_decl, desc->entries); +} + static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl) { + function_decl_t *func_decl; class_desc_t *class_desc; + unsigned i; + HRESULT hres; if(lookup_dim_decls(ctx, class_decl->name) || lookup_funcs_name(ctx, class_decl->name) || lookup_class_name(ctx, class_decl->name)) { @@ -822,6 +839,22 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl) if(!class_desc->name) return E_OUTOFMEMORY; + class_desc->func_cnt = 1; /* always allocate slot for default getter */ + + for(func_decl = class_decl->funcs; func_decl; func_decl = func_decl->next) + class_desc->func_cnt++; + + class_desc->funcs = compiler_alloc(ctx->code, class_desc->func_cnt*sizeof(*class_desc->funcs)); + if(!class_desc->funcs) + return E_OUTOFMEMORY; + memset(class_desc->funcs, 0, class_desc->func_cnt*sizeof(*class_desc->funcs)); + + for(func_decl = class_decl->funcs, i=1; func_decl; func_decl = func_decl->next, i++) { + hres = create_class_funcprop(ctx, func_decl, class_desc->funcs + i); + if(FAILED(hres)) + return hres; + } + class_desc->next = ctx->classes; ctx->classes = class_desc; return S_OK; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 014e480..11a5862 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -55,9 +55,24 @@ typedef struct named_item_t { struct list entry; } named_item_t; +typedef enum { + VBDISP_CALLGET, + VBDISP_LET, + VBDISP_SET, + VBDISP_ANY +} vbdisp_invoke_type_t; + +typedef struct { + const WCHAR *name; + BOOL is_public; + function_t *entries[VBDISP_ANY]; +} vbdisp_funcprop_desc_t; + typedef struct _class_desc_t { const WCHAR *name; script_ctx_t *ctx; + unsigned func_cnt; + vbdisp_funcprop_desc_t *funcs; struct _class_desc_t *next; } class_desc_t; @@ -69,13 +84,6 @@ typedef struct { const class_desc_t *desc; } vbdisp_t; -typedef enum { - VBDISP_CALLGET, - VBDISP_LET, - VBDISP_SET, - VBDISP_ANY -} vbdisp_invoke_type_t; - HRESULT create_vbdisp(const class_desc_t*,vbdisp_t**); HRESULT disp_get_id(IDispatch*,BSTR,DISPID*); HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*);
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
100
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200