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 2021
----- 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
1030 discussions
Start a n
N
ew thread
Jacek Caban : gdi32: Directly use ntdll in dib.c.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: ac6458844af6e7dc2b57761a544677899762d3b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ac6458844af6e7dc2b57761a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 17 13:45:10 2021 +0200 gdi32: Directly use ntdll in dib.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/gdi32/dib.c | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index c5f6a41cb77..4d70e99a3c5 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -1531,33 +1531,40 @@ HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, con if (section) { - DWORD mapOffset; - INT mapSize; + LARGE_INTEGER map_offset; + SIZE_T map_size; - mapOffset = offset - (offset % system_info.AllocationGranularity); - mapSize = bmp->dib.dsBmih.biSizeImage + (offset - mapOffset); - mapBits = MapViewOfFile( section, FILE_MAP_ALL_ACCESS, 0, mapOffset, mapSize ); - if (mapBits) bmp->dib.dsBm.bmBits = (char *)mapBits + (offset - mapOffset); + map_offset.QuadPart = offset - (offset % system_info.AllocationGranularity); + map_size = bmp->dib.dsBmih.biSizeImage + (offset - map_offset.QuadPart); + if (NtMapViewOfSection( section, GetCurrentProcess(), &mapBits, 0, 0, &map_offset, + &map_size, ViewShare, 0, PAGE_READWRITE )) + goto error; + bmp->dib.dsBm.bmBits = (char *)mapBits + (offset - map_offset.QuadPart); } else { + SIZE_T size = bmp->dib.dsBmih.biSizeImage; offset = 0; - bmp->dib.dsBm.bmBits = VirtualAlloc( NULL, bmp->dib.dsBmih.biSizeImage, - MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE ); + if (NtAllocateVirtualMemory( GetCurrentProcess(), &bmp->dib.dsBm.bmBits, 0, &size, + MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE )) + goto error; } bmp->dib.dshSection = section; bmp->dib.dsOffset = offset; - if (!bmp->dib.dsBm.bmBits) goto error; - - if (!(ret = alloc_gdi_handle( &bmp->obj, NTGDI_OBJ_BITMAP, &dib_funcs ))) goto error; - - if (bits) *bits = bmp->dib.dsBm.bmBits; - return ret; + if ((ret = alloc_gdi_handle( &bmp->obj, NTGDI_OBJ_BITMAP, &dib_funcs ))) + { + if (bits) *bits = bmp->dib.dsBm.bmBits; + return ret; + } + if (section) NtUnmapViewOfSection( GetCurrentProcess(), mapBits ); + else + { + SIZE_T size = 0; + NtFreeVirtualMemory( GetCurrentProcess(), &bmp->dib.dsBm.bmBits, &size, MEM_RELEASE ); + } error: - if (section) UnmapViewOfFile( mapBits ); - else VirtualFree( bmp->dib.dsBm.bmBits, 0, MEM_RELEASE ); HeapFree( GetProcessHeap(), 0, bmp->color_table ); HeapFree( GetProcessHeap(), 0, bmp ); return 0; @@ -1739,10 +1746,14 @@ static BOOL DIB_DeleteObject( HGDIOBJ handle ) if (bmp->dib.dshSection) { - UnmapViewOfFile( (char *)bmp->dib.dsBm.bmBits - - (bmp->dib.dsOffset % system_info.AllocationGranularity) ); + NtUnmapViewOfSection( GetCurrentProcess(), (char *)bmp->dib.dsBm.bmBits - + (bmp->dib.dsOffset % system_info.AllocationGranularity) ); + } + else + { + SIZE_T size = 0; + NtFreeVirtualMemory( GetCurrentProcess(), &bmp->dib.dsBm.bmBits, &size, MEM_RELEASE ); } - else VirtualFree( bmp->dib.dsBm.bmBits, 0, MEM_RELEASE ); HeapFree(GetProcessHeap(), 0, bmp->color_table); HeapFree( GetProcessHeap(), 0, bmp );
1
0
0
0
Jacek Caban : gdi32: Use NtQuerySystemInformation instead of GetSystemInfo.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 82f29bff475b31175919762d27b30f8f4fceef67 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82f29bff475b31175919762d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 17 13:44:50 2021 +0200 gdi32: Use NtQuerySystemInformation instead of GetSystemInfo. 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/gdi32/dib.c | 8 ++------ dlls/gdi32/gdiobj.c | 2 ++ dlls/gdi32/ntgdi_private.h | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index db517b89745..c5f6a41cb77 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -1531,12 +1531,10 @@ HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, con if (section) { - SYSTEM_INFO SystemInfo; DWORD mapOffset; INT mapSize; - GetSystemInfo( &SystemInfo ); - mapOffset = offset - (offset % SystemInfo.dwAllocationGranularity); + mapOffset = offset - (offset % system_info.AllocationGranularity); mapSize = bmp->dib.dsBmih.biSizeImage + (offset - mapOffset); mapBits = MapViewOfFile( section, FILE_MAP_ALL_ACCESS, 0, mapOffset, mapSize ); if (mapBits) bmp->dib.dsBm.bmBits = (char *)mapBits + (offset - mapOffset); @@ -1741,10 +1739,8 @@ static BOOL DIB_DeleteObject( HGDIOBJ handle ) if (bmp->dib.dshSection) { - SYSTEM_INFO SystemInfo; - GetSystemInfo( &SystemInfo ); UnmapViewOfFile( (char *)bmp->dib.dsBm.bmBits - - (bmp->dib.dsOffset % SystemInfo.dwAllocationGranularity) ); + (bmp->dib.dsOffset % system_info.AllocationGranularity) ); } else VirtualFree( bmp->dib.dsBm.bmBits, 0, MEM_RELEASE ); diff --git a/dlls/gdi32/gdiobj.c b/dlls/gdi32/gdiobj.c index 917d1c91f01..2a245b4596f 100644 --- a/dlls/gdi32/gdiobj.c +++ b/dlls/gdi32/gdiobj.c @@ -43,6 +43,7 @@ static GDI_HANDLE_ENTRY *next_free; static GDI_HANDLE_ENTRY *next_unused = gdi_shared.Handles + FIRST_GDI_HANDLE; static LONG debug_count; HMODULE gdi32_module = 0; +SYSTEM_BASIC_INFORMATION system_info; static inline HGDIOBJ entry_to_handle( GDI_HANDLE_ENTRY *entry ) { @@ -702,6 +703,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) gdi32_module = inst; DisableThreadLibraryCalls( inst ); + NtQuerySystemInformation( SystemBasicInformation, &system_info, sizeof(system_info), NULL ); set_gdi_shared(); font_init(); init_stock_objects(); diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h index 8e122dec6a0..afdbad24f4a 100644 --- a/dlls/gdi32/ntgdi_private.h +++ b/dlls/gdi32/ntgdi_private.h @@ -648,5 +648,6 @@ extern void CDECL free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN; void set_gdi_client_ptr( HGDIOBJ handle, void *ptr ) DECLSPEC_HIDDEN; extern HMODULE gdi32_module DECLSPEC_HIDDEN; +extern SYSTEM_BASIC_INFORMATION system_info DECLSPEC_HIDDEN; #endif /* __WINE_NTGDI_PRIVATE_H */
1
0
0
0
Jacek Caban : gdi32: Avoid calling gdi32 functions from ntgdi functions.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 57460dbb5859f1f6285707829d29fe88c73eb978 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57460dbb5859f1f628570782…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 17 13:44:30 2021 +0200 gdi32: Avoid calling gdi32 functions from ntgdi functions. 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/gdi32/clipping.c | 8 ++++---- dlls/gdi32/dib.c | 4 ++-- dlls/gdi32/driver.c | 2 +- dlls/gdi32/palette.c | 2 +- dlls/gdi32/path.c | 10 +++++----- dlls/gdi32/region.c | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 598f738cad1..4fefa834b58 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -133,7 +133,7 @@ static inline void create_default_clip_region( DC * dc ) rect.right = NtGdiGetDeviceCaps( dc->hSelf, DESKTOPHORZRES ); rect.bottom = NtGdiGetDeviceCaps( dc->hSelf, DESKTOPVERTRES ); } - dc->hClipRgn = CreateRectRgnIndirect( &rect ); + dc->hClipRgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom ); } @@ -265,7 +265,7 @@ INT WINAPI NtGdiExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bott rect = get_clip_rect( dc, left, top, right, bottom ); - if ((rgn = CreateRectRgnIndirect( &rect ))) + if ((rgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom ))) { if (!dc->hClipRgn) create_default_clip_region( dc ); ret = NtGdiCombineRgn( dc->hClipRgn, dc->hClipRgn, rgn, RGN_DIFF ); @@ -293,10 +293,10 @@ INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bo rect = get_clip_rect( dc, left, top, right, bottom ); if (!dc->hClipRgn) { - if ((dc->hClipRgn = CreateRectRgnIndirect( &rect ))) + if ((dc->hClipRgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom ))) ret = SIMPLEREGION; } - else if ((rgn = CreateRectRgnIndirect( &rect ))) + else if ((rgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom ))) { ret = NtGdiCombineRgn( dc->hClipRgn, dc->hClipRgn, rgn, RGN_AND ); NtGdiDeleteObjectApp( rgn ); diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 9f10f479c2f..db517b89745 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -936,8 +936,8 @@ UINT set_dib_dc_color_table( HDC hdc, UINT startpos, UINT entries, const RGBQUAD if (result) /* update colors of selected objects */ { - SetTextColor( hdc, dc->attr->text_color ); - SetBkColor( hdc, dc->attr->background_color ); + NtGdiGetAndSetDCDword( hdc, NtGdiSetTextColor, dc->attr->text_color, NULL ); + NtGdiGetAndSetDCDword( hdc, NtGdiSetBkColor, dc->attr->background_color, NULL ); NtGdiSelectPen( hdc, dc->hPen ); NtGdiSelectBrush( hdc, dc->hBrush ); } diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 75f82fbabe7..ac1a64016a1 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -608,7 +608,7 @@ static INT CDECL nulldrv_GetTextFace( PHYSDEV dev, INT size, LPWSTR name ) LOGFONTW font; DC *dc = get_nulldrv_dc( dev ); - if (GetObjectW( dc->hFont, sizeof(font), &font )) + if (NtGdiExtGetObjectW( dc->hFont, sizeof(font), &font )) { ret = lstrlenW( font.lfFaceName ) + 1; if (name) diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c index 09959c6d398..2f3fc7dd215 100644 --- a/dlls/gdi32/palette.c +++ b/dlls/gdi32/palette.c @@ -158,7 +158,7 @@ HPALETTE WINAPI NtGdiCreateHalftonePalette( HDC hdc ) pal->palPalEntry[i].peBlue = entries[i].rgbBlue; pal->palPalEntry[i].peFlags = 0; } - return CreatePalette( pal ); + return NtGdiCreatePaletteInternal( pal, pal->palNumEntries ); } diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index cc6c6c714c2..9eb0c40665e 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -348,7 +348,7 @@ static HRGN path_to_region( const struct gdi_path *path, int mode ) if (i > pos + 1) counts[polygons++] = i - pos; assert( polygons <= path->count / 2 ); - hrgn = CreatePolyPolygonRgn( path->points, counts, polygons, mode ); + hrgn = create_polypolygon_region( path->points, counts, polygons, mode, NULL ); HeapFree( GetProcessHeap(), 0, counts ); return hrgn; } @@ -1535,7 +1535,7 @@ static BOOL CDECL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, con DWORD dwSize; void *outline; - dwSize = GetGlyphOutlineW(dev->hdc, str[idx], ggo_flags, &gm, 0, NULL, &identity); + dwSize = NtGdiGetGlyphOutline( dev->hdc, str[idx], ggo_flags, &gm, 0, NULL, &identity, FALSE ); if (dwSize == GDI_ERROR) continue; /* add outline only if char is printable */ @@ -1544,7 +1544,7 @@ static BOOL CDECL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, con outline = HeapAlloc(GetProcessHeap(), 0, dwSize); if (!outline) return FALSE; - GetGlyphOutlineW(dev->hdc, str[idx], ggo_flags, &gm, dwSize, outline, &identity); + NtGdiGetGlyphOutline( dev->hdc, str[idx], ggo_flags, &gm, dwSize, outline, &identity, FALSE ); PATH_add_outline(physdev, x + offset.x, y + offset.y, outline, dwSize); HeapFree(GetProcessHeap(), 0, outline); @@ -1618,14 +1618,14 @@ static struct gdi_path *PATH_WidenPath(DC *dc) BYTE *type; DWORD obj_type, joint, endcap, penType; - size = GetObjectW( dc->hPen, 0, NULL ); + size = NtGdiExtGetObjectW( dc->hPen, 0, NULL ); if (!size) { SetLastError(ERROR_CAN_NOT_COMPLETE); return NULL; } elp = HeapAlloc( GetProcessHeap(), 0, size ); - GetObjectW( dc->hPen, size, elp ); + NtGdiExtGetObjectW( dc->hPen, size, elp ); obj_type = get_gdi_object_type(dc->hPen); switch (obj_type) diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index 757efc0ac1a..44ac1744793 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -927,7 +927,7 @@ HRGN WINAPI NtGdiExtCreateRegion( const XFORM *xform, DWORD count, const RGNDATA pt[3].y = pCurRect->bottom; translate( pt, 4, xform ); - poly_hrgn = CreatePolyPolygonRgn( pt, &count, 1, WINDING ); + poly_hrgn = create_polypolygon_region( pt, &count, 1, WINDING, NULL ); NtGdiCombineRgn( hrgn, hrgn, poly_hrgn, RGN_OR ); NtGdiDeleteObjectApp( poly_hrgn ); }
1
0
0
0
Jacek Caban : gdi32: Access stretch mode directly from DC in NtGdiTransparentBlt.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 6b1cdd1b5ee0db822f350ffe95c7579f33a0a851 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6b1cdd1b5ee0db822f350ffe…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 17 13:44:16 2021 +0200 gdi32: Access stretch mode directly from DC in NtGdiTransparentBlt. 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/gdi32/bitblt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index 83ef949ec3f..cf56f39da4c 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -852,19 +852,22 @@ BOOL WINAPI NtGdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDes COLORREF oldForeground; int oldStretchMode; DIBSECTION dib; + DC *dc_src; if(widthDest < 0 || heightDest < 0 || widthSrc < 0 || heightSrc < 0) { TRACE("Cannot mirror\n"); return FALSE; } + if (!(dc_src = get_dc_ptr( hdcSrc ))) return FALSE; + NtGdiGetAndSetDCDword( hdcDest, NtGdiSetBkColor, RGB(255,255,255), &oldBackground ); NtGdiGetAndSetDCDword( hdcDest, NtGdiSetTextColor, RGB(0,0,0), &oldForeground ); /* Stretch bitmap */ - oldStretchMode = GetStretchBltMode(hdcSrc); - if(oldStretchMode == BLACKONWHITE || oldStretchMode == WHITEONBLACK) - SetStretchBltMode(hdcSrc, COLORONCOLOR); + oldStretchMode = dc_src->attr->stretch_blt_mode; + if (oldStretchMode == BLACKONWHITE || oldStretchMode == WHITEONBLACK) + dc_src->attr->stretch_blt_mode = COLORONCOLOR; hdcWork = NtGdiCreateCompatibleDC( hdcDest ); if ((get_gdi_object_type( hdcDest ) != NTGDI_OBJ_MEMDC || NtGdiExtGetObjectW( NtGdiGetDCObject( hdcDest, NTGDI_OBJ_SURF ), @@ -926,7 +929,8 @@ BOOL WINAPI NtGdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDes ret = TRUE; error: - SetStretchBltMode(hdcSrc, oldStretchMode); + dc_src->attr->stretch_blt_mode = oldStretchMode; + release_dc_ptr( dc_src ); NtGdiGetAndSetDCDword( hdcDest, NtGdiSetBkColor, oldBackground, NULL ); NtGdiGetAndSetDCDword( hdcDest, NtGdiSetTextColor, oldForeground, NULL ); if(hdcWork) {
1
0
0
0
Nikolay Sivov : mfplat/allocator: Reduce duplication by returning ready-to-queue structure from allocation helper.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 12f72681da3ab4a8499233fc4b9e244a1ea3f311 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=12f72681da3ab4a8499233fc…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 17 14:15:41 2021 +0300 mfplat/allocator: Reduce duplication by returning ready-to-queue structure from allocation helper. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/sample.c | 53 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c index d99e2b046a6..04c68c87199 100644 --- a/dlls/mfplat/sample.c +++ b/dlls/mfplat/sample.c @@ -1305,20 +1305,18 @@ static void sample_allocator_release_surface_service(struct sample_allocator *al } static HRESULT sample_allocator_allocate_sample(struct sample_allocator *allocator, const struct surface_service *service, - IMFSample **sample) + struct queued_sample **queued_sample) { - struct queued_sample *queued_sample = malloc(sizeof(*queued_sample)); IMFTrackedSample *tracked_sample; IMFMediaBuffer *buffer; + IMFSample *sample; unsigned int i; HRESULT hr; if (FAILED(hr = MFCreateTrackedSample(&tracked_sample))) - { return hr; - } - IMFTrackedSample_QueryInterface(tracked_sample, &IID_IMFSample, (void **)sample); + IMFTrackedSample_QueryInterface(tracked_sample, &IID_IMFSample, (void **)&sample); IMFTrackedSample_Release(tracked_sample); for (i = 0; i < allocator->frame_desc.buffer_count; ++i) @@ -1369,11 +1367,24 @@ static HRESULT sample_allocator_allocate_sample(struct sample_allocator *allocat if (SUCCEEDED(hr)) { - hr = IMFSample_AddBuffer(*sample, buffer); + hr = IMFSample_AddBuffer(sample, buffer); IMFMediaBuffer_Release(buffer); } } + if (FAILED(hr)) + { + IMFSample_Release(sample); + return hr; + } + + if (!(*queued_sample = malloc(sizeof(**queued_sample)))) + { + IMFSample_Release(sample); + return E_OUTOFMEMORY; + } + (*queued_sample)->sample = sample; + return hr; } @@ -1381,11 +1392,11 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u unsigned int max_sample_count, IMFAttributes *attributes, IMFMediaType *media_type) { struct surface_service service; + struct queued_sample *sample; DXGI_FORMAT dxgi_format; unsigned int i, value; GUID major, subtype; UINT64 frame_size; - IMFSample *sample; D3D11_USAGE usage; HRESULT hr; @@ -1458,13 +1469,9 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u for (i = 0; i < sample_count; ++i) { - struct queued_sample *queued_sample; - if (SUCCEEDED(hr = sample_allocator_allocate_sample(allocator, &service, &sample))) { - queued_sample = malloc(sizeof(*queued_sample)); - queued_sample->sample = sample; - list_add_tail(&allocator->free_samples, &queued_sample->entry); + list_add_tail(&allocator->free_samples, &sample->entry); allocator->free_sample_count++; } } @@ -1512,7 +1519,7 @@ static HRESULT sample_allocator_track_sample(struct sample_allocator *allocator, static HRESULT WINAPI sample_allocator_AllocateSample(IMFVideoSampleAllocatorEx *iface, IMFSample **out) { struct sample_allocator *allocator = impl_from_IMFVideoSampleAllocatorEx(iface); - IMFSample *sample; + struct queued_sample *sample; HRESULT hr; TRACE("%p, %p.\n", iface, out); @@ -1527,9 +1534,9 @@ static HRESULT WINAPI sample_allocator_AllocateSample(IMFVideoSampleAllocatorEx { struct list *head = list_head(&allocator->free_samples); - sample = LIST_ENTRY(head, struct queued_sample, entry)->sample; + sample = LIST_ENTRY(head, struct queued_sample, entry); - if (SUCCEEDED(hr = sample_allocator_track_sample(allocator, sample))) + if (SUCCEEDED(hr = sample_allocator_track_sample(allocator, sample->sample))) { list_remove(head); list_add_tail(&allocator->used_samples, head); @@ -1538,7 +1545,7 @@ static HRESULT WINAPI sample_allocator_AllocateSample(IMFVideoSampleAllocatorEx /* Reference counter is not increased when sample is returned, so next release could trigger tracking condition. This is balanced by incremented reference counter when sample is returned back to the free list. */ - *out = sample; + *out = sample->sample; } } else /* allocator->cold_sample_count != 0 */ @@ -1549,15 +1556,17 @@ static HRESULT WINAPI sample_allocator_AllocateSample(IMFVideoSampleAllocatorEx { if (SUCCEEDED(hr = sample_allocator_allocate_sample(allocator, &service, &sample))) { - if (SUCCEEDED(hr = sample_allocator_track_sample(allocator, sample))) + if (SUCCEEDED(hr = sample_allocator_track_sample(allocator, sample->sample))) { - struct queued_sample *queued_sample = malloc(sizeof(*queued_sample)); - - queued_sample->sample = sample; - list_add_tail(&allocator->used_samples, &queued_sample->entry); + list_add_tail(&allocator->used_samples, &sample->entry); allocator->cold_sample_count--; - *out = queued_sample->sample; + *out = sample->sample; + } + else + { + IMFSample_Release(sample->sample); + free(sample); } }
1
0
0
0
Nikolay Sivov : oleaut32: Remove some local variables in Invoke() that don't improve readability.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 82f71d8bbef0e81a8d8e67b3ac5d5dd549336e91 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82f71d8bbef0e81a8d8e67b3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 17 14:12:53 2021 +0300 oleaut32: Remove some local variables in Invoke() that don't improve readability. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/typelib.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 5c5aca63538..70f15679811 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -7269,7 +7269,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( case FUNC_VIRTUAL: { void *buffer = heap_alloc_zero(INVBUF_ELEMENT_SIZE * func_desc->cParams); VARIANT varresult; - VARIANT retval; /* pointer for storing byref retvals in */ + VARIANT retval = {{{0}}}; /* pointer for storing byref retvals in */ VARIANTARG **prgpvarg = INVBUF_GET_ARG_PTR_ARRAY(buffer, func_desc->cParams); VARIANTARG *rgvarg = INVBUF_GET_ARG_ARRAY(buffer, func_desc->cParams); VARTYPE *rgvt = INVBUF_GET_ARG_TYPE_ARRAY(buffer, func_desc->cParams); @@ -7315,10 +7315,9 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( if (wParamFlags & PARAMFLAG_FLCID) { - VARIANTARG *arg; - arg = prgpvarg[i] = &rgvarg[i]; - V_VT(arg) = VT_I4; - V_I4(arg) = This->pTypeLib->lcid; + prgpvarg[i] = &rgvarg[i]; + V_VT(prgpvarg[i]) = VT_I4; + V_I4(prgpvarg[i]) = This->pTypeLib->lcid; continue; } @@ -7359,11 +7358,9 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( * native does */ if (i == func_desc->cParams - 1) { - VARIANTARG *arg; - arg = prgpvarg[i] = &rgvarg[i]; - V_VT(arg) = rgvt[i]; - memset(&retval, 0, sizeof(retval)); - V_BYREF(arg) = &retval; + prgpvarg[i] = &rgvarg[i]; + V_BYREF(prgpvarg[i]) = &retval; + V_VT(prgpvarg[i]) = rgvt[i]; } else {
1
0
0
0
Nikolay Sivov : oleaut32: Remove unnecessary initialization of retval arg slot in Invoke().
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 93a4fd5887a348ee9d6a887bad6247a27ddadfd6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=93a4fd5887a348ee9d6a887b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 17 14:12:52 2021 +0300 oleaut32: Remove unnecessary initialization of retval arg slot in Invoke(). Whole argument buffer is already zero-initialized. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/typelib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index fb49cd303fe..5c5aca63538 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -7361,7 +7361,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( { VARIANTARG *arg; arg = prgpvarg[i] = &rgvarg[i]; - memset(arg, 0, sizeof(*arg)); V_VT(arg) = rgvt[i]; memset(&retval, 0, sizeof(retval)); V_BYREF(arg) = &retval;
1
0
0
0
Nikolay Sivov : oleaut32: Use single local variable to access missing args array in Invoke().
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 3b2db03d2d38ece7196a37c556966a946d1ad152 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3b2db03d2d38ece7196a37c5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 17 14:12:51 2021 +0300 oleaut32: Use single local variable to access missing args array in Invoke(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/typelib.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index ac326afe1a1..fb49cd303fe 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -7273,6 +7273,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( VARIANTARG **prgpvarg = INVBUF_GET_ARG_PTR_ARRAY(buffer, func_desc->cParams); VARIANTARG *rgvarg = INVBUF_GET_ARG_ARRAY(buffer, func_desc->cParams); VARTYPE *rgvt = INVBUF_GET_ARG_TYPE_ARRAY(buffer, func_desc->cParams); + VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams); UINT cNamedArgs = pDispParams->cNamedArgs; DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs; UINT vargs_converted=0; @@ -7387,7 +7388,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( V_VARIANTREF(&rgvarg[i]) = V_VARIANTREF(src_arg); else { - VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams); if (wParamFlags & PARAMFLAG_FIN) hres = VariantCopy(&missing_arg[i], src_arg); V_VARIANTREF(&rgvarg[i]) = &missing_arg[i]; @@ -7430,7 +7430,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( } else if ((rgvt[i] & VT_BYREF) && !V_ISBYREF(src_arg)) { - VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams); if (wParamFlags & PARAMFLAG_FIN) hres = VariantChangeType(&missing_arg[i], src_arg, 0, rgvt[i] & ~VT_BYREF); else @@ -7500,20 +7499,22 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( } else { - VARIANTARG *missing_arg; /* if the function wants a pointer to a variant then * set that up, otherwise just pass the VT_ERROR in * the argument by value */ if (rgvt[i] & VT_BYREF) { - missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams) + i; + V_VT(&missing_arg[i]) = VT_ERROR; + V_ERROR(&missing_arg[i]) = DISP_E_PARAMNOTFOUND; + V_VT(arg) = VT_VARIANT | VT_BYREF; - V_VARIANTREF(arg) = missing_arg; + V_VARIANTREF(arg) = &missing_arg[i]; } else - missing_arg = arg; - V_VT(missing_arg) = VT_ERROR; - V_ERROR(missing_arg) = DISP_E_PARAMNOTFOUND; + { + V_VT(arg) = VT_ERROR; + V_ERROR(arg) = DISP_E_PARAMNOTFOUND; + } } } else @@ -7544,7 +7545,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( for (i = 0; i < func_desc->cParams; i++) { USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags; - VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams); if (wParamFlags & PARAMFLAG_FLCID) continue;
1
0
0
0
Nikolay Sivov : oleaut32/tests: Link to SafeArrayGetVartype() directly.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 5b04eacfa9f39f0f52ec4a86f82ddfed670f1f80 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5b04eacfa9f39f0f52ec4a86…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 17 14:12:50 2021 +0300 oleaut32/tests: Link to SafeArrayGetVartype() directly. It was already available on XP. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/usrmarshal.c | 78 +++++++++++----------------------------- 1 file changed, 21 insertions(+), 57 deletions(-) diff --git a/dlls/oleaut32/tests/usrmarshal.c b/dlls/oleaut32/tests/usrmarshal.c index 4fc26f33c63..92d0da3403b 100644 --- a/dlls/oleaut32/tests/usrmarshal.c +++ b/dlls/oleaut32/tests/usrmarshal.c @@ -36,14 +36,12 @@ # define V_U2(A) (*(A)) #endif -static HRESULT (WINAPI *pSafeArrayGetVartype)(SAFEARRAY*,VARTYPE*); - static inline SF_TYPE get_union_type(SAFEARRAY *psa) { VARTYPE vt; HRESULT hr; - hr = pSafeArrayGetVartype(psa, &vt); + hr = SafeArrayGetVartype(psa, &vt); if (FAILED(hr)) { if(psa->fFeatures & FADF_VARIANT) return SF_VARIANT; @@ -131,10 +129,7 @@ static void check_safearray(void *buffer, LPSAFEARRAY lpsa) return; } - if (!pSafeArrayGetVartype) - return; - - if(FAILED(pSafeArrayGetVartype(lpsa, &vt))) + if(FAILED(SafeArrayGetVartype(lpsa, &vt))) vt = 0; sftype = get_union_type(lpsa); @@ -266,12 +261,9 @@ static void test_marshal_LPSAFEARRAY(void) init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserUnmarshal(&umcb.Flags, buffer, &lpsa2); ok(lpsa2 != NULL, "LPSAFEARRAY didn't unmarshal\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(lpsa, &vt); - pSafeArrayGetVartype(lpsa2, &vt2); - ok(vt == vt2, "vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(lpsa, &vt); + SafeArrayGetVartype(lpsa2, &vt2); + ok(vt == vt2, "vts differ %x %x\n", vt, vt2); ok(lpsa2->cLocks == 0, "got lock count %u, expected 0\n", lpsa2->cLocks); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2); @@ -313,12 +305,9 @@ static void test_marshal_LPSAFEARRAY(void) init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserUnmarshal(&umcb.Flags, buffer, &lpsa2); ok(lpsa2 != NULL, "LPSAFEARRAY didn't unmarshal\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(lpsa, &vt); - pSafeArrayGetVartype(lpsa2, &vt2); - ok(vt == vt2, "vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(lpsa, &vt); + SafeArrayGetVartype(lpsa2, &vt2); + ok(vt == vt2, "vts differ %x %x\n", vt, vt2); ok(lpsa2->cLocks == 0, "got lock count %u, expected 0\n", lpsa2->cLocks); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2); @@ -387,12 +376,8 @@ static void test_marshal_LPSAFEARRAY(void) lpsa->rgsabound[0].cElements = 48; hr = SafeArrayAllocData(lpsa); ok(hr == S_OK, "saad failed %08x\n", hr); - - if (pSafeArrayGetVartype) - { - hr = pSafeArrayGetVartype(lpsa, &vt); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); - } + hr = SafeArrayGetVartype(lpsa, &vt); + ok(hr == E_INVALIDARG, "ret %08x\n", hr); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); @@ -496,12 +481,8 @@ static void test_marshal_LPSAFEARRAY(void) lpsa->rgsabound[0].cElements = 48; hr = SafeArrayAllocData(lpsa); ok(hr == S_OK, "saad failed %08x\n", hr); - - if (pSafeArrayGetVartype) - { - hr = pSafeArrayGetVartype(lpsa, &vt); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); - } + hr = SafeArrayGetVartype(lpsa, &vt); + ok(hr == E_INVALIDARG, "ret %08x\n", hr); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); @@ -1321,12 +1302,9 @@ static void test_marshal_VARIANT(void) SafeArrayGetUBound(V_ARRAY(&v), 1, &bound); SafeArrayGetUBound(V_ARRAY(&v2), 1, &bound2); ok(bound == bound2, "array ubounds differ\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(V_ARRAY(&v), &vt); - pSafeArrayGetVartype(V_ARRAY(&v2), &vt2); - ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(V_ARRAY(&v), &vt); + SafeArrayGetVartype(V_ARRAY(&v2), &vt2); + ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); VARIANT_UserFree(&umcb.Flags, &v2); HeapFree(GetProcessHeap(), 0, oldbuffer); @@ -1363,12 +1341,9 @@ static void test_marshal_VARIANT(void) SafeArrayGetUBound(*V_ARRAYREF(&v), 1, &bound); SafeArrayGetUBound(*V_ARRAYREF(&v2), 1, &bound2); ok(bound == bound2, "array ubounds differ\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(*V_ARRAYREF(&v), &vt); - pSafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); - ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(*V_ARRAYREF(&v), &vt); + SafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); + ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); VARIANT_UserFree(&umcb.Flags, &v2); HeapFree(GetProcessHeap(), 0, oldbuffer); @@ -1413,12 +1388,9 @@ static void test_marshal_VARIANT(void) SafeArrayGetUBound(*V_ARRAYREF(&v), 1, &bound); SafeArrayGetUBound(*V_ARRAYREF(&v2), 1, &bound2); ok(bound == bound2, "array ubounds differ\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(*V_ARRAYREF(&v), &vt); - pSafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); - ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(*V_ARRAYREF(&v), &vt); + SafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); + ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); lpsa2->fFeatures &= ~FADF_STATIC; hr = SafeArrayDestroy(*V_ARRAYREF(&v2)); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1608,14 +1580,6 @@ todo_wine START_TEST(usrmarshal) { - HANDLE hOleaut32 = GetModuleHandleA("oleaut32.dll"); -#define GETPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func) - GETPTR(SafeArrayGetVartype); -#undef GETPTR - - if (!pSafeArrayGetVartype) - win_skip("SafeArrayGetVartype is not available, some tests will be skipped\n"); - CoInitialize(NULL); test_marshal_LPSAFEARRAY();
1
0
0
0
Nikolay Sivov : oleaut32/tests: Remove unused variable.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 3c7b0e8d85985aee5d5c51c97f46b7d5c33c13f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3c7b0e8d85985aee5d5c51c9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 17 14:12:48 2021 +0300 oleaut32/tests: Remove unused variable. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/tmarshal.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c index 4e9a8baeca0..1e75a93ebce 100644 --- a/dlls/oleaut32/tests/tmarshal.c +++ b/dlls/oleaut32/tests/tmarshal.c @@ -30,9 +30,6 @@ #include "tmarshal.h" -static HRESULT (WINAPI *pVarAdd)(LPVARIANT,LPVARIANT,LPVARIANT); - - #define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr) static inline void release_iface_(unsigned int line, void *iface) { @@ -3747,8 +3744,6 @@ static void test_marshal_dispinterface(void) START_TEST(tmarshal) { HRESULT hr; - HANDLE hOleaut32 = GetModuleHandleA("oleaut32.dll"); - pVarAdd = (void*)GetProcAddress(hOleaut32, "VarAdd"); CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
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