winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 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
1138 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Move NtUserWindowFromDC implementation from user32.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: e411d919580b7bc72c6a86b03d8a4dbbbc567f6d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e411d919580b7bc72c6a86b0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 14 11:43:32 2022 +0100 win32u: Move NtUserWindowFromDC 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/painting.c | 27 --------------------------- dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 1 - dlls/win32u/Makefile.in | 1 + dlls/win32u/dce.c | 42 ++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/ntuser_private.h | 13 ++++++++++++- dlls/win32u/palette.c | 9 +++------ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 3 ++- dlls/wow64win/user.c | 7 +++++++ include/ntuser.h | 1 + 12 files changed, 71 insertions(+), 38 deletions(-) diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c index 96a06fe98c7..2f8ab9b81f8 100644 --- a/dlls/user32/painting.c +++ b/dlls/user32/painting.c @@ -35,17 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); -struct dce -{ - struct list entry; /* entry in global DCE list */ - HDC hdc; - HWND hwnd; - HRGN clip_rgn; - DWORD flags; - LONG count; /* usage count; 0 or 1 for cache DCEs, always 1 for window DCEs, - always >= 1 for class DCEs */ -}; - static struct list dce_list = LIST_INIT(dce_list); #define DCE_CACHE_SIZE 64 @@ -1164,22 +1153,6 @@ INT WINAPI ReleaseDC( HWND hwnd, HDC hdc ) } -/********************************************************************** - * WindowFromDC (USER32.@) - */ -HWND WINAPI WindowFromDC( HDC hdc ) -{ - struct dce *dce; - HWND hwnd = 0; - - USER_Lock(); - dce = (struct dce *)GetDCHook( hdc, NULL ); - if (dce) hwnd = dce->hwnd; - USER_Unlock(); - return hwnd; -} - - /*********************************************************************** * LockWindowUpdate (USER32.@) * diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 4c4e795c34a..aac2e39fa6d 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -818,7 +818,7 @@ @ stdcall WinHelpA(long str long long) @ stdcall WinHelpW(long wstr long long) # @ stub WinOldAppHackoMatic -@ stdcall WindowFromDC(long) +@ stdcall WindowFromDC(long) NtUserWindowFromDC @ stdcall WindowFromPoint(int64) @ stdcall WindowFromPhysicalPoint(int64) # @ stub YieldTask diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 2ef7b3f01d0..ba7462ee241 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -151,7 +151,6 @@ static const struct user_callbacks user_funcs = SendNotifyMessageW, SetWindowPos, WaitForInputIdle, - WindowFromDC, free_dce, notify_ime, register_builtin_classes, diff --git a/dlls/win32u/Makefile.in b/dlls/win32u/Makefile.in index ceb8f83eb97..2dea3682064 100644 --- a/dlls/win32u/Makefile.in +++ b/dlls/win32u/Makefile.in @@ -17,6 +17,7 @@ C_SRCS = \ clipping.c \ cursoricon.c \ dc.c \ + dce.c \ dib.c \ dibdrv/bitblt.c \ dibdrv/dc.c \ diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c new file mode 100644 index 00000000000..a811f7eae7f --- /dev/null +++ b/dlls/win32u/dce.c @@ -0,0 +1,42 @@ +/* + * Window painting functions + * + * Copyright 1993, 1994, 1995, 2001, 2004, 2005, 2008 Alexandre Julliard + * Copyright 1996, 1997, 1999 Alex Korobka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "ntgdi_private.h" +#include "ntuser_private.h" + +/********************************************************************** + * NtUserWindowFromDC (win32u.@) + */ +HWND WINAPI NtUserWindowFromDC( HDC hdc ) +{ + struct dce *dce; + HWND hwnd = 0; + + user_lock(); + dce = (struct dce *)GetDCHook( hdc, NULL ); + if (dce) hwnd = dce->hwnd; + user_unlock(); + return hwnd; +} diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 6c10a3e77e1..160e3ab5f14 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -38,7 +38,6 @@ struct user_callbacks BOOL (WINAPI *pSendNotifyMessageW)( HWND, UINT, WPARAM, LPARAM ); BOOL (WINAPI *pSetWindowPos)( HWND, HWND, INT, INT, INT, INT, UINT ); DWORD (WINAPI *pWaitForInputIdle)( HANDLE, DWORD ); - HWND (WINAPI *pWindowFromDC)( HDC ); void (WINAPI *free_dce)( struct dce *dce, HWND hwnd ); void (CDECL *notify_ime)( HWND hwnd, UINT param ); void (CDECL *register_builtin_classes)(void); @@ -196,6 +195,18 @@ typedef struct tagWINDOWPROC #define MAX_ATOM_LEN 255 +/* FIXME: make it private to dce.c */ +struct dce +{ + struct list entry; /* entry in global DCE list */ + HDC hdc; + HWND hwnd; + HRGN clip_rgn; + DWORD flags; + LONG count; /* usage count; 0 or 1 for cache DCEs, always 1 for window DCEs, + always >= 1 for class DCEs */ +}; + /* Built-in class names (see _Undocumented_Windows_ p.418) */ #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */ #define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */ diff --git a/dlls/win32u/palette.c b/dlls/win32u/palette.c index 367bfea21b4..18885c7fba8 100644 --- a/dlls/win32u/palette.c +++ b/dlls/win32u/palette.c @@ -516,7 +516,7 @@ HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE hpal, WORD bkg ) if (!bkg && hpal != get_stock_object( DEFAULT_PALETTE )) { - HWND hwnd = user_callbacks->pWindowFromDC( hdc ); + HWND hwnd = NtUserWindowFromDC( hdc ); if (hwnd) { /* set primary palette if it's related to current active */ @@ -582,7 +582,7 @@ UINT realize_palette( HDC hdc ) if (realized && is_primary) { /* send palette change notification */ - HWND hwnd = user_callbacks->pWindowFromDC( hdc ); + HWND hwnd = NtUserWindowFromDC( hdc ); if (hwnd) user_callbacks->pSendMessageTimeoutW( HWND_BROADCAST, WM_PALETTECHANGED, HandleToUlong(hwnd), 0, SMTO_ABORTIFHUNG, 2000, NULL ); @@ -591,9 +591,6 @@ UINT realize_palette( HDC hdc ) } -typedef HWND (WINAPI *WindowFromDC_funcptr)( HDC ); -typedef BOOL (WINAPI *RedrawWindow_funcptr)( HWND, const RECT *, HRGN, UINT ); - /********************************************************************** * NtGdiUpdateColors (win32u.@) * @@ -607,7 +604,7 @@ BOOL WINAPI NtGdiUpdateColors( HDC hDC ) if (!size) return FALSE; if (!user_callbacks) return TRUE; - hwnd = user_callbacks->pWindowFromDC( hDC ); + hwnd = NtUserWindowFromDC( hDC ); /* Docs say that we have to remap current drawable pixel by pixel * but it would take forever given the speed of XGet/PutPixel. diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 41f9cfead49..abe32b8d70c 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -158,6 +158,7 @@ static void * const syscalls[] = NtUserSetWindowsHookEx, NtUserUnhookWinEvent, NtUserUnhookWindowsHookEx, + NtUserWindowFromDC, }; static BYTE arguments[ARRAY_SIZE(syscalls)]; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 671d26f6805..7238e729e79 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1309,7 +1309,7 @@ @ stub NtUserWaitForMsgAndEvent @ stub NtUserWaitForRedirectionStartComplete @ stub NtUserWaitMessage -@ stub NtUserWindowFromDC +@ stdcall -syscall NtUserWindowFromDC(long) @ stub NtUserWindowFromPhysicalPoint @ stdcall NtUserWindowFromPoint(long long) @ stub NtUserYieldTask diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 82262cd83ab..b6cdf5edfb2 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -142,6 +142,7 @@ SYSCALL_ENTRY( NtUserSetWinEventHook ) \ SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \ SYSCALL_ENTRY( NtUserUnhookWinEvent ) \ - SYSCALL_ENTRY( NtUserUnhookWindowsHookEx ) + SYSCALL_ENTRY( NtUserUnhookWindowsHookEx ) \ + SYSCALL_ENTRY( NtUserWindowFromDC ) #endif /* __WOW64WIN_SYSCALL_H */ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 4ee05838b47..b8c4a86a352 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -206,6 +206,13 @@ NTSTATUS WINAPI wow64_NtUserGetWindowRgnEx( UINT *args ) return NtUserGetWindowRgnEx( hwnd, hrgn, unk ); } +NTSTATUS WINAPI wow64_NtUserWindowFromDC( UINT *args ) +{ + HDC hdc = get_handle( &args ); + + return HandleToUlong( NtUserWindowFromDC( hdc )); +} + NTSTATUS WINAPI wow64_NtUserBuildHwndList( UINT *args ) { HDESK desktop = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 28a025059f6..fb8db926888 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -407,6 +407,7 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *p const BLENDFUNCTION *blend, DWORD flags, const RECT *dirty ); WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ); DWORD WINAPI NtUserWaitForInputIdle( HANDLE process, DWORD timeout, BOOL wow ); +HWND WINAPI NtUserWindowFromDC( HDC hdc ); HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y ); #endif /* _NTUSER_ */
1
0
0
0
Jacek Caban : user32: Fix nameA pointer in alloc_menu_nameW.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: fa77147b5b105cb22196b6ca6977c1de9ec77d14 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fa77147b5b105cb22196b6ca…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 14 11:43:07 2022 +0100 user32: Fix nameA pointer in alloc_menu_nameW. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52651
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/class.c | 1 + dlls/user32/tests/class.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/dlls/user32/class.c b/dlls/user32/class.c index 3b6b70b8004..5d1c44a441d 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -174,6 +174,7 @@ static BOOL alloc_menu_nameW( struct client_menu_name *ret, const WCHAR *menu_na DWORD lenA = WideCharToMultiByte( CP_ACP, 0, menu_name, lenW, NULL, 0, NULL, NULL ); ret->nameW = HeapAlloc( GetProcessHeap(), 0, lenA + lenW * sizeof(WCHAR) ); if (!ret->nameW) return FALSE; + ret->nameA = (char *)(ret->nameW + lenW); memcpy( ret->nameW, menu_name, lenW * sizeof(WCHAR) ); WideCharToMultiByte( CP_ACP, 0, menu_name, lenW, ret->nameA, lenA, NULL, NULL ); } diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index 590e342585d..64fc3c014e3 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -1545,6 +1545,53 @@ static void test_uxtheme(void) UnregisterClassA(class_name, GetModuleHandleA(NULL)); } +static void test_class_name(void) +{ + WCHAR class_name[] = L"ClassNameTest"; + HINSTANCE hinst = GetModuleHandleW(0); + WNDCLASSEXW wcex; + const WCHAR *nameW; + const char *nameA; + UINT_PTR res; + HWND hwnd; + + memset(&wcex, 0, sizeof wcex); + wcex.cbSize = sizeof wcex; + wcex.lpfnWndProc = ClassTest_WndProc; + wcex.hIcon = LoadIconW(0, (LPCWSTR)IDI_APPLICATION); + wcex.hInstance = hinst; + wcex.lpszClassName = class_name; + wcex.lpszMenuName = L"menu name"; + ok(RegisterClassExW(&wcex), "RegisterClassExW returned 0\n"); + hwnd = CreateWindowExW(0, class_name, NULL, WS_OVERLAPPEDWINDOW, + 0, 0, 0, 0, NULL, NULL, hinst, 0); + ok(hwnd != NULL, "Window was not created\n"); + + nameA = (const char *)GetClassLongPtrA(hwnd, GCLP_MENUNAME); + ok(!strcmp(nameA, "menu name"), "unexpected class name %s\n", debugstr_a(nameA)); + nameW = (const WCHAR *)GetClassLongPtrW(hwnd, GCLP_MENUNAME); + ok(!wcscmp(nameW, L"menu name"), "unexpected class name %s\n", debugstr_w(nameW)); + + res = SetClassLongPtrA(hwnd, GCLP_MENUNAME, (LONG_PTR)"nameA"); + todo_wine + ok(res, "SetClassLongPtrA returned 0\n"); + nameA = (const char *)GetClassLongPtrA(hwnd, GCLP_MENUNAME); + ok(!strcmp(nameA, "nameA"), "unexpected class name %s\n", debugstr_a(nameA)); + nameW = (const WCHAR *)GetClassLongPtrW(hwnd, GCLP_MENUNAME); + ok(!wcscmp(nameW, L"nameA"), "unexpected class name %s\n", debugstr_w(nameW)); + + res = SetClassLongPtrW(hwnd, GCLP_MENUNAME, (LONG_PTR)L"nameW"); + todo_wine + ok(res, "SetClassLongPtrW returned 0\n"); + nameA = (const char *)GetClassLongPtrA(hwnd, GCLP_MENUNAME); + ok(!strcmp(nameA, "nameW"), "unexpected class name %s\n", debugstr_a(nameA)); + nameW = (const WCHAR *)GetClassLongPtrW(hwnd, GCLP_MENUNAME); + ok(!wcscmp(nameW, L"nameW"), "unexpected class name %s\n", debugstr_w(nameW)); + + DestroyWindow(hwnd); + UnregisterClassW(class_name, hinst); +} + START_TEST(class) { char **argv; @@ -1578,6 +1625,7 @@ START_TEST(class) test_icons(); test_comctl32_classes(); test_actctx_classes(); + test_class_name(); /* this test unregisters the Button class so it should be executed at the end */ test_instances();
1
0
0
0
Paul Gofman : winhttp: Also select for error in netconn_create().
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: 1f8738d5377d3edfc719a6e75e842fbd71057bfd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1f8738d5377d3edfc719a6e7…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Mar 14 13:31:28 2022 +0300 winhttp: Also select for error in netconn_create(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/net.c | 14 ++++++++++---- dlls/winhttp/tests/winhttp.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 5e4c55fad6a..2fc48476513 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -228,13 +228,19 @@ DWORD netconn_create( struct hostdata *host, const struct sockaddr_storage *sock ret = WSAGetLastError(); if (ret == WSAEWOULDBLOCK || ret == WSAEINPROGRESS) { - FD_SET set; TIMEVAL timeval = { timeout / 1000, (timeout % 1000) * 1000 }; + FD_SET set_read, set_error; int res; - FD_ZERO( &set ); - FD_SET( conn->socket, &set ); - if ((res = select( conn->socket + 1, NULL, &set, NULL, &timeval )) > 0) ret = ERROR_SUCCESS; + FD_ZERO( &set_read ); + FD_SET( conn->socket, &set_read ); + FD_ZERO( &set_error ); + FD_SET( conn->socket, &set_error ); + if ((res = select( conn->socket + 1, NULL, &set_read, &set_error, &timeval )) > 0) + { + if (FD_ISSET(conn->socket, &set_read)) ret = ERROR_SUCCESS; + else assert( FD_ISSET(conn->socket, &set_error) ); + } else if (!res) ret = ERROR_WINHTTP_TIMEOUT; } } diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 9dc8ece3069..3c615656373 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -482,6 +482,41 @@ static void test_WinHttpSendRequest (void) ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret); } +static void test_connect_error(void) +{ + static const WCHAR content_type[] = L"Content-Type: application/x-www-form-urlencoded"; + DWORD header_len, optional_len, total_len, err, t1, t2; + HINTERNET session, request, connection; + static char post_data[] = "mode=Test"; + BOOL ret; + + header_len = ~0u; + total_len = optional_len = sizeof(post_data); + + session = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, + WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); + ok(!!session, "WinHttpOpen failed to open session.\n"); + + connection = WinHttpConnect (session, L"127.0.0.1", 12345, 0); + ok(!!connection, "WinHttpConnect failed to open a connection, error %lu.\n", GetLastError()); + + request = WinHttpOpenRequest(connection, L"POST", L"tests/post.php", NULL, WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_BYPASS_PROXY_CACHE); + ok(!!request, "WinHttpOpenrequest failed to open a request, error: %lu\n", GetLastError()); + + t1 = GetTickCount(); + ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, 0); + t2 = GetTickCount(); + err = GetLastError(); + ok(!ret, "WinHttpSendRequest() succeeded.\n"); + ok(err == ERROR_WINHTTP_CANNOT_CONNECT, "Got unexpected err %lu.\n", err); + ok(t2 - t1 < 5000, "Unexpected connect failure delay %lums.\n", t2 - t1); + + WinHttpCloseHandle(request); + WinHttpCloseHandle(connection); + WinHttpCloseHandle(session); +} + static void test_WinHttpTimeFromSystemTime(void) { BOOL ret; @@ -5557,6 +5592,7 @@ START_TEST (winhttp) test_WinHttpOpenRequest(); test_WinHttpSendRequest(); + test_connect_error(); test_WinHttpTimeFromSystemTime(); test_WinHttpTimeToSystemTime(); test_WinHttpAddHeaders();
1
0
0
0
Paul Gofman : winhttp: Return an winhttp error from netconn_create() on connection failure.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: 550fdbd1de2872da7f3758c264bf27afcb23063a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=550fdbd1de2872da7f3758c2…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Mar 14 13:31:27 2022 +0300 winhttp: Return an winhttp error from netconn_create() on connection failure. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 09ed5e222d1..5e4c55fad6a 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -246,7 +246,7 @@ DWORD netconn_create( struct hostdata *host, const struct sockaddr_storage *sock WARN( "unable to connect to host (%lu)\n", ret ); closesocket( conn->socket ); free( conn ); - return ret; + return ret == ERROR_WINHTTP_TIMEOUT ? ERROR_WINHTTP_TIMEOUT : ERROR_WINHTTP_CANNOT_CONNECT; } *ret_conn = conn;
1
0
0
0
Paul Gofman : winhttp: Fix filling TIMEVAL in netconn_create().
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: e87d79fc495e416320471b4b28d6bf942ce3795e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e87d79fc495e416320471b4b…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Mar 14 13:31:26 2022 +0300 winhttp: Fix filling TIMEVAL in netconn_create(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 19fafb25804..09ed5e222d1 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -229,7 +229,7 @@ DWORD netconn_create( struct hostdata *host, const struct sockaddr_storage *sock if (ret == WSAEWOULDBLOCK || ret == WSAEINPROGRESS) { FD_SET set; - TIMEVAL timeval = { 0, timeout * 1000 }; + TIMEVAL timeval = { timeout / 1000, (timeout % 1000) * 1000 }; int res; FD_ZERO( &set );
1
0
0
0
Huw Davies : winealsa: Move the midi seq lock to the unixlib.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: c02386390cd8c1a87e86c6180ae3aa929199bffe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c02386390cd8c1a87e86c618…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 14 10:21:49 2022 +0000 winealsa: Move the midi seq lock to the unixlib. 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/winealsa.drv/Makefile.in | 1 + dlls/winealsa.drv/alsa.c | 2 + dlls/winealsa.drv/alsamidi.c | 64 ++++++++++++++++++++++++++++ dlls/winealsa.drv/midi.c | 97 +++++++++++++++++++++---------------------- dlls/winealsa.drv/unixlib.h | 4 ++ 5 files changed, 118 insertions(+), 50 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c02386390cd8c1a87e86…
1
0
0
0
Huw Davies : winealsa: Remove a workaround for versions of alsa-lib before 1.0.12.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: 52e262370a9383cd0595e8a588535291440bbc6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52e262370a9383cd0595e8a5…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 14 10:21:48 2022 +0000 winealsa: Remove a workaround for versions of alsa-lib before 1.0.12. Version 1.0.12 was released in 2006. 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/winealsa.drv/midi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index 699790d380d..e65cae6cda5 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -54,10 +54,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(midi); -#ifndef SND_SEQ_PORT_TYPE_PORT -#define SND_SEQ_PORT_TYPE_PORT (1<<19) /* Appears in version 1.0.12rc1 */ -#endif - typedef struct { int state; /* -1 disabled, 0 is no recording started, 1 in recording, bit 2 set if in sys exclusive recording */ MIDIOPENDESC midiDesc;
1
0
0
0
Huw Davies : winealsa: Remove several unused members.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: 8686fc82f0b113bc336cabf80c4e4709a6e884c7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8686fc82f0b113bc336cabf8…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 14 10:21:47 2022 +0000 winealsa: Remove several unused members. 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/winealsa.drv/midi.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index e61dae12860..699790d380d 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -60,14 +60,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(midi); typedef struct { int state; /* -1 disabled, 0 is no recording started, 1 in recording, bit 2 set if in sys exclusive recording */ - DWORD bufsize; MIDIOPENDESC midiDesc; WORD wFlags; LPMIDIHDR lpQueueHdr; - DWORD dwTotalPlayed; - unsigned char incoming[3]; - unsigned char incPrev; - char incLen; DWORD startTime; MIDIINCAPSW caps; snd_seq_addr_t addr; @@ -75,12 +70,8 @@ typedef struct { typedef struct { BOOL bEnabled; - DWORD bufsize; MIDIOPENDESC midiDesc; WORD wFlags; - LPMIDIHDR lpQueueHdr; - DWORD dwTotalPlayed; - void* lpExtra; /* according to port type (MIDI, FM...), extra data when needed */ MIDIOUTCAPSW caps; snd_seq_addr_t addr; int port_out; @@ -497,11 +488,8 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) MidiInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); MidiInDev[wDevID].lpQueueHdr = NULL; - MidiInDev[wDevID].dwTotalPlayed = 0; - MidiInDev[wDevID].bufsize = 0x3FFF; MidiInDev[wDevID].midiDesc = *lpDesc; MidiInDev[wDevID].state = 0; - MidiInDev[wDevID].incLen = 0; MidiInDev[wDevID].startTime = 0; /* Connect our app port to the device port */ @@ -571,7 +559,6 @@ static DWORD midClose(WORD wDevID) LeaveCriticalSection(&midiSeqLock); midiCloseSeq(); - MidiInDev[wDevID].bufsize = 0; MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L); MidiInDev[wDevID].midiDesc.hMidi = 0; @@ -752,8 +739,6 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) return MMSYSERR_INVALFLAG; } - MidiOutDev[wDevID].lpExtra = 0; - switch (MidiOutDev[wDevID].caps.wTechnology) { case MOD_FMSYNTH: case MOD_MIDIPORT: @@ -769,10 +754,6 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) } MidiOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); - - MidiOutDev[wDevID].lpQueueHdr = NULL; - MidiOutDev[wDevID].dwTotalPlayed = 0; - MidiOutDev[wDevID].bufsize = 0x3FFF; MidiOutDev[wDevID].midiDesc = *lpDesc; EnterCriticalSection(&midiSeqLock); @@ -853,10 +834,6 @@ static DWORD modClose(WORD wDevID) return MMSYSERR_NOTENABLED; } - HeapFree(GetProcessHeap(), 0, MidiOutDev[wDevID].lpExtra); - MidiOutDev[wDevID].lpExtra = 0; - - MidiOutDev[wDevID].bufsize = 0; MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L); MidiOutDev[wDevID].midiDesc.hMidi = 0; return ret;
1
0
0
0
Huw Davies : winealsa: Move get_prop_value to the unixlib.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: c6bfab87390f4f41536d8e5619adbcc4e0fd289c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c6bfab87390f4f41536d8e56…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 14 10:21:46 2022 +0000 winealsa: Move get_prop_value to the unixlib. 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/winealsa.drv/alsa.c | 181 ++++++++++++++++++++++++++++++++++++++++++- dlls/winealsa.drv/mmdevdrv.c | 177 +++++------------------------------------- dlls/winealsa.drv/unixlib.h | 13 ++++ 3 files changed, 213 insertions(+), 158 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c6bfab87390f4f41536d…
1
0
0
0
Bernhard Kölbl : windows.media.speech: Add SpeechRecognitionListConstraint stub.
by Alexandre Julliard
14 Mar '22
14 Mar '22
Module: wine Branch: master Commit: ab9fa4c6797bb1c3ba78a373ef51fe73cef63a3d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ab9fa4c6797bb1c3ba78a373…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Mon Mar 14 11:06:37 2022 +0100 windows.media.speech: Add SpeechRecognitionListConstraint stub. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/listconstraint.c | 202 ++++++++++++++++++++++++++++- dlls/windows.media.speech/tests/speech.c | 29 +++-- 2 files changed, 215 insertions(+), 16 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ab9fa4c6797bb1c3ba78…
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
114
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200