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
April 2022
----- 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
1024 discussions
Start a n
N
ew thread
Jacek Caban : winex11: Directly use win32u for GDI functions in bitblt.c.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: c3ed3403bae88f6a9fed26dd2fa0b622018cfd2a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c3ed3403bae88f6a9fed26dd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 12 13:09:19 2022 +0200 winex11: Directly use win32u for GDI functions in bitblt.c. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/bitblt.c | 50 ++++++++++++++++++++++++++++------------------- dlls/winex11.drv/x11drv.h | 3 +-- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 46e52612a21..bae0784be78 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -44,8 +44,6 @@ #include "windef.h" #include "winbase.h" -#include "wingdi.h" -#include "winuser.h" #include "x11drv.h" #include "winternl.h" #include "wine/debug.h" @@ -849,8 +847,14 @@ BOOL CDECL X11DRV_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, } if (physDevSrc->depth == 1) { - int text_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, GetTextColor(physDevDst->dev.hdc) ); - int bkgnd_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, GetBkColor(physDevDst->dev.hdc) ); + DWORD text_color, bk_color; + int text_pixel, bkgnd_pixel; + + NtGdiGetDCDword( physDevDst->dev.hdc, NtGdiGetTextColor, &text_color ); + text_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, text_color ); + + NtGdiGetDCDword( physDevDst->dev.hdc, NtGdiGetBkColor, &bk_color ); + bkgnd_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, bk_color ); XSetBackground( gdi_display, physDevDst->gc, text_pixel ); XSetForeground( gdi_display, physDevDst->gc, bkgnd_pixel ); @@ -880,8 +884,14 @@ BOOL CDECL X11DRV_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, to color or vice versa, the foreground and background color of the device context are used. In fact, it also applies to the case when it is converted from mono to mono. */ - int text_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, GetTextColor(physDevDst->dev.hdc) ); - int bkgnd_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, GetBkColor(physDevDst->dev.hdc) ); + DWORD text_color, bk_color; + int text_pixel, bkgnd_pixel; + + NtGdiGetDCDword( physDevDst->dev.hdc, NtGdiGetTextColor, &text_color ); + text_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, text_color ); + + NtGdiGetDCDword( physDevDst->dev.hdc, NtGdiGetBkColor, &bk_color ); + bkgnd_pixel = X11DRV_PALETTE_ToPhysical( physDevDst, bk_color ); if (X11DRV_PALETTE_XPixelToPalette && physDevDst->depth != 1) { @@ -1480,7 +1490,7 @@ Pixmap create_pixmap_from_image( HDC hdc, const XVisualInfo *vis, const BITMAPIN { if (dst_info->bmiHeader.biBitCount == 1) /* set a default color table for 1-bpp */ memcpy( dst_info->bmiColors, default_colortable, sizeof(default_colortable) ); - dib = CreateDIBSection( hdc, dst_info, coloruse, &dst_bits.ptr, 0, 0 ); + dib = NtGdiCreateDIBSection( hdc, 0, 0, dst_info, coloruse, 0, 0, 0, &dst_bits.ptr ); if (dib) { if (src_info->bmiHeader.biBitCount == 1 && !src_info->bmiHeader.biClrUsed) @@ -1489,7 +1499,7 @@ Pixmap create_pixmap_from_image( HDC hdc, const XVisualInfo *vis, const BITMAPIN dst_bits.free = NULL; dst_bits.is_copy = TRUE; err = put_pixmap_image( pixmap, vis, dst_info, &dst_bits ); - DeleteObject( dib ); + NtGdiDeleteObjectApp( dib ); } else err = ERROR_OUTOFMEMORY; } @@ -1592,9 +1602,9 @@ static inline UINT get_color_component( UINT color, UINT mask ) #ifdef HAVE_LIBXSHAPE static inline void flush_rgn_data( HRGN rgn, RGNDATA *data ) { - HRGN tmp = ExtCreateRegion( NULL, data->rdh.dwSize + data->rdh.nRgnSize, data ); - CombineRgn( rgn, rgn, tmp, RGN_OR ); - DeleteObject( tmp ); + HRGN tmp = NtGdiExtCreateRegion( NULL, data->rdh.dwSize + data->rdh.nRgnSize, data ); + NtGdiCombineRgn( rgn, rgn, tmp, RGN_OR ); + NtGdiDeleteObjectApp( tmp ); data->rdh.nCount = 0; } @@ -1639,7 +1649,7 @@ static void update_surface_region( struct x11drv_window_surface *surface ) data->rdh.nCount = 0; data->rdh.nRgnSize = sizeof(buffer) - sizeof(data->rdh); - rgn = CreateRectRgn( 0, 0, 0, 0 ); + rgn = NtGdiCreateRectRgn( 0, 0, 0, 0 ); width = surface->header.rect.right - surface->header.rect.left; switch (info->bmiHeader.biBitCount) @@ -1741,7 +1751,7 @@ static void update_surface_region( struct x11drv_window_surface *surface ) HeapFree( GetProcessHeap(), 0, data ); } - DeleteObject( rgn ); + NtGdiDeleteObjectApp( rgn ); #endif } @@ -1868,14 +1878,14 @@ static void x11drv_surface_set_region( struct window_surface *window_surface, HR window_surface->funcs->lock( window_surface ); if (!region) { - if (surface->region) DeleteObject( surface->region ); + if (surface->region) NtGdiDeleteObjectApp( surface->region ); surface->region = 0; XSetClipMask( gdi_display, surface->gc, None ); } else { - if (!surface->region) surface->region = CreateRectRgn( 0, 0, 0, 0 ); - CombineRgn( surface->region, region, 0, RGN_COPY ); + if (!surface->region) surface->region = NtGdiCreateRectRgn( 0, 0, 0, 0 ); + NtGdiCombineRgn( surface->region, region, 0, RGN_COPY ); if ((data = X11DRV_GetRegionData( surface->region, 0 ))) { XSetClipRectangles( gdi_display, surface->gc, 0, 0, @@ -1979,7 +1989,7 @@ static void x11drv_surface_destroy( struct window_surface *window_surface ) } surface->crit.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &surface->crit ); - if (surface->region) DeleteObject( surface->region ); + if (surface->region) NtGdiDeleteObjectApp( surface->region ); HeapFree( GetProcessHeap(), 0, surface ); } @@ -2099,10 +2109,10 @@ HRGN expose_surface( struct window_surface *window_surface, const RECT *rect ) add_bounds_rect( &surface->bounds, &rc ); if (surface->region) { - region = CreateRectRgnIndirect( rect ); - if (CombineRgn( region, region, surface->region, RGN_DIFF ) <= NULLREGION) + region = NtGdiCreateRectRgn( rect->left, rect->top, rect->right, rect->bottom ); + if (NtGdiCombineRgn( region, region, surface->region, RGN_DIFF ) <= NULLREGION) { - DeleteObject( region ); + NtGdiDeleteObjectApp( region ); region = 0; } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 9890fc94c22..dacd7b171cf 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -57,8 +57,7 @@ typedef int Status; #include "windef.h" #include "winbase.h" -#include "wingdi.h" -#include "winuser.h" +#include "ntgdi.h" #include "wine/gdi_driver.h" #include "wine/list.h"
1
0
0
0
Jacek Caban : win32u: Implement NtGdiGetDCPoint.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 43126a5053ce62586d74fd70e87e9a1e7d267569 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=43126a5053ce62586d74fd70…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 12 13:09:06 2022 +0200 win32u: Implement NtGdiGetDCPoint. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/dc.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/gdi.c | 9 +++++++++ dlls/wow64win/syscall.h | 1 + include/ntgdi.h | 8 ++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 01a9c5d258a..216b3813729 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -1027,6 +1027,42 @@ BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result ) } +/*********************************************************************** + * NtGdiGetDCPoint (win32u.@) + */ +BOOL WINAPI NtGdiGetDCPoint( HDC hdc, UINT method, POINT *result ) +{ + BOOL ret = TRUE; + DC *dc; + + if (!(dc = get_dc_ptr( hdc ))) return 0; + + switch (method) + { + case NtGdiGetBrushOrgEx: + *result = dc->attr->brush_org; + break; + + case NtGdiGetCurrentPosition: + *result = dc->attr->cur_pos; + break; + + case NtGdiGetDCOrg: + result->x = dc->attr->vis_rect.left; + result->y = dc->attr->vis_rect.top; + break; + + default: + WARN( "unknown method %u\n", method ); + ret = FALSE; + break; + } + + release_dc_ptr( dc ); + return ret; +} + + /*********************************************************************** * NtGdiSetBrushOrg (win32u.@) */ diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index f9e1d67bb6b..d19ab54fa90 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -72,6 +72,7 @@ static void * const syscalls[] = NtGdiGetColorAdjustment, NtGdiGetDCDword, NtGdiGetDCObject, + NtGdiGetDCPoint, NtGdiGetFontFileData, NtGdiGetFontFileInfo, NtGdiGetNearestPaletteIndex, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 522f280f9ae..8c2073d0fb1 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -464,7 +464,7 @@ @ stub NtGdiGetDCDpiScaleValue @ stdcall -syscall NtGdiGetDCDword(long long ptr) @ stdcall -syscall NtGdiGetDCObject(long long) -@ stub NtGdiGetDCPoint +@ stdcall -syscall NtGdiGetDCPoint(long long ptr) @ stub NtGdiGetDCforBitmap @ stdcall NtGdiGetDIBitsInternal(long long long long ptr ptr long long long) @ stdcall NtGdiGetDeviceCaps(long long) diff --git a/dlls/wow64win/gdi.c b/dlls/wow64win/gdi.c index 15dae62c1e0..ed85754640d 100644 --- a/dlls/wow64win/gdi.c +++ b/dlls/wow64win/gdi.c @@ -67,6 +67,15 @@ NTSTATUS WINAPI wow64_NtGdiGetDCObject( UINT *args ) return HandleToUlong( NtGdiGetDCObject( hdc, type )); } +NTSTATUS WINAPI wow64_NtGdiGetDCPoint( UINT *args ) +{ + HDC hdc = get_handle( &args ); + UINT method = get_ulong( &args ); + POINT *result = get_ptr( &args ); + + return NtGdiGetDCPoint( hdc, method, result ); +} + NTSTATUS WINAPI wow64_NtGdiCreateBitmap( UINT *args ) { INT width = get_ulong( &args ); diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 1632f007e34..ba921e7e543 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -59,6 +59,7 @@ SYSCALL_ENTRY( NtGdiGetColorAdjustment ) \ SYSCALL_ENTRY( NtGdiGetDCDword ) \ SYSCALL_ENTRY( NtGdiGetDCObject ) \ + SYSCALL_ENTRY( NtGdiGetDCPoint ) \ SYSCALL_ENTRY( NtGdiGetFontFileData ) \ SYSCALL_ENTRY( NtGdiGetFontFileInfo ) \ SYSCALL_ENTRY( NtGdiGetNearestPaletteIndex ) \ diff --git a/include/ntgdi.h b/include/ntgdi.h index 8f3d4c05178..78d0f620be3 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -131,6 +131,14 @@ enum NtGdiIsMemDC, }; +/* NtGdiGetDCPoint parameter, not compatible with Windows */ +enum +{ + NtGdiGetBrushOrgEx, + NtGdiGetCurrentPosition, + NtGdiGetDCOrg, +}; + enum { NtGdiAnimatePalette,
1
0
0
0
Jacek Caban : win32u: Implement NtGdiGetDCDword.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: e9cfbef46b9d78af8c70558bd8b6fd08f7a4c74b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e9cfbef46b9d78af8c70558b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Apr 12 13:08:54 2022 +0200 win32u: Implement NtGdiGetDCDword. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/dc.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/gdi.c | 9 +++++++ dlls/wow64win/syscall.h | 1 + include/ntgdi.h | 16 ++++++++++++ 6 files changed, 95 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 6336c8afb2e..01a9c5d258a 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -960,6 +960,73 @@ BOOL WINAPI NtGdiGetAndSetDCDword( HDC hdc, UINT method, DWORD value, DWORD *pre } +/*********************************************************************** + * NtGdiGetDCDword (win32u.@) + */ +BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result ) +{ + BOOL ret = TRUE; + DC *dc; + + if (!(dc = get_dc_ptr( hdc ))) return 0; + + switch (method) + { + case NtGdiGetArcDirection: + *result = dc->attr->arc_direction; + break; + + case NtGdiGetBkColor: + *result = dc->attr->background_color; + break; + + case NtGdiGetBkMode: + *result = dc->attr->background_mode; + break; + + case NtGdiGetDCBrushColor: + *result = dc->attr->brush_color; + break; + + case NtGdiGetDCPenColor: + *result = dc->attr->pen_color; + break; + + case NtGdiGetGraphicsMode: + *result = dc->attr->graphics_mode; + break; + + case NtGdiGetLayout: + *result = dc->attr->layout; + break; + + case NtGdiGetPolyFillMode: + *result = dc->attr->poly_fill_mode; + break; + + case NtGdiGetROP2: + *result = dc->attr->rop_mode; + break; + + case NtGdiGetTextColor: + *result = dc->attr->text_color; + break; + + case NtGdiIsMemDC: + *result = get_gdi_object_type( hdc ) == NTGDI_OBJ_MEMDC; + break; + + default: + WARN( "unknown method %u\n", method ); + ret = FALSE; + break; + } + + release_dc_ptr( dc ); + return ret; +} + + /*********************************************************************** * NtGdiSetBrushOrg (win32u.@) */ diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 2be2cfce3bf..f9e1d67bb6b 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -70,6 +70,7 @@ static void * const syscalls[] = NtGdiGetBitmapBits, NtGdiGetBitmapDimension, NtGdiGetColorAdjustment, + NtGdiGetDCDword, NtGdiGetDCObject, NtGdiGetFontFileData, NtGdiGetFontFileInfo, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index e083797b544..522f280f9ae 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -462,7 +462,7 @@ @ stub NtGdiGetColorSpaceforBitmap @ stub NtGdiGetCurrentDpiInfo @ stub NtGdiGetDCDpiScaleValue -@ stub NtGdiGetDCDword +@ stdcall -syscall NtGdiGetDCDword(long long ptr) @ stdcall -syscall NtGdiGetDCObject(long long) @ stub NtGdiGetDCPoint @ stub NtGdiGetDCforBitmap diff --git a/dlls/wow64win/gdi.c b/dlls/wow64win/gdi.c index 3abe6daeda4..15dae62c1e0 100644 --- a/dlls/wow64win/gdi.c +++ b/dlls/wow64win/gdi.c @@ -50,6 +50,15 @@ NTSTATUS WINAPI wow64_NtGdiExtGetObjectW( UINT *args ) return NtGdiExtGetObjectW( handle, count, buffer ); } +NTSTATUS WINAPI wow64_NtGdiGetDCDword( UINT *args ) +{ + HDC hdc = get_handle( &args ); + UINT method = get_ulong( &args ); + DWORD *result = get_ptr( &args ); + + return NtGdiGetDCDword( hdc, method, result ); +} + NTSTATUS WINAPI wow64_NtGdiGetDCObject( UINT *args ) { HDC hdc = get_handle( &args ); diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index a90c4c20d40..1632f007e34 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -57,6 +57,7 @@ SYSCALL_ENTRY( NtGdiGetBitmapBits ) \ SYSCALL_ENTRY( NtGdiGetBitmapDimension ) \ SYSCALL_ENTRY( NtGdiGetColorAdjustment ) \ + SYSCALL_ENTRY( NtGdiGetDCDword ) \ SYSCALL_ENTRY( NtGdiGetDCObject ) \ SYSCALL_ENTRY( NtGdiGetFontFileData ) \ SYSCALL_ENTRY( NtGdiGetFontFileInfo ) \ diff --git a/include/ntgdi.h b/include/ntgdi.h index 3bc1d4206e4..8f3d4c05178 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -115,6 +115,22 @@ enum NtGdiSetGraphicsMode, }; +/* NtGdiGetDCDword parameter, not compatible with Windows */ +enum +{ + NtGdiGetArcDirection, + NtGdiGetBkColor, + NtGdiGetBkMode, + NtGdiGetDCBrushColor, + NtGdiGetDCPenColor, + NtGdiGetGraphicsMode, + NtGdiGetLayout, + NtGdiGetPolyFillMode, + NtGdiGetROP2, + NtGdiGetTextColor, + NtGdiIsMemDC, +}; + enum { NtGdiAnimatePalette,
1
0
0
0
Zhiyi Zhang : kernel32/tests: Check against INVALID_HANDLE_VALUE for CreateActCtxW() return values.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 9eff8911c3aa9ee066898b47e08a6ddc1b9f493b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9eff8911c3aa9ee066898b47…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Apr 12 16:04:14 2022 +0800 kernel32/tests: Check against INVALID_HANDLE_VALUE for CreateActCtxW() return values. CreateActCtxW() returns INVALID_HANDLE_VALUE on error. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/actctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index a91c46ddf89..ebe1bb86470 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -3650,7 +3650,7 @@ static void test_manifest_in_module(void) ctx.lpResourceName = (LPWSTR)124; ctx.hModule = GetModuleHandleW(NULL); handle = CreateActCtxW(&ctx); - ok(handle != 0, "CreateActCtx error %lu\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError()); test_basic_info(handle, __LINE__); test_detailed_info(handle, &detailed_info3, __LINE__);
1
0
0
0
Eric Pouech : oleaut32/tests: Simplify printf for 64 bit integers.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 4782bc3c1a4c8be6cf6140d50454e4a3378f677f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4782bc3c1a4c8be6cf6140d5…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Apr 12 09:59:56 2022 +0200 oleaut32/tests: Simplify printf for 64 bit integers. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/typelib.c | 11 +++++------ dlls/oleaut32/tests/vartest.c | 34 ++++++++++++++++------------------ dlls/oleaut32/tests/vartype.c | 4 ++-- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index b273f72ac8d..2e926a5bc36 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -1194,9 +1194,8 @@ static double WINAPI double_func( double a0, float a1, double a2, int a3 ) static LONGLONG WINAPI longlong_func( LONGLONG a0, CY a1 ) { - ok( a0 == 0xdead00000000beefll, "wrong arg0 %08lx%08lx\n", (DWORD)(a0 >> 32), (DWORD)a0); - ok( a1.int64 == ((ULONGLONG)10000 * 12345678), "wrong arg1 %08lx%08lx\n", - (DWORD)(a1.int64 >> 32), (DWORD)a1.int64 ); + ok( a0 == 0xdead00000000beefll, "wrong arg0 %#I64x\n", a0); + ok( a1.int64 == ((ULONGLONG)10000 * 12345678), "wrong arg1 %#I64x\n", a1.int64 ); return ((ULONGLONG)4321 << 32) | 8765; } @@ -1208,7 +1207,7 @@ static VARIANT WINAPI variant_func( int a0, BOOL a1, DECIMAL a2, VARIANT a3 ) V_VT(&var) = VT_LPWSTR; V_UI4(&var) = 0xbabe; ok( a2.Hi32 == 1122, "wrong arg2.Hi32 %lx\n", a2.Hi32 ); - ok( U1(a2).Lo64 == 3344, "wrong arg2.Lo64 %08lx%08lx\n", (DWORD)(U1(a2).Lo64 >> 32), (DWORD)U1(a2).Lo64 ); + ok( U1(a2).Lo64 == 3344, "wrong arg2.Lo64 %#I64x\n", U1(a2).Lo64 ); ok( V_VT(&a3) == VT_EMPTY, "wrong arg3 type %x\n", V_VT(&a3) ); ok( V_UI4(&a3) == 0xdeadbeef, "wrong arg3 value %lx\n", V_UI4(&a3) ); return var; @@ -1389,8 +1388,8 @@ static void test_DispCallFunc(void) if (res == S_OK) { ok( V_VT(&result) == VT_I8, "wrong result type %d\n", V_VT(&result) ); - ok( V_I8(&result) == (((ULONGLONG)4321 << 32) | 8765), "wrong result %08lx%08lx\n", - (DWORD)(V_I8(&result) >> 32), (DWORD)V_I8(&result) ); + ok( V_I8(&result) == (((ULONGLONG)4321 << 32) | 8765), "wrong result %#I64x\n", + V_I8(&result) ); } memset( args, 0x55, sizeof(args) ); diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index b6ccc083ad4..9456b56eb26 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -558,9 +558,9 @@ static const char *variantstr( const VARIANT *var ) case VT_INT: sprintf( vtstr_buffer[vtstr_current], "VT_INT(%d)", V_INT(var) ); break; case VT_I8: - sprintf( vtstr_buffer[vtstr_current], "VT_I8(%x%08x)", (UINT)(V_I8(var) >> 32), (UINT)V_I8(var) ); break; + sprintf( vtstr_buffer[vtstr_current], "VT_I8(%I64x)", V_I8(var) ); break; case VT_UI8: - sprintf( vtstr_buffer[vtstr_current], "VT_UI8(%x%08x)", (UINT)(V_UI8(var) >> 32), (UINT)V_UI8(var) ); break; + sprintf( vtstr_buffer[vtstr_current], "VT_UI8(%I64x)", V_UI8(var) ); break; case VT_R4: sprintf( vtstr_buffer[vtstr_current], "VT_R4(%g)", V_R4(var) ); break; case VT_R8: @@ -2515,19 +2515,17 @@ static const char *szFailOk = "Call failed, hres = %08x\n"; #define EXPECT_UI4(val) EXPECT_OK { EXPECT_TYPE(VT_UI4); \ ok(V_UI4(&vOut) == val, "Expected ui4 = %d, got %d\n", (ULONG)val, V_UI4(&vOut)); } #define EXPECT_I8(val) EXPECT_OK { EXPECT_TYPE(VT_I8); \ - ok(V_I8(&vOut) == val, "Expected i8 = %lx%08lx, got %lx%08lx\n", \ - (LONG)(val >> 32), (LONG)(val), (LONG)(V_I8(&vOut)>>32), (LONG)V_I8(&vOut) ); } + ok(V_I8(&vOut) == val, "Expected i8 = %#I64x, got %#I64x\n", (LONG64)val, V_I8(&vOut)); } #define EXPECT_UI8(val) EXPECT_OK { EXPECT_TYPE(VT_UI8); \ - ok(V_UI8(&vOut) == val, "Expected ui8 = 0x%x%08x, got 0x%x%08x\n", \ - (DWORD)((ULONG64)val >> 32), (DWORD)(ULONG64)val, (DWORD)(V_UI8(&vOut) >> 32), (DWORD)V_UI8(&vOut)); } + ok(V_UI8(&vOut) == val, "Expected ui8 = %#I64x, got %#I64x\n", (ULONG64)val, V_UI8(&vOut); } #define EXPECT_R4(val) EXPECT_OK { EXPECT_TYPE(VT_R4); \ ok(V_R4(&vOut) == val, "Expected r4 = %f, got %f\n", val, V_R4(&vOut)); } #define EXPECT_R8(val) EXPECT_OK { EXPECT_TYPE(VT_R8); \ ok(V_R8(&vOut) == val, "Expected r8 = %g, got %g\n", val, V_R8(&vOut)); } #define CY_MULTIPLIER 10000 #define EXPECT_CY(val) EXPECT_OK { EXPECT_TYPE(VT_CY); \ - ok(V_CY(&vOut).int64 == (LONG64)(val * CY_MULTIPLIER), "Expected r8 = 0x%lx%08lx, got 0x%lx%08lx\n", \ - (DWORD)((LONG64)val >> 23), (DWORD)(LONG64)val, (DWORD)(V_CY(&vOut).int64 >>32), (DWORD)V_CY(&vOut).int64); } + ok(V_CY(&vOut).int64 == (LONG64)(val * CY_MULTIPLIER), "Expected r8 = %#I64x, got %#I64x\n", \ + (LONG64)val, V_CY(&vOut).int64); } #define EXPECT_DECIMAL(valHi, valMid, valLo) EXPECT_OK { EXPECT_TYPE(VT_DECIMAL); \ ok((V_DECIMAL(&vOut).Hi32 == valHi) && (S1(U1(V_DECIMAL(&vOut))).Mid32 == valMid) && \ (S1(U1(V_DECIMAL(&vOut))).Lo32 == valLo), \ @@ -4221,8 +4219,8 @@ static void test_VarInt(void) pcy->int64 = -11000; hres = pVarInt(&v,&vDst); ok(hres == S_OK && V_VT(&vDst) == VT_CY && V_CY(&vDst).int64 == -20000, - "VarInt: VT_CY wrong, hres=0x%lX 0x%lx%08lx\n", - hres, (DWORD)(V_CY(&vDst).int64 >> 32), (DWORD)V_CY(&vDst).int64); + "VarInt: VT_CY wrong, hres=%#lX %#I64x\n", + hres, V_CY(&vDst).int64); } static HRESULT (WINAPI *pVarNeg)(LPVARIANT,LPVARIANT); @@ -9315,8 +9313,8 @@ static void test_VarIdiv(void) "VARIDIV: expected coerced hres 0x%lX type VT_I8, got hres 0x%lX type %s!\n", S_OK, hres, vtstr(V_VT(&result))); ok(hres == S_OK && V_I8(&result) == 5000, - "VARIDIV: CY value 0x%lx%08lx, expected 0x%x\n", - (DWORD)(V_I8(&result) >>32), (DWORD)V_I8(&result), 5000); + "VARIDIV: CY value %#I64x, expected %#x\n", + V_I8(&result), 5000); } hres = pVarIdiv(&left, &cy, &result); @@ -9347,8 +9345,8 @@ static void test_VarIdiv(void) "VARIDIV: expected coerced hres 0x%lX type VT_I8, got hres 0x%lX type %s!\n", S_OK, hres, vtstr(V_VT(&result))); ok(hres == S_OK && V_I8(&result) == 1, - "VARIDIV: DECIMAL value 0x%lx%08lx, expected %d\n", - (DWORD)(V_I8(&result) >> 32), (DWORD)V_I8(&result), 1); + "VARIDIV: DECIMAL value %I64d, expected %d\n", + V_I8(&result), 1); } /* Check for division by zero */ @@ -9895,8 +9893,8 @@ static void test_VarImp(void) "VARIMP: expected coerced hres 0x%lX type VT_I8, got hres 0x%lX type %s!\n", S_OK, hres, vtstr(V_VT(&result))); ok(hres == S_OK && V_I8(&result) == -2, - "VARIMP: CY value %lx%08lx, expected %d\n", - (DWORD)((V_I8(&result)) >> 32), (DWORD)(V_I8(&result)), -2); + "VARIMP: CY value %I64d, expected %d\n", + V_I8(&result), -2); } hres = pVarImp(&left, &cy, &result); @@ -9927,8 +9925,8 @@ static void test_VarImp(void) "VARIMP: expected coerced hres 0x%lX type VT_I8, got hres 0x%lX type %s!\n", S_OK, hres, vtstr(V_VT(&result))); ok(hres == S_OK && V_I8(&result) == -3, - "VARIMP: DECIMAL value 0x%lx%08lx, expected %d\n", - (DWORD)(V_I8(&result) >>32), (DWORD)V_I8(&result), -3); + "VARIMP: DECIMAL value %#I64x, expected %d\n", + V_I8(&result), -3); } SysFreeString(false_str); diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c index 78b50e6bcdb..c5137572d9d 100644 --- a/dlls/oleaut32/tests/vartype.c +++ b/dlls/oleaut32/tests/vartype.c @@ -3618,8 +3618,8 @@ static void test_VarCyInt(void) #define EXPECTDEC(scl, sgn, hi, lo) ok(hres == S_OK && \ S(U(out)).scale == (BYTE)(scl) && S(U(out)).sign == (BYTE)(sgn) && \ out.Hi32 == (ULONG)(hi) && U1(out).Lo64 == (ULONG64)(lo), \ - "expected (%d,%d,%d,(%lx %lx)), got (%d,%d,%ld,(%lx %lx)) hres 0x%08lx\n", \ - scl, sgn, hi, (LONG)((LONG64)(lo) >> 32), (LONG)((lo) & 0xffffffff), S(U(out)).scale, \ + "expected (%d,%d,%d,%I64x), got (%d,%d,%ld,(%lx %lx)) hres 0x%08lx\n", \ + scl, sgn, hi, (LONG64)(lo), S(U(out)).scale, \ S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres) #define EXPECTDEC64(scl, sgn, hi, mid, lo) ok(hres == S_OK && \
1
0
0
0
Eric Pouech : oleaut32/tests: Simplify test by using long long constants.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: f438e285d3301519702704167ea5fd64a0e8b19b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f438e285d330151970270416…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Apr 12 09:59:48 2022 +0200 oleaut32/tests: Simplify test by using long long constants. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/tmarshal.c | 25 ++++++++++--------------- dlls/oleaut32/tests/typelib.c | 4 ++-- dlls/oleaut32/tests/vartest.c | 12 ++++++------ 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c index a61b1637c5e..53861870e78 100644 --- a/dlls/oleaut32/tests/tmarshal.c +++ b/dlls/oleaut32/tests/tmarshal.c @@ -39,21 +39,18 @@ static inline void release_iface_(unsigned int line, void *iface) } #define release_iface(a) release_iface_(__LINE__, a) -/* ULL suffix is not portable */ -#define ULL_CONST(dw1, dw2) ((((ULONGLONG)dw1) << 32) | (ULONGLONG)dw2) - static const WCHAR test_bstr1[] = {'f','o','o',0,'b','a','r'}; static const WCHAR test_bstr2[] = {'t','e','s','t',0}; static const WCHAR test_bstr3[] = {'q','u','x',0}; static const WCHAR test_bstr4[] = {'a','b','c',0}; -static const MYSTRUCT test_mystruct1 = {0x12345678, ULL_CONST(0xdeadbeef, 0x98765432), {0,1,2,3,4,5,6,7}}; -static const MYSTRUCT test_mystruct2 = {0x91827364, ULL_CONST(0x88776655, 0x44332211), {3,6,1,4,0,1,3,0}}; -static const MYSTRUCT test_mystruct3 = {0x1a1b1c1d, ULL_CONST(0x1e1f1011, 0x12131415), {9,2,4,5,6,5,1,3}}; -static const MYSTRUCT test_mystruct4 = {0x2a2b2c2d, ULL_CONST(0x2e2f2021, 0x22232425), {0,4,6,7,3,6,7,4}}; -static const MYSTRUCT test_mystruct5 = {0x3a3b3c3d, ULL_CONST(0x3e3f3031, 0x32333435), {1,6,7,3,8,4,6,5}}; -static const MYSTRUCT test_mystruct6 = {0x4a4b4c4d, ULL_CONST(0x4e4f4041, 0x42434445), {3,6,5,3,4,8,0,9}}; -static const MYSTRUCT test_mystruct7 = {0x5a5b5c5d, ULL_CONST(0x5e5f5051, 0x52535455), {1,8,4,4,4,2,3,1}}; +static const MYSTRUCT test_mystruct1 = {0x12345678, 0xdeadbeef98765432ull, {0,1,2,3,4,5,6,7}}; +static const MYSTRUCT test_mystruct2 = {0x91827364, 0x8877665544332211ull, {3,6,1,4,0,1,3,0}}; +static const MYSTRUCT test_mystruct3 = {0x1a1b1c1d, 0x1e1f101112131415ull, {9,2,4,5,6,5,1,3}}; +static const MYSTRUCT test_mystruct4 = {0x2a2b2c2d, 0x2e2f202122232425ull, {0,4,6,7,3,6,7,4}}; +static const MYSTRUCT test_mystruct5 = {0x3a3b3c3d, 0x3e3f303132333435ull, {1,6,7,3,8,4,6,5}}; +static const MYSTRUCT test_mystruct6 = {0x4a4b4c4d, 0x4e4f404142434445ull, {3,6,5,3,4,8,0,9}}; +static const MYSTRUCT test_mystruct7 = {0x5a5b5c5d, 0x5e5f505152535455ull, {1,8,4,4,4,2,3,1}}; static const struct thin test_thin_struct = {-456, 78}; @@ -1134,7 +1131,7 @@ static HRESULT WINAPI Widget_basetypes_out(IWidget *iface, signed char *c, short *uc = 254; *us = 256; *ul = 0xf00dfade; - *uh = (((ULONGLONG)0xabcdef01) << 32) | (ULONGLONG)0x23456789; + *uh = 0xabcdef0123456789ull; *f = M_LN2; *d = M_LN10; *st = STATE_UNWIDGETIFIED; @@ -2033,8 +2030,7 @@ static void test_marshal_basetypes(IWidget *widget, IDispatch *disp) ok(uc == 254, "Got unsigned char %u.\n", uc); ok(us == 256, "Got unsigned short %u.\n", us); ok(ul == 0xf00dfade, "Got unsigned int %li.\n", ul); - ok(uh == ((((ULONGLONG)0xabcdef01) << 32) | (ULONGLONG)0x23456789), - "Got unsigned hyper %s.\n", wine_dbgstr_longlong(uh)); + ok(uh == 0xabcdef0123456789ull, "Got unsigned hyper %s.\n", wine_dbgstr_longlong(uh)); ok(f == (float)M_LN2, "Got float %f.\n", f); ok(d == M_LN10, "Got double %f.\n", d); ok(st == STATE_UNWIDGETIFIED, "Got state %u.\n", st); @@ -2050,8 +2046,7 @@ static void test_marshal_basetypes(IWidget *widget, IDispatch *disp) ok(uc == 254, "Got unsigned char %u.\n", uc); ok(us == 256, "Got unsigned short %u.\n", us); ok(ul == 0xf00dfade, "Got unsigned int %li.\n", ul); - ok(uh == ((((ULONGLONG)0xabcdef01) << 32) | (ULONGLONG)0x23456789), - "Got unsigned hyper %s.\n", wine_dbgstr_longlong(uh)); + ok(uh == 0xabcdef0123456789ull, "Got unsigned hyper %s.\n", wine_dbgstr_longlong(uh)); ok(f == (float)M_LN2, "Got float %f.\n", f); ok(d == M_LN10, "Got double %f.\n", d); ok(st == STATE_UNWIDGETIFIED, "Got state %u.\n", st); diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index 44d5b26cbc4..b273f72ac8d 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -1194,7 +1194,7 @@ static double WINAPI double_func( double a0, float a1, double a2, int a3 ) static LONGLONG WINAPI longlong_func( LONGLONG a0, CY a1 ) { - ok( a0 == (((ULONGLONG)0xdead << 32) | 0xbeef), "wrong arg0 %08lx%08lx\n", (DWORD)(a0 >> 32), (DWORD)a0); + ok( a0 == 0xdead00000000beefll, "wrong arg0 %08lx%08lx\n", (DWORD)(a0 >> 32), (DWORD)a0); ok( a1.int64 == ((ULONGLONG)10000 * 12345678), "wrong arg1 %08lx%08lx\n", (DWORD)(a1.int64 >> 32), (DWORD)a1.int64 ); return ((ULONGLONG)4321 << 32) | 8765; @@ -1379,7 +1379,7 @@ static void test_DispCallFunc(void) memset( args, 0x55, sizeof(args) ); types[0] = VT_I8; - V_I8(&args[0]) = ((ULONGLONG)0xdead << 32) | 0xbeef; + V_I8(&args[0]) = 0xdead00000000beefll; types[1] = VT_CY; V_CY(&args[1]).int64 = (ULONGLONG)10000 * 12345678; memset( &result, 0xcc, sizeof(result) ); diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index db0562e2d03..b6ccc083ad4 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -2514,9 +2514,9 @@ static const char *szFailOk = "Call failed, hres = %08x\n"; ok(V_I4(&vOut) == val, "Expected i4 = %ld, got %ld\n", (LONG)val, V_I4(&vOut)); } #define EXPECT_UI4(val) EXPECT_OK { EXPECT_TYPE(VT_UI4); \ ok(V_UI4(&vOut) == val, "Expected ui4 = %d, got %d\n", (ULONG)val, V_UI4(&vOut)); } -#define EXPECT_I8(high,low) EXPECT_OK { EXPECT_TYPE(VT_I8); \ - ok(V_I8(&vOut) == ((((ULONG64)(high))<<32)|(low)), "Expected i8 = %lx%08lx, got %lx%08lx\n", \ - (LONG)(high), (LONG)(low), (LONG)(V_I8(&vOut)>>32), (LONG)V_I8(&vOut) ); } +#define EXPECT_I8(val) EXPECT_OK { EXPECT_TYPE(VT_I8); \ + ok(V_I8(&vOut) == val, "Expected i8 = %lx%08lx, got %lx%08lx\n", \ + (LONG)(val >> 32), (LONG)(val), (LONG)(V_I8(&vOut)>>32), (LONG)V_I8(&vOut) ); } #define EXPECT_UI8(val) EXPECT_OK { EXPECT_TYPE(VT_UI8); \ ok(V_UI8(&vOut) == val, "Expected ui8 = 0x%x%08x, got 0x%x%08x\n", \ (DWORD)((ULONG64)val >> 32), (DWORD)(ULONG64)val, (DWORD)(V_UI8(&vOut) >> 32), (DWORD)V_UI8(&vOut)); } @@ -2615,7 +2615,7 @@ static void test_VarNumFromParseNum(void) /* We cannot use INTEGER_VTBITS as WinXP and Win2003 are broken(?). They truncate the number to the smallest integer size requested: CONVERT(16,0,0,16,4,0, INTEGER_VTBITS); EXPECT_I1((signed char)0xff); */ - CONVERT(16,0,0,16,4,0, VTBIT_I8); EXPECT_I8(0x7fffffff,0xffffffff); + CONVERT(16,0,0,16,4,0, VTBIT_I8); EXPECT_I8(0x7fffffffffffffffull); } /* Assume the above pattern holds for numbers without hi-bit set, test (preservation of) hi-bit */ @@ -2642,7 +2642,7 @@ static void test_VarNumFromParseNum(void) truncate the number to the smallest integer size requested: CONVERT(16,0,0,16,4,0, INTEGER_VTBITS & ~VTBIT_I1); EXPECT_I2((signed short)0x0002); */ - CONVERT(16,0,0,16,4,0, VTBIT_I8); EXPECT_I8(0x80000000,0x00000002); + CONVERT(16,0,0,16,4,0, VTBIT_I8); EXPECT_I8(0x8000000000000002ull); } /* Test (preservation of) hi-bit with STRICT type requesting */ @@ -2665,7 +2665,7 @@ static void test_VarNumFromParseNum(void) SETRGB(12, 0); SETRGB(13, 0); SETRGB(14, 0); SETRGB(15, 2); if (has_i8) { - CONVERT(16,0,0,16,4,0, VTBIT_I8); EXPECT_I8(0x80000000,0x00000002); + CONVERT(16,0,0,16,4,0, VTBIT_I8); EXPECT_I8(0x8000000000000002ull); } /* Assume the above pattern holds for numbers with hi-bit set */
1
0
0
0
Hans Leidekker : crypt32/tests: Get rid of workarounds for old Windows versions.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 21f82ad4ff990fdaa53602e246730f505836205e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=21f82ad4ff990fdaa53602e2…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Apr 12 09:51:51 2022 +0200 crypt32/tests: Get rid of workarounds for old Windows versions. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/tests/cert.c | 418 ++++--------- dlls/crypt32/tests/chain.c | 166 ++--- dlls/crypt32/tests/crl.c | 197 +++--- dlls/crypt32/tests/ctl.c | 52 +- dlls/crypt32/tests/encode.c | 1235 ++++++++++++++++---------------------- dlls/crypt32/tests/message.c | 117 ++-- dlls/crypt32/tests/msg.c | 758 +++++++++-------------- dlls/crypt32/tests/object.c | 37 +- dlls/crypt32/tests/oid.c | 155 ++--- dlls/crypt32/tests/protectdata.c | 76 +-- dlls/crypt32/tests/sip.c | 37 +- dlls/crypt32/tests/store.c | 15 +- dlls/crypt32/tests/str.c | 210 +++---- 13 files changed, 1268 insertions(+), 2205 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=21f82ad4ff990fdaa536…
1
0
0
0
Huw Davies : wineoss: Move create_stream and release_stream to the unixlib.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: bc81fdbf7c513fea4cfe0597fc1f56da3281b93b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bc81fdbf7c513fea4cfe0597…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Apr 12 07:59:04 2022 +0100 wineoss: Move create_stream and release_stream to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/mmdevdrv.c | 300 +++++--------------------------------------- dlls/wineoss.drv/oss.c | 139 ++++++++++++++++++++ dlls/wineoss.drv/unixlib.h | 21 ++++ 3 files changed, 191 insertions(+), 269 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=bc81fdbf7c513fea4cfe…
1
0
0
0
Huw Davies : wineoss: Use NtAllocateVirtualMemory() to alloc the buffers returned to the user.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 0562266783b62f33912fe379b565be78a9af4e4a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0562266783b62f33912fe379…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Apr 12 07:59:03 2022 +0100 wineoss: Use NtAllocateVirtualMemory() to alloc the buffers returned to the user. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/mmdevdrv.c | 51 ++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 2fd2e3c08ad..56b188424fb 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -551,9 +551,16 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) } HeapFree(GetProcessHeap(), 0, This->vols); if(stream){ + SIZE_T size; close(stream->fd); - HeapFree(GetProcessHeap(), 0, stream->local_buffer); - HeapFree(GetProcessHeap(), 0, stream->tmp_buffer); + if(stream->local_buffer){ + size = 0; + NtFreeVirtualMemory(GetCurrentProcess(), (void **)&stream->local_buffer, &size, MEM_RELEASE); + } + if(stream->tmp_buffer){ + size = 0; + NtFreeVirtualMemory(GetCurrentProcess(), (void **)&stream->tmp_buffer, &size, MEM_RELEASE); + } CoTaskMemFree(stream->fmt); pthread_mutex_destroy(&stream->lock); HeapFree(GetProcessHeap(), 0, stream); @@ -855,6 +862,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, ACImpl *This = impl_from_IAudioClient3(iface); struct oss_stream *stream; oss_audioinfo ai; + SIZE_T size; int i; HRESULT hr; @@ -963,9 +971,9 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, stream->bufsize_frames = MulDiv(duration, fmt->nSamplesPerSec, 10000000); if(mode == AUDCLNT_SHAREMODE_EXCLUSIVE) stream->bufsize_frames -= stream->bufsize_frames % stream->period_frames; - stream->local_buffer = HeapAlloc(GetProcessHeap(), 0, - stream->bufsize_frames * fmt->nBlockAlign); - if(!stream->local_buffer){ + size = stream->bufsize_frames * fmt->nBlockAlign; + if(NtAllocateVirtualMemory(GetCurrentProcess(), (void **)&stream->local_buffer, 0, &size, + MEM_COMMIT, PAGE_READWRITE)){ hr = E_OUTOFMEMORY; goto exit; } @@ -992,7 +1000,10 @@ exit: This->vols = NULL; CoTaskMemFree(stream->fmt); if(stream->fd >= 0) close(stream->fd); - HeapFree(GetProcessHeap(), 0, stream->local_buffer); + if(stream->local_buffer){ + size = 0; + NtFreeVirtualMemory(GetCurrentProcess(), (void **)&stream->local_buffer, &size, MEM_RELEASE); + } pthread_mutex_destroy(&stream->lock); HeapFree(GetProcessHeap(), 0, stream); } else { @@ -1707,6 +1718,7 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, ACImpl *This = impl_from_IAudioRenderClient(iface); struct oss_stream *stream = This->stream; UINT32 write_pos; + SIZE_T size; TRACE("(%p)->(%u, %p)\n", This, frames, data); @@ -1736,10 +1748,15 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, (stream->lcl_offs_frames + stream->held_frames) % stream->bufsize_frames; if(write_pos + frames > stream->bufsize_frames){ if(stream->tmp_buffer_frames < frames){ - HeapFree(GetProcessHeap(), 0, stream->tmp_buffer); - stream->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, - frames * stream->fmt->nBlockAlign); - if(!stream->tmp_buffer){ + if(stream->tmp_buffer){ + size = 0; + NtFreeVirtualMemory(GetCurrentProcess(), (void **)&stream->tmp_buffer, &size, MEM_RELEASE); + stream->tmp_buffer = NULL; + } + size = frames * stream->fmt->nBlockAlign; + if(NtAllocateVirtualMemory(GetCurrentProcess(), (void **)&stream->tmp_buffer, 0, &size, + MEM_COMMIT, PAGE_READWRITE)){ + stream->tmp_buffer_frames = 0; oss_unlock(stream); return E_OUTOFMEMORY; } @@ -1875,6 +1892,7 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface, { ACImpl *This = impl_from_IAudioCaptureClient(iface); struct oss_stream *stream = This->stream; + SIZE_T size; TRACE("(%p)->(%p, %p, %p, %p, %p)\n", This, data, frames, flags, devpos, qpcpos); @@ -1907,10 +1925,15 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface, if(stream->lcl_offs_frames + *frames > stream->bufsize_frames){ UINT32 chunk_bytes, offs_bytes, frames_bytes; if(stream->tmp_buffer_frames < *frames){ - HeapFree(GetProcessHeap(), 0, stream->tmp_buffer); - stream->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, - *frames * stream->fmt->nBlockAlign); - if(!stream->tmp_buffer){ + if(stream->tmp_buffer){ + size = 0; + NtFreeVirtualMemory(GetCurrentProcess(), (void **)&stream->tmp_buffer, &size, MEM_RELEASE); + stream->tmp_buffer = NULL; + } + size = *frames * stream->fmt->nBlockAlign; + if(NtAllocateVirtualMemory(GetCurrentProcess(), (void **)&stream->tmp_buffer, 0, &size, + MEM_COMMIT, PAGE_READWRITE)){ + stream->tmp_buffer_frames = 0; oss_unlock(stream); return E_OUTOFMEMORY; }
1
0
0
0
Huw Davies : wineoss: Use a pthread mutex for the stream lock.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: e0ec4f8c197c5dd07b5e80a5eba8c1ee83c50cc4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e0ec4f8c197c5dd07b5e80a5…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Apr 12 07:59:02 2022 +0100 wineoss: Use a pthread mutex for the stream lock. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/mmdevdrv.c | 167 +++++++++++++++++++++----------------------- dlls/wineoss.drv/unixlib.h | 2 + 2 files changed, 83 insertions(+), 86 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e0ec4f8c197c5dd07b5e…
1
0
0
0
← Newer
1
...
61
62
63
64
65
66
67
...
103
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
101
102
103
Results per page:
10
25
50
100
200