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
November 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
951 discussions
Start a n
N
ew thread
Brendan Shanks : winemac.drv: Remove workarounds for Mac OS X 10.6 and earlier.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: 32fb017d4a22be38ca271bf387e466e958601355 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=32fb017d4a22be38ca271bf3…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Thu Nov 18 13:05:04 2021 -0800 winemac.drv: Remove workarounds for Mac OS X 10.6 and earlier. Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/cocoa_app.m | 15 +++++------ dlls/winemac.drv/cocoa_window.m | 59 ++++++++++++----------------------------- dlls/winemac.drv/opengl.c | 20 -------------- 3 files changed, 23 insertions(+), 71 deletions(-) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index c4c745ff732..1bb752d20b7 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -299,15 +299,12 @@ static NSString* WineLocalizedString(unsigned int stringID) [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ZOOM) action:@selector(performZoom:) keyEquivalent:@""]; - if ([NSWindow instancesRespondToSelector:@selector(toggleFullScreen:)]) - { - item = [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ENTER_FULL_SCREEN) - action:@selector(toggleFullScreen:) - keyEquivalent:@"f"]; - [item setKeyEquivalentModifierMask:NSEventModifierFlagCommand | - NSEventModifierFlagOption | - NSEventModifierFlagControl]; - } + item = [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ENTER_FULL_SCREEN) + action:@selector(toggleFullScreen:) + keyEquivalent:@"f"]; + [item setKeyEquivalentModifierMask:NSEventModifierFlagCommand | + NSEventModifierFlagOption | + NSEventModifierFlagControl]; [submenu addItem:[NSMenuItem separatorItem]]; [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_BRING_ALL_TO_FRONT) action:@selector(arrangeInFront:) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 812b46bee2c..d0672b7fb06 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -36,20 +36,6 @@ #import "cocoa_opengl.h" -#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 -enum { - NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7, - NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8, - NSWindowFullScreenButton = 7, - NSWindowStyleMaskFullScreen = 1 << 14, -}; - -@interface NSWindow (WineFullScreenExtensions) - - (void) toggleFullScreen:(id)sender; -@end -#endif - - #if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 /* Additional Mac virtual keycode, to complement those in Carbon's <HIToolbox/Events.h>. */ enum { @@ -1091,11 +1077,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi [[self standardWindowButton:NSWindowMiniaturizeButton] setEnabled:!self.disabled]; if (style & NSWindowStyleMaskResizable) [[self standardWindowButton:NSWindowZoomButton] setEnabled:!self.disabled]; - if ([self respondsToSelector:@selector(toggleFullScreen:)]) - { - if ([self collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary) - [[self standardWindowButton:NSWindowFullScreenButton] setEnabled:!self.disabled]; - } + if ([self collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary) + [[self standardWindowButton:NSWindowFullScreenButton] setEnabled:!self.disabled]; if ([self preventResizing]) { @@ -1115,24 +1098,21 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi - (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior { - if ([self respondsToSelector:@selector(toggleFullScreen:)]) - { - NSUInteger style = [self styleMask]; + NSUInteger style = [self styleMask]; - if (behavior & NSWindowCollectionBehaviorParticipatesInCycle && - style & NSWindowStyleMaskResizable && !(style & NSWindowStyleMaskUtilityWindow) && !maximized && - !(self.parentWindow || self.latentParentWindow)) - { - behavior |= NSWindowCollectionBehaviorFullScreenPrimary; - behavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary; - } - else - { - behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; - behavior |= NSWindowCollectionBehaviorFullScreenAuxiliary; - if (style & NSWindowStyleMaskFullScreen) - [super toggleFullScreen:nil]; - } + if (behavior & NSWindowCollectionBehaviorParticipatesInCycle && + style & NSWindowStyleMaskResizable && !(style & NSWindowStyleMaskUtilityWindow) && !maximized && + !(self.parentWindow || self.latentParentWindow)) + { + behavior |= NSWindowCollectionBehaviorFullScreenPrimary; + behavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary; + } + else + { + behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; + behavior |= NSWindowCollectionBehaviorFullScreenAuxiliary; + if (style & NSWindowStyleMaskFullScreen) + [super toggleFullScreen:nil]; } if (behavior != [self collectionBehavior]) @@ -2480,12 +2460,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi for (i = 0; i < sizeof(buttons) / sizeof(buttons[0]); i++) { - NSButton* button; - - if (buttons[i] == NSWindowFullScreenButton && ![self respondsToSelector:@selector(toggleFullScreen:)]) - continue; - - button = [self standardWindowButton:buttons[i]]; + NSButton* button = [self standardWindowButton:buttons[i]]; if ([button hitTest:[button.superview convertPoint:event.locationInWindow fromView:nil]]) { hitButton = YES; diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index 9f02e93d376..33132de7415 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -1248,7 +1248,6 @@ static BOOL init_gl_info(void) kCGLPFADisplayMask, displayMask, 0 }; -#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 CGLPixelFormatAttribute core_attribs[] = { kCGLPFADisplayMask, displayMask, @@ -1256,7 +1255,6 @@ static BOOL init_gl_info(void) kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core, 0 }; -#endif CGLPixelFormatObj pix; GLint virtualScreens; CGLError err; @@ -1308,7 +1306,6 @@ static BOOL init_gl_info(void) CGLSetCurrentContext(old_context); CGLReleaseContext(context); -#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 err = CGLChoosePixelFormat(core_attribs, &pix, &virtualScreens); if (err != kCGLNoError || !pix) { @@ -1340,7 +1337,6 @@ static BOOL init_gl_info(void) sscanf(str, "%u.%u", &gl_info.max_major, &gl_info.max_minor); CGLSetCurrentContext(old_context); CGLReleaseContext(context); -#endif return TRUE; } @@ -1397,14 +1393,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns CGLError err; BOOL core = major >= 3; -#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 - if (core) - { - WARN("OS X version >= 10.7 is required to be able to create core contexts\n"); - return FALSE; - } -#endif - pf = get_pixel_format(context->format, TRUE /* non-displayable */); if (!pf) { @@ -1480,7 +1468,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns if (pf->backing_store) attribs[n++] = kCGLPFABackingStore; -#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (core) { attribs[n++] = kCGLPFAOpenGLProfile; @@ -1493,7 +1480,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns attribs[n++] = (int)kCGLOGLPVersion_3_2_Core; #endif } -#endif attribs[n] = 0; @@ -1856,12 +1842,8 @@ static CGLPixelFormatObj create_pixel_format_for_renderer(CGLRendererInfoObj ren if (core) { -#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 attrs[3] = kCGLPFAOpenGLProfile; attrs[4] = (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core; -#else - return NULL; -#endif } if (!get_renderer_property(renderer_info, renderer, kCGLRPRendererID, &renderer_id)) @@ -2157,12 +2139,10 @@ static BOOL query_renderer_integer(CGLRendererInfoObj renderer_info, GLint rende } case WGL_RENDERER_VIDEO_MEMORY_WINE: -#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 err = CGLDescribeRenderer(renderer_info, renderer, kCGLRPVideoMemoryMegabytes, (GLint*)value); if (err != kCGLNoError && err != kCGLBadProperty) WARN("CGLDescribeRenderer(kCGLRPVideoMemoryMegabytes) failed: %d %s\n", err, CGLErrorString(err)); if (err != kCGLNoError) -#endif { if (get_renderer_property(renderer_info, renderer, kCGLRPVideoMemory, (GLint*)value)) *value /= 1024 * 1024;
1
0
0
0
Henri Verbeet : ntdll: Only add a module dependency if import_dll() returned a modref.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: deff68bb728a58965fc69bd8a7d3759d6073b6a3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=deff68bb728a58965fc69bd8…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Nov 18 18:52:20 2021 +0100 ntdll: Only add a module dependency if import_dll() returned a modref. In particular, if import_dll() skips an unused import, it will return TRUE, but set *pwm to NULL. This fixes a regression in 3DMark03 version 3.4.0, introduced by commit 0dd37b02f99f5090dd855343fcd8a99496047f3e. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 255d5afef79..a754579bf54 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1282,7 +1282,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) imp = NULL; status = STATUS_DLL_NOT_FOUND; } - else if (!is_import_dll_system( &wm->ldr, &imports[i] )) + else if (imp && !is_import_dll_system( &wm->ldr, &imports[i] )) { add_module_dependency_after( wm->ldr.DdagNode, imp->ldr.DdagNode, dep_after ); }
1
0
0
0
Alexandre Julliard : makefiles: Split the module generation into several helper functions.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: 6944dc51891637b39c02ec22fa35988c41e584da URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6944dc51891637b39c02ec22…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 18 19:21:12 2021 +0100 makefiles: Split the module generation into several helper functions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 147 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 95 insertions(+), 52 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 1455d90d897..e757efdb121 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3219,12 +3219,9 @@ static void output_module( struct makefile *make ) strarray_add( &all_libs, strmake( "-Wl,-delayload,%s%s", make->delayimports.str[i], strchr( make->delayimports.str[i], '.' ) ? "" : ".dll" )); strarray_add( &make->all_targets, strmake( "%s%s", make->module, dll_ext )); - strarray_add( &make->all_targets, strmake( "%s.fake", make->module )); add_install_rule( make, make->module, strmake( "%s%s", make->module, dll_ext ), strmake( "p%s/%s%s", so_dir, make->module, dll_ext )); - add_install_rule( make, make->module, strmake( "%s.fake", make->module ), - strmake( "d%s/%s", pe_dir, make->module )); - output( "%s%s %s.fake:", module_path, dll_ext, module_path ); + output( "%s%s:", module_path, dll_ext ); } else { @@ -3258,56 +3255,55 @@ static void output_module( struct makefile *make ) output_filename( make->is_cross ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); - if (make->unixlib) + if (spec_file) + output_man_pages( make ); + else if (*dll_ext && !make->is_win16 && strendswith( make->module, ".exe" )) { - struct strarray unix_libs = empty_strarray; - struct strarray unix_deps = empty_strarray; - - if (!make->native_unix_lib) - { - struct strarray unix_imports = empty_strarray; + char *binary = replace_extension( make->module, ".exe", "" ); + add_install_rule( make, binary, "wineapploader", strmake( "t$(bindir)/%s", binary )); + } +} - strarray_add( &unix_imports, "ntdll" ); - strarray_add( &unix_deps, obj_dir_path( top_makefile, "dlls/ntdll/ntdll.so" )); - strarray_add( &unix_imports, "winecrt0" ); - if (spec_file) strarray_add( &unix_deps, spec_file ); - strarray_addall( &unix_libs, add_import_libs( make, &unix_deps, unix_imports, 0, 0 )); - } +/******************************************************************* + * output_fake_module + */ +static void output_fake_module( struct makefile *make ) +{ + char *spec_file = NULL; - strarray_addall( &unix_libs, add_unix_libraries( make, &unix_deps )); + if (!make->is_exe) spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); - strarray_add( &make->all_targets, make->unixlib ); - add_install_rule( make, make->module, make->unixlib, strmake( "p%s/%s", so_dir, make->unixlib )); - output( "%s:", obj_dir_path( make, make->unixlib )); - output_filenames_obj_dir( make, make->unixobj_files ); - output_filenames( unix_deps ); + strarray_add( &make->all_targets, strmake( "%s.fake", make->module )); + add_install_rule( make, make->module, strmake( "%s.fake", make->module ), + strmake( "d%s/%s", pe_dir, make->module )); - if (make->native_unix_lib) - { - output( "\n" ); - output( "\t%s$(CC) -o $@", cmd_prefix( "CCLD" )); - output_filenames( get_expanded_make_var_array( make, "UNIXLDFLAGS" )); - } - else - { - output_filename( tools_path( make, "winebuild" )); - output_filename( tools_path( make, "winegcc" )); - output( "\n" ); - output_winegcc_command( make, 0 ); - output_filename( "-munix" ); - output_filename( "-shared" ); - if (spec_file) output_filename( spec_file ); - } - output_filenames_obj_dir( make, make->unixobj_files ); - output_filenames( unix_libs ); - output_filename( "$(LDFLAGS)" ); - output( "\n" ); + output( "%s.fake:", obj_dir_path( make, make->module )); + if (spec_file) output_filename( spec_file ); + output_filenames_obj_dir( make, make->res_files ); + output_filename( tools_path( make, "winebuild" )); + output_filename( tools_path( make, "winegcc" )); + output( "\n" ); + output_winegcc_command( make, make->is_cross ); + output_filename( "-Wb,--fake-module" ); + if (spec_file) + { + output_filename( "-shared" ); + output_filename( spec_file ); } + output_filenames( make->extradllflags ); + output_filenames_obj_dir( make, make->res_files ); + output( "\n" ); +} - if (spec_file && make->importlib) - { - char *importlib_path = obj_dir_path( make, strmake( "lib%s", make->importlib )); + +/******************************************************************* + * output_import_lib + */ +static void output_import_lib( struct makefile *make ) +{ + char *spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); + char *importlib_path = obj_dir_path( make, strmake( "lib%s", make->importlib )); strarray_add( &make->clean_files, strmake( "lib%s.a", make->importlib )); if (!*dll_ext && needs_delay_lib( make )) @@ -3357,14 +3353,55 @@ static void output_module( struct makefile *make ) if (needs_implib_symlink( make )) strarray_addall( &top_makefile->clean_files, output_importlib_symlinks( make )); } +/******************************************************************* + * output_unix_lib + */ +static void output_unix_lib( struct makefile *make ) +{ + struct strarray unix_libs = empty_strarray; + struct strarray unix_deps = empty_strarray; + char *spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); - if (spec_file) - output_man_pages( make ); - else if (*dll_ext && !make->is_win16 && strendswith( make->module, ".exe" )) + if (!make->native_unix_lib) { - char *binary = replace_extension( make->module, ".exe", "" ); - add_install_rule( make, binary, "wineapploader", strmake( "t$(bindir)/%s", binary )); + struct strarray unix_imports = empty_strarray; + + strarray_add( &unix_imports, "ntdll" ); + strarray_add( &unix_deps, obj_dir_path( top_makefile, "dlls/ntdll/ntdll.so" )); + strarray_add( &unix_imports, "winecrt0" ); + if (spec_file) strarray_add( &unix_deps, spec_file ); + + strarray_addall( &unix_libs, add_import_libs( make, &unix_deps, unix_imports, 0, 0 )); } + + strarray_addall( &unix_libs, add_unix_libraries( make, &unix_deps )); + + strarray_add( &make->all_targets, make->unixlib ); + add_install_rule( make, make->module, make->unixlib, strmake( "p%s/%s", so_dir, make->unixlib )); + output( "%s:", obj_dir_path( make, make->unixlib )); + output_filenames_obj_dir( make, make->unixobj_files ); + output_filenames( unix_deps ); + + if (make->native_unix_lib) + { + output( "\n" ); + output( "\t%s$(CC) -o $@", cmd_prefix( "CCLD" )); + output_filenames( get_expanded_make_var_array( make, "UNIXLDFLAGS" )); + } + else + { + output_filename( tools_path( make, "winebuild" )); + output_filename( tools_path( make, "winegcc" )); + output( "\n" ); + output_winegcc_command( make, 0 ); + output_filename( "-munix" ); + output_filename( "-shared" ); + if (spec_file) output_filename( spec_file ); + } + output_filenames_obj_dir( make, make->unixobj_files ); + output_filenames( unix_libs ); + output_filename( "$(LDFLAGS)" ); + output( "\n" ); } @@ -3724,7 +3761,13 @@ static void output_sources( struct makefile *make ) } if (make->staticlib) output_static_lib( make ); - else if (make->module) output_module( make ); + else if (make->module) + { + output_module( make ); + if (*dll_ext && !make->is_cross) output_fake_module( make ); + if (make->unixlib) output_unix_lib( make ); + if (make->importlib) output_import_lib( make ); + } else if (make->testdll) output_test_module( make ); else if (make->sharedlib) output_shared_lib( make ); else if (make->programs.count) output_programs( make );
1
0
0
0
Alexandre Julliard : winegcc: Support an explicit --fake-module option.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: 9ac2eecbbaad305a5b167abffae9fdf4bcc55c4c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9ac2eecbbaad305a5b167abf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 18 19:47:40 2021 +0100 winegcc: Support an explicit --fake-module option. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index f82323d2094..e8457e46643 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -179,6 +179,7 @@ struct options int force_pointer_size; int large_address_aware; int wine_builtin; + int fake_module; int unwind_tables; int strip; int pic; @@ -1002,7 +1003,6 @@ static const char *build_spec_obj( struct options *opts, const char *spec_file, struct strarray spec_args = get_winebuild_args( opts ); struct strarray tool; const char *spec_o_name, *output_name; - int fake_module = strendswith(output_file, ".fake"); /* get the filename from the path */ output_name = get_basename( output_file ); @@ -1020,7 +1020,7 @@ static const char *build_spec_obj( struct options *opts, const char *spec_file, strarray_add(&spec_args, strmake("-m%u", 8 * opts->force_pointer_size )); if (opts->pic && !is_pe) strarray_add(&spec_args, "-fPIC"); strarray_add(&spec_args, opts->shared ? "--dll" : "--exe"); - if (fake_module) + if (opts->fake_module) { strarray_add(&spec_args, "--fake-module"); strarray_add(&spec_args, "-o"); @@ -1101,7 +1101,6 @@ static void build(struct options* opts) const char *output_name, *spec_file, *lang; int generate_app_loader = 1; const char *crt_lib = NULL, *entry_point = NULL; - int fake_module = 0; int is_pe = is_pe_target( opts ); unsigned int j; @@ -1128,7 +1127,7 @@ static void build(struct options* opts) if (opts->shared || is_pe || strendswith(output_file, ".so")) generate_app_loader = 0; - if (strendswith(output_file, ".fake")) fake_module = 1; + if (strendswith(output_file, ".fake")) opts->fake_module = 1; /* normalize the filename a bit: strip .so, ensure it has proper ext */ if (!strchr(get_basename( output_file ), '.')) @@ -1250,7 +1249,7 @@ static void build(struct options* opts) if (spec_file || !opts->unix_lib) spec_o_name = build_spec_obj( opts, spec_file, output_file, files, lib_dirs, entry_point ); - if (fake_module) return; /* nothing else to do */ + if (opts->fake_module) return; /* nothing else to do */ /* link everything together now */ link_args = get_link_args( opts, output_name ); @@ -1880,9 +1879,13 @@ int main(int argc, char **argv) } else if (strncmp("-Wb,", opts.args.str[i], 4) == 0) { - strarray_addall( &opts.winebuild_args, - strarray_fromstring( opts.args.str[i] + 4, ",") ); - /* don't pass it to the compiler, it generates errors */ + unsigned int j; + struct strarray Wb = strarray_fromstring(opts.args.str[i] + 4, ","); + for (j = 0; j < Wb.count; j++) + { + if (!strcmp(Wb.str[j], "--fake-module")) opts.fake_module = 1; + else strarray_add( &opts.winebuild_args, Wb.str[j] ); + } raw_compiler_arg = raw_linker_arg = 0; } break; @@ -1958,7 +1961,7 @@ int main(int argc, char **argv) if (!opts.wine_objdir && is_pe_target( &opts )) opts.use_msvcrt = 1; - if (opts.files.count == 0) forward(&opts); + if (opts.files.count == 0 && !opts.fake_module) forward(&opts); else if (linking) build(&opts); else compile(&opts, lang);
1
0
0
0
Alexandre Julliard : tools: Move target CPU and platform handling to the common tools.h header.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: d969d02e21eb9f128d21a9209f62ac6dfbae236f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d969d02e21eb9f128d21a920…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 16 21:02:12 2021 +0100 tools: Move target CPU and platform handling to the common tools.h header. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/tools.h | 228 ++++++++++++++++++++++++++++++++++++++++++++ tools/widl/widl.c | 121 ++---------------------- tools/widl/widl.h | 7 -- tools/winebuild/build.h | 30 ++---- tools/winebuild/import.c | 34 +++---- tools/winebuild/main.c | 109 ++------------------- tools/winebuild/parser.c | 6 +- tools/winebuild/res32.c | 4 +- tools/winebuild/spec32.c | 30 +++--- tools/winebuild/utils.c | 105 ++++++--------------- tools/winegcc/utils.c | 10 +- tools/winegcc/utils.h | 18 +--- tools/winegcc/winegcc.c | 240 ++++++++++------------------------------------- 13 files changed, 377 insertions(+), 565 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d969d02e21eb9f128d21…
1
0
0
0
Alexandre Julliard : widl: Get rid of PowerPC support.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: c70ed78a364908b8cf54c85fcf0eb0824b3fae9d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c70ed78a364908b8cf54c85f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 17 21:32:51 2021 +0100 widl: Get rid of PowerPC support. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/widl.c | 17 +---------------- tools/widl/widl.h | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 1e473eb9cb7..4e60358fbba 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -96,10 +96,6 @@ static const char version_string[] = "Wine IDL Compiler version " PACKAGE_VERSIO enum target_cpu target_cpu = CPU_x86; #elif defined(__x86_64__) enum target_cpu target_cpu = CPU_x86_64; -#elif defined(__powerpc64__) -enum target_cpu target_cpu = CPU_POWERPC64; -#elif defined(__powerpc__) -enum target_cpu target_cpu = CPU_POWERPC; #elif defined(__arm__) enum target_cpu target_cpu = CPU_ARM; #elif defined(__aarch64__) @@ -227,9 +223,6 @@ static const struct { "i786", CPU_x86 }, { "amd64", CPU_x86_64 }, { "x86_64", CPU_x86_64 }, - { "powerpc", CPU_POWERPC }, - { "powerpc64", CPU_POWERPC64 }, - { "powerpc64le", CPU_POWERPC64 }, { "arm", CPU_ARM }, { "armv5", CPU_ARM }, { "armv6", CPU_ARM }, @@ -855,15 +848,7 @@ int main(int argc,char *argv[]) break; case CPU_ARM64: if (pointer_size == 4) target_cpu = CPU_ARM; - pointer_size = 8; - break; - case CPU_POWERPC64: - if (pointer_size == 4) error( "Cannot build 32-bit code for this CPU\n" ); - pointer_size = 8; - break; - default: - if (pointer_size == 8) error( "Cannot build 64-bit code for this CPU\n" ); - pointer_size = 4; + else pointer_size = 8; break; } diff --git a/tools/widl/widl.h b/tools/widl/widl.h index 38ffc477115..84e9206d390 100644 --- a/tools/widl/widl.h +++ b/tools/widl/widl.h @@ -77,7 +77,7 @@ extern int char_number; enum target_cpu { - CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64, CPU_POWERPC64, CPU_LAST = CPU_POWERPC64 + CPU_x86, CPU_x86_64, CPU_ARM, CPU_ARM64, CPU_LAST = CPU_ARM64 }; extern enum target_cpu target_cpu;
1
0
0
0
Alexandre Julliard : winebuild: Get rid of PowerPC support.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: 61e210f1967a4237d07f5c791433b99f49e78113 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=61e210f1967a4237d07f5c79…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 17 21:32:45 2021 +0100 winebuild: Get rid of PowerPC support. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/build.h | 2 +- tools/winebuild/import.c | 105 +---------------------------------------------- tools/winebuild/main.c | 2 - tools/winebuild/parser.c | 5 --- tools/winebuild/spec32.c | 7 ---- tools/winebuild/utils.c | 26 ++---------- 6 files changed, 5 insertions(+), 142 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=61e210f1967a4237d07f…
1
0
0
0
Alexandre Julliard : winegcc: Get rid of PowerPC support.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: 8cd36798489692d1e79f8d0ec67d1b8e2d82c85c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8cd36798489692d1e79f8d0e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 17 21:32:34 2021 +0100 winegcc: Get rid of PowerPC support. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/utils.h | 2 +- tools/winegcc/winegcc.c | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/tools/winegcc/utils.h b/tools/winegcc/utils.h index 552659e75c3..88bf6ae57d2 100644 --- a/tools/winegcc/utils.h +++ b/tools/winegcc/utils.h @@ -34,7 +34,7 @@ enum target_cpu { - CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64 + CPU_x86, CPU_x86_64, CPU_ARM, CPU_ARM64 }; enum target_platform diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 940eaeb5279..c27ccf7357e 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -171,7 +171,6 @@ static const struct { "i786", CPU_x86 }, { "amd64", CPU_x86_64 }, { "x86_64", CPU_x86_64 }, - { "powerpc", CPU_POWERPC }, { "arm", CPU_ARM }, { "armv5", CPU_ARM }, { "armv6", CPU_ARM }, @@ -251,8 +250,6 @@ struct options static const enum target_cpu build_cpu = CPU_x86; #elif defined(__x86_64__) static const enum target_cpu build_cpu = CPU_x86_64; -#elif defined(__powerpc__) -static const enum target_cpu build_cpu = CPU_POWERPC; #elif defined(__arm__) static const enum target_cpu build_cpu = CPU_ARM; #elif defined(__aarch64__) @@ -474,11 +471,6 @@ static struct strarray get_link_args( struct options *opts, const char *output_n strarray_add( &flags, opts->unix_lib ? "-dynamiclib" : "-bundle" ); strarray_add( &flags, "-multiply_defined" ); strarray_add( &flags, "suppress" ); - if (opts->target_cpu == CPU_POWERPC) - { - strarray_add( &flags, "-read_only_relocs" ); - strarray_add( &flags, "warning" ); - } if (opts->image_base) { strarray_add( &flags, "-image_base" ); @@ -618,7 +610,6 @@ static const char *get_multiarch_dir( enum target_cpu cpu ) case CPU_x86_64: return "/x86_64-linux-gnu"; case CPU_ARM: return "/arm-linux-gnueabi"; case CPU_ARM64: return "/aarch64-linux-gnu"; - case CPU_POWERPC: return "/powerpc-linux-gnu"; default: assert(0); return NULL; @@ -852,11 +843,6 @@ static void compile(struct options* opts, const char* lang) strarray_add(&comp_args, "-D__cdecl=__stdcall"); strarray_add(&comp_args, "-D__fastcall=__stdcall"); break; - case CPU_POWERPC: - strarray_add(&comp_args, "-D__stdcall="); - strarray_add(&comp_args, "-D__cdecl="); - strarray_add(&comp_args, "-D__fastcall="); - break; } strarray_add(&comp_args, "-D_stdcall=__stdcall"); strarray_add(&comp_args, "-D_cdecl=__cdecl");
1
0
0
0
Ivo Ivanov : dinput: Add support for DIPROP_(PHYSICAL|LOGICAL)RANGE properties.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: b793fb54573166f33d0304ec4b542a4b272ac357 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b793fb54573166f33d0304ec…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Thu Nov 18 09:53:19 2021 +0100 dinput: Add support for DIPROP_(PHYSICAL|LOGICAL)RANGE properties. Fixes apps like WheelCheck, which rely on some of these properties (DIPROP_PHYSICALRANGE) to correctly calculate the top center of the wheel against their permitted range. In particular the constant force test now works just like in Windows, directing the wheel to the upper center and resisting any movement to the left or right. Before that it would pull the steering wheel hard to the left. Signed-off-by: Ivo Ivanov <logos128(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 27 +++++++++++++++++++++++++++ dlls/dinput/device_private.h | 2 ++ dlls/dinput/joystick_hid.c | 2 ++ dlls/dinput8/tests/hid.c | 8 -------- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index f70b7e549c0..6240d640e0d 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -936,6 +936,8 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con if (header->dwSize != sizeof(DIPROPPOINTER)) return DIERR_INVALIDPARAM; break; + case (DWORD_PTR)DIPROP_PHYSICALRANGE: + case (DWORD_PTR)DIPROP_LOGICALRANGE: case (DWORD_PTR)DIPROP_RANGE: if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; break; @@ -963,6 +965,8 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con if (header->dwObj) return DIERR_INVALIDPARAM; break; + case (DWORD_PTR)DIPROP_PHYSICALRANGE: + case (DWORD_PTR)DIPROP_LOGICALRANGE: case (DWORD_PTR)DIPROP_RANGE: case (DWORD_PTR)DIPROP_DEADZONE: case (DWORD_PTR)DIPROP_SATURATION: @@ -988,6 +992,8 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con case (DWORD_PTR)DIPROP_AUTOCENTER: case (DWORD_PTR)DIPROP_AXISMODE: case (DWORD_PTR)DIPROP_BUFFERSIZE: + case (DWORD_PTR)DIPROP_PHYSICALRANGE: + case (DWORD_PTR)DIPROP_LOGICALRANGE: if (impl->acquired) return DIERR_ACQUIRED; break; case (DWORD_PTR)DIPROP_FFLOAD: @@ -1023,6 +1029,9 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con if (value->dwData > 1) return DIERR_INVALIDPARAM; break; } + case (DWORD_PTR)DIPROP_PHYSICALRANGE: + case (DWORD_PTR)DIPROP_LOGICALRANGE: + return DIERR_UNSUPPORTED; } } else @@ -1039,6 +1048,8 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con if (impl->caps.dwAxes && !(impl->caps.dwDevType & DIDEVTYPE_HID)) return DIERR_UNSUPPORTED; break; + case (DWORD_PTR)DIPROP_PHYSICALRANGE: + case (DWORD_PTR)DIPROP_LOGICALRANGE: case (DWORD_PTR)DIPROP_DEADZONE: case (DWORD_PTR)DIPROP_SATURATION: case (DWORD_PTR)DIPROP_CALIBRATIONMODE: @@ -1087,6 +1098,20 @@ static BOOL CALLBACK get_object_property( const DIDEVICEOBJECTINSTANCEW *instanc switch (params->property) { + case (DWORD_PTR)DIPROP_PHYSICALRANGE: + { + DIPROPRANGE *value = (DIPROPRANGE *)params->header; + value->lMin = properties->physical_min; + value->lMax = properties->physical_max; + return DI_OK; + } + case (DWORD_PTR)DIPROP_LOGICALRANGE: + { + DIPROPRANGE *value = (DIPROPRANGE *)params->header; + value->lMin = properties->logical_min; + value->lMax = properties->logical_max; + return DI_OK; + } case (DWORD_PTR)DIPROP_RANGE: { DIPROPRANGE *value = (DIPROPRANGE *)params->header; @@ -1151,6 +1176,8 @@ static HRESULT dinput_device_get_property( IDirectInputDevice8W *iface, const GU return impl->vtbl->get_property( iface, LOWORD( guid ), header, NULL ); case (DWORD_PTR)DIPROP_RANGE: + case (DWORD_PTR)DIPROP_PHYSICALRANGE: + case (DWORD_PTR)DIPROP_LOGICALRANGE: case (DWORD_PTR)DIPROP_DEADZONE: case (DWORD_PTR)DIPROP_SATURATION: case (DWORD_PTR)DIPROP_GRANULARITY: diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index c12cc92bc70..e2cae26aea2 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -58,6 +58,8 @@ struct dinput_device_vtbl struct object_properties { LONG bit_size; + LONG physical_min; + LONG physical_max; LONG logical_min; LONG logical_max; LONG range_min; diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2ad3462ca42..70c761267f7 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1486,6 +1486,8 @@ static BOOL init_object_properties( struct hid_joystick *impl, struct hid_value_ LONG tmp; properties->bit_size = caps->bit_size; + properties->physical_min = caps->physical_min; + properties->physical_max = caps->physical_max; properties->logical_min = caps->logical_min; properties->logical_max = caps->logical_max; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 3beabc4b03b..9e21ccdb713 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4253,18 +4253,12 @@ static void test_simple_joystick(void) ok( prop_range.lMin == 0, "got %d expected %d\n", prop_range.lMin, 0 ); ok( prop_range.lMax == 65535, "got %d expected %d\n", prop_range.lMax, 65535 ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph ); - todo_wine ok( hr == DI_OK, "GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr ); - todo_wine ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 ); - todo_wine ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph ); - todo_wine ok( hr == DI_OK, "GetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr ); - todo_wine ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 ); - todo_wine ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 ); prop_pointer.diph.dwHow = DIPH_BYUSAGE; @@ -4810,10 +4804,8 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph ); ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_LOGICALRANGE returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr ); hr = IDirectInputDevice8_Unacquire( device );
1
0
0
0
Rémi Bernon : dinput: Stub support for the DIPROP_CALIBRATIONMODE property.
by Alexandre Julliard
18 Nov '21
18 Nov '21
Module: wine Branch: master Commit: e8d961b5c74ba3a57f33af696ad38f3317ac0ab5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e8d961b5c74ba3a57f33af69…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Nov 18 09:53:18 2021 +0100 dinput: Stub support for the DIPROP_CALIBRATIONMODE property. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 26 ++++++++++++++++++++++++++ dlls/dinput8/tests/hid.c | 11 ----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index ed2ae551e3e..f70b7e549c0 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -920,6 +920,7 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con case (DWORD_PTR)DIPROP_AUTOCENTER: case (DWORD_PTR)DIPROP_AXISMODE: case (DWORD_PTR)DIPROP_BUFFERSIZE: + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: case (DWORD_PTR)DIPROP_DEADZONE: case (DWORD_PTR)DIPROP_FFGAIN: case (DWORD_PTR)DIPROP_FFLOAD: @@ -966,6 +967,7 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con case (DWORD_PTR)DIPROP_DEADZONE: case (DWORD_PTR)DIPROP_SATURATION: case (DWORD_PTR)DIPROP_GRANULARITY: + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: if (header->dwHow == DIPH_DEVICE && !set) return DIERR_UNSUPPORTED; break; @@ -1015,6 +1017,7 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con } case (DWORD_PTR)DIPROP_AUTOCENTER: case (DWORD_PTR)DIPROP_AXISMODE: + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: { const DIPROPDWORD *value = (const DIPROPDWORD *)header; if (value->dwData > 1) return DIERR_INVALIDPARAM; @@ -1038,6 +1041,7 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con case (DWORD_PTR)DIPROP_DEADZONE: case (DWORD_PTR)DIPROP_SATURATION: + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: if (!impl->object_properties) return DIERR_UNSUPPORTED; break; @@ -1102,6 +1106,12 @@ static BOOL CALLBACK get_object_property( const DIDEVICEOBJECTINSTANCEW *instanc value->dwData = properties->saturation; return DIENUM_STOP; } + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: + { + DIPROPDWORD *value = (DIPROPDWORD *)params->header; + value->dwData = properties->calibration_mode; + return DI_OK; + } case (DWORD_PTR)DIPROP_GRANULARITY: { DIPROPDWORD *value = (DIPROPDWORD *)params->header; @@ -1145,6 +1155,7 @@ static HRESULT dinput_device_get_property( IDirectInputDevice8W *iface, const GU case (DWORD_PTR)DIPROP_SATURATION: case (DWORD_PTR)DIPROP_GRANULARITY: case (DWORD_PTR)DIPROP_KEYNAME: + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: hr = impl->vtbl->enum_objects( iface, &filter, object_mask, get_object_property, ¶ms ); if (FAILED(hr)) return hr; if (hr == DIENUM_CONTINUE) return DIERR_NOTFOUND; @@ -1249,6 +1260,12 @@ static BOOL CALLBACK set_object_property( const DIDEVICEOBJECTINSTANCEW *instanc properties->saturation = value->dwData; return DIENUM_CONTINUE; } + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: + { + const DIPROPDWORD *value = (const DIPROPDWORD *)params->header; + properties->calibration_mode = value->dwData; + return DIENUM_CONTINUE; + } } return DIENUM_STOP; @@ -1312,6 +1329,15 @@ static HRESULT WINAPI dinput_device_set_property( IDirectInputDevice8W *iface, c reset_device_state( iface ); return DI_OK; } + case (DWORD_PTR)DIPROP_CALIBRATIONMODE: + { + const DIPROPDWORD *value = (const DIPROPDWORD *)header; + if (value->dwData > DIPROPCALIBRATIONMODE_RAW) return DIERR_INVALIDPARAM; + hr = impl->vtbl->enum_objects( iface, &filter, DIDFT_AXIS, set_object_property, ¶ms ); + if (FAILED(hr)) return hr; + reset_device_state( iface ); + return DI_OK; + } case (DWORD_PTR)DIPROP_AUTOCENTER: { const DIPROPDWORD *value = (const DIPROPDWORD *)header; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index b3f696e09ee..3beabc4b03b 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4215,9 +4215,7 @@ static void test_simple_joystick(void) ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATIONMODE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "GetProperty DIPROP_CALIBRATIONMODE returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == DIPROPCALIBRATIONMODE_COOKED, "got %u expected %u\n", prop_dword.dwData, DIPROPCALIBRATIONMODE_COOKED ); prop_string.diph.dwHow = DIPH_BYUSAGE; @@ -4927,7 +4925,6 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_SATURATION returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_CALIBRATIONMODE, &prop_dword.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_CALIBRATIONMODE returned %#x\n", hr ); prop_dword.dwData = 1000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); @@ -4937,7 +4934,6 @@ static void test_simple_joystick(void) ok( hr == DI_OK, "SetProperty DIPROP_SATURATION returned %#x\n", hr ); prop_dword.dwData = DIPROPCALIBRATIONMODE_COOKED; hr = IDirectInputDevice8_SetProperty( device, DIPROP_CALIBRATIONMODE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "SetProperty DIPROP_CALIBRATIONMODE returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); @@ -5025,13 +5021,10 @@ static void test_simple_joystick(void) prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = DIPROPCALIBRATIONMODE_RAW; hr = IDirectInputDevice8_SetProperty( device, DIPROP_CALIBRATIONMODE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "SetProperty DIPROP_CALIBRATIONMODE returned %#x\n", hr ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATIONMODE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "GetProperty DIPROP_CALIBRATIONMODE returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == DIPROPCALIBRATIONMODE_RAW, "got %u expected %u\n", prop_dword.dwData, DIPROPCALIBRATIONMODE_RAW ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); @@ -5039,23 +5032,19 @@ static void test_simple_joystick(void) winetest_push_context( "state[%d]", i ); todo_wine ok( state.lX == 15, "got lX %d, expected %d\n" , state.lX, 15 ); - todo_wine check_member( state, expect_state_abs[0], "%d", lY ); check_member( state, expect_state_abs[0], "%d", lZ ); check_member( state, expect_state_abs[0], "%d", lRx ); - todo_wine check_member( state, expect_state_abs[0], "%d", rgdwPOV[0] ); check_member( state, expect_state_abs[0], "%d", rgdwPOV[1] ); winetest_pop_context(); prop_dword.dwData = DIPROPCALIBRATIONMODE_COOKED; hr = IDirectInputDevice8_SetProperty( device, DIPROP_CALIBRATIONMODE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "SetProperty DIPROP_CALIBRATIONMODE returned %#x\n", hr ); send_hid_input( file, &injected_input[ARRAY_SIZE(injected_input) - 1], sizeof(*injected_input) ); res = WaitForSingleObject( event, 100 ); - todo_wine ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); hr = IDirectInputDevice8_Unacquire( device );
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
96
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
Results per page:
10
25
50
100
200