winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1024 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Move is_window_rect_full_screen implementation from winex11.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: ee405dd8b88683417af1e21ae6a254edadc32723 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee405dd8b88683417af1e21a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 20 16:00:23 2022 +0200 win32u: Move is_window_rect_full_screen implementation from winex11. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/sysparams.c | 24 ++++++++++++++++++++++++ dlls/winex11.drv/event.c | 2 +- dlls/winex11.drv/mouse.c | 2 +- dlls/winex11.drv/window.c | 34 +++------------------------------- dlls/winex11.drv/x11drv.h | 1 - include/ntuser.h | 6 ++++++ 6 files changed, 35 insertions(+), 34 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 49f3f716b2d..1e8b0fbf489 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1547,6 +1547,27 @@ RECT get_virtual_screen_rect( UINT dpi ) return rect; } +static BOOL is_window_rect_full_screen( const RECT *rect ) +{ + struct monitor *monitor; + BOOL ret = FALSE; + + if (!lock_display_devices()) return FALSE; + + LIST_FOR_EACH_ENTRY( monitor, &monitors, struct monitor, entry ) + { + if (rect->left <= monitor->rc_monitor.left && rect->right >= monitor->rc_monitor.right && + rect->top <= monitor->rc_monitor.top && rect->bottom >= monitor->rc_monitor.bottom) + { + ret = TRUE; + break; + } + } + + unlock_display_devices(); + return ret; +} + RECT get_display_rect( const WCHAR *display ) { struct monitor *monitor; @@ -4698,6 +4719,9 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserCallOneParam_GetSysColor: return get_sys_color( arg ); + case NtUserCallOneParam_IsWindowRectFullScreen: + return is_window_rect_full_screen( (const RECT *)arg ); + case NtUserCallOneParam_RealizePalette: return realize_palette( UlongToHandle(arg) ); diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 900f24c4002..e1bcd70d35a 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1156,7 +1156,7 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) data->window_rect.bottom - data->window_rect.top, cx, cy ); style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); - if ((style & WS_CAPTION) == WS_CAPTION || !is_window_rect_full_screen( &data->whole_rect )) + if ((style & WS_CAPTION) == WS_CAPTION || !NtUserIsWindowRectFullScreen( &data->whole_rect )) { read_net_wm_states( event->display, data ); if ((data->net_wm_state & (1 << NET_WM_STATE_MAXIMIZED))) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 82d3e17a0d1..5bebcf42fb2 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -549,7 +549,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) /* maximized windows don't count as full screen */ if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) return FALSE; if (!(data = get_win_data( hwnd ))) return FALSE; - fullscreen = is_window_rect_full_screen( &data->whole_rect ); + fullscreen = NtUserIsWindowRectFullScreen( &data->whole_rect ); release_win_data( data ); if (!fullscreen) return FALSE; if (!(thread_data = x11drv_thread_data())) return FALSE; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 4c4e47884ff..bed5081d124 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -281,35 +281,7 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl { if (style & WS_THICKFRAME) return TRUE; /* Metacity needs the window to be resizable to make it fullscreen */ - return is_window_rect_full_screen( &data->whole_rect ); -} - -struct monitor_info -{ - const RECT *rect; - BOOL full_screen; -}; - -static BOOL CALLBACK enum_monitor_proc( HMONITOR monitor, HDC hdc, RECT *monitor_rect, LPARAM lparam ) -{ - struct monitor_info *info = (struct monitor_info *)lparam; - - if (info->rect->left <= monitor_rect->left && info->rect->right >= monitor_rect->right && - info->rect->top <= monitor_rect->top && info->rect->bottom >= monitor_rect->bottom) - { - info->full_screen = TRUE; - return FALSE; - } - - return TRUE; -} - -BOOL is_window_rect_full_screen( const RECT *rect ) -{ - struct monitor_info info = {rect, FALSE}; - - EnumDisplayMonitors( NULL, NULL, enum_monitor_proc, (LPARAM)&info ); - return info.full_screen; + return NtUserIsWindowRectFullScreen( &data->whole_rect ); } /*********************************************************************** @@ -992,7 +964,7 @@ void update_net_wm_states( struct x11drv_win_data *data ) style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); if (style & WS_MINIMIZE) new_state |= data->net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED)); - if (is_window_rect_full_screen( &data->whole_rect )) + if (NtUserIsWindowRectFullScreen( &data->whole_rect )) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) new_state |= (1 << NET_WM_STATE_MAXIMIZED); @@ -2511,7 +2483,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, { release_win_data( data ); unmap_window( hwnd ); - if (is_window_rect_full_screen( &old_window_rect )) reset_clipping_window(); + if (NtUserIsWindowRectFullScreen( &old_window_rect )) reset_clipping_window(); if (!(data = get_win_data( hwnd ))) return; } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 23886936dd4..da037297745 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -694,7 +694,6 @@ typedef int (*x11drv_error_callback)( Display *display, XErrorEvent *event, void extern void X11DRV_expect_error( Display *display, x11drv_error_callback callback, void *arg ) DECLSPEC_HIDDEN; extern int X11DRV_check_error(void) DECLSPEC_HIDDEN; extern void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, int y, int cx, int cy ) DECLSPEC_HIDDEN; -extern BOOL is_window_rect_full_screen( const RECT *rect ) DECLSPEC_HIDDEN; extern POINT virtual_screen_to_root( INT x, INT y ) DECLSPEC_HIDDEN; extern POINT root_to_virtual_screen( INT x, INT y ) DECLSPEC_HIDDEN; extern RECT get_host_primary_monitor_rect(void) DECLSPEC_HIDDEN; diff --git a/include/ntuser.h b/include/ntuser.h index bab4a0dc78c..b34ff3da4c1 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -642,6 +642,7 @@ enum NtUserCallOneParam_GetSysColorPen, NtUserCallOneParam_GetSystemMetrics, NtUserCallOneParam_GetVirtualScreenRect, + NtUserCallOneParam_IsWindowRectFullScreen, NtUserCallOneParam_MessageBeep, NtUserCallOneParam_RealizePalette, /* temporary exports */ @@ -732,6 +733,11 @@ static inline RECT NtUserGetVirtualScreenRect(void) return virtual; } +static inline BOOL NtUserIsWindowRectFullScreen( const RECT *rect ) +{ + return NtUserCallOneParam( (UINT_PTR)rect, NtUserCallOneParam_IsWindowRectFullScreen ); +} + static inline BOOL NtUserMessageBeep( UINT i ) { return NtUserCallOneParam( i, NtUserCallOneParam_MessageBeep );
1
0
0
0
Jacek Caban : win32u: Move GetMenuInfo implementation from user32.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: 782220626fa7148d0d7421a5f7e632083a4b89f2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=782220626fa7148d0d7421a5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 20 15:58:00 2022 +0200 win32u: Move GetMenuInfo implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/menu.c | 35 +++-------------------------------- dlls/win32u/menu.c | 23 +++++++++++++++++++++++ dlls/win32u/sysparams.c | 3 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 7 +++++++ 5 files changed, 37 insertions(+), 32 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 2585f92f97d..b1f038938f6 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -5124,40 +5124,11 @@ BOOL WINAPI SetMenuInfo (HMENU hMenu, LPCMENUINFO lpmi) } /********************************************************************** - * GetMenuInfo (USER32.@) - * - * NOTES - * win98/NT5.0 - * + * GetMenuInfo (USER32.@) */ -BOOL WINAPI GetMenuInfo (HMENU hMenu, LPMENUINFO lpmi) +BOOL WINAPI GetMenuInfo( HMENU menu, MENUINFO *info ) { - POPUPMENU *menu; - - TRACE("(%p %p)\n", hMenu, lpmi); - - if (lpmi && (lpmi->cbSize == sizeof(MENUINFO)) && (menu = grab_menu_ptr(hMenu))) - { - if (lpmi->fMask & MIM_BACKGROUND) - lpmi->hbrBack = menu->hbrBack; - - if (lpmi->fMask & MIM_HELPID) - lpmi->dwContextHelpID = menu->dwContextHelpID; - - if (lpmi->fMask & MIM_MAXHEIGHT) - lpmi->cyMax = menu->cyMax; - - if (lpmi->fMask & MIM_MENUDATA) - lpmi->dwMenuData = menu->dwMenuData; - - if (lpmi->fMask & MIM_STYLE) - lpmi->dwStyle = menu->dwStyle; - - release_menu_ptr(menu); - return TRUE; - } - SetLastError( ERROR_INVALID_PARAMETER); - return FALSE; + return NtUserGetMenuInfo( menu, info ); } diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index afe4c148775..fd4e1f74039 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -451,6 +451,29 @@ BOOL WINAPI NtUserGetMenuItemRect( HWND hwnd, HMENU handle, UINT item, RECT *rec return TRUE; } +/* see GetMenuInfo */ +BOOL get_menu_info( HMENU handle, MENUINFO *info ) +{ + POPUPMENU *menu; + + TRACE( "(%p %p)\n", handle, info ); + + if (!info || info->cbSize != sizeof(MENUINFO) || !(menu = grab_menu_ptr( handle ))) + { + SetLastError( ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (info->fMask & MIM_BACKGROUND) info->hbrBack = menu->hbrBack; + if (info->fMask & MIM_HELPID) info->dwContextHelpID = menu->dwContextHelpID; + if (info->fMask & MIM_MAXHEIGHT) info->cyMax = menu->cyMax; + if (info->fMask & MIM_MENUDATA) info->dwMenuData = menu->dwMenuData; + if (info->fMask & MIM_STYLE) info->dwStyle = menu->dwStyle; + + release_menu_ptr(menu); + return TRUE; +} + /********************************************************************** * NtUserSetMenuContextHelpId (win32u.@) */ diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 32da544c157..49f3f716b2d 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4762,6 +4762,9 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code { switch(code) { + case NtUserCallTwoParam_GetMenuInfo: + return get_menu_info( UlongToHandle(arg1), (MENUINFO *)arg2 ); + case NtUserCallTwoParam_GetMonitorInfo: return get_monitor_info( UlongToHandle(arg1), (MONITORINFO *)arg2 ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index f3a751f1836..2299330be0d 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -359,6 +359,7 @@ extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ) DECLSPEC_HIDDEN; extern HMENU create_menu( BOOL is_popup ) DECLSPEC_HIDDEN; extern BOOL draw_menu_bar( HWND hwnd ) DECLSPEC_HIDDEN; extern HMENU get_menu( HWND hwnd ) DECLSPEC_HIDDEN; +extern BOOL get_menu_info( HMENU handle, MENUINFO *info ) DECLSPEC_HIDDEN; extern BOOL set_window_menu( HWND hwnd, HMENU handle ) DECLSPEC_HIDDEN; /* message.c */ diff --git a/include/ntuser.h b/include/ntuser.h index 8420784a5a0..bab4a0dc78c 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -745,6 +745,7 @@ static inline UINT NtUserRealizePalette( HDC hdc ) /* NtUserCallTwoParam codes, not compatible with Windows */ enum { + NtUserCallTwoParam_GetMenuInfo, NtUserCallTwoParam_GetMonitorInfo, NtUserCallTwoParam_GetSystemMetricsForDpi, NtUserCallTwoParam_MonitorFromRect, @@ -756,6 +757,12 @@ enum NtUserGetHandlePtr, }; +static inline BOOL NtUserGetMenuInfo( HMENU menu, MENUINFO *info ) +{ + return NtUserCallTwoParam( HandleToUlong(menu), (ULONG_PTR)info, + NtUserCallTwoParam_GetMenuInfo ); +} + static inline BOOL NtUserGetMonitorInfo( HMONITOR monitor, MONITORINFO *info ) { return NtUserCallTwoParam( HandleToUlong(monitor), (ULONG_PTR)info,
1
0
0
0
Jacek Caban : win32u: Move NtUserSetMenu implemenetation from user32.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: 9015ae5978a15adb8e2fdd48824d08b3cf3680ed URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9015ae5978a15adb8e2fdd48…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 20 15:57:42 2022 +0200 win32u: Move NtUserSetMenu implemenetation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/controls.h | 1 - dlls/user32/mdi.c | 2 +- dlls/user32/menu.c | 49 ---------------------------------- dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 1 - dlls/win32u/gdiobj.c | 1 + dlls/win32u/input.c | 8 ++++++ dlls/win32u/menu.c | 63 ++++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/ntuser_private.h | 1 - dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 3 +++ dlls/win32u/window.c | 2 +- dlls/win32u/wrappers.c | 6 +++++ include/ntuser.h | 1 + 14 files changed, 86 insertions(+), 56 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9015ae5978a15adb8e2f…
1
0
0
0
Jacek Caban : win32u: Move NtUserGetMenuItemRect implementation from user32.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: 19a2af27673271a464172fb8f115ca4f811325e2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=19a2af27673271a464172fb8…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 20 15:57:02 2022 +0200 win32u: Move NtUserGetMenuItemRect implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/menu.c | 49 ++----------------------------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/menu.c | 40 ++++++++++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 10 ++++++++++ include/ntuser.h | 1 + 8 files changed, 57 insertions(+), 49 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 8df665c9132..c62e0818e60 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -4262,13 +4262,13 @@ BOOL WINAPI GetMenuBarInfo( HWND hwnd, LONG idObject, LONG idItem, PMENUBARINFO } else if (idItem == 0) { - GetMenuItemRect(hwnd, hmenu, 0, &pmbi->rcBar); + NtUserGetMenuItemRect( hwnd, hmenu, 0, &pmbi->rcBar ); pmbi->rcBar.right = pmbi->rcBar.left + menu->Width; pmbi->rcBar.bottom = pmbi->rcBar.top + menu->Height; } else { - GetMenuItemRect(hwnd, hmenu, idItem - 1, &pmbi->rcBar); + NtUserGetMenuItemRect( hwnd, hmenu, idItem - 1, &pmbi->rcBar ); } pmbi->hMenu = hmenu; @@ -5120,51 +5120,6 @@ BOOL WINAPI CheckMenuRadioItem(HMENU hMenu, UINT first, UINT last, } -/********************************************************************** - * GetMenuItemRect (USER32.@) - * - * ATTENTION: Here, the returned values in rect are the screen - * coordinates of the item just like if the menu was - * always on the upper left side of the application. - * - */ -BOOL WINAPI GetMenuItemRect(HWND hwnd, HMENU hMenu, UINT uItem, RECT *rect) -{ - POPUPMENU *menu; - UINT pos; - RECT window_rect; - - TRACE("(%p,%p,%d,%p)\n", hwnd, hMenu, uItem, rect); - - if (!rect) - return FALSE; - - if (!(menu = find_menu_item(hMenu, uItem, MF_BYPOSITION, &pos))) - return FALSE; - - if (!hwnd) hwnd = menu->hWnd; - if (!hwnd) - { - release_menu_ptr(menu); - return FALSE; - } - - *rect = menu->items[pos].rect; - OffsetRect(rect, menu->items_rect.left, menu->items_rect.top); - - /* Popup menu item draws in the client area */ - if (menu->wFlags & MF_POPUP) MapWindowPoints(hwnd, 0, (POINT *)rect, 2); - else - { - /* Sysmenu draws in the non-client area */ - GetWindowRect(hwnd, &window_rect); - OffsetRect(rect, window_rect.left, window_rect.top); - } - - release_menu_ptr(menu); - return TRUE; -} - /********************************************************************** * SetMenuInfo (USER32.@) * diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 8af07c49e98..6c54957795b 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -338,7 +338,7 @@ @ stdcall GetMenuItemID(long long) @ stdcall GetMenuItemInfoA(long long long ptr) @ stdcall GetMenuItemInfoW(long long long ptr) -@ stdcall GetMenuItemRect(long long long ptr) +@ stdcall GetMenuItemRect(long long long ptr) NtUserGetMenuItemRect @ stdcall GetMenuState(long long long) @ stdcall GetMenuStringA(long long ptr long long) @ stdcall GetMenuStringW(long long ptr long long) diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index fcb6b83b2e8..ef539d1ffdd 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -348,6 +348,46 @@ BOOL draw_menu_bar( HWND hwnd ) SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); } +/********************************************************************** + * NtUserGetMenuItemRect (win32u.@) + */ +BOOL WINAPI NtUserGetMenuItemRect( HWND hwnd, HMENU handle, UINT item, RECT *rect ) +{ + POPUPMENU *menu; + UINT pos; + RECT window_rect; + + TRACE( "(%p,%p,%d,%p)\n", hwnd, handle, item, rect ); + + if (!rect) + return FALSE; + + if (!(menu = find_menu_item( handle, item, MF_BYPOSITION, &pos ))) + return FALSE; + + if (!hwnd) hwnd = menu->hWnd; + if (!hwnd) + { + release_menu_ptr( menu ); + return FALSE; + } + + *rect = menu->items[pos].rect; + OffsetRect( rect, menu->items_rect.left, menu->items_rect.top ); + + /* Popup menu item draws in the client area */ + if (menu->wFlags & MF_POPUP) map_window_points( hwnd, 0, (POINT *)rect, 2, get_thread_dpi() ); + else + { + /* Sysmenu draws in the non-client area */ + get_window_rect( hwnd, &window_rect, get_thread_dpi() ); + OffsetRect( rect, window_rect.left, window_rect.top ); + } + + release_menu_ptr(menu); + return TRUE; +} + /********************************************************************** * NtUserSetMenuContextHelpId (win32u.@) */ diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 18204a34379..3ac03cef0d9 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -136,6 +136,7 @@ static void * const syscalls[] = NtUserGetKeyboardLayoutName, NtUserGetKeyboardState, NtUserGetLayeredWindowAttributes, + NtUserGetMenuItemRect, NtUserGetMouseMovePointsEx, NtUserGetObjectInformation, NtUserGetOpenClipboardWindow, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 4acb1dae455..44094a55b13 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -954,7 +954,7 @@ @ stub NtUserGetListBoxInfo @ stub NtUserGetMenuBarInfo @ stub NtUserGetMenuIndex -@ stub NtUserGetMenuItemRect +@ stdcall -syscall NtUserGetMenuItemRect(long long long ptr) @ stdcall NtUserGetMessage(ptr long long long) @ stdcall -syscall NtUserGetMouseMovePointsEx(long ptr ptr long long) @ stdcall -syscall NtUserGetObjectInformation(long long long long ptr) diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index fe1b2a2e2e1..52df3a4d67c 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -123,6 +123,7 @@ SYSCALL_ENTRY( NtUserGetKeyboardLayoutName ) \ SYSCALL_ENTRY( NtUserGetKeyboardState ) \ SYSCALL_ENTRY( NtUserGetLayeredWindowAttributes ) \ + SYSCALL_ENTRY( NtUserGetMenuItemRect ) \ SYSCALL_ENTRY( NtUserGetMouseMovePointsEx ) \ SYSCALL_ENTRY( NtUserGetObjectInformation ) \ SYSCALL_ENTRY( NtUserGetOpenClipboardWindow ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 08c65e8a3df..f964b2d1b11 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -642,6 +642,16 @@ NTSTATUS WINAPI wow64_NtUserCheckMenuItem( UINT *args ) return NtUserCheckMenuItem( handle, id, flags ); } +NTSTATUS WINAPI wow64_NtUserGetMenuItemRect( UINT *args ) +{ + HWND hwnd = get_handle( &args ); + HMENU handle = get_handle( &args ); + UINT item = get_ulong( &args ); + RECT *rect = get_ptr( &args ); + + return NtUserGetMenuItemRect( hwnd, handle, item, rect ); +} + NTSTATUS WINAPI wow64_NtUserSetMenuContextHelpId( UINT *args ) { HMENU menu = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 7084dec19eb..47b6900619e 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -492,6 +492,7 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts ); BOOL WINAPI NtUserGetKeyboardLayoutName( WCHAR *name ); BOOL WINAPI NtUserGetKeyboardState( BYTE *state ); BOOL WINAPI NtUserGetLayeredWindowAttributes( HWND hwnd, COLORREF *key, BYTE *alpha, DWORD *flags ); +BOOL WINAPI NtUserGetMenuItemRect( HWND hwnd, HMENU menu, UINT item, RECT *rect ); BOOL WINAPI NtUserGetMessage( MSG *msg, HWND hwnd, UINT first, UINT last ); int WINAPI NtUserGetMouseMovePointsEx( UINT size, MOUSEMOVEPOINT *ptin, MOUSEMOVEPOINT *ptout, int count, DWORD resolution );
1
0
0
0
Jacek Caban : win32u: Move NtUserSetMenuContextHelpId implementation from user32.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: d275253f5db5532f4778ae14344fe28ab2b88c54 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d275253f5db5532f4778ae14…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Apr 20 15:56:50 2022 +0200 win32u: Move NtUserSetMenuContextHelpId implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/menu.c | 19 ------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/menu.c | 15 +++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 8 ++++++++ include/ntuser.h | 1 + 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index b1fdacefc9c..8df665c9132 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -5255,25 +5255,6 @@ BOOL WINAPI GetMenuInfo (HMENU hMenu, LPMENUINFO lpmi) } -/********************************************************************** - * SetMenuContextHelpId (USER32.@) - */ -BOOL WINAPI SetMenuContextHelpId( HMENU hMenu, DWORD dwContextHelpID) -{ - POPUPMENU *menu; - - TRACE("(%p 0x%08x)\n", hMenu, dwContextHelpID); - - if ((menu = grab_menu_ptr(hMenu))) - { - menu->dwContextHelpID = dwContextHelpID; - release_menu_ptr(menu); - return TRUE; - } - return FALSE; -} - - /********************************************************************** * GetMenuContextHelpId (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 783684e8cc7..8af07c49e98 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -679,7 +679,7 @@ @ stdcall SetLayeredWindowAttributes(ptr long long long) NtUserSetLayeredWindowAttributes @ stdcall SetLogonNotifyWindow(long long) @ stdcall SetMenu(long long) -@ stdcall SetMenuContextHelpId(long long) +@ stdcall SetMenuContextHelpId(long long) NtUserSetMenuContextHelpId @ stdcall SetMenuDefaultItem(long long long) @ stdcall SetMenuInfo(long ptr) @ stdcall SetMenuItemBitmaps(long long long long long) diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index b107bd7e8e0..fcb6b83b2e8 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -347,3 +347,18 @@ BOOL draw_menu_bar( HWND hwnd ) return NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); } + +/********************************************************************** + * NtUserSetMenuContextHelpId (win32u.@) + */ +BOOL WINAPI NtUserSetMenuContextHelpId( HMENU handle, DWORD id ) +{ + POPUPMENU *menu; + + TRACE( "(%p 0x%08x)\n", handle, id ); + + if (!(menu = grab_menu_ptr( handle ))) return FALSE; + menu->dwContextHelpID = id; + release_menu_ptr( menu ); + return TRUE; +} diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index f88b8fa30da..18204a34379 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -155,6 +155,7 @@ static void * const syscalls[] = NtUserRemoveClipboardFormatListener, NtUserRemoveProp, NtUserSetKeyboardState, + NtUserSetMenuContextHelpId, NtUserSetObjectInformation, NtUserSetProcessDpiAwarenessContext, NtUserSetProcessWindowStation, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 98bfbb33a2d..4acb1dae455 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1207,7 +1207,7 @@ @ stub NtUserSetMagnificationDesktopMagnifierOffsetsDWMUpdated @ stub NtUserSetManipulationInputTarget @ stub NtUserSetMenu -@ stub NtUserSetMenuContextHelpId +@ stdcall -syscall NtUserSetMenuContextHelpId(long long) @ stub NtUserSetMenuDefaultItem @ stub NtUserSetMenuFlagRtoL @ stub NtUserSetMirrorRendering diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index c1d41c2be43..fe1b2a2e2e1 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -142,6 +142,7 @@ SYSCALL_ENTRY( NtUserRemoveClipboardFormatListener ) \ SYSCALL_ENTRY( NtUserRemoveProp ) \ SYSCALL_ENTRY( NtUserSetKeyboardState ) \ + SYSCALL_ENTRY( NtUserSetMenuContextHelpId ) \ SYSCALL_ENTRY( NtUserSetObjectInformation ) \ SYSCALL_ENTRY( NtUserSetProcessDpiAwarenessContext ) \ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index d916680660a..08c65e8a3df 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -641,3 +641,11 @@ NTSTATUS WINAPI wow64_NtUserCheckMenuItem( UINT *args ) return NtUserCheckMenuItem( handle, id, flags ); } + +NTSTATUS WINAPI wow64_NtUserSetMenuContextHelpId( UINT *args ) +{ + HMENU menu = get_handle( &args ); + DWORD id = get_ulong( &args ); + + return NtUserSetMenuContextHelpId( menu, id ); +} diff --git a/include/ntuser.h b/include/ntuser.h index 879eed4bf79..7084dec19eb 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -553,6 +553,7 @@ BOOL WINAPI NtUserSetCursorPos( INT x, INT y ); HWND WINAPI NtUserSetFocus( HWND hwnd ); BOOL WINAPI NtUserSetKeyboardState( BYTE *state ); BOOL WINAPI NtUserSetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ); +BOOL WINAPI NtUserSetMenuContextHelpId( HMENU handle, DWORD id ); HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent ); BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown ); BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
1
0
0
0
Huw Davies : wineoss: Move MODM_OPEN and MODM_CLOSE to the unixlib.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: f57a3916e8260048ba4d7751ce1496e14693bc5a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f57a3916e8260048ba4d7751…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Apr 20 09:04:24 2022 -0500 wineoss: Move MODM_OPEN and MODM_CLOSE to the unixlib. They are both moved together because of the memory allocated for "lpExtra". Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 180 +++++++----------------------------------- dlls/wineoss.drv/oss.c | 2 +- dlls/wineoss.drv/ossmidi.c | 191 ++++++++++++++++++++++++++++++++++++++++++--- dlls/wineoss.drv/unixlib.h | 28 ++++++- 4 files changed, 235 insertions(+), 166 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f57a3916e8260048ba4d…
1
0
0
0
Huw Davies : wineoss: Add a temporary midi_out_fm_reset syscall.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: 5ebc7d78aa9985f7b38aac4ae8331090d818a7ab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5ebc7d78aa9985f7b38aac4a…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Apr 20 09:04:03 2022 -0500 wineoss: Add a temporary midi_out_fm_reset syscall. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 40 +--------------- dlls/wineoss.drv/oss.c | 1 + dlls/wineoss.drv/ossmidi.c | 113 +++++++++++++++++++++++++++++++++++++++++++++ dlls/wineoss.drv/unixlib.h | 2 + 4 files changed, 118 insertions(+), 38 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 3d2552007cd..7d21dd32ae8 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -737,42 +737,6 @@ static int modFMLoad(WORD dev, int fd) return params.ret; } -/************************************************************************** - * modFMReset [internal] - */ -static void modFMReset(WORD wDevID) -{ - sFMextra* extra = MidiOutDev[wDevID].lpExtra; - sVoice* voice = extra->voice; - sChannel* channel = extra->channel; - int i; - - for (i = 0; i < MidiOutDev[wDevID].caps.wVoices; i++) { - if (voice[i].status != sVS_UNUSED) { - SEQ_STOP_NOTE(wDevID, i, voice[i].note, 64); - } - SEQ_KEY_PRESSURE(wDevID, i, 127, 0); - SEQ_CONTROL(wDevID, i, SEQ_VOLMODE, VOL_METHOD_LINEAR); - voice[i].note = 0; - voice[i].channel = -1; - voice[i].cntMark = 0; - voice[i].status = sVS_UNUSED; - } - for (i = 0; i < 16; i++) { - channel[i].program = 0; - channel[i].bender = 8192; - channel[i].benderRange = 2; - channel[i].bank = 0; - channel[i].volume = 127; - channel[i].balance = 64; - channel[i].expression = 0; - channel[i].sustain = 0; - } - extra->counter = 0; - extra->drumSetMask = 1 << 9; /* channel 10 is normally drums, sometimes 16 also */ - SEQ_DUMPBUF(); -} - #define IS_DRUM_CHANNEL(_xtra, _chn) ((_xtra)->drumSetMask & (1 << (_chn))) /************************************************************************** @@ -846,7 +810,7 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) HeapFree(GetProcessHeap(), 0, extra); return MMSYSERR_ERROR; } - modFMReset(wDevID); + OSS_CALL(midi_out_fm_reset, (void *)(UINT_PTR)wDevID); } break; case MOD_MIDIPORT: @@ -1120,7 +1084,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) case MIDI_SYSTEM_PREFIX: switch (evt & 0x0F) { case 0x0F: /* Reset */ - modFMReset(wDevID); + OSS_CALL(midi_out_fm_reset, (void *)(UINT_PTR)wDevID); break; default: WARN("Unsupported (yet) system event %02x\n", evt & 0x0F); diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index 2fc6c81e560..902685c11b8 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -1409,4 +1409,5 @@ unixlib_entry_t __wine_unix_call_funcs[] = midi_seq_open, midi_out_fm_load, + midi_out_fm_reset, }; diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index ba5dbca7e4f..dcafbe609d9 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -52,6 +52,47 @@ static unsigned int num_dests, num_srcs, num_synths, seq_refs; static struct midi_dest dests[MAX_MIDIOUTDRV]; static struct midi_src srcs[MAX_MIDIINDRV]; +typedef struct sVoice +{ + int note; /* 0 means not used */ + int channel; + unsigned cntMark : 30, + status : 2; +#define sVS_UNUSED 0 +#define sVS_PLAYING 1 +#define sVS_SUSTAINED 2 +} sVoice; + +typedef struct sChannel +{ + int program; + + int bender; + int benderRange; + /* controllers */ + int bank; /* CTL_BANK_SELECT */ + int volume; /* CTL_MAIN_VOLUME */ + int balance; /* CTL_BALANCE */ + int expression; /* CTL_EXPRESSION */ + int sustain; /* CTL_SUSTAIN */ + + unsigned char nrgPmtMSB; /* Non register Parameters */ + unsigned char nrgPmtLSB; + unsigned char regPmtMSB; /* Non register Parameters */ + unsigned char regPmtLSB; +} sChannel; + +typedef struct sFMextra +{ + unsigned counter; + int drumSetMask; + sChannel channel[16]; /* MIDI has only 16 channels */ + sVoice voice[1]; /* dyn allocated according to sound card */ + /* do not append fields below voice[1] since the size of this structure + * depends on the number of available voices on the FM synth... + */ +} sFMextra; + WINE_DEFAULT_DEBUG_CHANNEL(midi); static int oss_to_win_device_type(int type) @@ -346,6 +387,40 @@ wrapup: return STATUS_SUCCESS; } +/* FIXME: this is a bad idea, it's even not static... */ +SEQ_DEFINEBUF(1024); + +/* FIXME: this is not reentrant, not static - because of global variable + * _seqbuf and al. + */ +/************************************************************************** + * seqbuf_dump [internal] + * + * Used by SEQ_DUMPBUF to flush the buffer. + * + */ +void seqbuf_dump(void) +{ + int fd; + + /* The device is already open, but there's no way to pass the + fd to this function. Rather than rely on a global variable + we pretend to open the seq again. */ + fd = seq_open(); + if (_seqbufptr) + { + if (write(fd, _seqbuf, _seqbufptr) == -1) + { + WARN("Can't write data to sequencer %d, errno %d (%s)!\n", + fd, errno, strerror(errno)); + } + /* FIXME: In any case buffer is lost so that if many errors occur the buffer + * will not overrun */ + _seqbufptr = 0; + } + seq_close(fd); +} + extern const unsigned char midiFMInstrumentPatches[16 * 128]; extern const unsigned char midiFMDrumsPatches[16 * 128]; @@ -388,3 +463,41 @@ NTSTATUS midi_out_fm_load(void *args) params->ret = 0; return STATUS_SUCCESS; } + +NTSTATUS midi_out_fm_reset(void *args) +{ + WORD dev_id = (WORD)(UINT_PTR)args; + struct midi_dest *dest = dests + dev_id; + sFMextra *extra = dest->lpExtra; + sVoice *voice = extra->voice; + sChannel *channel = extra->channel; + int i; + + for (i = 0; i < dest->caps.wVoices; i++) + { + if (voice[i].status != sVS_UNUSED) + SEQ_STOP_NOTE(dev_id, i, voice[i].note, 64); + SEQ_KEY_PRESSURE(dev_id, i, 127, 0); + SEQ_CONTROL(dev_id, i, SEQ_VOLMODE, VOL_METHOD_LINEAR); + voice[i].note = 0; + voice[i].channel = -1; + voice[i].cntMark = 0; + voice[i].status = sVS_UNUSED; + } + for (i = 0; i < 16; i++) + { + channel[i].program = 0; + channel[i].bender = 8192; + channel[i].benderRange = 2; + channel[i].bank = 0; + channel[i].volume = 127; + channel[i].balance = 64; + channel[i].expression = 0; + channel[i].sustain = 0; + } + extra->counter = 0; + extra->drumSetMask = 1 << 9; /* channel 10 is normally drums, sometimes 16 also */ + SEQ_DUMPBUF(); + + return STATUS_SUCCESS; +} diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index 4dab53f5148..ecca092d540 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -288,11 +288,13 @@ enum oss_funcs oss_midi_seq_open, /* temporary */ oss_midi_out_fm_load, + oss_midi_out_fm_reset, }; NTSTATUS midi_init(void *args) DECLSPEC_HIDDEN; NTSTATUS midi_seq_open(void *args) DECLSPEC_HIDDEN; NTSTATUS midi_out_fm_load(void *args) DECLSPEC_HIDDEN; +NTSTATUS midi_out_fm_reset(void *args) DECLSPEC_HIDDEN; extern unixlib_handle_t oss_handle;
1
0
0
0
Huw Davies : wineoss: Add a temporary midi_out_fm_patch syscall.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: bbe19f20a9643e2ad2ce03ab7a49b47cb491f1a2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bbe19f20a9643e2ad2ce03ab…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Apr 20 09:03:43 2022 -0500 wineoss: Add a temporary midi_out_fm_patch syscall. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 34 ++++++---------------------------- dlls/wineoss.drv/midipatch.c | 4 ++++ dlls/wineoss.drv/oss.c | 1 + dlls/wineoss.drv/ossmidi.c | 43 +++++++++++++++++++++++++++++++++++++++++++ dlls/wineoss.drv/unixlib.h | 9 +++++++++ 5 files changed, 63 insertions(+), 28 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 58047380639..3d2552007cd 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -723,40 +723,18 @@ typedef struct sFMextra { */ } sFMextra; -extern const unsigned char midiFMInstrumentPatches[16 * 128]; -extern const unsigned char midiFMDrumsPatches [16 * 128]; - /************************************************************************** * modFMLoad [internal] */ -static int modFMLoad(int dev, int fd) +static int modFMLoad(WORD dev, int fd) { - int i; - struct sbi_instrument sbi; - - sbi.device = dev; - sbi.key = FM_PATCH; - - memset(sbi.operators + 16, 0, 16); - for (i = 0; i < 128; i++) { - sbi.channel = i; - memcpy(sbi.operators, midiFMInstrumentPatches + i * 16, 16); + struct midi_out_fm_load_params params; - if (write(fd, &sbi, sizeof(sbi)) == -1) { - WARN("Couldn't write patch for instrument %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); - return -1; - } - } - for (i = 0; i < 128; i++) { - sbi.channel = 128 + i; - memcpy(sbi.operators, midiFMDrumsPatches + i * 16, 16); + params.dev_id = dev; + params.fd = fd; + OSS_CALL(midi_out_fm_load, ¶ms); - if (write(fd, &sbi, sizeof(sbi)) == -1) { - WARN("Couldn't write patch for drum %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); - return -1; - } - } - return 0; + return params.ret; } /************************************************************************** diff --git a/dlls/wineoss.drv/midipatch.c b/dlls/wineoss.drv/midipatch.c index 41d8e07b99a..4ff48623260 100644 --- a/dlls/wineoss.drv/midipatch.c +++ b/dlls/wineoss.drv/midipatch.c @@ -24,6 +24,10 @@ * Eric POUECH : MIDI FM patches for GM instruments */ +#if 0 +#pragma makedep unix +#endif + #define NOT_DEFINED 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, const unsigned char midiFMInstrumentPatches[128 * 16] = { diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index ac8847920b0..2fc6c81e560 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -1408,4 +1408,5 @@ unixlib_entry_t __wine_unix_call_funcs[] = midi_init, midi_seq_open, + midi_out_fm_load, }; diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index a0a0b1caad2..ba5dbca7e4f 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -345,3 +345,46 @@ wrapup: return STATUS_SUCCESS; } + +extern const unsigned char midiFMInstrumentPatches[16 * 128]; +extern const unsigned char midiFMDrumsPatches[16 * 128]; + +NTSTATUS midi_out_fm_load(void *args) +{ + struct midi_out_fm_load_params *params = args; + WORD dev_id = params->dev_id; + int fd = params->fd; + struct sbi_instrument sbi; + int i; + + sbi.device = dev_id; + sbi.key = FM_PATCH; + + memset(sbi.operators + 16, 0, 16); + for (i = 0; i < 128; i++) + { + sbi.channel = i; + memcpy(sbi.operators, midiFMInstrumentPatches + i * 16, 16); + + if (write(fd, &sbi, sizeof(sbi)) == -1) + { + WARN("Couldn't write patch for instrument %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); + params->ret = -1; + return STATUS_SUCCESS; + } + } + for (i = 0; i < 128; i++) + { + sbi.channel = 128 + i; + memcpy(sbi.operators, midiFMDrumsPatches + i * 16, 16); + + if (write(fd, &sbi, sizeof(sbi)) == -1) + { + WARN("Couldn't write patch for drum %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); + params->ret = -1; + return STATUS_SUCCESS; + } + } + params->ret = 0; + return STATUS_SUCCESS; +} diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index 68d41e41f74..4dab53f5148 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -252,6 +252,13 @@ struct midi_seq_open_params int fd; }; +struct midi_out_fm_load_params +{ + WORD dev_id; + int fd; + int ret; +}; + enum oss_funcs { oss_test_connect, @@ -280,10 +287,12 @@ enum oss_funcs oss_midi_init, oss_midi_seq_open, /* temporary */ + oss_midi_out_fm_load, }; NTSTATUS midi_init(void *args) DECLSPEC_HIDDEN; NTSTATUS midi_seq_open(void *args) DECLSPEC_HIDDEN; +NTSTATUS midi_out_fm_load(void *args) DECLSPEC_HIDDEN; extern unixlib_handle_t oss_handle;
1
0
0
0
Huw Davies : wineoss: Add a temporary syscall to open and close the seq fd.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: e37bf4e991b076c7065ca0092830c695b5b4a927 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e37bf4e991b076c7065ca009…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Apr 20 09:03:26 2022 -0500 wineoss: Add a temporary syscall to open and close the seq fd. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 53 +++++++++++----------------------------------- dlls/wineoss.drv/oss.c | 2 ++ dlls/wineoss.drv/ossmidi.c | 12 +++++++++++ dlls/wineoss.drv/unixlib.h | 9 ++++++++ 4 files changed, 35 insertions(+), 41 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 10e5ba854b1..58047380639 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -75,7 +75,6 @@ static int MODM_NumFMSynthDevs = 0; /* this is the total number of MIDI out devices found */ static int MIDM_NumDevs = 0; -static int numOpenMidiSeq = 0; static int numStartedMidiIn = 0; static CRITICAL_SECTION crit_sect; /* protects all MidiIn buffers queues */ @@ -199,49 +198,18 @@ static void MIDI_NotifyClient(UINT wDevID, WORD wMsg, DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwInstance, dwParam1, dwParam2); } -static int midi_warn = 1; /************************************************************************** * midiOpenSeq [internal] */ static int midiOpenSeq(void) { - static int midiSeqFD = -1; - - if (numOpenMidiSeq == 0) { - const char* device; - device=getenv("MIDIDEV"); - if (!device) device="/dev/sequencer"; - midiSeqFD = open(device, O_RDWR, 0); - if (midiSeqFD == -1) { - if (midi_warn) - { - WARN("Can't open MIDI device '%s' ! (%s). If your " - "program needs this (probably not): %s\n", - device, strerror(errno), - errno == ENOENT ? - "create it ! (\"man MAKEDEV\" ?)" : - errno == ENODEV ? - "load MIDI sequencer kernel driver !" : - errno == EACCES ? - "grant access ! (\"man chmod\")" : "" - ); - } - midi_warn = 0; - return -1; - } -#if 0 - if (fcntl(midiSeqFD, F_SETFL, O_NONBLOCK) < 0) { - WARN("can't set sequencer fd to non-blocking, errno %d (%s)\n", errno, strerror(errno)); - close(midiSeqFD); - midiSeqFD = -1; - return -1; - } -#endif - fcntl(midiSeqFD, F_SETFD, 1); /* set close on exec flag */ - ioctl(midiSeqFD, SNDCTL_SEQ_RESET); - } - numOpenMidiSeq++; - return midiSeqFD; + struct midi_seq_open_params params; + + params.close = 0; + params.fd = -1; + OSS_CALL(midi_seq_open, ¶ms); + + return params.fd; } /************************************************************************** @@ -249,8 +217,11 @@ static int midiOpenSeq(void) */ static int midiCloseSeq(int fd) { - if (--numOpenMidiSeq == 0) - close(fd); + struct midi_seq_open_params params; + + params.close = 1; + params.fd = fd; + OSS_CALL(midi_seq_open, ¶ms); return 0; } diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c index 4f3c0bcb2cf..ac8847920b0 100644 --- a/dlls/wineoss.drv/oss.c +++ b/dlls/wineoss.drv/oss.c @@ -1406,4 +1406,6 @@ unixlib_entry_t __wine_unix_call_funcs[] = set_event_handle, is_started, midi_init, + + midi_seq_open, }; diff --git a/dlls/wineoss.drv/ossmidi.c b/dlls/wineoss.drv/ossmidi.c index 75fbf6d7bee..a0a0b1caad2 100644 --- a/dlls/wineoss.drv/ossmidi.c +++ b/dlls/wineoss.drv/ossmidi.c @@ -119,6 +119,18 @@ static int seq_close(int fd) return 0; } +NTSTATUS midi_seq_open(void *args) +{ + struct midi_seq_open_params *params = args; + + if (!params->close) + params->fd = seq_open(); + else + seq_close(params->fd); + + return STATUS_SUCCESS; +} + NTSTATUS midi_init(void *args) { struct midi_init_params *params = args; diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index 8c131037b76..68d41e41f74 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -246,6 +246,12 @@ struct midi_init_params struct midi_src *srcs; }; +struct midi_seq_open_params +{ + int close; + int fd; +}; + enum oss_funcs { oss_test_connect, @@ -272,9 +278,12 @@ enum oss_funcs oss_set_event_handle, oss_is_started, oss_midi_init, + + oss_midi_seq_open, /* temporary */ }; NTSTATUS midi_init(void *args) DECLSPEC_HIDDEN; +NTSTATUS midi_seq_open(void *args) DECLSPEC_HIDDEN; extern unixlib_handle_t oss_handle;
1
0
0
0
Huw Davies : wineoss: Store the sequencer fd in the driver struct.
by Alexandre Julliard
20 Apr '22
20 Apr '22
Module: wine Branch: master Commit: 53eeb1162d8c7e48adf76fcbd6c48fc12e33497b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=53eeb1162d8c7e48adf76fcb…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Apr 20 09:03:03 2022 -0500 wineoss: Store the sequencer fd in the driver struct. This avoids using a global variable. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/midi.c | 78 +++++++++++++++++++++++++++++----------------- dlls/wineoss.drv/unixlib.h | 2 ++ 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 626b3d43d83..10e5ba854b1 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -75,7 +75,6 @@ static int MODM_NumFMSynthDevs = 0; /* this is the total number of MIDI out devices found */ static int MIDM_NumDevs = 0; -static int midiSeqFD = -1; static int numOpenMidiSeq = 0; static int numStartedMidiIn = 0; @@ -96,7 +95,7 @@ static HANDLE hThread; *======================================================================*/ static int midiOpenSeq(void); -static int midiCloseSeq(void); +static int midiCloseSeq(int); static int MIDI_loadcount; /************************************************************************** @@ -206,6 +205,8 @@ static int midi_warn = 1; */ static int midiOpenSeq(void) { + static int midiSeqFD = -1; + if (numOpenMidiSeq == 0) { const char* device; device=getenv("MIDIDEV"); @@ -240,18 +241,17 @@ static int midiOpenSeq(void) ioctl(midiSeqFD, SNDCTL_SEQ_RESET); } numOpenMidiSeq++; - return 0; + return midiSeqFD; } /************************************************************************** * midiCloseSeq [internal] */ -static int midiCloseSeq(void) +static int midiCloseSeq(int fd) { - if (--numOpenMidiSeq == 0) { - close(midiSeqFD); - midiSeqFD = -1; - } + if (--numOpenMidiSeq == 0) + close(fd); + return 0; } @@ -269,10 +269,16 @@ SEQ_DEFINEBUF(1024); */ void seqbuf_dump(void) { + int fd; + + /* The device is already open, but there's no way to pass the + fd to this function. Rather than rely on a global variable + we pretend to open the seq again. */ + fd = midiOpenSeq(); if (_seqbufptr) { - if (write(midiSeqFD, _seqbuf, _seqbufptr) == -1) { + if (write(fd, _seqbuf, _seqbufptr) == -1) { WARN("Can't write data to sequencer %d, errno %d (%s)!\n", - midiSeqFD, errno, strerror(errno)); + fd, errno, strerror(errno)); } /* FIXME: * in any case buffer is lost so that if many errors occur the buffer @@ -280,6 +286,7 @@ void seqbuf_dump(void) */ _seqbufptr = 0; } + midiCloseSeq(fd); } /************************************************************************** @@ -392,8 +399,9 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) } } -static DWORD WINAPI midRecThread(LPVOID arg) +static DWORD WINAPI midRecThread(void *arg) { + int fd = (int)(INT_PTR)arg; unsigned char buffer[256]; int len, idx; DWORD dwTime; @@ -401,7 +409,7 @@ static DWORD WINAPI midRecThread(LPVOID arg) TRACE("Thread startup\n"); - pfd.fd = midiSeqFD; + pfd.fd = fd; pfd.events = POLLIN; while(!end_thread) { @@ -411,7 +419,7 @@ static DWORD WINAPI midRecThread(LPVOID arg) if (poll(&pfd, 1, 250) <= 0) continue; - len = read(midiSeqFD, buffer, sizeof(buffer)); + len = read(fd, buffer, sizeof(buffer)); TRACE("Received %d bytes\n", len); if (len < 0) continue; @@ -470,6 +478,8 @@ static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPSW lpCaps, DWORD dwSize) */ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) { + int fd; + TRACE("(%04X, %p, %08X);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { @@ -501,17 +511,18 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) return MMSYSERR_INVALFLAG; } - if (midiOpenSeq() < 0) { + fd = midiOpenSeq(); + if (fd < 0) { return MMSYSERR_ERROR; } if (numStartedMidiIn++ == 0) { end_thread = 0; - hThread = CreateThread(NULL, 0, midRecThread, NULL, 0, NULL); + hThread = CreateThread(NULL, 0, midRecThread, (void *)(INT_PTR)fd, 0, NULL); if (!hThread) { numStartedMidiIn = 0; WARN("Couldn't create thread for midi-in\n"); - midiCloseSeq(); + midiCloseSeq(fd); return MMSYSERR_ERROR; } SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL); @@ -525,6 +536,7 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) MidiInDev[wDevID].state = 0; MidiInDev[wDevID].incLen = 0; MidiInDev[wDevID].startTime = 0; + MidiInDev[wDevID].fd = fd; MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L); return MMSYSERR_NOERROR; @@ -551,7 +563,7 @@ static DWORD midClose(WORD wDevID) return MIDIERR_STILLPLAYING; } - if (midiSeqFD == -1) { + if (MidiInDev[wDevID].fd == -1) { WARN("ooops !\n"); return MMSYSERR_ERROR; } @@ -564,7 +576,8 @@ static DWORD midClose(WORD wDevID) } TRACE("Stopped thread for midi-in\n"); } - midiCloseSeq(); + midiCloseSeq(MidiInDev[wDevID].fd); + MidiInDev[wDevID].fd = -1; MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L); MidiInDev[wDevID].midiDesc.hMidi = 0; @@ -745,7 +758,7 @@ extern const unsigned char midiFMDrumsPatches [16 * 128]; /************************************************************************** * modFMLoad [internal] */ -static int modFMLoad(int dev) +static int modFMLoad(int dev, int fd) { int i; struct sbi_instrument sbi; @@ -758,7 +771,7 @@ static int modFMLoad(int dev) sbi.channel = i; memcpy(sbi.operators, midiFMInstrumentPatches + i * 16, 16); - if (write(midiSeqFD, &sbi, sizeof(sbi)) == -1) { + if (write(fd, &sbi, sizeof(sbi)) == -1) { WARN("Couldn't write patch for instrument %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); return -1; } @@ -767,7 +780,7 @@ static int modFMLoad(int dev) sbi.channel = 128 + i; memcpy(sbi.operators, midiFMDrumsPatches + i * 16, 16); - if (write(midiSeqFD, &sbi, sizeof(sbi)) == -1) { + if (write(fd, &sbi, sizeof(sbi)) == -1) { WARN("Couldn't write patch for drum %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); return -1; } @@ -833,6 +846,8 @@ static DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPSW lpCaps, DWORD dwSize) */ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) { + int fd = -1; + TRACE("(%04X, %p, %08X);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { WARN("Invalid Parameter !\n"); @@ -870,13 +885,14 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) return MMSYSERR_NOMEM; } MidiOutDev[wDevID].lpExtra = extra; - if (midiOpenSeq() < 0) { + fd = midiOpenSeq(); + if (fd < 0) { MidiOutDev[wDevID].lpExtra = 0; HeapFree(GetProcessHeap(), 0, extra); return MMSYSERR_ERROR; } - if (modFMLoad(wDevID) < 0) { - midiCloseSeq(); + if (modFMLoad(wDevID, fd) < 0) { + midiCloseSeq(fd); MidiOutDev[wDevID].lpExtra = 0; HeapFree(GetProcessHeap(), 0, extra); return MMSYSERR_ERROR; @@ -886,7 +902,8 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) break; case MOD_MIDIPORT: case MOD_SYNTH: - if (midiOpenSeq() < 0) { + fd = midiOpenSeq(); + if (fd < 0) { return MMSYSERR_ALLOCATED; } break; @@ -900,6 +917,7 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) MidiOutDev[wDevID].lpQueueHdr = NULL; MidiOutDev[wDevID].midiDesc = *lpDesc; + MidiOutDev[wDevID].fd = fd; MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L); TRACE("Successful !\n"); @@ -923,15 +941,16 @@ static DWORD modClose(WORD wDevID) /* FIXME: should test that no pending buffer is still in the queue for * playing */ - if (midiSeqFD == -1) { + if (MidiOutDev[wDevID].fd == -1) { WARN("can't close !\n"); return MMSYSERR_ERROR; } switch (MidiOutDev[wDevID].caps.wTechnology) { case MOD_FMSYNTH: + case MOD_SYNTH: case MOD_MIDIPORT: - midiCloseSeq(); + midiCloseSeq(MidiOutDev[wDevID].fd); break; default: WARN("Technology not supported (yet) %d !\n", @@ -941,6 +960,7 @@ static DWORD modClose(WORD wDevID) HeapFree(GetProcessHeap(), 0, MidiOutDev[wDevID].lpExtra); MidiOutDev[wDevID].lpExtra = 0; + MidiOutDev[wDevID].fd = -1; MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L); MidiOutDev[wDevID].midiDesc.hMidi = 0; @@ -961,7 +981,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) if (wDevID >= MODM_NumDevs) return MMSYSERR_BADDEVICEID; if (!MidiOutDev[wDevID].bEnabled) return MIDIERR_NODEVICE; - if (midiSeqFD == -1) { + if (MidiOutDev[wDevID].fd == -1) { WARN("can't play !\n"); return MIDIERR_NODEVICE; } @@ -1256,7 +1276,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) if (wDevID >= MODM_NumDevs) return MMSYSERR_BADDEVICEID; if (!MidiOutDev[wDevID].bEnabled) return MIDIERR_NODEVICE; - if (midiSeqFD == -1) { + if (MidiOutDev[wDevID].fd == -1) { WARN("can't play !\n"); return MIDIERR_NODEVICE; } diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index 2b30c5992c7..8c131037b76 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -222,6 +222,7 @@ typedef struct midi_src char incLen; UINT startTime; MIDIINCAPSW caps; + int fd; } WINE_MIDIIN; typedef struct midi_dest @@ -232,6 +233,7 @@ typedef struct midi_dest MIDIHDR *lpQueueHdr; void *lpExtra; /* according to port type (MIDI, FM...), extra data when needed */ MIDIOUTCAPSW caps; + int fd; } WINE_MIDIOUT; struct midi_init_params
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
103
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Results per page:
10
25
50
100
200