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 2018
----- 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
542 discussions
Start a n
N
ew thread
Alexandre Julliard : user32: Implement AdjustWindowRectExForDpi().
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 300217e38b63a61a3539c1ba20ad1cd1c1a69dbe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=300217e38b63a61a3539c1ba…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 17 11:23:29 2018 +0200 user32: Implement AdjustWindowRectExForDpi(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/nonclient.c | 19 +++++++++++++++++++ dlls/user32/tests/win.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- dlls/user32/user32.spec | 1 + include/winuser.h | 1 + 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 1bdb823..4444a2c 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -323,7 +323,26 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); adjust_window_rect( rect, style, menu, exStyle, &ncm ); + return TRUE; +} + + +/*********************************************************************** + * AdjustWindowRectExForDpi (USER32.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectExForDpi( LPRECT rect, DWORD style, BOOL menu, + DWORD exStyle, UINT dpi ) +{ + NONCLIENTMETRICSW ncm; + + if (style & WS_MINIMIZE) return TRUE; + + TRACE("(%s) %08x %d %08x %u\n", wine_dbgstr_rect(rect), style, menu, exStyle, dpi ); + ncm.cbSize = sizeof(ncm); + SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); + + adjust_window_rect( rect, style, menu, exStyle, &ncm ); return TRUE; } diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 61bb736..d409918 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -69,6 +69,8 @@ static DWORD (WINAPI *pGetLayout)(HDC hdc); static BOOL (WINAPI *pMirrorRgn)(HWND hwnd, HRGN hrgn); static BOOL (WINAPI *pGetWindowDisplayAffinity)(HWND hwnd, DWORD *affinity); static BOOL (WINAPI *pSetWindowDisplayAffinity)(HWND hwnd, DWORD affinity); +static BOOL (WINAPI *pAdjustWindowRectExForDpi)(LPRECT,DWORD,BOOL,DWORD,UINT); +static BOOL (WINAPI *pSystemParametersInfoForDpi)(UINT,UINT,void*,UINT,UINT); static BOOL test_lbuttondown_flag; static DWORD num_gettext_msgs; @@ -1053,6 +1055,39 @@ static void wine_AdjustWindowRectEx( RECT *rect, LONG style, BOOL menu, LONG exS if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL); } +static void wine_AdjustWindowRectExForDpi( RECT *rect, LONG style, BOOL menu, LONG exStyle, UINT dpi ) +{ + NONCLIENTMETRICSW ncm; + int adjust = 0; + + ncm.cbSize = sizeof(ncm); + pSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi ); + + if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) + adjust = 1; /* for the outer frame always present */ + else if ((exStyle & WS_EX_DLGMODALFRAME) || (style & (WS_THICKFRAME|WS_DLGFRAME))) + adjust = 2; /* outer */ + + if (style & WS_THICKFRAME) adjust += ncm.iBorderWidth + ncm.iPaddedBorderWidth; + + if ((style & (WS_BORDER|WS_DLGFRAME)) || (exStyle & WS_EX_DLGMODALFRAME)) + adjust++; /* The other border */ + + InflateRect (rect, adjust, adjust); + + if ((style & WS_CAPTION) == WS_CAPTION) + { + if (exStyle & WS_EX_TOOLWINDOW) + rect->top -= ncm.iSmCaptionHeight + 1; + else + rect->top -= ncm.iCaptionHeight + 1; + } + if (menu) rect->top -= ncm.iMenuHeight + 1; + + if (exStyle & WS_EX_CLIENTEDGE) + InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE)); +} + static void test_nonclient_area(HWND hwnd) { DWORD style, exstyle; @@ -5282,8 +5317,15 @@ static void test_AWR_flags(void) rect2 = rect; AdjustWindowRectEx( &rect, style, FALSE, exstyle ); wine_AdjustWindowRectEx( &rect2, style, FALSE, exstyle ); - ok( EqualRect( &rect, &rect2 ), "rects do not match: win %s wine %s\n", - wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 )); + ok( EqualRect( &rect, &rect2 ), "%08x %08x rects do not match: win %s wine %s\n", + style, exstyle, wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 )); + if (pAdjustWindowRectExForDpi) + { + pAdjustWindowRectExForDpi( &rect, style, FALSE, exstyle, 192 ); + wine_AdjustWindowRectExForDpi( &rect2, style, FALSE, exstyle, 192 ); + ok( EqualRect( &rect, &rect2 ), "%08x %08x rects do not match: win %s wine %s\n", + style, exstyle, wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &rect2 )); + } } } } @@ -10521,6 +10563,8 @@ START_TEST(win) pMirrorRgn = (void *)GetProcAddress( gdi32, "MirrorRgn" ); pGetWindowDisplayAffinity = (void *)GetProcAddress( user32, "GetWindowDisplayAffinity" ); pSetWindowDisplayAffinity = (void *)GetProcAddress( user32, "SetWindowDisplayAffinity" ); + pAdjustWindowRectExForDpi = (void *)GetProcAddress( user32, "AdjustWindowRectExForDpi" ); + pSystemParametersInfoForDpi = (void *)GetProcAddress( user32, "SystemParametersInfoForDpi" ); if (argc==4 && !strcmp(argv[2], "create_children")) { diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 3314518..8d9058b 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -2,6 +2,7 @@ @ stdcall AddClipboardFormatListener(long) @ stdcall AdjustWindowRect(ptr long long) @ stdcall AdjustWindowRectEx(ptr long long long) +@ stdcall AdjustWindowRectExForDpi(ptr long long long long) @ stdcall AlignRects(ptr long long long) # @ stub AllowForegroundActivation @ stdcall AllowSetForegroundWindow (long) diff --git a/include/winuser.h b/include/winuser.h index ab3aba2..86cdbf6 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3369,6 +3369,7 @@ WINUSERAPI HKL WINAPI ActivateKeyboardLayout(HKL,UINT); WINUSERAPI BOOL WINAPI AddClipboardFormatListener(HWND); WINUSERAPI BOOL WINAPI AdjustWindowRect(LPRECT,DWORD,BOOL); WINUSERAPI BOOL WINAPI AdjustWindowRectEx(LPRECT,DWORD,BOOL,DWORD); +WINUSERAPI BOOL WINAPI AdjustWindowRectExForDpi(RECT*,DWORD,BOOL,DWORD,UINT); WINUSERAPI BOOL WINAPI AllowSetForegroundWindow(DWORD); WINUSERAPI BOOL WINAPI AnimateWindow(HWND,DWORD,DWORD); #define AnsiLowerA CharLowerA
1
0
0
0
Alexandre Julliard : user32: Reimplement AdjustWindowRectEx using NONCLIENTMETRICSW.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 77013e97960e10a7e0ea4dd7e239dc0668d54f48 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=77013e97960e10a7e0ea4dd7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 17 11:22:52 2018 +0200 user32: Reimplement AdjustWindowRectEx using NONCLIENTMETRICSW. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/nonclient.c | 100 +++++++++--------------------------------------- dlls/user32/tests/win.c | 32 +++++++--------- 2 files changed, 33 insertions(+), 99 deletions(-) diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 3f3d96a..1bdb823 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -55,54 +55,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(nonclient); (((exStyle) & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == \ WS_EX_STATICEDGE) -#define HAS_ANYFRAME(style,exStyle) \ - (((style) & (WS_THICKFRAME | WS_DLGFRAME | WS_BORDER)) || \ - ((exStyle) & WS_EX_DLGMODALFRAME) || \ - !((style) & (WS_CHILD | WS_POPUP))) - #define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd)) -/****************************************************************************** - * NC_AdjustRectOuter - * - * Computes the size of the "outside" parts of the window based on the - * parameters of the client area. - * - * PARAMS - * LPRECT rect - * DWORD style - * BOOL menu - * DWORD exStyle - * - * NOTES - * "Outer" parts of a window means the whole window frame, caption and - * menu bar. It does not include "inner" parts of the frame like client - * edge, static edge or scroll bars. - * - *****************************************************************************/ - -static void -NC_AdjustRectOuter (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) +static void adjust_window_rect( RECT *rect, DWORD style, BOOL menu, DWORD exStyle, NONCLIENTMETRICSW *ncm ) { - int adjust; + int adjust = 0; - if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == - WS_EX_STATICEDGE) - { + if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) adjust = 1; /* for the outer frame always present */ - } - else - { - adjust = 0; - if ((exStyle & WS_EX_DLGMODALFRAME) || - (style & (WS_THICKFRAME|WS_DLGFRAME))) adjust = 2; /* outer */ - } + else if ((exStyle & WS_EX_DLGMODALFRAME) || (style & (WS_THICKFRAME|WS_DLGFRAME))) + adjust = 2; /* outer */ + if (style & WS_THICKFRAME) - adjust += ( GetSystemMetrics (SM_CXFRAME) - - GetSystemMetrics (SM_CXDLGFRAME)); /* The resize border */ - if ((style & (WS_BORDER|WS_DLGFRAME)) || - (exStyle & WS_EX_DLGMODALFRAME)) + adjust += ncm->iBorderWidth + ncm->iPaddedBorderWidth; /* The resize border */ + + if ((style & (WS_BORDER|WS_DLGFRAME)) || (exStyle & WS_EX_DLGMODALFRAME)) adjust++; /* The other border */ InflateRect (rect, adjust, adjust); @@ -110,50 +78,17 @@ NC_AdjustRectOuter (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) if ((style & WS_CAPTION) == WS_CAPTION) { if (exStyle & WS_EX_TOOLWINDOW) - rect->top -= GetSystemMetrics(SM_CYSMCAPTION); + rect->top -= ncm->iSmCaptionHeight + 1; else - rect->top -= GetSystemMetrics(SM_CYCAPTION); + rect->top -= ncm->iCaptionHeight + 1; } - if (menu) rect->top -= GetSystemMetrics(SM_CYMENU); -} + if (menu) rect->top -= ncm->iMenuHeight + 1; - -/****************************************************************************** - * NC_AdjustRectInner - * - * Computes the size of the "inside" part of the window based on the - * parameters of the client area. - * - * PARAMS - * LPRECT rect - * DWORD style - * DWORD exStyle - * - * NOTES - * "Inner" part of a window means the window frame inside of the flat - * window frame. It includes the client edge, the static edge and the - * scroll bars. - * - *****************************************************************************/ - -static void -NC_AdjustRectInner (LPRECT rect, DWORD style, DWORD exStyle) -{ if (exStyle & WS_EX_CLIENTEDGE) InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE)); - - if (style & WS_VSCROLL) - { - if((exStyle & WS_EX_LEFTSCROLLBAR) != 0) - rect->left -= GetSystemMetrics(SM_CXVSCROLL); - else - rect->right += GetSystemMetrics(SM_CXVSCROLL); - } - if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL); } - static HICON NC_IconForWindow( HWND hwnd ) { HICON hIcon = 0; @@ -378,13 +313,16 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRect( LPRECT rect, DWORD style, BOOL m */ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL menu, DWORD exStyle ) { + NONCLIENTMETRICSW ncm; + if (style & WS_MINIMIZE) return TRUE; - style &= ~(WS_HSCROLL | WS_VSCROLL); TRACE("(%s) %08x %d %08x\n", wine_dbgstr_rect(rect), style, menu, exStyle ); - NC_AdjustRectOuter( rect, style, menu, exStyle ); - NC_AdjustRectInner( rect, style, exStyle ); + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + + adjust_window_rect( rect, style, menu, exStyle, &ncm ); return TRUE; } @@ -411,7 +349,7 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect ) if (!(style & WS_MINIMIZE)) { - NC_AdjustRectOuter( &tmpRect, style, FALSE, exStyle ); + AdjustWindowRectEx( &tmpRect, style, FALSE, exStyle & ~WS_EX_CLIENTEDGE); winRect->left -= tmpRect.left; winRect->top -= tmpRect.top; diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index e8d0b0f..61bb736 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1014,23 +1014,19 @@ static void FixedAdjustWindowRectEx(RECT* rc, LONG style, BOOL menu, LONG exstyl /* reimplement it to check that the Wine algorithm gives the correct result */ static void wine_AdjustWindowRectEx( RECT *rect, LONG style, BOOL menu, LONG exStyle ) { - int adjust; + NONCLIENTMETRICSW ncm; + int adjust = 0; - if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == - WS_EX_STATICEDGE) - { + ncm.cbSize = offsetof( NONCLIENTMETRICSW, iPaddedBorderWidth ); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + + if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) adjust = 1; /* for the outer frame always present */ - } - else - { - adjust = 0; - if ((exStyle & WS_EX_DLGMODALFRAME) || - (style & (WS_THICKFRAME|WS_DLGFRAME))) adjust = 2; /* outer */ - } - if (style & WS_THICKFRAME) - adjust += GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXDLGFRAME); /* The resize border */ - if ((style & (WS_BORDER|WS_DLGFRAME)) || - (exStyle & WS_EX_DLGMODALFRAME)) + else if ((exStyle & WS_EX_DLGMODALFRAME) || (style & (WS_THICKFRAME|WS_DLGFRAME))) + adjust = 2; /* outer */ + + if (style & WS_THICKFRAME) adjust += ncm.iBorderWidth; /* The resize border */ + if ((style & (WS_BORDER|WS_DLGFRAME)) || (exStyle & WS_EX_DLGMODALFRAME)) adjust++; /* The other border */ InflateRect (rect, adjust, adjust); @@ -1038,11 +1034,11 @@ static void wine_AdjustWindowRectEx( RECT *rect, LONG style, BOOL menu, LONG exS if ((style & WS_CAPTION) == WS_CAPTION) { if (exStyle & WS_EX_TOOLWINDOW) - rect->top -= GetSystemMetrics(SM_CYSMCAPTION); + rect->top -= ncm.iSmCaptionHeight + 1; else - rect->top -= GetSystemMetrics(SM_CYCAPTION); + rect->top -= ncm.iCaptionHeight + 1; } - if (menu) rect->top -= GetSystemMetrics(SM_CYMENU); + if (menu) rect->top -= ncm.iMenuHeight + 1; if (exStyle & WS_EX_CLIENTEDGE) InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
1
0
0
0
Alistair Leslie-Hughes : ntoskrnl: Add FsRtlRegisterFileSystemFilterCallbacks stub.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: f8f7b46ea4fb85285d8dc93195287c2ede096251 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f8f7b46ea4fb85285d8dc931…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Apr 17 05:09:00 2018 +0000 ntoskrnl: Add FsRtlRegisterFileSystemFilterCallbacks stub. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.c | 9 ++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- include/ddk/ntifs.h | 82 +++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 8e6fde2..99f5f92 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -3516,3 +3516,12 @@ HANDLE WINAPI PsGetProcessId(PEPROCESS process) return 0; } + +/********************************************************************* + * FsRtlRegisterFileSystemFilterCallbacks (NTOSKRNL.@) + */ +NTSTATUS WINAPI FsRtlRegisterFileSystemFilterCallbacks( DRIVER_OBJECT *object, PFS_FILTER_CALLBACKS callbacks) +{ + FIXME("stub: %p %p\n", object, callbacks); + return STATUS_NOT_IMPLEMENTED; +} diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index ce9f93c..0bece17 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -273,7 +273,7 @@ @ stub FsRtlPrepareMdlWriteDev @ stub FsRtlPrivateLock @ stub FsRtlProcessFileLock -@ stub FsRtlRegisterFileSystemFilterCallbacks +@ stdcall FsRtlRegisterFileSystemFilterCallbacks(ptr ptr) @ stdcall FsRtlRegisterUncProvider(ptr ptr long) @ stub FsRtlReleaseFile @ stub FsRtlRemoveLargeMcbEntry diff --git a/include/ddk/ntifs.h b/include/ddk/ntifs.h index 8c63d0b..50aaabe 100644 --- a/include/ddk/ntifs.h +++ b/include/ddk/ntifs.h @@ -46,6 +46,88 @@ typedef struct _KQUEUE LIST_ENTRY ThreadListHead; } KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE; +typedef enum _FS_FILTER_STREAM_FO_NOTIFICATION_TYPE +{ + NotifyTypeCreate = 0, + NotifyTypeRetired +} FS_FILTER_STREAM_FO_NOTIFICATION_TYPE, *PFS_FILTER_STREAM_FO_NOTIFICATION_TYPE; + +typedef union _FS_FILTER_PARAMETERS +{ + struct + { + PLARGE_INTEGER EndingOffset; + PERESOURCE *ResourceToRelease; + } AcquireForModifiedPageWriter; + + struct + { + PERESOURCE ResourceToRelease; + } ReleaseForModifiedPageWriter; + + struct + { + FS_FILTER_SECTION_SYNC_TYPE SyncType; + ULONG PageProtection; + PFS_FILTER_SECTION_SYNC_OUTPUT OutputInformation; + } AcquireForSectionSynchronization; + + struct + { + FS_FILTER_STREAM_FO_NOTIFICATION_TYPE NotificationType; + BOOLEAN POINTER_ALIGNMENT SafeToRecurse; + } NotifyStreamFileObject; + + struct + { + PIRP Irp; + void *FileInformation; + PULONG Length; + FILE_INFORMATION_CLASS FileInformationClass; + NTSTATUS CompletionStatus; + } QueryOpen; + + struct + { + void *Argument1; + void *Argument2; + void *Argument3; + void *Argument4; + void *Argument5; + } Others; + +} FS_FILTER_PARAMETERS, *PFS_FILTER_PARAMETERS; + +typedef struct _FS_FILTER_CALLBACK_DATA +{ + ULONG SizeOfFsFilterCallbackData; + UCHAR Operation; + UCHAR Reserved; + struct _DEVICE_OBJECT *DeviceObject; + struct _FILE_OBJECT *FileObject; + FS_FILTER_PARAMETERS Parameters; +} FS_FILTER_CALLBACK_DATA, *PFS_FILTER_CALLBACK_DATA; + +typedef NTSTATUS (WINAPI *PFS_FILTER_CALLBACK)(PFS_FILTER_CALLBACK_DATA, void **); +typedef void (WINAPI *PFS_FILTER_COMPLETION_CALLBACK)(PFS_FILTER_CALLBACK_DATA, NTSTATUS, void *context); + +typedef struct _FS_FILTER_CALLBACKS +{ + ULONG SizeOfFsFilterCallbacks; + ULONG Reserved; + PFS_FILTER_CALLBACK PreAcquireForSectionSynchronization; + PFS_FILTER_COMPLETION_CALLBACK PostAcquireForSectionSynchronization; + PFS_FILTER_CALLBACK PreReleaseForSectionSynchronization; + PFS_FILTER_COMPLETION_CALLBACK PostReleaseForSectionSynchronization; + PFS_FILTER_CALLBACK PreAcquireForCcFlush; + PFS_FILTER_COMPLETION_CALLBACK PostAcquireForCcFlush; + PFS_FILTER_CALLBACK PreReleaseForCcFlush; + PFS_FILTER_COMPLETION_CALLBACK PostReleaseForCcFlush; + PFS_FILTER_CALLBACK PreAcquireForModifiedPageWriter; + PFS_FILTER_COMPLETION_CALLBACK PostAcquireForModifiedPageWriter; + PFS_FILTER_CALLBACK PreReleaseForModifiedPageWriter; + PFS_FILTER_COMPLETION_CALLBACK PostReleaseForModifiedPageWriter; +} FS_FILTER_CALLBACKS, *PFS_FILTER_CALLBACKS; NTSTATUS WINAPI ObQueryNameString(PVOID,POBJECT_NAME_INFORMATION,ULONG,PULONG);
1
0
0
0
Austin English : ntdsapi: Add DsCrackNamesA/W stubs.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 369c163929dc82c66b65077a5e28d0821ec8b382 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=369c163929dc82c66b65077a…
Author: Austin English <austinenglish(a)gmail.com> Date: Fri Apr 13 16:11:47 2018 -0500 ntdsapi: Add DsCrackNamesA/W stubs. Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- ...-win-security-activedirectoryclient-l1-1-0.spec | 2 +- dlls/ntdsapi/ntdsapi.c | 23 +++++++++ dlls/ntdsapi/ntdsapi.spec | 4 +- include/ntdsapi.h | 59 ++++++++++++++++++++++ 4 files changed, 85 insertions(+), 3 deletions(-) diff --git a/dlls/api-ms-win-security-activedirectoryclient-l1-1-0/api-ms-win-security-activedirectoryclient-l1-1-0.spec b/dlls/api-ms-win-security-activedirectoryclient-l1-1-0/api-ms-win-security-activedirectoryclient-l1-1-0.spec index eef1c40..8f897f7 100644 --- a/dlls/api-ms-win-security-activedirectoryclient-l1-1-0/api-ms-win-security-activedirectoryclient-l1-1-0.spec +++ b/dlls/api-ms-win-security-activedirectoryclient-l1-1-0/api-ms-win-security-activedirectoryclient-l1-1-0.spec @@ -1,5 +1,5 @@ @ stub DsBindWithSpnExW -@ stub DsCrackNamesW +@ stdcall DsCrackNamesW(ptr long long long long ptr ptr) ntdsapi.DsCrackNamesW @ stub DsFreeDomainControllerInfoW @ stub DsFreeNameResultW @ stub DsFreePasswordCredentials diff --git a/dlls/ntdsapi/ntdsapi.c b/dlls/ntdsapi/ntdsapi.c index ee0c837..003b1a2 100644 --- a/dlls/ntdsapi/ntdsapi.c +++ b/dlls/ntdsapi/ntdsapi.c @@ -204,6 +204,9 @@ DWORD WINAPI DsServerRegisterSpnW(DS_SPN_WRITE_OP operation, LPCWSTR ServiceClas return ERROR_CALL_NOT_IMPLEMENTED; } +/*********************************************************************** + * DsClientMakeSpnForTargetServerW (NTDSAPI.@) + */ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD *buflen, LPWSTR buf) { DWORD len; @@ -229,3 +232,23 @@ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD return ERROR_SUCCESS; } + +/*********************************************************************** + * DsCrackNamesA (NTDSAPI.@) + */ +DWORD WINAPI DsCrackNamesA(HANDLE handle, DS_NAME_FLAGS flags, DS_NAME_FORMAT offered, DS_NAME_FORMAT desired, + DWORD num, const CHAR **names, PDS_NAME_RESULTA *result) +{ + FIXME("(%p %u %u %u %u %p %p stub\n", handle, flags, offered, desired, num, names, result); + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/*********************************************************************** + * DsCrackNamesW (NTDSAPI.@) + */ +DWORD WINAPI DsCrackNamesW(HANDLE handle, DS_NAME_FLAGS flags, DS_NAME_FORMAT offered, DS_NAME_FORMAT desired, + DWORD num, const WCHAR **names, PDS_NAME_RESULTW *result) +{ + FIXME("(%p %u %u %u %u %p %p stub\n", handle, flags, offered, desired, num, names, result); + return ERROR_CALL_NOT_IMPLEMENTED; +} diff --git a/dlls/ntdsapi/ntdsapi.spec b/dlls/ntdsapi/ntdsapi.spec index 925cb71..bc7827d 100644 --- a/dlls/ntdsapi/ntdsapi.spec +++ b/dlls/ntdsapi/ntdsapi.spec @@ -8,8 +8,8 @@ @ stub DsBindWithSpnW @ stub DsClientMakeSpnForTargetServerA @ stdcall DsClientMakeSpnForTargetServerW(wstr wstr ptr ptr) -@ stub DsCrackNamesA -@ stub DsCrackNamesW +@ stdcall DsCrackNamesA(ptr long long long long ptr ptr) +@ stdcall DsCrackNamesW(ptr long long long long ptr ptr) @ stub DsCrackSpn2A @ stub DsCrackSpn2W @ stub DsCrackSpn3W diff --git a/include/ntdsapi.h b/include/ntdsapi.h index 672ea63..099c205 100644 --- a/include/ntdsapi.h +++ b/include/ntdsapi.h @@ -35,6 +35,30 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR, LPCWSTR, LPCWSTR, USHORT, LPCWSTR, DWORD*, LPWS typedef enum { + DS_NAME_NO_FLAGS = 0x0, + DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1, + DS_NAME_FLAG_EVAL_AT_DC = 0x2, + DS_NAME_FLAG_GCVERIFY = 0x4, + DS_NAME_FLAG_TRUST_REFERRAL = 0x8 +} DS_NAME_FLAGS; + +typedef enum +{ + DS_UNKNOWN_NAME = 0, + DS_FQDN_1779_NAME = 1, + DS_NT4_ACCOUNT_NAME = 2, + DS_DISPLAY_NAME = 3, + DS_UNIQUE_ID_NAME = 6, + DS_CANONICAL_NAME = 7, + DS_USER_PRINCIPAL_NAME = 8, + DS_CANONICAL_NAME_EX = 9, + DS_SERVICE_PRINCIPAL_NAME = 10, + DS_SID_OR_SID_HISTORY_NAME = 11, + DS_DNS_DOMAIN_NAME = 12 +} DS_NAME_FORMAT; + +typedef enum +{ DS_SPN_DNS_HOST = 0, DS_SPN_DN_HOST = 1, DS_SPN_NB_HOST = 2, @@ -50,6 +74,41 @@ typedef enum DS_SPN_DELETE_SPN_OP = 2 } DS_SPN_WRITE_OP; +typedef struct +{ + DWORD status; + LPSTR pDomain; + LPSTR pName; +} DS_NAME_RESULT_ITEMA, *PDS_NAME_RESULT_ITEMA; + +typedef struct +{ + DWORD status; + LPWSTR pDomain; + LPWSTR pName; +} DS_NAME_RESULT_ITEMW, *PDS_NAME_RESULT_ITEMW; + +DECL_WINELIB_TYPE_AW(DS_NAME_RESULT_ITEM) +DECL_WINELIB_TYPE_AW(PDS_NAME_RESULT_ITEM) + +typedef struct +{ + DWORD cItems; + PDS_NAME_RESULT_ITEMA rItems; +} DS_NAME_RESULTA, *PDS_NAME_RESULTA; + +typedef struct +{ + DWORD cItems; + PDS_NAME_RESULT_ITEMW rItems; +} DS_NAME_RESULTW, *PDS_NAME_RESULTW; + +DECL_WINELIB_TYPE_AW(DS_NAME_RESULT) +DECL_WINELIB_TYPE_AW(PDS_NAME_RESULT) + +DWORD WINAPI DsCrackNamesA(HANDLE handle, DS_NAME_FLAGS flags, DS_NAME_FORMAT offered, DS_NAME_FORMAT desired, DWORD num, const CHAR **names, PDS_NAME_RESULTA *result); +DWORD WINAPI DsCrackNamesW(HANDLE handle, DS_NAME_FLAGS flags, DS_NAME_FORMAT offered, DS_NAME_FORMAT desired, DWORD num, const WCHAR **names, PDS_NAME_RESULTW *result); +#define DsCrackNames WINELIB_NAME_AW(DsCrackNames) DWORD WINAPI DsServerRegisterSpnA(DS_SPN_WRITE_OP operation, LPCSTR ServiceClass, LPCSTR UserObjectDN); DWORD WINAPI DsServerRegisterSpnW(DS_SPN_WRITE_OP operation, LPCWSTR ServiceClass, LPCWSTR UserObjectDN); #define DsServerRegisterSpn WINELIB_NAME_AW(DsServerRegisterSpn)
1
0
0
0
Austin English : iphlpapi: Add GetIpForwardTable2 stub.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: cf9eced885cb0a2ac664c967ac3e391f0ebfdaf4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cf9eced885cb0a2ac664c967…
Author: Austin English <austinenglish(a)gmail.com> Date: Fri Apr 13 16:11:15 2018 -0500 iphlpapi: Add GetIpForwardTable2 stub. Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi.spec | 2 +- dlls/iphlpapi/iphlpapi_main.c | 11 +++++++++++ include/netioapi.h | 35 +++++++++++++++++++++++++++++++++++ include/nldef.h | 9 +++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec index bbd1ed8..1686644 100644 --- a/dlls/iphlpapi/iphlpapi.spec +++ b/dlls/iphlpapi/iphlpapi.spec @@ -102,7 +102,7 @@ #@ stub GetIpErrorString #@ stub GetIpForwardEntry2 @ stdcall GetIpForwardTable( ptr ptr long ) -#@ stub GetIpForwardTable2 +@ stdcall GetIpForwardTable2( long ptr ) @ stub GetIpForwardTableFromStack #@ stub GetIpInterfaceEntry #@ stub GetIpInterfaceTable diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index d81fb6a..7911e9d 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -3264,3 +3264,14 @@ PCHAR WINAPI IPHLP_if_indextoname(NET_IFINDEX index, PCHAR name) return getInterfaceNameByIndex(index, name); } + +/****************************************************************** + * GetIpForwardTable2 (IPHLPAPI.@) + */ +DWORD WINAPI GetIpForwardTable2(ADDRESS_FAMILY family, PMIB_IPFORWARD_TABLE2 *table) +{ + static int once; + + if (!once++) FIXME("(%u %p): stub\n", family, table); + return ERROR_NOT_SUPPORTED; +} diff --git a/include/netioapi.h b/include/netioapi.h index 11cadf6..f15a80f 100644 --- a/include/netioapi.h +++ b/include/netioapi.h @@ -21,6 +21,10 @@ #include <ntddndis.h> +#ifndef ANY_SIZE +#define ANY_SIZE 1 +#endif + typedef enum _MIB_IF_TABLE_LEVEL { MibIfTableNormal, @@ -158,6 +162,37 @@ typedef struct _MIB_UNICASTIPADDRESS_TABLE MIB_UNICASTIPADDRESS_ROW Table[1]; } MIB_UNICASTIPADDRESS_TABLE, *PMIB_UNICASTIPADDRESS_TABLE; +typedef struct _IP_ADDRESS_PREFIX +{ + SOCKADDR_INET Prefix; + UINT8 PrefixLength; +} IP_ADDRESS_PREFIX, *PIP_ADDRESS_PREFIX; + +typedef struct _MIB_IPFORWARD_ROW2 +{ + NET_LUID InterfaceLuid; + NET_IFINDEX InterfaceIndex; + IP_ADDRESS_PREFIX DestinationPrefix; + SOCKADDR_INET NextHop; + UCHAR SitePrefixLength; + ULONG ValidLifetime; + ULONG PreferredLifetime; + ULONG Metric; + NL_ROUTE_PROTOCOL Protocol; + BOOLEAN Loopback; + BOOLEAN AutoconfigureAddress; + BOOLEAN Publish; + BOOLEAN Immortal; + ULONG Age; + NL_ROUTE_ORIGIN Origin; +} MIB_IPFORWARD_ROW2, *PMIB_IPFORWARD_ROW2; + +typedef struct _MIB_IPFORWARD_TABLE2 +{ + ULONG NumEntries; + MIB_IPFORWARD_ROW2 Table[ANY_SIZE]; +} MIB_IPFORWARD_TABLE2, *PMIB_IPFORWARD_TABLE2; + typedef VOID (WINAPI *PIPINTERFACE_CHANGE_CALLBACK)(PVOID, PMIB_IPINTERFACE_ROW, MIB_NOTIFICATION_TYPE); typedef VOID (WINAPI *PUNICAST_IPADDRESS_CHANGE_CALLBACK)(PVOID, PMIB_UNICASTIPADDRESS_ROW, diff --git a/include/nldef.h b/include/nldef.h index 1f96773..983b96c 100644 --- a/include/nldef.h +++ b/include/nldef.h @@ -28,6 +28,15 @@ typedef enum IpPrefixOriginUnchanged = 16, } NL_PREFIX_ORIGIN; +typedef enum _NL_ROUTE_ORIGIN +{ + NlroManual, + NlroWellKnown, + NlroDHCP, + NlroRouterAdvertisement, + Nlro6to4, +} NL_ROUTE_ORIGIN, *PNL_ROUTE_ORIGIN; + typedef enum { IpSuffixOriginOther = 0,
1
0
0
0
Nikolay Sivov : user32/menu: Replace macro checks for window style with a helper function.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 6cae93a36e217cf45c8e09913442a805eb95e95f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6cae93a36e217cf45c8e0991…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Apr 16 14:12:13 2018 +0300 user32/menu: Replace macro checks for window style with a helper function. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/menu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 20a569c..537c2eb 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -165,8 +165,6 @@ typedef struct #define STATE_MASK (~TYPE_MASK) #define MENUITEMINFO_STATE_MASK (STATE_MASK & ~(MF_BYPOSITION | MF_MOUSESELECT)) -#define WIN_ALLOWED_MENU(style) ((style & (WS_CHILD | WS_POPUP)) != WS_CHILD) - static SIZE menucharsize; static UINT ODitemheight; /* default owner drawn item height */ @@ -182,6 +180,11 @@ DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFO static BOOL SetMenuItemInfo_common( MENUITEM *, const MENUITEMINFOW *, BOOL); +static BOOL is_win_menu_disallowed(HWND hwnd) +{ + return (GetWindowLongW(hwnd, GWL_STYLE) & (WS_CHILD | WS_POPUP)) == WS_CHILD; +} + /********************************************************************* * menu class descriptor */ @@ -3442,7 +3445,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar) /* find window that has a menu */ - while (!WIN_ALLOWED_MENU(GetWindowLongW( hwnd, GWL_STYLE ))) + while (is_win_menu_disallowed(hwnd)) if (!(hwnd = GetAncestor( hwnd, GA_PARENT ))) return; /* check if we have to track a system menu */ @@ -4375,7 +4378,7 @@ BOOL MENU_SetMenu( HWND hWnd, HMENU hMenu ) WARN("hMenu %p is not a menu handle\n", hMenu); return FALSE; } - if (!WIN_ALLOWED_MENU(GetWindowLongW( hWnd, GWL_STYLE ))) + if (is_win_menu_disallowed(hWnd)) return FALSE; hWnd = WIN_GetFullHandle( hWnd ); @@ -4432,7 +4435,7 @@ BOOL WINAPI DrawMenuBar( HWND hWnd ) if (!IsWindow( hWnd )) return FALSE; - if (!WIN_ALLOWED_MENU(GetWindowLongW( hWnd, GWL_STYLE ))) + if (is_win_menu_disallowed(hWnd)) return TRUE; if ((hMenu = GetMenu( hWnd )))
1
0
0
0
Nikolay Sivov : user32/menu: Hold a reference to menu data for calls with menu handles on input.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: fcdc7db39035eb620b646a63452017fa1ffbbc7f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fcdc7db39035eb620b646a63…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Apr 16 14:12:12 2018 +0300 user32/menu: Hold a reference to menu data for calls with menu handles on input. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/menu.c | 197 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 127 insertions(+), 70 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 99a99c0..20a569c 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -98,6 +98,7 @@ typedef struct { UINT nScrollPos; /* Current scroll position */ UINT nTotalHeight; /* Total height of menu items inside menu */ RECT items_rect; /* Rectangle within which the items lie. Excludes margins and scroll arrows */ + LONG refcount; /* ------------ MENUINFO members ------ */ DWORD dwStyle; /* Extended menu style */ UINT cyMax; /* max height of the whole menu, 0 is screen height */ @@ -299,6 +300,32 @@ static POPUPMENU *MENU_GetMenu(HMENU hMenu) return menu; } +static POPUPMENU *grab_menu_ptr(HMENU hMenu) +{ + POPUPMENU *menu = get_user_handle_ptr( hMenu, USER_MENU ); + + if (menu == OBJ_OTHER_PROCESS) + { + WARN("other process menu %p?\n", hMenu); + return NULL; + } + + if (menu) + menu->refcount++; + else + WARN("invalid menu handle=%p\n", hMenu); + return menu; +} + +static void release_menu_ptr(POPUPMENU *menu) +{ + if (menu) + { + menu->refcount--; + release_user_handle_ptr(menu); + } +} + /*********************************************************************** * get_win_sys_menu * @@ -3830,10 +3857,15 @@ UINT WINAPI GetMenuState( HMENU hMenu, UINT wItemID, UINT wFlags ) */ INT WINAPI GetMenuItemCount( HMENU hMenu ) { - LPPOPUPMENU menu = MENU_GetMenu(hMenu); + POPUPMENU *menu = grab_menu_ptr(hMenu); + INT count; + if (!menu) return -1; - TRACE("(%p) returning %d\n", hMenu, menu->nItems ); - return menu->nItems; + count = menu->nItems; + release_menu_ptr(menu); + + TRACE("(%p) returning %d\n", hMenu, count); + return count; } @@ -4127,6 +4159,7 @@ HMENU WINAPI CreateMenu(void) if (!(menu = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*menu) ))) return 0; menu->FocusedItem = NO_SELECTED_ITEM; + menu->refcount = 1; if (!(hMenu = alloc_user_handle( &menu->obj, USER_MENU ))) HeapFree( GetProcessHeap(), 0, menu ); @@ -4349,14 +4382,14 @@ BOOL MENU_SetMenu( HWND hWnd, HMENU hMenu ) if (GetCapture() == hWnd) set_capture_window( 0, GUI_INMENUMODE, NULL ); /* release the capture */ - if (hMenu != 0) + if (hMenu) { - LPPOPUPMENU lpmenu; - - if (!(lpmenu = MENU_GetMenu(hMenu))) return FALSE; + POPUPMENU *menu; - lpmenu->hWnd = hWnd; - lpmenu->Height = 0; /* Make sure we recalculate the size */ + if (!(menu = grab_menu_ptr(hMenu))) return FALSE; + menu->hWnd = hWnd; + menu->Height = 0; /* Make sure we recalculate the size */ + release_menu_ptr(menu); } SetWindowLongPtrW( hWnd, GWLP_ID, (LONG_PTR)hMenu ); return TRUE; @@ -4395,7 +4428,6 @@ HMENU WINAPI GetSubMenu( HMENU hMenu, INT nPos ) */ BOOL WINAPI DrawMenuBar( HWND hWnd ) { - LPPOPUPMENU lppop; HMENU hMenu; if (!IsWindow( hWnd )) @@ -4403,9 +4435,15 @@ BOOL WINAPI DrawMenuBar( HWND hWnd ) if (!WIN_ALLOWED_MENU(GetWindowLongW( hWnd, GWL_STYLE ))) return TRUE; - if ((hMenu = GetMenu( hWnd )) && (lppop = MENU_GetMenu( hMenu ))) { - lppop->Height = 0; /* Make sure we call MENU_MenuBarCalcSize */ - lppop->hwndOwner = hWnd; + if ((hMenu = GetMenu( hWnd ))) + { + POPUPMENU *menu = grab_menu_ptr(hMenu); + if (menu) + { + menu->Height = 0; /* Make sure we call MENU_MenuBarCalcSize */ + menu->hwndOwner = hWnd; + release_menu_ptr(menu); + } } return SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | @@ -4573,14 +4611,17 @@ HMENU WINAPI LoadMenuIndirectA( LPCVOID template ) */ BOOL WINAPI IsMenu(HMENU hmenu) { - LPPOPUPMENU menu = MENU_GetMenu(hmenu); + POPUPMENU *menu; + BOOL is_menu; - if (!menu) - { + menu = grab_menu_ptr(hmenu); + is_menu = menu != NULL; + release_menu_ptr(menu); + + if (!is_menu) SetLastError(ERROR_INVALID_MENU_HANDLE); - return FALSE; - } - return TRUE; + + return is_menu; } /********************************************************************** @@ -4942,53 +4983,60 @@ BOOL WINAPI SetMenuItemInfoW(HMENU hmenu, UINT item, BOOL bypos, return SetMenuItemInfo_common( menuitem, &mii, TRUE ); } +static BOOL set_menu_default_item(POPUPMENU *menu, UINT uItem, UINT bypos) +{ + unsigned int i; + MENUITEM *item; + + /* reset all default-item flags */ + item = menu->items; + for (i = 0; i < menu->nItems; i++, item++) + { + item->fState &= ~MFS_DEFAULT; + } + + /* no default item */ + if (-1 == uItem) + return TRUE; + + item = menu->items; + if ( bypos ) + { + if ( uItem >= menu->nItems ) return FALSE; + item[uItem].fState |= MFS_DEFAULT; + return TRUE; + } + else + { + for (i = 0; i < menu->nItems; i++, item++) + { + if (item->wID == uItem) + { + item->fState |= MFS_DEFAULT; + return TRUE; + } + } + } + + return FALSE; +} + /********************************************************************** * SetMenuDefaultItem (USER32.@) * */ BOOL WINAPI SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT bypos) { - UINT i; - POPUPMENU *menu; - MENUITEM *item; - - TRACE("(%p,%d,%d)\n", hmenu, uItem, bypos); - - if (!(menu = MENU_GetMenu(hmenu))) return FALSE; - - /* reset all default-item flags */ - item = menu->items; - for (i = 0; i < menu->nItems; i++, item++) - { - item->fState &= ~MFS_DEFAULT; - } + POPUPMENU *menu; + BOOL ret; - /* no default item */ - if ( -1 == uItem) - { - return TRUE; - } + TRACE("(%p,%d,%d)\n", hmenu, uItem, bypos); - item = menu->items; - if ( bypos ) - { - if ( uItem >= menu->nItems ) return FALSE; - item[uItem].fState |= MFS_DEFAULT; - return TRUE; - } - else - { - for (i = 0; i < menu->nItems; i++, item++) - { - if (item->wID == uItem) - { - item->fState |= MFS_DEFAULT; - return TRUE; - } - } + if (!(menu = grab_menu_ptr(hmenu))) return FALSE; + ret = set_menu_default_item(menu, uItem, bypos); + release_menu_ptr(menu); - } - return FALSE; + return ret; } /********************************************************************** @@ -5213,13 +5261,13 @@ BOOL WINAPI SetMenuInfo (HMENU hMenu, LPCMENUINFO lpmi) * */ BOOL WINAPI GetMenuInfo (HMENU hMenu, LPMENUINFO lpmi) -{ POPUPMENU *menu; +{ + POPUPMENU *menu; TRACE("(%p %p)\n", hMenu, lpmi); - if (lpmi && (lpmi->cbSize == sizeof( MENUINFO)) && (menu = MENU_GetMenu(hMenu))) + if (lpmi && (lpmi->cbSize == sizeof(MENUINFO)) && (menu = grab_menu_ptr(hMenu))) { - if (lpmi->fMask & MIM_BACKGROUND) lpmi->hbrBack = menu->hbrBack; @@ -5235,6 +5283,7 @@ BOOL WINAPI GetMenuInfo (HMENU hMenu, LPMENUINFO lpmi) if (lpmi->fMask & MIM_STYLE) lpmi->dwStyle = menu->dwStyle; + release_menu_ptr(menu); return TRUE; } SetLastError( ERROR_INVALID_PARAMETER); @@ -5247,14 +5296,15 @@ BOOL WINAPI GetMenuInfo (HMENU hMenu, LPMENUINFO lpmi) */ BOOL WINAPI SetMenuContextHelpId( HMENU hMenu, DWORD dwContextHelpID) { - LPPOPUPMENU menu; + POPUPMENU *menu; TRACE("(%p 0x%08x)\n", hMenu, dwContextHelpID); - if ((menu = MENU_GetMenu(hMenu))) + if ((menu = grab_menu_ptr(hMenu))) { - menu->dwContextHelpID = dwContextHelpID; - return TRUE; + menu->dwContextHelpID = dwContextHelpID; + release_menu_ptr(menu); + return TRUE; } return FALSE; } @@ -5265,15 +5315,18 @@ BOOL WINAPI SetMenuContextHelpId( HMENU hMenu, DWORD dwContextHelpID) */ DWORD WINAPI GetMenuContextHelpId( HMENU hMenu ) { - LPPOPUPMENU menu; + DWORD help_id = 0; + POPUPMENU *menu; TRACE("(%p)\n", hMenu); - if ((menu = MENU_GetMenu(hMenu))) + if ((menu = grab_menu_ptr(hMenu))) { - return menu->dwContextHelpID; + help_id = menu->dwContextHelpID; + release_menu_ptr(menu); } - return 0; + + return help_id; } /********************************************************************** @@ -5281,12 +5334,16 @@ DWORD WINAPI GetMenuContextHelpId( HMENU hMenu ) */ INT WINAPI MenuItemFromPoint(HWND hWnd, HMENU hMenu, POINT ptScreen) { - POPUPMENU *menu = MENU_GetMenu(hMenu); + POPUPMENU *menu = grab_menu_ptr(hMenu); UINT pos; /*FIXME: Do we have to handle hWnd here? */ if (!menu) return -1; - if (MENU_FindItemByCoords( menu, ptScreen, &pos ) != ht_item) return -1; + + if (MENU_FindItemByCoords( menu, ptScreen, &pos ) != ht_item) + pos = -1; + + release_menu_ptr(menu); return pos; }
1
0
0
0
Dmitry Timoshkov : dinput/tests: Add some tests for DIK_ codes using different keyboard layouts.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: 210cefd23dff7be0184d51afb6e53ab74b2fef77 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=210cefd23dff7be0184d51af…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 16 22:30:53 2018 +0800 dinput/tests: Add some tests for DIK_ codes using different keyboard layouts. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/keyboard.c | 3 +- dlls/dinput/tests/keyboard.c | 193 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 193 insertions(+), 3 deletions(-) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index e1ba15e..8a59ce0 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -86,7 +86,8 @@ static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM wparam != WM_SYSKEYDOWN && wparam != WM_SYSKEYUP) return 0; - TRACE("(%p) %ld,%ld\n", iface, wparam, lparam); + TRACE("(%p) wp %08lx, lp %08lx, vk %02x, scan %02x\n", + iface, wparam, lparam, hook->vkCode, hook->scanCode); switch (hook->vkCode) { diff --git a/dlls/dinput/tests/keyboard.c b/dlls/dinput/tests/keyboard.c index e51e332..576a94c 100644 --- a/dlls/dinput/tests/keyboard.c +++ b/dlls/dinput/tests/keyboard.c @@ -30,6 +30,53 @@ #include "wingdi.h" #include "dinput.h" +/* to make things easier with PSDK without a dinput.lib */ +static HRESULT (WINAPI *pDirectInputCreateA)(HINSTANCE,DWORD,IDirectInputA **,IUnknown *); + +static void pump_messages(void) +{ + MSG msg; + + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessageA(&msg); + } +} + +static HKL activate_keyboard_layout(LANGID langid, HKL *hkl_orig) +{ + HKL hkl, hkl_current; + char hkl_name[64]; + + sprintf(hkl_name, "%08x", langid); + trace("Loading keyboard layout %s\n", hkl_name); + hkl = LoadKeyboardLayoutA(hkl_name, 0); + if (!hkl) + { + win_skip("Unable to load keyboard layout %s\n", hkl_name); + return 0; + } + *hkl_orig = ActivateKeyboardLayout(hkl, 0); + ok(*hkl_orig != 0, "Unable to activate keyboard layout %s\n", hkl_name); + if (!*hkl_orig) return 0; + + hkl_current = GetKeyboardLayout(0); + if (LOWORD(hkl_current) != langid) + { + /* FIXME: Wine can't activate different keyboard layouts. + * for testing purposes use this workaround: + * setxkbmap us && LANG=en_US.UTF-8 make test + * setxkbmap fr && LANG=fr_FR.UTF-8 make test + * setxkbmap de && LANG=de_DE.UTF-8 make test + */ + skip("current %08x != langid %08x\n", LOWORD(hkl_current), langid); + return 0; + } + + return hkl; +} + static void acquire_tests(IDirectInputA *pDI, HWND hwnd) { HRESULT hr; @@ -44,8 +91,12 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) { &GUID_Key, sizeof(LONG) * 2, DIDFT_MAKEINSTANCE(DIK_E)|DIDFT_BUTTON, 0 }, { &GUID_Key, sizeof(LONG) * 4, DIDFT_MAKEINSTANCE(DIK_R)|DIDFT_BUTTON, 0 }, }; - DIDATAFORMAT df; + HKL hkl, hkl_orig; + + hkl = activate_keyboard_layout(MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), &hkl_orig); + if (!hkl) return; + df.dwSize = sizeof( df ); df.dwObjSize = sizeof( DIOBJECTDATAFORMAT ); df.dwFlags = DIDF_RELAXIS; @@ -93,6 +144,8 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) /* simulate some keyboard input */ SetFocus(hwnd); + pump_messages(); + keybd_event('Q', 0, 0, 0); hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state); ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState() failed: %08x\n", hr); @@ -113,6 +166,9 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) keybd_event('Q', 0, KEYEVENTF_KEYUP, 0); if (pKeyboard) IUnknown_Release(pKeyboard); + + ActivateKeyboardLayout(hkl_orig, 0); + UnloadKeyboardLayout(hkl); } static const HRESULT SetCoop_null_window[16] = { @@ -225,6 +281,130 @@ static void test_capabilities(IDirectInputA *pDI, HWND hwnd) IUnknown_Release(pKeyboard); } +static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid) +{ + static const struct key2dik + { + BYTE key, dik; + } key2dik_en[] = + { + {'Q',DIK_Q}, {'W',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Y',DIK_Y} + }, + key2dik_fr[] = + { + {'A',DIK_Q}, {'Z',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Y',DIK_Y} + }, + key2dik_de[] = + { + {'Q',DIK_Q}, {'W',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Z',DIK_Y} + }; + static const struct + { + LANGID langid; + const struct key2dik *map; + } expected[] = + { + { MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), key2dik_en }, + { MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH), key2dik_fr }, + { MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), key2dik_de }, + { MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN), key2dik_en } + }; + const struct key2dik *map = NULL; + UINT i; + HRESULT hr; + IDirectInputDeviceA *device; + HKL hkl, hkl_orig; + MSG msg; + + for (i = 0; i < sizeof(expected)/sizeof(expected[0]); i++) + { + if (expected[i].langid == langid) + { + map = expected[i].map; + break; + } + } + ok(map != NULL, "can't find mapping for langid %04x\n", langid); + if (!map) return; + + hr = IDirectInput_CreateDevice(dI, &GUID_SysKeyboard, &device, NULL); + ok(hr == S_OK, "CreateDevice() failed: %08x\n", hr); + hr = IDirectInputDevice_SetDataFormat(device, &c_dfDIKeyboard); + ok(hr == S_OK, "SetDataFormat() failed: %08x\n", hr); + hr = IDirectInputDevice_Acquire(device); + ok(hr == S_OK, "Acquire() failed: %08x\n", hr); + + hkl = activate_keyboard_layout(langid, &hkl_orig); + if (!hkl) goto fail; + + SetFocus(hwnd); + pump_messages(); + + for (i = 0; i < sizeof(key2dik_en)/sizeof(key2dik_en[0]); i++) + { + BYTE kbd_state[256]; + UINT n; + INPUT in; + + n = MapVirtualKeyA(map[i].key, MAPVK_VK_TO_CHAR); + ok(n == map[i].key, "%u: expected %c, got %c\n", i, map[i].key, n); + n = MapVirtualKeyA(map[i].key, MAPVK_VK_TO_VSC); + ok(n == map[i].dik, "%u: expected %02x, got %02x\n", i, map[i].dik, n); + + in.type = INPUT_KEYBOARD; + U(in).ki.wVk = map[i].key; + U(in).ki.wScan = map[i].dik; /* scan codes match the DIK_ codes */ + U(in).ki.dwFlags = 0; + U(in).ki.dwExtraInfo = 0; + U(in).ki.time = 0; + n = SendInput(1, &in, sizeof(in)); + ok(n == 1, "got %u\n", n); + + if (!PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + win_skip("failed to queue keyboard event\n"); + break; + } + ok(msg.message == WM_KEYDOWN || broken(msg.message != WM_KEYDOWN), "expected WM_KEYDOWN, got %04x\n", msg.message); + /* this never happens on real hardware but tesbot VMs seem to have timing issues */ + if (msg.message != WM_KEYDOWN) + { + win_skip("failed to queue keyboard event\n"); + break; + } + DispatchMessageA(&msg); + + trace("keydown wParam: %#lx (%c) lParam: %#lx, MapVirtualKey(MAPVK_VK_TO_CHAR) = %c\n", + msg.wParam, LOWORD(msg.wParam), msg.lParam, MapVirtualKeyA(msg.wParam, MAPVK_VK_TO_CHAR)); + + pump_messages(); + + hr = IDirectInputDevice_GetDeviceState(device, sizeof(kbd_state), kbd_state); + ok(hr == S_OK, "GetDeviceState() failed: %08x\n", hr); + + /* this never happens on real hardware but tesbot VMs seem to have timing issues */ + if (i == 0 && kbd_state[map[0].dik] != 0x80) + { + win_skip("dinput failed to handle keyboard event\n"); + break; + } + + ok(kbd_state[map[i].dik] == 0x80, "DI key %#x has state %#x\n", map[i].dik, kbd_state[map[i].dik]); + + U(in).ki.dwFlags = KEYEVENTF_KEYUP; + n = SendInput(1, &in, sizeof(in)); + ok(n == 1, "got %u\n", n); + + pump_messages(); + } + + ActivateKeyboardLayout(hkl_orig, 0); + UnloadKeyboardLayout(hkl); +fail: + IDirectInputDevice_Unacquire(device); + IUnknown_Release(device); +} + static void keyboard_tests(DWORD version) { HRESULT hr; @@ -233,7 +413,7 @@ static void keyboard_tests(DWORD version) HWND hwnd; ULONG ref = 0; - hr = DirectInputCreateA(hInstance, version, &pDI, NULL); + hr = pDirectInputCreateA(hInstance, version, &pDI, NULL); if (hr == DIERR_OLDDIRECTINPUTVERSION) { skip("Tests require a newer dinput version\n"); @@ -248,10 +428,17 @@ static void keyboard_tests(DWORD version) if (hwnd) { + pump_messages(); + acquire_tests(pDI, hwnd); test_set_coop(pDI, hwnd); test_get_prop(pDI, hwnd); test_capabilities(pDI, hwnd); + + test_dik_codes(pDI, hwnd, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)); + test_dik_codes(pDI, hwnd, MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH)); + test_dik_codes(pDI, hwnd, MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN)); + test_dik_codes(pDI, hwnd, MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN)); } DestroyWindow(hwnd); @@ -261,6 +448,8 @@ static void keyboard_tests(DWORD version) START_TEST(keyboard) { + pDirectInputCreateA = (void *)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateA"); + CoInitialize(NULL); keyboard_tests(0x0700);
1
0
0
0
Dmitry Timoshkov : dinput: The DIK_ key code should match the scan code.
by Alexandre Julliard
17 Apr '18
17 Apr '18
Module: wine Branch: master Commit: d341b0a86b0d6264677635ba658535a63509b8bc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d341b0a86b0d6264677635ba…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 16 22:30:47 2018 +0800 dinput: The DIK_ key code should match the scan code. This reverts commit 304ff3c7280a53b7cbadfa83eaeda458ff5959d1. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/keyboard.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 4c3c38e..e1ba15e 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -69,26 +69,10 @@ static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(SysKeyboardIm static BYTE map_dik_code(DWORD scanCode, DWORD vkCode) { - static const BYTE asciiCodes[] = - {/*32*/ DIK_SPACE,0,0,0,0,0,0,DIK_APOSTROPHE, - /*40*/ 0,0,0,0,DIK_COMMA,DIK_MINUS,DIK_PERIOD,DIK_SLASH, - /*48*/ DIK_0,DIK_1,DIK_2,DIK_3,DIK_4,DIK_5,DIK_6,DIK_7, - /*56*/ DIK_8,DIK_9,DIK_COLON,DIK_SEMICOLON,0,DIK_EQUALS,0,0, - /*64*/ DIK_AT,DIK_A,DIK_B,DIK_C,DIK_D,DIK_E,DIK_F,DIK_G, - /*72*/ DIK_H,DIK_I,DIK_J,DIK_K,DIK_L,DIK_M,DIK_N,DIK_O, - /*80*/ DIK_P,DIK_Q,DIK_R,DIK_S,DIK_T,DIK_U,DIK_V,DIK_W, - /*88*/ DIK_X,DIK_Y,DIK_Z,DIK_LBRACKET,0,DIK_RBRACKET,DIK_CIRCUMFLEX,DIK_UNDERLINE} /*95*/ ; - - BYTE out_code = 0; - WCHAR c = MapVirtualKeyW(vkCode,MAPVK_VK_TO_CHAR); - - if (c > 31 && c < 96) - out_code = asciiCodes[c - 32]; - - if (out_code == 0) - out_code = scanCode; - - return out_code; + if (!scanCode) + scanCode = MapVirtualKeyW(vkCode, MAPVK_VK_TO_VSC); + + return scanCode; } static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam )
1
0
0
0
Henri Verbeet : wined3d: Get rid of the "numberedArraysLoaded" field in struct wined3d_context.
by Alexandre Julliard
16 Apr '18
16 Apr '18
Module: wine Branch: master Commit: 70c5dc64fc02408c6f7233c996e0ffdc5dc4a5a0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=70c5dc64fc02408c6f7233c9…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Apr 16 18:17:30 2018 +0430 wined3d: Get rid of the "numberedArraysLoaded" field in struct wined3d_context. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/state.c | 4 +--- dlls/wined3d/wined3d_private.h | 9 +++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 5a37fad..5bcd244 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4346,10 +4346,9 @@ static void streamsrc(struct wined3d_context *context, const struct wined3d_stat && !use_vs(state) && !context->use_immediate_mode_draw; if (isStateDirty(context, STATE_VDECL)) return; - if (context->numberedArraysLoaded && !load_numbered) + if (context->numbered_array_mask && !load_numbered) { unload_numbered_arrays(context); - context->numberedArraysLoaded = FALSE; context->numbered_array_mask = 0; } else if (context->namedArraysLoaded) @@ -4362,7 +4361,6 @@ static void streamsrc(struct wined3d_context *context, const struct wined3d_stat { TRACE("Loading numbered arrays\n"); load_numbered_arrays(context, &context->stream_info, state); - context->numberedArraysLoaded = TRUE; } else if (load_named) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 24d9232..7e6a87f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1883,7 +1883,7 @@ struct wined3d_context DWORD last_was_vshader : 1; DWORD last_was_normal : 1; DWORD namedArraysLoaded : 1; - DWORD numberedArraysLoaded : 1; + DWORD last_was_ffp_blit : 1; DWORD last_was_blit : 1; DWORD last_was_ckey : 1; DWORD fog_coord : 1; @@ -1892,6 +1892,7 @@ struct wined3d_context DWORD current : 1; DWORD destroyed : 1; DWORD valid : 1; + DWORD texShaderBumpMap : 8; /* MAX_TEXTURES, 8 */ DWORD lastWasPow2Texture : 8; /* MAX_TEXTURES, 8 */ DWORD fixed_function_usage_map : 8; /* MAX_TEXTURES, 8 */ @@ -1900,6 +1901,7 @@ struct wined3d_context DWORD rebind_fbo : 1; DWORD needs_set : 1; DWORD hdc_is_private : 1; + DWORD hdc_has_format : 1; /* only meaningful if hdc_is_private */ DWORD update_shader_resource_bindings : 1; DWORD update_compute_shader_resource_bindings : 1; @@ -1911,11 +1913,10 @@ struct wined3d_context DWORD transform_feedback_paused : 1; DWORD shader_update_mask : 6; /* WINED3D_SHADER_TYPE_COUNT, 6 */ DWORD clip_distance_mask : 8; /* MAX_CLIP_DISTANCES, 8 */ - DWORD last_was_ffp_blit : 1; - DWORD padding : 8; + DWORD padding : 9; DWORD constant_update_mask; - DWORD numbered_array_mask; + DWORD numbered_array_mask; GLenum tracking_parm; /* Which source is tracking current colour */ GLenum untracked_materials[2]; UINT blit_w, blit_h;
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
55
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
Results per page:
10
25
50
100
200