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
March 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
1163 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Load the Unix library only when __wine_init_unix_lib() is called.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: 89340bb762300c76a40cb4b62ba0f0d779306125 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=89340bb762300c76a40cb4b6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 22 16:03:22 2021 +0100 ntdll: Load the Unix library only when __wine_init_unix_lib() is called. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/loader.c | 40 ++++++++++++++++++++++++---------------- dlls/ntdll/unix/unix_private.h | 4 ++-- dlls/ntdll/unix/virtual.c | 36 +++++++++++++++++++++--------------- 3 files changed, 47 insertions(+), 33 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 9e43358a26d..1c95b84e965 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1111,30 +1111,38 @@ already_loaded: /*********************************************************************** - * dlopen_unix_dll + * init_unix_lib */ -static NTSTATUS dlopen_unix_dll( void *module, const char *name ) +static NTSTATUS CDECL init_unix_lib( void *module, DWORD reason, const void *ptr_in, void *ptr_out ) { - void *unix_module, *handle, *entry; + NTSTATUS (CDECL *init_func)( HMODULE, DWORD, const void *, void * ); const IMAGE_NT_HEADERS *nt; - NTSTATUS status = STATUS_INVALID_IMAGE_FORMAT; + const char *name; + void *handle, *entry, *unix_module; + NTSTATUS status; - handle = dlopen( name, RTLD_NOW ); - if (!handle) return STATUS_DLL_NOT_FOUND; - if (!(nt = dlsym( handle, "__wine_spec_nt_header" ))) goto done; - if (!(entry = dlsym( handle, "__wine_init_unix_lib" ))) goto done; + if ((status = get_builtin_unix_info( module, &name, &handle, &entry ))) return status; - unix_module = (HMODULE)((nt->OptionalHeader.ImageBase + 0xffff) & ~0xffff); - status = set_builtin_unix_handle( module, handle, entry ); - if (!status) + if (!entry) { + if (!name) return STATUS_DLL_NOT_FOUND; + if (!(handle = dlopen( name, RTLD_NOW ))) return STATUS_DLL_NOT_FOUND; + + if (!(nt = dlsym( handle, "__wine_spec_nt_header" )) || + !(entry = dlsym( handle, "__wine_init_unix_lib" ))) + { + dlclose( handle ); + set_builtin_unix_info( module, NULL, NULL, NULL ); + return STATUS_INVALID_IMAGE_FORMAT; + } + TRACE( "loaded %s for %p\n", debugstr_a(name), module ); + unix_module = (void *)((nt->OptionalHeader.ImageBase + 0xffff) & ~0xffff); map_so_dll( nt, unix_module ); fixup_ntdll_imports( name, unix_module ); - return status; + set_builtin_unix_info( module, NULL, handle, entry ); } -done: - dlclose( handle ); - return status; + init_func = entry; + return init_func( module, reason, ptr_in, ptr_out ); } @@ -1393,7 +1401,7 @@ done: if (!status && ext) { strcpy( ext, ".so" ); - dlopen_unix_dll( *module, ptr ); + set_builtin_unix_info( *module, ptr, NULL, NULL ); } free( file ); return status; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index c00a6ee6aa8..5877a00bac8 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -203,8 +203,8 @@ extern void virtual_set_large_address_space(void) DECLSPEC_HIDDEN; extern void virtual_fill_image_information( const pe_image_info_t *pe_info, SECTION_IMAGE_INFORMATION *info ) DECLSPEC_HIDDEN; extern void *get_builtin_so_handle( void *module ) DECLSPEC_HIDDEN; -extern NTSTATUS set_builtin_unix_handle( void *module, void *handle, void *entry ) DECLSPEC_HIDDEN; -extern NTSTATUS CDECL init_unix_lib( void *module, DWORD reason, const void *ptr_in, void *ptr_out ) DECLSPEC_HIDDEN; +extern NTSTATUS get_builtin_unix_info( void *module, const char **name, void **handle, void **entry ) DECLSPEC_HIDDEN; +extern NTSTATUS set_builtin_unix_info( void *module, const char *name, void *handle, void *entry ) DECLSPEC_HIDDEN; extern NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_len ) DECLSPEC_HIDDEN; extern BOOL get_thread_times( int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index bff4569b615..4edc7d0261e 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -90,6 +90,7 @@ struct builtin_module ino_t ino; void *handle; void *module; + char *unix_name; void *unix_handle; void *unix_entry; }; @@ -570,6 +571,7 @@ static void add_builtin_module( void *module, void *handle, const struct stat *s if (!(builtin = malloc( sizeof(*builtin) ))) return; builtin->handle = handle; builtin->module = module; + builtin->unix_name = NULL; builtin->unix_handle = NULL; builtin->unix_entry = NULL; if (st) @@ -641,9 +643,9 @@ void *get_builtin_so_handle( void *module ) /*********************************************************************** - * set_builtin_unix_handle + * get_builtin_unix_info */ -NTSTATUS set_builtin_unix_handle( void *module, void *handle, void *entry ) +NTSTATUS get_builtin_unix_info( void *module, const char **name, void **handle, void **entry ) { sigset_t sigset; NTSTATUS status = STATUS_DLL_NOT_FOUND; @@ -653,13 +655,10 @@ NTSTATUS set_builtin_unix_handle( void *module, void *handle, void *entry ) LIST_FOR_EACH_ENTRY( builtin, &builtin_modules, struct builtin_module, entry ) { if (builtin->module != module) continue; - if (!builtin->unix_handle) - { - builtin->unix_handle = handle; - builtin->unix_entry = entry; - status = STATUS_SUCCESS; - } - else status = STATUS_IMAGE_ALREADY_LOADED; + *name = builtin->unix_name; + *handle = builtin->unix_handle; + *entry = builtin->unix_entry; + status = STATUS_SUCCESS; break; } server_leave_uninterrupted_section( &virtual_mutex, &sigset ); @@ -668,24 +667,31 @@ NTSTATUS set_builtin_unix_handle( void *module, void *handle, void *entry ) /*********************************************************************** - * init_unix_lib + * set_builtin_unix_info */ -NTSTATUS CDECL init_unix_lib( void *module, DWORD reason, const void *ptr_in, void *ptr_out ) +NTSTATUS set_builtin_unix_info( void *module, const char *name, void *handle, void *entry ) { sigset_t sigset; - NTSTATUS (CDECL *init_func)( HMODULE, DWORD, const void *, void * ) = NULL; + NTSTATUS status = STATUS_DLL_NOT_FOUND; struct builtin_module *builtin; server_enter_uninterrupted_section( &virtual_mutex, &sigset ); LIST_FOR_EACH_ENTRY( builtin, &builtin_modules, struct builtin_module, entry ) { if (builtin->module != module) continue; - init_func = builtin->unix_entry; + if (!builtin->unix_handle) + { + free( builtin->unix_name ); + builtin->unix_name = name ? strdup( name ) : NULL; + builtin->unix_handle = handle; + builtin->unix_entry = entry; + status = STATUS_SUCCESS; + } + else status = STATUS_IMAGE_ALREADY_LOADED; break; } server_leave_uninterrupted_section( &virtual_mutex, &sigset ); - if (!init_func) return STATUS_DLL_NOT_FOUND; - return init_func( module, reason, ptr_in, ptr_out ); + return status; }
1
0
0
0
Nikolay Sivov : gdiplus/metafile: Implement DrawRectangles() recording.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: 81bbc4872e8f5fb88916cd79bc6ef8b2c15dff83 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=81bbc4872e8f5fb88916cd79…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 18 15:18:03 2021 +0300 gdiplus/metafile: Implement DrawRectangles() recording. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 3 +++ dlls/gdiplus/metafile.c | 56 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 9b608035909..a617ca4803e 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -112,6 +112,7 @@ extern GpStatus METAFILE_FillRegion(GpMetafile* metafile, GpBrush* brush, extern void METAFILE_Free(GpMetafile *metafile) DECLSPEC_HIDDEN; extern GpStatus METAFILE_DrawEllipse(GpMetafile *metafile, GpPen *pen, GpRectF *rect) DECLSPEC_HIDDEN; extern GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRectF *rect) DECLSPEC_HIDDEN; +extern GpStatus METAFILE_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF *rects, INT count) DECLSPEC_HIDDEN; extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index c2c116acf94..2c18ced3e92 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4132,6 +4132,9 @@ GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, if(graphics->busy) return ObjectBusy; + if (is_metafile_graphics(graphics)) + return METAFILE_DrawRectangles((GpMetafile *)graphics->image, pen, rects, count); + status = GdipCreatePath(FillModeAlternate, &path); if (status != Ok) return status; diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index c285dc58f40..eafcdaee963 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -5102,3 +5102,59 @@ GpStatus METAFILE_FillRegion(GpMetafile* metafile, GpBrush* brush, GpRegion* reg return Ok; } + +GpStatus METAFILE_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF *rects, INT count) +{ + EmfPlusDrawRects *record; + GpStatus stat; + BOOL integer_rects = TRUE; + DWORD pen_id; + int i; + + if (metafile->metafile_type == MetafileTypeEmf) + { + FIXME("stub!\n"); + return NotImplemented; + } + + stat = METAFILE_AddPenObject(metafile, pen, &pen_id); + if (stat != Ok) return stat; + + for (i = 0; i < count; i++) + { + if (!is_integer_rect(&rects[i])) + { + integer_rects = FALSE; + break; + } + } + + stat = METAFILE_AllocateRecord(metafile, FIELD_OFFSET(EmfPlusDrawRects, RectData) + + count * (integer_rects ? sizeof(record->RectData.rect) : sizeof(record->RectData.rectF)), + (void **)&record); + if (stat != Ok) + return stat; + + record->Header.Type = EmfPlusRecordTypeDrawRects; + record->Header.Flags = pen_id; + if (integer_rects) + record->Header.Flags |= 0x4000; + record->Count = count; + + if (integer_rects) + { + for (i = 0; i < count; i++) + { + record->RectData.rect[i].X = (SHORT)rects[i].X; + record->RectData.rect[i].Y = (SHORT)rects[i].Y; + record->RectData.rect[i].Width = (SHORT)rects[i].Width; + record->RectData.rect[i].Height = (SHORT)rects[i].Height; + } + } + else + memcpy(record->RectData.rectF, rects, sizeof(*rects) * count); + + METAFILE_WriteRecords(metafile); + + return Ok; +}
1
0
0
0
Nikolay Sivov : gdiplus: Add a helper to check for metafile graphics context.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: b733e39ae5e246246ea993013484f2352abd3580 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b733e39ae5e246246ea99301…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 18 15:18:02 2021 +0300 gdiplus: Add a helper to check for metafile graphics context. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 78 +++++++++++++++++++++++++++---------------------- dlls/gdiplus/image.c | 1 + 2 files changed, 44 insertions(+), 35 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b733e39ae5e246246ea9…
1
0
0
0
Nikolay Sivov : gdiplus/metafile: Implement FillEllipse() recording.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: 81b7555da8bfa48ec494bfb57827fc8e8ab3a1aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=81b7555da8bfa48ec494bfb5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 18 15:18:01 2021 +0300 gdiplus/metafile: Implement FillEllipse() recording. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 11 ++++++++ dlls/gdiplus/metafile.c | 46 +++++++++++++++++++++++++++++++++ dlls/gdiplus/tests/metafile.c | 58 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 0b6dfb69b07..9b608035909 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -111,6 +111,7 @@ extern GpStatus METAFILE_FillRegion(GpMetafile* metafile, GpBrush* brush, GpRegion* region) DECLSPEC_HIDDEN; extern void METAFILE_Free(GpMetafile *metafile) DECLSPEC_HIDDEN; extern GpStatus METAFILE_DrawEllipse(GpMetafile *metafile, GpPen *pen, GpRectF *rect) DECLSPEC_HIDDEN; +extern GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRectF *rect) DECLSPEC_HIDDEN; extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index b2d0e6bf59b..97dfc4a75f2 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4258,6 +4258,17 @@ GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x if(graphics->busy) return ObjectBusy; + if (graphics->image && graphics->image->type == ImageTypeMetafile) + { + GpRectF rect; + + rect.X = x; + rect.Y = y; + rect.Width = width; + rect.Height = height; + return METAFILE_FillEllipse((GpMetafile *)graphics->image, brush, &rect); + } + stat = GdipCreatePath(FillModeAlternate, &path); if (stat == Ok) diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index 3e7853ecd50..c285dc58f40 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -4850,6 +4850,52 @@ GpStatus METAFILE_FillPath(GpMetafile *metafile, GpBrush *brush, GpPath *path) return Ok; } +GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRectF *rect) +{ + EmfPlusFillEllipse *record; + DWORD brush_id = -1; + BOOL inline_color; + GpStatus stat; + + if (metafile->metafile_type == MetafileTypeEmf) + { + FIXME("stub!\n"); + return NotImplemented; + } + + inline_color = brush->bt == BrushTypeSolidColor; + if (!inline_color) + { + stat = METAFILE_AddBrushObject(metafile, brush, &brush_id); + if (stat != Ok) return stat; + } + + stat = METAFILE_AllocateRecord(metafile, sizeof(EmfPlusFillEllipse), (void **)&record); + if (stat != Ok) return stat; + record->Header.Type = EmfPlusRecordTypeFillEllipse; + if (inline_color) + { + record->Header.Flags = 0x8000; + record->BrushId = ((GpSolidFill *)brush)->color; + } + else + record->BrushId = brush_id; + + if (is_integer_rect(rect)) + { + record->Header.Flags |= 0x4000; + record->RectData.rect.X = (SHORT)rect->X; + record->RectData.rect.Y = (SHORT)rect->Y; + record->RectData.rect.Width = (SHORT)rect->Width; + record->RectData.rect.Height = (SHORT)rect->Height; + } + else + memcpy(&record->RectData.rectF, rect, sizeof(*rect)); + + METAFILE_WriteRecords(metafile); + return Ok; +} + static GpStatus METAFILE_AddFontObject(GpMetafile *metafile, GDIPCONST GpFont *font, DWORD *id) { EmfPlusObject *object_record; diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index fede802b675..410e9a6ab8c 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -3593,6 +3593,63 @@ static void test_drawellipse(void) expect(Ok, stat); } +static const emfplus_record fill_ellipse_records[] = +{ + { EMR_HEADER }, + { EmfPlusRecordTypeHeader }, + { EmfPlusRecordTypeFillEllipse, 0xc000 }, + { EMR_SAVEDC, 0, 1 }, + { EMR_SETICMMODE, 0, 1 }, + { EMR_BITBLT, 0, 1 }, + { EMR_RESTOREDC, 0, 1 }, + { EmfPlusRecordTypeEndOfFile }, + { EMR_EOF }, + { 0 } +}; + +static void test_fillellipse(void) +{ + static const GpRectF frame = { 0.0f, 0.0f, 100.0f, 100.0f }; + + GpMetafile *metafile; + GpGraphics *graphics; + GpSolidFill *brush; + HENHMETAFILE hemf; + GpStatus stat; + HDC hdc; + + hdc = CreateCompatibleDC(0); + stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnitPixel, description, &metafile); + expect(Ok, stat); + DeleteDC(hdc); + + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); + expect(Ok, stat); + + stat = GdipCreateSolidFill(0xffaabbcc, &brush); + expect(Ok, stat); + + stat = GdipFillEllipse(graphics, (GpBrush *)brush, 0.0f, 0.0f, 10.0f, 20.0f); + expect(Ok, stat); + + stat = GdipDeleteBrush((GpBrush*)brush); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + sync_metafile(&metafile, "fill_ellipse.emf"); + + stat = GdipGetHemfFromMetafile(metafile, &hemf); + expect(Ok, stat); + + check_emfplus(hemf, fill_ellipse_records, "fill ellipse"); + + DeleteEnhMetaFile(hemf); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); +} + START_TEST(metafile) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3648,6 +3705,7 @@ START_TEST(metafile) test_lineargradient(); test_printer_dc(); test_drawellipse(); + test_fillellipse(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Nikolay Sivov : gdiplus/metafile: Implement DrawEllipse() recording.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: 4e55ec2b9eaac4d70202bb752690ca00d45fae37 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4e55ec2b9eaac4d70202bb75…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 18 15:18:00 2021 +0300 gdiplus/metafile: Implement DrawEllipse() recording. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 10 ++++++++ dlls/gdiplus/metafile.c | 34 +++++++++++++++++++++++++ dlls/gdiplus/tests/metafile.c | 58 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 4bca5b13be9..0b6dfb69b07 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -110,6 +110,7 @@ extern GpStatus METAFILE_DrawDriverString(GpMetafile *metafile, GDIPCONST UINT16 extern GpStatus METAFILE_FillRegion(GpMetafile* metafile, GpBrush* brush, GpRegion* region) DECLSPEC_HIDDEN; extern void METAFILE_Free(GpMetafile *metafile) DECLSPEC_HIDDEN; +extern GpStatus METAFILE_DrawEllipse(GpMetafile *metafile, GpPen *pen, GpRectF *rect) DECLSPEC_HIDDEN; extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7b4794e3620..b2d0e6bf59b 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2906,6 +2906,7 @@ GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, { GpPath *path; GpStatus status; + GpRectF rect; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height); @@ -2915,6 +2916,15 @@ GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, if(graphics->busy) return ObjectBusy; + if (graphics->image && graphics->image->type == ImageTypeMetafile) + { + rect.X = x; + rect.Y = y; + rect.Width = width; + rect.Height = height; + return METAFILE_DrawEllipse((GpMetafile *)graphics->image, pen, &rect); + } + status = GdipCreatePath(FillModeAlternate, &path); if (status != Ok) return status; diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index 5ff6b113c3d..3e7853ecd50 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -4774,6 +4774,40 @@ GpStatus METAFILE_DrawPath(GpMetafile *metafile, GpPen *pen, GpPath *path) return Ok; } +GpStatus METAFILE_DrawEllipse(GpMetafile *metafile, GpPen *pen, GpRectF *rect) +{ + EmfPlusDrawEllipse *record; + GpStatus stat; + DWORD pen_id; + + if (metafile->metafile_type == MetafileTypeEmf) + { + FIXME("stub!\n"); + return NotImplemented; + } + + stat = METAFILE_AddPenObject(metafile, pen, &pen_id); + if (stat != Ok) return stat; + + stat = METAFILE_AllocateRecord(metafile, sizeof(EmfPlusDrawEllipse), (void **)&record); + if (stat != Ok) return stat; + record->Header.Type = EmfPlusRecordTypeDrawEllipse; + record->Header.Flags = pen_id; + if (is_integer_rect(rect)) + { + record->Header.Flags |= 0x4000; + record->RectData.rect.X = (SHORT)rect->X; + record->RectData.rect.Y = (SHORT)rect->Y; + record->RectData.rect.Width = (SHORT)rect->Width; + record->RectData.rect.Height = (SHORT)rect->Height; + } + else + memcpy(&record->RectData.rectF, rect, sizeof(*rect)); + + METAFILE_WriteRecords(metafile); + return Ok; +} + GpStatus METAFILE_FillPath(GpMetafile *metafile, GpBrush *brush, GpPath *path) { EmfPlusFillPath *fill_path_record; diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 60659bf3119..fede802b675 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -3536,6 +3536,63 @@ static void test_printer_dc(void) GdipDisposeImage((GpImage *)metafile); } +static const emfplus_record draw_ellipse_records[] = +{ + { EMR_HEADER }, + { EmfPlusRecordTypeHeader }, + { EmfPlusRecordTypeObject, ObjectTypePen << 8 }, + { EmfPlusRecordTypeDrawEllipse, 0x4000 }, + { EMR_SAVEDC, 0, 1 }, + { EMR_SETICMMODE, 0, 1 }, + { EMR_BITBLT, 0, 1 }, + { EMR_RESTOREDC, 0, 1 }, + { EmfPlusRecordTypeEndOfFile }, + { EMR_EOF }, + { 0 } +}; + +static void test_drawellipse(void) +{ + static const GpRectF frame = { 0.0f, 0.0f, 100.0f, 100.0f }; + + GpMetafile *metafile; + GpGraphics *graphics; + HENHMETAFILE hemf; + GpStatus stat; + GpPen *pen; + HDC hdc; + + hdc = CreateCompatibleDC(0); + stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnitPixel, description, &metafile); + expect(Ok, stat); + DeleteDC(hdc); + + stat = GdipGetImageGraphicsContext((GpImage *)metafile, &graphics); + expect(Ok, stat); + + stat = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, stat); + + stat = GdipDrawEllipse(graphics, pen, 1.0f, 1.0f, 16.0f, 32.0f); + expect(Ok, stat); + + stat = GdipDeletePen(pen); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + sync_metafile(&metafile, "draw_ellipse.emf"); + + stat = GdipGetHemfFromMetafile(metafile, &hemf); + expect(Ok, stat); + + check_emfplus(hemf, draw_ellipse_records, "draw ellipse"); + DeleteEnhMetaFile(hemf); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); +} + START_TEST(metafile) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3590,6 +3647,7 @@ START_TEST(metafile) test_fillregion(); test_lineargradient(); test_printer_dc(); + test_drawellipse(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Rémi Bernon : windows.gaming.input: Fake IEventHandler_RawGameController support.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: e2189f588fed47caa51cb24452deeba145169b05 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e2189f588fed47caa51cb244…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 22 11:17:35 2021 +0100 windows.gaming.input: Fake IEventHandler_RawGameController support. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/main.c | 12 ++++++++---- dlls/windows.gaming.input/tests/input.c | 15 +++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index 56c5ad20ab0..c71374e34a3 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -558,28 +558,32 @@ static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControll IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token) { FIXME("iface %p, value %p, token %p stub!\n", iface, value, token); - return E_NOTIMPL; + if (!value) return E_INVALIDARG; + token->value = 0; + return S_OK; } static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerAdded( IRawGameControllerStatics *iface, EventRegistrationToken token) { FIXME("iface %p, token %#I64x stub!\n", iface, token.value); - return E_NOTIMPL; + return S_OK; } static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControllerRemoved( IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token) { FIXME("iface %p, value %p, token %p stub!\n", iface, value, token); - return E_NOTIMPL; + if (!value) return E_INVALIDARG; + token->value = 0; + return S_OK; } static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerRemoved( IRawGameControllerStatics *iface, EventRegistrationToken token) { FIXME("iface %p, token %#I64x stub!\n", iface, token.value); - return E_NOTIMPL; + return S_OK; } static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers( diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c index a359f225728..62822b30c28 100644 --- a/dlls/windows.gaming.input/tests/input.c +++ b/dlls/windows.gaming.input/tests/input.c @@ -359,19 +359,22 @@ static void test_RawGameController(void) token.value = 0xdeadbeef; hr = IRawGameControllerStatics_add_RawGameControllerAdded(controller_statics, &controller_event_handler.IEventHandler_RawGameController_iface, &token); - todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr); - todo_wine ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerAdded returned token %#I64x\n", token.value); + ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr); + ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerAdded returned token %#I64x\n", token.value); hr = IRawGameControllerStatics_remove_RawGameControllerAdded(controller_statics, token); - todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr); + ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr); token.value = 0xdeadbeef; IRawGameControllerStatics_add_RawGameControllerRemoved(controller_statics, &controller_event_handler.IEventHandler_RawGameController_iface, &token); - todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerRemoved failed, hr %#x\n", hr); - todo_wine ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerRemoved returned token %#I64x\n", token.value); + ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerRemoved failed, hr %#x\n", hr); + ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerRemoved returned token %#I64x\n", token.value); hr = IRawGameControllerStatics_remove_RawGameControllerRemoved(controller_statics, token); - todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr); + ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr); + + hr = IRawGameControllerStatics_add_RawGameControllerAdded(controller_statics, NULL, &token); + ok(hr == E_INVALIDARG, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr); IRawGameControllerStatics_Release(controller_statics);
1
0
0
0
Rémi Bernon : windows.gaming.input: Fake empty IRawGameControllerStatics::RawGameControllers vector.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: 5f4c28ea4b60bc627ec37ced877af923266955a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5f4c28ea4b60bc627ec37ced…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 22 11:17:34 2021 +0100 windows.gaming.input: Fake empty IRawGameControllerStatics::RawGameControllers vector. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/main.c | 10 +++++++--- dlls/windows.gaming.input/tests/input.c | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index 69839e06558..56c5ad20ab0 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -244,21 +244,25 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt( IVectorView_RawGameController *iface, ULONG index, IRawGameController **value) { FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); - return E_NOTIMPL; + *value = NULL; + return E_BOUNDS; } static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_get_Size( IVectorView_RawGameController *iface, ULONG *value) { FIXME("iface %p, value %p stub!\n", iface, value); - return E_NOTIMPL; + *value = 0; + return S_OK; } static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf( IVectorView_RawGameController *iface, IRawGameController *element, ULONG *index, BOOLEAN *found) { FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found); - return E_NOTIMPL; + *index = 0; + *found = FALSE; + return S_OK; } static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetMany( diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c index 1344d885ecb..a359f225728 100644 --- a/dlls/windows.gaming.input/tests/input.c +++ b/dlls/windows.gaming.input/tests/input.c @@ -340,20 +340,20 @@ static void test_RawGameController(void) size = 0xdeadbeef; hr = IVectorView_RawGameController_get_Size(controllers, &size); - todo_wine ok(hr == S_OK, "IVectorView_RawGameController_get_Size failed, hr %#x\n", hr); - todo_wine ok(size != 0xdeadbeef, "IVectorView_RawGameController_get_Size returned %u\n", size); + ok(hr == S_OK, "IVectorView_RawGameController_get_Size failed, hr %#x\n", hr); + ok(size != 0xdeadbeef, "IVectorView_RawGameController_get_Size returned %u\n", size); controller = (IRawGameController *)0xdeadbeef; hr = IVectorView_RawGameController_GetAt(controllers, size, &controller); - todo_wine ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetAt failed, hr %#x\n", hr); - todo_wine ok(controller == NULL, "IVectorView_RawGameController_GetAt returned %p\n", controller); + ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetAt failed, hr %#x\n", hr); + ok(controller == NULL, "IVectorView_RawGameController_GetAt returned %p\n", controller); size = 0xdeadbeef; found = TRUE; controller = (IRawGameController *)0xdeadbeef; hr = IVectorView_RawGameController_IndexOf(controllers, controller, &size, &found); - todo_wine ok(hr == S_OK, "IVectorView_RawGameController_IndexOf failed, hr %#x\n", hr); - todo_wine ok(size == 0 && found == FALSE, "IVectorView_RawGameController_IndexOf returned size %d, found %d\n", size, found); + ok(hr == S_OK, "IVectorView_RawGameController_IndexOf failed, hr %#x\n", hr); + ok(size == 0 && found == FALSE, "IVectorView_RawGameController_IndexOf returned size %d, found %d\n", size, found); IVectorView_RawGameController_Release(controllers);
1
0
0
0
Rémi Bernon : windows.gaming.input: Implement IRawGameControllerStatics::RawGameControllers stubs.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: f32584544d19dab6a77fe56e423fc88b568fecb2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f32584544d19dab6a77fe56e…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 22 11:17:33 2021 +0100 windows.gaming.input: Implement IRawGameControllerStatics::RawGameControllers stubs. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/main.c | 126 +++++++++++++++++++++++++++++++- dlls/windows.gaming.input/tests/input.c | 16 ++-- 2 files changed, 131 insertions(+), 11 deletions(-) diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index 8a79d77858e..69839e06558 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -170,6 +170,126 @@ static struct gamepad_vector gamepads = 0 }; +struct raw_game_controller_vector +{ + IVectorView_RawGameController IVectorView_RawGameController_iface; + LONG ref; +}; + +static inline struct raw_game_controller_vector *impl_from_IVectorView_RawGameController(IVectorView_RawGameController *iface) +{ + return CONTAINING_RECORD(iface, struct raw_game_controller_vector, IVectorView_RawGameController_iface); +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_QueryInterface( + IVectorView_RawGameController *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IAgileObject) || + IsEqualGUID(iid, &IID_IVectorView_RawGameController)) + { + IUnknown_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE vector_view_raw_game_controller_AddRef( + IVectorView_RawGameController *iface) +{ + struct raw_game_controller_vector *impl = impl_from_IVectorView_RawGameController(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %u.\n", iface, ref); + return ref; +} + +static ULONG STDMETHODCALLTYPE vector_view_raw_game_controller_Release( + IVectorView_RawGameController *iface) +{ + struct raw_game_controller_vector *impl = impl_from_IVectorView_RawGameController(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %u.\n", iface, ref); + return ref; +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetIids( + IVectorView_RawGameController *iface, ULONG *iid_count, IID **iids) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetRuntimeClassName( + IVectorView_RawGameController *iface, HSTRING *class_name) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetTrustLevel( + IVectorView_RawGameController *iface, TrustLevel *trust_level) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt( + IVectorView_RawGameController *iface, ULONG index, IRawGameController **value) +{ + FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_get_Size( + IVectorView_RawGameController *iface, ULONG *value) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf( + IVectorView_RawGameController *iface, IRawGameController *element, ULONG *index, BOOLEAN *found) +{ + FIXME("iface %p, element %p, index %p, found %p stub!\n", iface, element, index, found); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetMany( + IVectorView_RawGameController *iface, ULONG start_index, IRawGameController **items, UINT *value) +{ + FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value); + return E_NOTIMPL; +} + +static const struct IVectorView_RawGameControllerVtbl vector_view_raw_game_controller_vtbl = +{ + vector_view_raw_game_controller_QueryInterface, + vector_view_raw_game_controller_AddRef, + vector_view_raw_game_controller_Release, + /* IInspectable methods */ + vector_view_raw_game_controller_GetIids, + vector_view_raw_game_controller_GetRuntimeClassName, + vector_view_raw_game_controller_GetTrustLevel, + /* IVectorView<RawGameController> methods */ + vector_view_raw_game_controller_GetAt, + vector_view_raw_game_controller_get_Size, + vector_view_raw_game_controller_IndexOf, + vector_view_raw_game_controller_GetMany, +}; + +static struct raw_game_controller_vector raw_game_controllers = +{ + {&vector_view_raw_game_controller_vtbl}, + 0 +}; + struct windows_gaming_input { IActivationFactory IActivationFactory_iface; @@ -461,8 +581,10 @@ static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameContr static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers( IRawGameControllerStatics *iface, IVectorView_RawGameController **value) { - FIXME("iface %p, value %p stub!\n", iface, value); - return E_NOTIMPL; + TRACE("iface %p, value %p.\n", iface, value); + *value = &raw_game_controllers.IVectorView_RawGameController_iface; + IVectorView_RawGameController_AddRef(*value); + return S_OK; } static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_FromGameController( diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c index 2f0cb1a1553..1344d885ecb 100644 --- a/dlls/windows.gaming.input/tests/input.c +++ b/dlls/windows.gaming.input/tests/input.c @@ -326,8 +326,7 @@ static void test_RawGameController(void) IAgileObject_Release(tmp_agile_object); hr = IRawGameControllerStatics_get_RawGameControllers(controller_statics, &controllers); - todo_wine ok(hr == S_OK, "IRawGameControllerStatics_get_RawGameControllers failed, hr %#x\n", hr); - if (FAILED(hr)) goto done; + ok(hr == S_OK, "IRawGameControllerStatics_get_RawGameControllers failed, hr %#x\n", hr); hr = IVectorView_RawGameController_QueryInterface(controllers, &IID_IInspectable, (void **)&tmp_inspectable); ok(hr == S_OK, "IVectorView_RawGameController_QueryInterface failed, hr %#x\n", hr); @@ -341,24 +340,23 @@ static void test_RawGameController(void) size = 0xdeadbeef; hr = IVectorView_RawGameController_get_Size(controllers, &size); - ok(hr == S_OK, "IVectorView_RawGameController_get_Size failed, hr %#x\n", hr); - ok(size != 0xdeadbeef, "IVectorView_RawGameController_get_Size returned %u\n", size); + todo_wine ok(hr == S_OK, "IVectorView_RawGameController_get_Size failed, hr %#x\n", hr); + todo_wine ok(size != 0xdeadbeef, "IVectorView_RawGameController_get_Size returned %u\n", size); controller = (IRawGameController *)0xdeadbeef; hr = IVectorView_RawGameController_GetAt(controllers, size, &controller); - ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetAt failed, hr %#x\n", hr); - ok(controller == NULL, "IVectorView_RawGameController_GetAt returned %p\n", controller); + todo_wine ok(hr == E_BOUNDS, "IVectorView_RawGameController_GetAt failed, hr %#x\n", hr); + todo_wine ok(controller == NULL, "IVectorView_RawGameController_GetAt returned %p\n", controller); size = 0xdeadbeef; found = TRUE; controller = (IRawGameController *)0xdeadbeef; hr = IVectorView_RawGameController_IndexOf(controllers, controller, &size, &found); - ok(hr == S_OK, "IVectorView_RawGameController_IndexOf failed, hr %#x\n", hr); - ok(size == 0 && found == FALSE, "IVectorView_RawGameController_IndexOf returned size %d, found %d\n", size, found); + todo_wine ok(hr == S_OK, "IVectorView_RawGameController_IndexOf failed, hr %#x\n", hr); + todo_wine ok(size == 0 && found == FALSE, "IVectorView_RawGameController_IndexOf returned size %d, found %d\n", size, found); IVectorView_RawGameController_Release(controllers); -done: token.value = 0xdeadbeef; hr = IRawGameControllerStatics_add_RawGameControllerAdded(controller_statics, &controller_event_handler.IEventHandler_RawGameController_iface, &token); todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
1
0
0
0
Rémi Bernon : windows.gaming.input: Implement IRawGameControllerStatics stubs.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: 21c8a30906e656729854e8bf899ba44750f215ac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=21c8a30906e656729854e8bf…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 22 11:17:32 2021 +0100 windows.gaming.input: Implement IRawGameControllerStatics stubs. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/main.c | 116 +++++++++++++++++++++ dlls/windows.gaming.input/tests/input.c | 173 ++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=21c8a30906e656729854…
1
0
0
0
Rémi Bernon : windows.gaming.input: Fake IEventHandler_Gamepad support.
by Alexandre Julliard
22 Mar '21
22 Mar '21
Module: wine Branch: master Commit: 3728a813890733546b2d5b49126676f63ce7f1ad URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3728a813890733546b2d5b49…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 22 11:17:31 2021 +0100 windows.gaming.input: Fake IEventHandler_Gamepad support. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.gaming.input/main.c | 12 ++++++++---- dlls/windows.gaming.input/tests/input.c | 15 +++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index d7a2f138a14..545a7acdbaf 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -321,28 +321,32 @@ static HRESULT STDMETHODCALLTYPE gamepad_statics_add_GamepadAdded( IGamepadStatics *iface, IEventHandler_Gamepad *value, EventRegistrationToken* token) { FIXME("iface %p, value %p, token %p stub!\n", iface, value, token); - return E_NOTIMPL; + if (!value) return E_INVALIDARG; + token->value = 0; + return S_OK; } static HRESULT STDMETHODCALLTYPE gamepad_statics_remove_GamepadAdded( IGamepadStatics *iface, EventRegistrationToken token) { FIXME("iface %p, token %#I64x stub!\n", iface, token.value); - return E_NOTIMPL; + return S_OK; } static HRESULT STDMETHODCALLTYPE gamepad_statics_add_GamepadRemoved( IGamepadStatics *iface, IEventHandler_Gamepad *value, EventRegistrationToken* token) { FIXME("iface %p, value %p, token %p stub!\n", iface, value, token); - return E_NOTIMPL; + if (!value) return E_INVALIDARG; + token->value = 0; + return S_OK; } static HRESULT STDMETHODCALLTYPE gamepad_statics_remove_GamepadRemoved( IGamepadStatics *iface, EventRegistrationToken token) { FIXME("iface %p, token %#I64x stub!\n", iface, token.value); - return E_NOTIMPL; + return S_OK; } static HRESULT STDMETHODCALLTYPE gamepad_statics_get_Gamepads( diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c index fa83261ffc4..9462f3a4ed7 100644 --- a/dlls/windows.gaming.input/tests/input.c +++ b/dlls/windows.gaming.input/tests/input.c @@ -186,19 +186,22 @@ static void test_Gamepad(void) token.value = 0xdeadbeef; hr = IGamepadStatics_add_GamepadAdded(gamepad_statics, &gamepad_event_handler.IEventHandler_Gamepad_iface, &token); - todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr); - todo_wine ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadAdded returned token %#I64x\n", token.value); + ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr); + ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadAdded returned token %#I64x\n", token.value); hr = IGamepadStatics_remove_GamepadAdded(gamepad_statics, token); - todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr); + ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr); token.value = 0xdeadbeef; IGamepadStatics_add_GamepadRemoved(gamepad_statics, &gamepad_event_handler.IEventHandler_Gamepad_iface, &token); - todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadRemoved failed, hr %#x\n", hr); - todo_wine ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadRemoved returned token %#I64x\n", token.value); + ok(hr == S_OK, "IGamepadStatics_add_GamepadRemoved failed, hr %#x\n", hr); + ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadRemoved returned token %#I64x\n", token.value); hr = IGamepadStatics_remove_GamepadRemoved(gamepad_statics, token); - todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr); + ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr); + + hr = IGamepadStatics_add_GamepadAdded(gamepad_statics, NULL, &token); + ok(hr == E_INVALIDARG, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr); IGamepadStatics_Release(gamepad_statics);
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
117
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200