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
February 2019
----- 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
1 participants
672 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Directly try to open the dll file instead of checking for existence first.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: c946922a9cc17929dc121b0d4c0895cf57010753 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c946922a9cc17929dc121b0d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Feb 8 19:58:40 2019 +0100 ntdll: Directly try to open the dll file instead of checking for existence first. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/module.c | 25 ++++-------- dlls/ntdll/loader.c | 94 ++++++++++++++++++++------------------------ 2 files changed, 50 insertions(+), 69 deletions(-) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 2314c84..3e077f3 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -336,32 +336,23 @@ static void testLoadLibraryEx(void) SetLastError(0xdeadbeef); hmodule = LoadLibraryExA("testfile.dll", hfile, 0); ok(hmodule == 0, "Expected 0, got %p\n", hmodule); - todo_wine - { - ok(GetLastError() == ERROR_SHARING_VIOLATION || - GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ - "Unexpected last error, got %d\n", GetLastError()); - } + ok(GetLastError() == ERROR_SHARING_VIOLATION || + GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ + "Unexpected last error, got %d\n", GetLastError()); SetLastError(0xdeadbeef); hmodule = LoadLibraryExA("testfile.dll", (HANDLE)0xdeadbeef, 0); ok(hmodule == 0, "Expected 0, got %p\n", hmodule); - todo_wine - { - ok(GetLastError() == ERROR_SHARING_VIOLATION || - GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ - "Unexpected last error, got %d\n", GetLastError()); - } + ok(GetLastError() == ERROR_SHARING_VIOLATION || + GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ + "Unexpected last error, got %d\n", GetLastError()); /* try to open a file that is locked */ SetLastError(0xdeadbeef); hmodule = LoadLibraryExA("testfile.dll", NULL, 0); ok(hmodule == 0, "Expected 0, got %p\n", hmodule); - todo_wine - { - ok(GetLastError() == ERROR_SHARING_VIOLATION, - "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); - } + ok(GetLastError() == ERROR_SHARING_VIOLATION, + "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); /* lpFileName does not matter */ if (is_unicode_enabled) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 701692a..2c93b02 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2345,14 +2345,19 @@ done: * * Open a file for a new dll. Helper for find_dll_file. */ -static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct stat *st ) +static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, + WINE_MODREF **pwm, HANDLE *handle, struct stat *st ) { + FILE_BASIC_INFORMATION info; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; - HANDLE handle; + NTSTATUS status; int fd, needs_close; - if ((*pwm = find_fullname_module( nt_name ))) return 0; + nt_name->Buffer = NULL; + if ((status = RtlDosPathNameToNtPathName_U_WithStatus( name, nt_name, NULL, NULL ))) return status; + + if ((*pwm = find_fullname_module( nt_name ))) return STATUS_SUCCESS; attr.Length = sizeof(attr); attr.RootDirectory = 0; @@ -2360,11 +2365,22 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct attr.ObjectName = nt_name; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - if (NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_DELETE, - FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE )) - return 0; + if ((status = NtOpenFile( handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, + FILE_SHARE_READ | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE ))) + { + if (status != STATUS_OBJECT_PATH_NOT_FOUND && + status != STATUS_OBJECT_NAME_NOT_FOUND && + !NtQueryAttributesFile( &attr, &info )) + { + /* if the file exists but failed to open, report the error */ + return status; + } + /* otherwise continue searching */ + return STATUS_DLL_NOT_FOUND; + } - if (!server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL )) + if (!server_get_unix_fd( *handle, 0, &fd, &needs_close, NULL, NULL )) { fstat( fd, st ); if (needs_close) close( fd ); @@ -2372,11 +2388,11 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct { TRACE( "%s is the same file as existing module %p %s\n", debugstr_w( nt_name->Buffer ), (*pwm)->ldr.BaseAddress, debugstr_w( (*pwm)->ldr.FullDllName.Buffer )); - NtClose( handle ); - return 0; + NtClose( *handle ); + *handle = 0; } } - return handle; + return STATUS_SUCCESS; } @@ -2385,7 +2401,8 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct * * Search for dll in the specified paths. */ -static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *nt_name ) +static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *nt_name, + WINE_MODREF **pwm, HANDLE *handle, struct stat *st ) { WCHAR *name; NTSTATUS status = STATUS_DLL_NOT_FOUND; @@ -2407,14 +2424,9 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * memcpy( name, paths, len * sizeof(WCHAR) ); if (len && name[len - 1] != '\\') name[len++] = '\\'; strcpyW( name + len, search ); - if (RtlDoesFileExists_U( name )) - { - if (!RtlDosPathNameToNtPathName_U( name, nt_name, NULL, NULL )) - status = STATUS_NO_MEMORY; - else - status = STATUS_SUCCESS; - goto done; - } + status = open_dll_file( name, nt_name, pwm, handle, st ); + if (status != STATUS_DLL_NOT_FOUND) goto done; + RtlFreeUnicodeString( nt_name ); paths = ptr; } @@ -2439,11 +2451,12 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, HANDLE *handle, struct stat *st ) { WCHAR *ext, *dllname; - NTSTATUS status; + NTSTATUS status = STATUS_SUCCESS; /* first append .dll if needed */ *handle = 0; + *pwm = NULL; dllname = NULL; if (!(ext = strrchrW( libname, '.')) || strchrW( ext, '/' ) || strchrW( ext, '\\')) { @@ -2461,7 +2474,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, { WCHAR *fullname = NULL; - if ((*pwm = find_basename_module( libname )) != NULL) goto found; + if ((*pwm = find_basename_module( libname )) != NULL) goto done; status = find_actctx_dll( libname, &fullname ); if (status == STATUS_SUCCESS) @@ -2470,40 +2483,17 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, RtlFreeHeap( GetProcessHeap(), 0, dllname ); libname = dllname = fullname; } - else if (status != STATUS_SXS_KEY_NOT_FOUND) - { - RtlFreeHeap( GetProcessHeap(), 0, dllname ); - return status; - } + else if (status != STATUS_SXS_KEY_NOT_FOUND) goto done; } if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) - { - /* we need to search for it */ - if (!(status = search_dll_file( load_path, libname, nt_name ))) - { - *handle = open_dll_file( nt_name, pwm, st ); - } - else if (status != STATUS_DLL_NOT_FOUND) - { - RtlFreeHeap( GetProcessHeap(), 0, dllname ); - return status; - } - goto found; - } - - /* absolute path name */ - - if (!RtlDosPathNameToNtPathName_U( libname, nt_name, NULL, NULL )) - { - RtlFreeHeap( GetProcessHeap(), 0, dllname ); - return STATUS_NO_MEMORY; - } - *handle = open_dll_file( nt_name, pwm, st ); + status = search_dll_file( load_path, libname, nt_name, pwm, handle, st ); + else + status = open_dll_file( libname, nt_name, pwm, handle, st ); -found: +done: RtlFreeHeap( GetProcessHeap(), 0, dllname ); - return STATUS_SUCCESS; + return status; } @@ -2524,9 +2514,8 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ TRACE( "looking for %s in %s\n", debugstr_w(libname), debugstr_w(load_path) ); - *pwm = NULL; nts = find_dll_file( load_path, libname, &nt_name, pwm, &handle, &st ); - if (nts) return nts; + if (nts && nts != STATUS_DLL_NOT_FOUND) goto done; if (*pwm) /* found already loaded module */ { @@ -2591,6 +2580,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ break; } +done: if (nts == STATUS_SUCCESS) TRACE("Loaded module %s (%s) at %p\n", debugstr_us(&nt_name), ((*pwm)->ldr.Flags & LDR_WINE_INTERNAL) ? "builtin" : "native", (*pwm)->ldr.BaseAddress);
1
0
0
0
Alexandre Julliard : ntdll: Pass a flag instead of a file handle to load_builtin_dll().
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 4880a5a0f40f1007bc48b9e5a41c73a11eb4b63f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4880a5a0f40f1007bc48b9e5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Feb 9 09:48:00 2019 +0100 ntdll: Pass a flag instead of a file handle to load_builtin_dll(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index e7a9c2c..701692a 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2127,7 +2127,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam /*********************************************************************** * load_builtin_dll */ -static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, HANDLE file, +static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, BOOL has_file, DWORD flags, WINE_MODREF** pwm ) { char error[256], dllname[MAX_PATH]; @@ -2151,7 +2151,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_na info.status = STATUS_SUCCESS; info.wm = NULL; - if (file) /* we have a real file, try to load it */ + if (has_file) /* we have a real file, try to load it */ { ANSI_STRING unix_name; @@ -2565,19 +2565,19 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_ nts = load_native_dll( load_path, &nt_name, handle, flags, pwm, &st ); if (nts == STATUS_INVALID_IMAGE_NOT_MZ) /* not in PE format, maybe it's a builtin */ - nts = load_builtin_dll( load_path, &nt_name, handle, flags, pwm ); + nts = load_builtin_dll( load_path, &nt_name, TRUE, flags, pwm ); } if (nts == STATUS_DLL_NOT_FOUND && loadorder == LO_NATIVE_BUILTIN) - nts = load_builtin_dll( load_path, &nt_name, 0, flags, pwm ); + nts = load_builtin_dll( load_path, &nt_name, FALSE, flags, pwm ); break; case LO_BUILTIN: case LO_BUILTIN_NATIVE: case LO_DEFAULT: /* default is builtin,native */ - nts = load_builtin_dll( load_path, &nt_name, handle, flags, pwm ); + nts = load_builtin_dll( load_path, &nt_name, handle != 0, flags, pwm ); if (!handle) break; /* nothing else we can try */ /* file is not a builtin library, try without using the specified file */ if (nts != STATUS_SUCCESS) - nts = load_builtin_dll( load_path, &nt_name, 0, flags, pwm ); + nts = load_builtin_dll( load_path, &nt_name, FALSE, flags, pwm ); if (nts == STATUS_SUCCESS && loadorder == LO_DEFAULT && (MODULE_InitDLL( *pwm, DLL_WINE_PREATTACH, NULL ) != STATUS_SUCCESS)) { @@ -3576,7 +3576,7 @@ void __wine_process_init(void) wine_dll_set_callback( load_builtin_callback ); RtlInitUnicodeString( &nt_name, kernel32W ); - if ((status = load_builtin_dll( NULL, &nt_name, 0, 0, &wm )) != STATUS_SUCCESS) + if ((status = load_builtin_dll( NULL, &nt_name, FALSE, 0, &wm )) != STATUS_SUCCESS) { MESSAGE( "wine: could not load kernel32.dll, status %x\n", status ); exit(1);
1
0
0
0
Sven Baars : webservices/tests: Add a missing closesocket call (Coverity).
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 340d0106fe2d2e521261e10823f71eb916995761 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=340d0106fe2d2e521261e108…
Author: Sven Baars <sven.wine(a)gmail.com> Date: Sat Feb 9 16:55:49 2019 +0100 webservices/tests: Add a missing closesocket call (Coverity). Signed-off-by: Sven Baars <sven.wine(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/tests/proxy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/webservices/tests/proxy.c b/dlls/webservices/tests/proxy.c index f529779..3fe9236 100644 --- a/dlls/webservices/tests/proxy.c +++ b/dlls/webservices/tests/proxy.c @@ -708,6 +708,7 @@ static DWORD CALLBACK server_proc( void *arg ) closesocket( c ); if (quit) break; } + closesocket( s ); return 0; }
1
0
0
0
Sergio Gómez Del Real : gdi32/dibdrv : Clip segment points to dib rect in wide_line_segment().
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: c20285218b55a08c1ad3a9a5e049d50913319de6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c20285218b55a08c1ad3a9a5…
Author: Sergio Gómez Del Real <sdelreal(a)codeweavers.com> Date: Fri Feb 8 10:05:10 2019 -0500 gdi32/dibdrv: Clip segment points to dib rect in wide_line_segment(). Signed-off-by: Sergio Gómez Del Real <sdelreal(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/dibdrv/objects.c | 43 +++++++++++++++++++++++++++++++++---------- dlls/gdi32/gdi_private.h | 8 ++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index f95475a..26710dd 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -1334,15 +1334,21 @@ static void add_join( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const P { HRGN join; POINT pts[4]; + RECT rect; switch (pdev->pen_join) { default: FIXME( "Unknown line join %x\n", pdev->pen_join ); /* fall through */ case PS_JOIN_ROUND: - OffsetRgn( round_cap, pt->x, pt->y ); - CombineRgn( region, region, round_cap, RGN_OR ); - OffsetRgn( round_cap, -pt->x, -pt->y ); + GetRgnBox( round_cap, &rect ); + offset_rect( &rect, pt->x, pt->y ); + if (clip_rect_to_dib( &pdev->dib, &rect )) + { + OffsetRgn( round_cap, pt->x, pt->y ); + CombineRgn( region, region, round_cap, RGN_OR ); + OffsetRgn( round_cap, -pt->x, -pt->y ); + } return; case PS_JOIN_MITER: @@ -1358,7 +1364,9 @@ static void add_join( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const P break; } - CombineRgn( region, region, join, RGN_OR ); + GetRgnBox( join, &rect ); + if (clip_rect_to_dib( &pdev->dib, &rect )) + CombineRgn( region, region, join, RGN_OR ); DeleteObject( join ); return; } @@ -1367,7 +1375,7 @@ static BOOL wide_line_segment( dibdrv_physdev *pdev, HRGN total, const POINT *pt_1, const POINT *pt_2, int dx, int dy, BOOL need_cap_1, BOOL need_cap_2, struct face *face_1, struct face *face_2 ) { - RECT rect; + RECT rect, clip_rect; BOOL sq_cap_1 = need_cap_1 && (pdev->pen_endcap == PS_ENDCAP_SQUARE); BOOL sq_cap_2 = need_cap_2 && (pdev->pen_endcap == PS_ENDCAP_SQUARE); @@ -1381,7 +1389,9 @@ static BOOL wide_line_segment( dibdrv_physdev *pdev, HRGN total, rect.bottom = rect.top + pdev->pen_width; if ((sq_cap_1 && dx > 0) || (sq_cap_2 && dx < 0)) rect.left -= pdev->pen_width / 2; if ((sq_cap_2 && dx > 0) || (sq_cap_1 && dx < 0)) rect.right += pdev->pen_width / 2; - add_rect_to_region( total, &rect ); + clip_rect = rect; + if (clip_rect_to_dib( &pdev->dib, &clip_rect )) + add_rect_to_region( total, &clip_rect ); if (dx > 0) { face_1->start.x = face_1->end.x = rect.left; @@ -1405,7 +1415,9 @@ static BOOL wide_line_segment( dibdrv_physdev *pdev, HRGN total, rect.right = rect.left + pdev->pen_width; if ((sq_cap_1 && dy > 0) || (sq_cap_2 && dy < 0)) rect.top -= pdev->pen_width / 2; if ((sq_cap_2 && dy > 0) || (sq_cap_1 && dy < 0)) rect.bottom += pdev->pen_width / 2; - add_rect_to_region( total, &rect ); + clip_rect = rect; + if (clip_rect_to_dib( &pdev->dib, &clip_rect )) + add_rect_to_region( total, &clip_rect ); if (dy > 0) { face_1->start.x = face_2->end.x = rect.left; @@ -1475,9 +1487,20 @@ static BOOL wide_line_segment( dibdrv_physdev *pdev, HRGN total, seg_pts[3].y += wide_half.x; } - segment = CreatePolygonRgn( seg_pts, 4, ALTERNATE ); - CombineRgn( total, total, segment, RGN_OR ); - DeleteObject( segment ); + if (dx > 0 && dy > 0) + set_rect( &clip_rect, seg_pts[0].x, seg_pts[1].y, seg_pts[2].x, seg_pts[3].y ); + else if (dx > 0 && dy < 0) + set_rect( &clip_rect, seg_pts[1].x, seg_pts[2].y, seg_pts[3].x, seg_pts[0].y ); + else if (dx < 0 && dy > 0) + set_rect( &clip_rect, seg_pts[3].x, seg_pts[0].y, seg_pts[1].x, seg_pts[2].y ); + else + set_rect( &clip_rect, seg_pts[2].x, seg_pts[3].y, seg_pts[0].x, seg_pts[1].y ); + if (clip_rect_to_dib( &pdev->dib, &clip_rect )) + { + segment = CreatePolygonRgn( seg_pts, 4, ALTERNATE ); + CombineRgn( total, total, segment, RGN_OR ); + DeleteObject( segment ); + } face_1->start = seg_pts[0]; face_1->end = seg_pts[1]; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 920cd1e..01473dd 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -521,6 +521,14 @@ static inline void offset_rect( RECT *rect, int offset_x, int offset_y ) rect->bottom += offset_y; } +static inline void set_rect( RECT *rect, int left, int top, int right, int bottom ) +{ + rect->left = left; + rect->top = top; + rect->right = right; + rect->bottom = bottom; +} + static inline void order_rect( RECT *rect ) { if (rect->left > rect->right)
1
0
0
0
Gabriel Ivăncescu : user32/tests: Add tests for LB_INITSTORAGE.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 0d19628ef5511d23e2d793af4ad5adca0aede884 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0d19628ef5511d23e2d793af…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Feb 8 13:17:22 2019 +0200 user32/tests: Add tests for LB_INITSTORAGE. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/listbox.c | 64 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index b87acd7..7f1e9cf 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1824,6 +1824,69 @@ todo_wine DestroyWindow(parent); } +static void test_init_storage( void ) +{ + static const DWORD styles[] = + { + LBS_HASSTRINGS, + LBS_NODATA | LBS_OWNERDRAWFIXED, + }; + HWND parent, listbox; + LONG ret, items_size; + int i, j; + + parent = create_parent(); + for (i = 0; i < ARRAY_SIZE(styles); i++) + { + listbox = CreateWindowA("listbox", "TestList", styles[i] | WS_CHILD, + 0, 0, 100, 100, parent, (HMENU)1, NULL, 0); + + items_size = SendMessageA(listbox, LB_INITSTORAGE, 100, 0); + ok(items_size >= 100, "expected at least 100, got %d\n", items_size); + + ret = SendMessageA(listbox, LB_INITSTORAGE, 0, 0); + ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + + /* it doesn't grow since the space was already reserved */ + ret = SendMessageA(listbox, LB_INITSTORAGE, items_size, 0); + ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + + /* it doesn't shrink the reserved space */ + ret = SendMessageA(listbox, LB_INITSTORAGE, 42, 0); + ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + + /* now populate almost all of it so it's not reserved anymore */ + if (styles[i] & LBS_NODATA) + { + ret = SendMessageA(listbox, LB_SETCOUNT, items_size - 1, 0); + ok(ret == 0, "unexpected return value %d\n", ret); + } + else + { + for (j = 0; j < items_size - 1; j++) + { + ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)""); + ok(ret == j, "expected %d, got %d\n", j, ret); + } + } + + /* we still have one more reserved slot, so it doesn't grow yet */ + ret = SendMessageA(listbox, LB_INITSTORAGE, 1, 0); + ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + + /* fill the slot and check again, it should grow this time */ + ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)""); + ok(ret == items_size - 1, "expected %d, got %d\n", items_size - 1, ret); + ret = SendMessageA(listbox, LB_INITSTORAGE, 0, 0); + ok(ret == items_size, "expected %d, got %d\n", items_size, ret); + ret = SendMessageA(listbox, LB_INITSTORAGE, 1, 0); + ok(ret > items_size, "expected it to grow past %d, got %d\n", items_size, ret); + + DestroyWindow(listbox); + } + DestroyWindow(parent); +} + static void test_missing_lbuttonup( void ) { HWND listbox, parent, capture; @@ -2251,6 +2314,7 @@ START_TEST(listbox) test_listbox_LB_DIR(); test_listbox_dlgdir(); test_set_count(); + test_init_storage(); test_GetListBoxInfo(); test_missing_lbuttonup(); test_extents();
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Return proper value for LB_INITSTORAGE.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 0dd9eaf4e32ad15be524fefa79bc01034c454b2e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0dd9eaf4e32ad15be524fefa…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Feb 8 13:17:21 2019 +0200 user32/listbox: Return proper value for LB_INITSTORAGE. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 3bd1b58..a2791eb 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -734,7 +734,7 @@ static LRESULT LISTBOX_InitStorage( LB_DESCR *descr, INT nb_items ) if (new_size > descr->items_size && !resize_storage(descr, new_size)) return LB_ERRSPACE; - return LB_OKAY; + return descr->items_size; }
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Shrink the item array with resize_storage.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: 1ece9f62056d1ce88bc528b6e55c26b05cc17522 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1ece9f62056d1ce88bc528b6…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Feb 8 13:17:20 2019 +0200 user32/listbox: Shrink the item array with resize_storage. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 80ba38b..3bd1b58 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1678,7 +1678,6 @@ static void LISTBOX_DeleteItem( LB_DESCR *descr, INT index ) static LRESULT LISTBOX_RemoveItem( LB_DESCR *descr, INT index ) { LB_ITEMDATA *item; - INT max_items; if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; @@ -1698,20 +1697,8 @@ static LRESULT LISTBOX_RemoveItem( LB_DESCR *descr, INT index ) (descr->nb_items - index) * sizeof(LB_ITEMDATA) ); if (descr->anchor_item == descr->nb_items) descr->anchor_item--; - /* Shrink the item array if possible */ + resize_storage(descr, descr->nb_items); - max_items = descr->items_size; - if (descr->nb_items < max_items - 2*LB_ARRAY_GRANULARITY) - { - max_items -= LB_ARRAY_GRANULARITY; - item = HeapReAlloc( GetProcessHeap(), 0, descr->items, - max_items * sizeof(LB_ITEMDATA) ); - if (item) - { - descr->items_size = max_items; - descr->items = item; - } - } /* Repaint the items */ LISTBOX_UpdateScroll( descr );
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Use a helper to expand the item array.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: d7f2f33575cf6de36a0fc9b3b6732bcc5e161330 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d7f2f33575cf6de36a0fc9b3…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Feb 8 13:17:19 2019 +0200 user32/listbox: Use a helper to expand the item array. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 64 ++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 39 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 821da60..80ba38b 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -33,10 +33,11 @@ #include "controls.h" #include "wine/exception.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(listbox); -/* Items array granularity */ +/* Items array granularity (must be power of 2) */ #define LB_ARRAY_GRANULARITY 16 /* Scrolling timeout in ms */ @@ -121,6 +122,26 @@ static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE; static LRESULT LISTBOX_GetItemRect( const LB_DESCR *descr, INT index, RECT *rect ); +static BOOL resize_storage(LB_DESCR *descr, UINT items_size) +{ + LB_ITEMDATA *items; + + if (items_size > descr->items_size || + items_size + LB_ARRAY_GRANULARITY * 2 < descr->items_size) + { + items_size = (items_size + LB_ARRAY_GRANULARITY - 1) & ~(LB_ARRAY_GRANULARITY - 1); + items = heap_realloc(descr->items, items_size * sizeof(LB_ITEMDATA)); + if (!items) + { + SEND_NOTIFICATION(descr, LBN_ERRSPACE); + return FALSE; + } + descr->items_size = items_size; + descr->items = items; + } + return TRUE; +} + static BOOL is_item_selected( const LB_DESCR *descr, UINT index ) { return descr->items[index].selected; @@ -709,27 +730,10 @@ static void LISTBOX_DrawFocusRect( LB_DESCR *descr, BOOL on ) */ static LRESULT LISTBOX_InitStorage( LB_DESCR *descr, INT nb_items ) { - LB_ITEMDATA *item; - - nb_items += LB_ARRAY_GRANULARITY - 1; - nb_items -= (nb_items % LB_ARRAY_GRANULARITY); - if (descr->items) { - nb_items += descr->items_size; - item = HeapReAlloc( GetProcessHeap(), 0, descr->items, - nb_items * sizeof(LB_ITEMDATA)); - } - else { - item = HeapAlloc( GetProcessHeap(), 0, - nb_items * sizeof(LB_ITEMDATA)); - } + UINT new_size = descr->nb_items + nb_items; - if (!item) - { - SEND_NOTIFICATION( descr, LBN_ERRSPACE ); + if (new_size > descr->items_size && !resize_storage(descr, new_size)) return LB_ERRSPACE; - } - descr->items_size = nb_items; - descr->items = item; return LB_OKAY; } @@ -1534,29 +1538,11 @@ static LRESULT LISTBOX_InsertItem( LB_DESCR *descr, INT index, LPWSTR str, ULONG_PTR data ) { LB_ITEMDATA *item; - INT max_items; INT oldfocus = descr->focus_item; if (index == -1) index = descr->nb_items; else if ((index < 0) || (index > descr->nb_items)) return LB_ERR; - if (descr->nb_items == descr->items_size) - { - /* We need to grow the array */ - max_items = descr->items_size + LB_ARRAY_GRANULARITY; - if (descr->items) - item = HeapReAlloc( GetProcessHeap(), 0, descr->items, - max_items * sizeof(LB_ITEMDATA) ); - else - item = HeapAlloc( GetProcessHeap(), 0, - max_items * sizeof(LB_ITEMDATA) ); - if (!item) - { - SEND_NOTIFICATION( descr, LBN_ERRSPACE ); - return LB_ERRSPACE; - } - descr->items_size = max_items; - descr->items = item; - } + if (!resize_storage(descr, descr->nb_items + 1)) return LB_ERR; /* Insert the item structure */
1
0
0
0
Gabriel Ivăncescu : user32/listbox: Check for out of bounds using the index when painting the item.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: ea185314b37a59640f59a9dd3321205fc53068a1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea185314b37a59640f59a9dd…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Feb 8 13:17:18 2019 +0200 user32/listbox: Check for out of bounds using the index when painting the item. Needed for LBS_NODATA. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/listbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 594c956..821da60 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -533,7 +533,7 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, RECT r; HRGN hrgn; - if (!item) + if (index >= descr->nb_items) { if (action == ODA_FOCUS) DrawFocusRect( hdc, rect );
1
0
0
0
Zebediah Figura : oleaut32: Register non-dual dispinterfaces using the correct proxy.
by Alexandre Julliard
11 Feb '19
11 Feb '19
Module: wine Branch: master Commit: f72f8e5c4036ed3344ef9aa5df8f000b1634c664 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f72f8e5c4036ed3344ef9aa5…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Feb 10 21:20:35 2019 -0600 oleaut32: Register non-dual dispinterfaces using the correct proxy. Fixes a bug where NetLinx Studio 4 would fail to compile files. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/tests/typelib.c | 22 +++++++++++++++++++++- dlls/oleaut32/typelib.c | 20 +++++++++++++++----- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index 90f0cb2..857100e 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -4963,6 +4963,7 @@ static void test_register_typelib(BOOL system_registration) HKEY hkey; REGSAM opposite = (sizeof(void*) == 8 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY); BOOL is_wow64 = FALSE; + LONG size; struct { TYPEKIND kind; @@ -5071,7 +5072,26 @@ static void test_register_typelib(BOOL system_registration) ret = RegOpenKeyExA(HKEY_CLASSES_ROOT, key_name, 0, KEY_READ, &hkey); ok(ret == expect_ret, "%d: got %d\n", i, ret); - if(ret == ERROR_SUCCESS) RegCloseKey(hkey); + if (ret == ERROR_SUCCESS) + { + size = sizeof(uuid); + ret = RegQueryValueA(hkey, "ProxyStubClsid32", uuid, &size); + ok(!ret, "Failed to get proxy GUID, error %u.\n", ret); + + if (attrs[i].kind == TKIND_INTERFACE || (attrs[i].flags & TYPEFLAG_FDUAL)) + { + ok(!strcasecmp(uuid, "{00020424-0000-0000-c000-000000000046}"), + "Got unexpected proxy CLSID %s.\n", uuid); + } + else + { + ok(!strcasecmp(uuid, "{00020420-0000-0000-c000-000000000046}"), + "Got unexpected proxy CLSID %s.\n", uuid); + } + + RegCloseKey(hkey); + } + /* 32-bit typelibs should be registered into both registry bit modes */ if (is_win64 || is_wow64) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index f17a926..acd4d07 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -578,14 +578,24 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t WCHAR keyName[60]; HKEY key, subKey; - static const WCHAR PSOA[] = {'{','0','0','0','2','0','4','2','4','-', - '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-', - '0','0','0','0','0','0','0','0','0','0','4','6','}',0}; + static const WCHAR typelib_proxy_clsid[] = {'{','0','0','0','2','0','4','2','4','-', + '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-', + '0','0','0','0','0','0','0','0','0','0','4','6','}',0}; + static const WCHAR dispatch_proxy_clsid[] = {'{','0','0','0','2','0','4','2','0','-', + '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-', + '0','0','0','0','0','0','0','0','0','0','4','6','}',0}; get_interface_key( &tattr->guid, keyName ); if (RegCreateKeyExW(HKEY_CLASSES_ROOT, keyName, 0, NULL, 0, KEY_WRITE | flag, NULL, &key, NULL) == ERROR_SUCCESS) { + const WCHAR *proxy_clsid; + + if (tattr->typekind == TKIND_INTERFACE || (tattr->wTypeFlags & TYPEFLAG_FDUAL)) + proxy_clsid = typelib_proxy_clsid; + else + proxy_clsid = dispatch_proxy_clsid; + if (name) RegSetValueExW(key, NULL, 0, REG_SZ, (BYTE *)name, (strlenW(name)+1) * sizeof(OLECHAR)); @@ -593,14 +603,14 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t if (RegCreateKeyExW(key, ProxyStubClsidW, 0, NULL, 0, KEY_WRITE | flag, NULL, &subKey, NULL) == ERROR_SUCCESS) { RegSetValueExW(subKey, NULL, 0, REG_SZ, - (const BYTE *)PSOA, sizeof PSOA); + (const BYTE *)proxy_clsid, sizeof(typelib_proxy_clsid)); RegCloseKey(subKey); } if (RegCreateKeyExW(key, ProxyStubClsid32W, 0, NULL, 0, KEY_WRITE | flag, NULL, &subKey, NULL) == ERROR_SUCCESS) { RegSetValueExW(subKey, NULL, 0, REG_SZ, - (const BYTE *)PSOA, sizeof PSOA); + (const BYTE *)proxy_clsid, sizeof(typelib_proxy_clsid)); RegCloseKey(subKey); }
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
68
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
Results per page:
10
25
50
100
200