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
Sergio Gómez Del Real : riched20: Mask out extended flags introduced by CHARFORMAT2 when converting to CHARFORMAT.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 4f007da8d3af4ec3acf573e8aca2fd5b182a378a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f007da8d3af4ec3acf573e8…
Author: Sergio Gómez Del Real <sdelreal(a)codeweavers.com> Date: Wed Feb 6 08:54:18 2019 +0000 riched20: Mask out extended flags introduced by CHARFORMAT2 when converting to CHARFORMAT. 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/riched20/style.c | 4 ++++ dlls/riched20/tests/editor.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index c3f3fc3..3b9d771 100644 --- a/dlls/riched20/style.c +++ b/dlls/riched20/style.c @@ -85,6 +85,8 @@ BOOL cf2w_to_cfany(CHARFORMAT2W *to, const CHARFORMAT2W *from) CopyMemory(t, from, FIELD_OFFSET(CHARFORMATA, szFaceName)); WideCharToMultiByte(CP_ACP, 0, from->szFaceName, -1, t->szFaceName, sizeof(t->szFaceName), NULL, NULL); t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */ + t->dwMask &= CFM_ALL; + t->dwEffects &= CFM_EFFECTS; return TRUE; } if (to->cbSize == sizeof(CHARFORMATW)) @@ -92,6 +94,8 @@ BOOL cf2w_to_cfany(CHARFORMAT2W *to, const CHARFORMAT2W *from) CHARFORMATW *t = (CHARFORMATW *)to; CopyMemory(t, from, sizeof(*t)); t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */ + t->dwMask &= CFM_ALL; + t->dwEffects &= CFM_EFFECTS; return TRUE; } if (to->cbSize == sizeof(CHARFORMAT2A)) diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 932c8a1..ddb1018 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -751,6 +751,8 @@ static void test_EM_SETCHARFORMAT(void) HWND hwndRichEdit = new_richedit(NULL); CHARFORMAT2A cf2; CHARFORMAT2W cfW; + CHARFORMATA cf1a; + CHARFORMATW cf1w; int rc = 0; int tested_effects[] = { CFE_BOLD, @@ -1338,6 +1340,23 @@ static void test_EM_SETCHARFORMAT(void) ok(cf2.dwEffects & CFE_UNDERLINE, "got %08x\n", cf2.dwEffects); ok(cf2.bUnderlineType == CFU_UNDERLINEDOUBLE, "got %x\n", cf2.bUnderlineType); + /* Check setting CFM_ALL2/CFM_EFFECTS2 in CHARFORMAT(A/W). */ + memset(&cf1a, 0, sizeof(CHARFORMATA)); + memset(&cf1w, 0, sizeof(CHARFORMATW)); + cf1a.cbSize = sizeof(CHARFORMATA); + cf1w.cbSize = sizeof(CHARFORMATW); + cf1a.dwMask = cf1w.dwMask = CFM_ALL2; + cf1a.dwEffects = cf1w.dwEffects = CFM_EFFECTS2; + SendMessageA(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf1a); + SendMessageA(hwndRichEdit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf1a); + /* flags only valid for CHARFORMAT2 should be masked out */ + ok((cf1a.dwMask & (CFM_ALL2 & ~CFM_ALL)) == 0, "flags were not masked out\n"); + ok((cf1a.dwEffects & (CFM_EFFECTS2 & ~CFM_EFFECTS)) == 0, "flags were not masked out\n"); + SendMessageA(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf1w); + SendMessageA(hwndRichEdit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf1w); + ok((cf1w.dwMask & (CFM_ALL2 & ~CFM_ALL)) == 0, "flags were not masked out\n"); + ok((cf1w.dwEffects & (CFM_EFFECTS2 & ~CFM_EFFECTS)) == 0, "flags were not masked out\n"); + DestroyWindow(hwndRichEdit); }
1
0
0
0
Alexandre Julliard : ntdll: Don' t use current directory for libraries unless explicitly specified in the search path.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 6fb00db51e21914e57b2c4ea04b1a95081425d48 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6fb00db51e21914e57b2c4ea…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Feb 6 10:45:18 2019 +0100 ntdll: Don't use current directory for libraries unless explicitly specified in the search path. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/module.c | 84 ++++++++++++++++++++++++++++++++++++++++++-- dlls/ntdll/loader.c | 12 ++----- 2 files changed, 84 insertions(+), 12 deletions(-) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index ba65e0a..2314c84 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -479,15 +479,13 @@ static void test_LoadLibraryEx_search_flags(void) { { 6, 5 }, 5, 0 }, { { 1, 1, 2 }, 0, 2 }, }; - char *p, path[MAX_PATH], buf[MAX_PATH]; + char *p, path[MAX_PATH], buf[MAX_PATH], curdir[MAX_PATH]; WCHAR bufW[MAX_PATH]; DLL_DIRECTORY_COOKIE cookies[4]; unsigned int i, j, k; BOOL ret; HMODULE mod; - if (!pAddDllDirectory || !pSetDllDirectoryA) return; - GetTempPathA( sizeof(path), path ); GetTempFileNameA( path, "tmp", 0, buf ); DeleteFileA( buf ); @@ -503,6 +501,80 @@ static void test_LoadLibraryEx_search_flags(void) sprintf( p, "\\%u\\winetestdll.dll", i ); create_test_dll( buf ); } + + GetCurrentDirectoryA( MAX_PATH, curdir ); + *p = 0; + SetCurrentDirectoryA( buf ); + + SetLastError( 0xdeadbeef ); + mod = LoadLibraryA( "1\\winetestdll.dll" ); + ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + FreeLibrary( mod ); + + SetLastError( 0xdeadbeef ); + sprintf( path, "%c:1\\winetestdll.dll", buf[0] ); + mod = LoadLibraryA( path ); + ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + FreeLibrary( mod ); + + if (pAddDllDirectory) + { + SetLastError( 0xdeadbeef ); + mod = LoadLibraryExA( "1\\winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); + ok( !mod, "LoadLibrary succeeded\n" ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + mod = LoadLibraryExA( path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); + ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + FreeLibrary( mod ); + } + + strcpy( p, "\\1" ); + SetCurrentDirectoryA( buf ); + + SetLastError( 0xdeadbeef ); + mod = LoadLibraryA( "winetestdll.dll" ); + ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + FreeLibrary( mod ); + + SetLastError( 0xdeadbeef ); + sprintf( path, "%c:winetestdll.dll", buf[0] ); + mod = LoadLibraryA( path ); + ok( mod != NULL || broken(!mod), /* win10 disallows this but allows c:1\\winetestdll.dll */ + "LoadLibrary failed err %u\n", GetLastError() ); + if (!mod) ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + else FreeLibrary( mod ); + + SetLastError( 0xdeadbeef ); + sprintf( path, "%s\\winetestdll.dll", buf + 2 ); + mod = LoadLibraryA( path ); + ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + FreeLibrary( mod ); + + if (pAddDllDirectory) + { + SetLastError( 0xdeadbeef ); + mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); + ok( !mod, "LoadLibrary succeeded\n" ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + mod = LoadLibraryExA( path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); + ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + FreeLibrary( mod ); + + SetLastError( 0xdeadbeef ); + sprintf( path, "%s\\winetestdll.dll", buf + 2 ); + mod = LoadLibraryExA( path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32 ); + ok( mod != NULL, "LoadLibrary failed err %u\n", GetLastError() ); + FreeLibrary( mod ); + } + + SetCurrentDirectoryA( curdir ); + + if (!pAddDllDirectory || !pSetDllDirectoryA) goto done; + SetLastError( 0xdeadbeef ); mod = LoadLibraryExA( "winetestdll.dll", 0, LOAD_LIBRARY_SEARCH_APPLICATION_DIR ); ok( !mod, "LoadLibrary succeeded\n" ); @@ -539,6 +611,11 @@ static void test_LoadLibraryEx_search_flags(void) ok( !mod, "LoadLibrary succeeded\n" ); ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + mod = LoadLibraryA( "1\\winetestdll.dll" ); + ok( !mod, "LoadLibrary succeeded\n" ); + ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() ); + for (j = 0; j < ARRAY_SIZE(tests); j++) { for (k = 0; tests[j].add_dirs[k]; k++) @@ -575,6 +652,7 @@ static void test_LoadLibraryEx_search_flags(void) for (k = 0; tests[j].add_dirs[k]; k++) pRemoveDllDirectory( cookies[k] ); } +done: for (i = 1; i <= 6; i++) { sprintf( p, "\\%u\\winetestdll.dll", i ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index a47dfe0..1f92eb0 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2442,23 +2442,17 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, return STATUS_NO_MEMORY; } *handle = open_dll_file( &nt_name, pwm, st ); - goto found; } - - /* not found */ - - if (!contains_path( libname )) + else /* not found, return the name as is, to be loaded as builtin */ { - /* if libname doesn't contain a path at all, we simply return the name as is, - * to be loaded as builtin */ len = strlenW(libname) * sizeof(WCHAR); if (len >= *size) goto overflow; strcpyW( filename, libname ); - goto found; } + goto found; } - /* absolute path name, or relative path name but not found above */ + /* absolute path name */ if (!RtlDosPathNameToNtPathName_U( libname, &nt_name, &file_part, NULL )) {
1
0
0
0
Michael Stefaniuc : gdi32: Avoid TRUE : FALSE conditional expressions.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 0aea7fc915a7ba02f71763c2068336b2c7fcf4d2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0aea7fc915a7ba02f71763c2…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Mon Feb 4 23:16:42 2019 +0100 gdi32: Avoid TRUE : FALSE conditional expressions. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index c38108e..de62425 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -8217,14 +8217,14 @@ static BOOL load_child_font(GdiFont *font, CHILD_FONT *child) UINT penalty = 0, new_penalty = 0; BOOL bold, italic, bd, it; - italic = font->font_desc.lf.lfItalic ? TRUE : FALSE; - bold = font->font_desc.lf.lfWeight > FW_MEDIUM ? TRUE : FALSE; + italic = !!font->font_desc.lf.lfItalic; + bold = font->font_desc.lf.lfWeight > FW_MEDIUM; face_list = get_face_list_from_family( child->face->family ); LIST_FOR_EACH_ENTRY( child_face, face_list, Face, entry ) { - it = child_face->ntmFlags & NTM_ITALIC ? TRUE : FALSE; - bd = child_face->ntmFlags & NTM_BOLD ? TRUE : FALSE; + it = !!(child_face->ntmFlags & NTM_ITALIC); + bd = !!(child_face->ntmFlags & NTM_BOLD); new_penalty = ( it ^ italic ) + ( bd ^ bold ); if (!best_face || new_penalty < penalty) {
1
0
0
0
Isira Seneviratne : po: Update Sinhala translation.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 08d6df5f810b08762ac6c416b70469c5916b220a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=08d6df5f810b08762ac6c416…
Author: Isira Seneviratne <isirasen96(a)gmail.com> Date: Wed Feb 6 07:10:58 2019 +0530 po: Update Sinhala translation. Signed-off-by: Isira Seneviratne <isirasen96(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- po/si.po | 615 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 335 insertions(+), 280 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=08d6df5f810b08762ac6…
1
0
0
0
Zebediah Figura : ntdll: Add a futex-based implementation of WaitOnAddress ().
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: cc8f9b64194f115de1161526e2f0ebbcb0bdcc4b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cc8f9b64194f115de1161526…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 5 20:21:07 2019 -0600 ntdll: Add a futex-based implementation of WaitOnAddress(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/sync.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 62cb3cd..8513561 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -26,7 +26,11 @@ #include <assert.h> #include <errno.h> +#include <limits.h> #include <signal.h> +#ifdef HAVE_SYS_SYSCALL_H +#include <sys/syscall.h> +#endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif @@ -63,6 +67,8 @@ HANDLE keyed_event = NULL; static const LARGE_INTEGER zero_timeout; +#define TICKSPERSEC 10000000 + static inline int interlocked_dec_if_nonzero( int *dest ) { int val, tmp; @@ -74,6 +80,41 @@ static inline int interlocked_dec_if_nonzero( int *dest ) return val; } + +#ifdef __linux__ + +static int wait_op = 128; /*FUTEX_WAIT|FUTEX_PRIVATE_FLAG*/ +static int wake_op = 129; /*FUTEX_WAKE|FUTEX_PRIVATE_FLAG*/ + +static inline int futex_wait( const int *addr, int val, struct timespec *timeout ) +{ + return syscall( __NR_futex, addr, wait_op, val, timeout, 0, 0 ); +} + +static inline int futex_wake( const int *addr, int val ) +{ + return syscall( __NR_futex, addr, wake_op, val, NULL, 0, 0 ); +} + +static inline int use_futexes(void) +{ + static int supported = -1; + + if (supported == -1) + { + futex_wait( &supported, 10, NULL ); + if (errno == ENOSYS) + { + wait_op = 0; /*FUTEX_WAIT*/ + wake_op = 1; /*FUTEX_WAKE*/ + futex_wait( &supported, 10, NULL ); + } + supported = (errno != ENOSYS); + } + return supported; +} +#endif + /* creates a struct security_descriptor and contained information in one contiguous piece of memory */ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret, data_size_t *ret_len ) @@ -1987,6 +2028,95 @@ static BOOL compare_addr( const void *addr, const void *cmp, SIZE_T size ) return FALSE; } +#ifdef __linux__ +/* We can't map addresses to futex directly, because an application can wait on + * 8 bytes, and we can't pass all 8 as the compare value to futex(). Instead we + * map all addresses to a small fixed table of futexes. This may result in + * spurious wakes, but the application is already expected to handle those. */ + +static int addr_futex_table[256]; + +static inline int *hash_addr( const void *addr ) +{ + ULONG_PTR val = (ULONG_PTR)addr; + + return &addr_futex_table[(val >> 2) & 255]; +} + +static inline NTSTATUS fast_wait_addr( const void *addr, const void *cmp, SIZE_T size, + const LARGE_INTEGER *timeout ) +{ + int *futex; + int val; + LARGE_INTEGER now; + timeout_t diff; + struct timespec timespec; + int ret; + + if (!use_futexes()) + return STATUS_NOT_IMPLEMENTED; + + futex = hash_addr( addr ); + + /* We must read the previous value of the futex before checking the value + * of the address being waited on. That way, if we receive a wake between + * now and waiting on the futex, we know that val will have changed. + * Use an atomic load so that memory accesses are ordered between this read + * and the increment below. */ + val = interlocked_cmpxchg( futex, 0, 0 ); + if (!compare_addr( addr, cmp, size )) + return STATUS_SUCCESS; + + if (timeout) + { + if (timeout->QuadPart > 0) + { + NtQuerySystemTime( &now ); + diff = timeout->QuadPart - now.QuadPart; + } + else + diff = -timeout->QuadPart; + + timespec.tv_sec = diff / TICKSPERSEC; + timespec.tv_nsec = (diff % TICKSPERSEC) * 100; + + ret = futex_wait( futex, val, ×pec ); + } + else + ret = futex_wait( futex, val, NULL ); + + if (ret == -1 && errno == ETIMEDOUT) + return STATUS_TIMEOUT; + return STATUS_SUCCESS; +} + +static inline NTSTATUS fast_wake_addr( const void *addr ) +{ + int *futex; + + if (!use_futexes()) + return STATUS_NOT_IMPLEMENTED; + + futex = hash_addr( addr ); + + interlocked_xchg_add( futex, 1 ); + + futex_wake( futex, INT_MAX ); + return STATUS_SUCCESS; +} +#else +static inline NTSTATUS fast_wait_addr( const void *addr, const void *cmp, SIZE_T size, + const LARGE_INTEGER *timeout ) +{ + return STATUS_NOT_IMPLEMENTED; +} + +static inline NTSTATUS fast_wake_addr( const void *addr ) +{ + return STATUS_NOT_IMPLEMENTED; +} +#endif + /*********************************************************************** * RtlWaitOnAddress (NTDLL.@) */ @@ -2005,6 +2135,9 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size if (size != 1 && size != 2 && size != 4 && size != 8) return STATUS_INVALID_PARAMETER; + if ((ret = fast_wait_addr( addr, cmp, size, timeout )) != STATUS_NOT_IMPLEMENTED) + return ret; + select_op.keyed_event.op = SELECT_KEYED_EVENT_WAIT; select_op.keyed_event.handle = wine_server_obj_handle( keyed_event ); select_op.keyed_event.key = wine_server_client_ptr( addr ); @@ -2059,6 +2192,9 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size */ void WINAPI RtlWakeAddressAll( const void *addr ) { + if (fast_wake_addr( addr ) != STATUS_NOT_IMPLEMENTED) + return; + RtlEnterCriticalSection( &addr_section ); while (NtReleaseKeyedEvent( 0, addr, 0, &zero_timeout ) == STATUS_SUCCESS) {} RtlLeaveCriticalSection( &addr_section ); @@ -2069,6 +2205,9 @@ void WINAPI RtlWakeAddressAll( const void *addr ) */ void WINAPI RtlWakeAddressSingle( const void *addr ) { + if (fast_wake_addr( addr ) != STATUS_NOT_IMPLEMENTED) + return; + RtlEnterCriticalSection( &addr_section ); NtReleaseKeyedEvent( 0, addr, 0, &zero_timeout ); RtlLeaveCriticalSection( &addr_section );
1
0
0
0
Zebediah Figura : kernelbase/tests: Relax tests for WaitOnAddress().
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 749fe42d1f34a1dfaa9833d9b5fc956b2b8e0b31 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=749fe42d1f34a1dfaa9833d9…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 5 20:21:06 2019 -0600 kernelbase/tests: Relax tests for WaitOnAddress(). Application should be expected to handle spurious wakeups, which the following implementation will give in WakeByAddressSingle(). Avoid testing that WakeByAddressSingle() only wakes one thread. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/tests/sync.c | 48 +++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/dlls/kernelbase/tests/sync.c b/dlls/kernelbase/tests/sync.c index 99cbbc4..9f57cf7 100644 --- a/dlls/kernelbase/tests/sync.c +++ b/dlls/kernelbase/tests/sync.c @@ -30,20 +30,24 @@ static BOOL (WINAPI *pWaitOnAddress)(volatile void *, void *, SIZE_T, DWORD); static void (WINAPI *pWakeByAddressAll)(void *); static void (WINAPI *pWakeByAddressSingle)(void *); -static LONG64 address; -static LONG64 compare; +static LONG address; static DWORD WINAPI test_WaitOnAddress_func(void *arg) { BOOL ret = FALSE; - DWORD gle; - while (address == compare) + LONG compare; + + do { - SetLastError(0xdeadbeef); - ret = pWaitOnAddress(&address, &compare, sizeof(compare), INFINITE); - gle = GetLastError(); - ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %d\n", gle); - } - ok(ret, "got %d\n", ret); + while (!(compare = address)) + { + SetLastError(0xdeadbeef); + ret = pWaitOnAddress(&address, &compare, sizeof(compare), INFINITE); + ok(ret, "wait failed\n"); + ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_SUCCESS) /* Win 8 */, + "got error %d\n", GetLastError()); + } + } while (InterlockedCompareExchange(&address, compare - 1, compare) != compare); + return 0; } @@ -51,6 +55,7 @@ static void test_WaitOnAddress(void) { DWORD gle, val, nthreads; HANDLE threads[8]; + LONG compare; BOOL ret; int i; @@ -64,8 +69,8 @@ static void test_WaitOnAddress(void) compare = 0; if (0) /* crash on Windows */ { - ret = pWaitOnAddress(&address, NULL, 8, 0); - ret = pWaitOnAddress(NULL, &compare, 8, 0); + ret = pWaitOnAddress(&address, NULL, 4, 0); + ret = pWaitOnAddress(NULL, &compare, 4, 0); } /* invalid arguments */ @@ -111,15 +116,15 @@ static void test_WaitOnAddress(void) /* different address size */ address = 0; - compare = 0xffff0000; + compare = 0xff00; SetLastError(0xdeadbeef); - ret = pWaitOnAddress(&address, &compare, 4, 0); + ret = pWaitOnAddress(&address, &compare, 2, 0); gle = GetLastError(); ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %d\n", gle); ok(ret, "got %d\n", ret); SetLastError(0xdeadbeef); - ret = pWaitOnAddress(&address, &compare, 2, 0); + ret = pWaitOnAddress(&address, &compare, 1, 0); gle = GetLastError(); ok(gle == ERROR_TIMEOUT, "got %d\n", gle); ok(!ret, "got %d\n", ret); @@ -128,24 +133,24 @@ static void test_WaitOnAddress(void) address = 0; compare = 1; SetLastError(0xdeadbeef); - ret = pWaitOnAddress(&address, &compare, 8, 0); + ret = pWaitOnAddress(&address, &compare, 4, 0); gle = GetLastError(); ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %d\n", gle); ok(ret, "got %d\n", ret); /* WakeByAddressAll */ address = 0; - compare = 0; for (i = 0; i < ARRAY_SIZE(threads); i++) threads[i] = CreateThread(NULL, 0, test_WaitOnAddress_func, NULL, 0, NULL); Sleep(100); - address = ~0; + address = ARRAY_SIZE(threads); pWakeByAddressAll(&address); val = WaitForMultipleObjects(ARRAY_SIZE(threads), threads, TRUE, 5000); ok(val == WAIT_OBJECT_0, "got %d\n", val); for (i = 0; i < ARRAY_SIZE(threads); i++) CloseHandle(threads[i]); + ok(!address, "got unexpected value %s\n", wine_dbgstr_longlong(address)); /* WakeByAddressSingle */ address = 0; @@ -153,13 +158,10 @@ static void test_WaitOnAddress(void) threads[i] = CreateThread(NULL, 0, test_WaitOnAddress_func, NULL, 0, NULL); Sleep(100); - address = 1; nthreads = ARRAY_SIZE(threads); + address = ARRAY_SIZE(threads); while (nthreads) { - val = WaitForMultipleObjects(nthreads, threads, FALSE, 0); - ok(val == STATUS_TIMEOUT, "got %u\n", val); - pWakeByAddressSingle(&address); val = WaitForMultipleObjects(nthreads, threads, FALSE, 2000); ok(val < WAIT_OBJECT_0 + nthreads, "got %u\n", val); @@ -167,7 +169,7 @@ static void test_WaitOnAddress(void) memmove(&threads[val], &threads[val+1], (nthreads - val - 1) * sizeof(threads[0])); nthreads--; } - + ok(!address, "got unexpected value %s\n", wine_dbgstr_longlong(address)); } START_TEST(sync)
1
0
0
0
Hans Leidekker : odbc32: Improve tracing in the remaining functions.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 69c2be841ca02155d76edc30d2a48328d21f727b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=69c2be841ca02155d76edc30…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Feb 5 21:22:57 2019 +0100 odbc32: Improve tracing in the remaining functions. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/odbc32/proxyodbc.c | 1835 +++++++++++++++++++++++++++-------------------- 1 file changed, 1051 insertions(+), 784 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=69c2be841ca02155d76e…
1
0
0
0
Hans Leidekker : odbc32: Work around drivers that don' t accept NULL name length in SQLDescribeCol.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 74b2dc01c6c4c84d7759764ca30946c92b7f353f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=74b2dc01c6c4c84d7759764c…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Feb 5 21:22:56 2019 +0100 odbc32: Work around drivers that don't accept NULL name length in SQLDescribeCol. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/odbc32/proxyodbc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 13546ed..ab28506 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -1020,6 +1020,7 @@ SQLRETURN WINAPI ODBC32_SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT Co SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) { + SQLSMALLINT dummy; SQLRETURN ret; TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," @@ -1027,6 +1028,7 @@ SQLRETURN WINAPI ODBC32_SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT Co BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); if (!pSQLDescribeCol) return SQL_ERROR; + if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ ret = pSQLDescribeCol(StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); @@ -2167,6 +2169,7 @@ SQLRETURN WINAPI ODBC32_SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT C SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) { + SQLSMALLINT dummy; SQLRETURN ret; TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," @@ -2174,6 +2177,7 @@ SQLRETURN WINAPI ODBC32_SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT C BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); if (!pSQLDescribeColW) return SQL_ERROR; + if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ ret = pSQLDescribeColW(StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable);
1
0
0
0
Hans Leidekker : odbc32: Improve tracing in a number of functions.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: wine Branch: master Commit: 4f0e765909c185879421db79a0aa574b72d2cdf4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f0e765909c185879421db79…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Feb 5 21:22:55 2019 +0100 odbc32: Improve tracing in a number of functions. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/odbc32/proxyodbc.c | 833 +++++++++++++++++++++++++++--------------------- 1 file changed, 466 insertions(+), 367 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=4f0e765909c185879421…
1
0
0
0
Zhiyi Zhang : tests: Add SetName() tests.
by Alexandre Julliard
06 Feb '19
06 Feb '19
Module: vkd3d Branch: master Commit: f5fd7ce046e439e5ffce0320fac604333956bb67 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=f5fd7ce046e439e5ffce032…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Feb 6 21:52:02 2019 +0330 tests: Add SetName() tests. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tests/d3d12.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index a854bd6..136af92 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -2740,7 +2740,7 @@ static void test_create_fence(void) ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount); } -static void test_private_data(void) +static void test_object_interface(void) { D3D12_DESCRIPTOR_HEAP_DESC descriptor_heap_desc; D3D12_QUERY_HEAP_DESC query_heap_desc; @@ -2763,6 +2763,8 @@ static void test_private_data(void) static const GUID test_guid2 = {0x2e5afac2, 0x87b5, 0x4c10, {0x9b, 0x4b, 0x89, 0xd7, 0xd1, 0x12, 0xe7, 0x2b}}; static const DWORD data[] = {1, 2, 3, 4}; + static const WCHAR deadbeefW[] = {'d', 'e', 'a', 'd', 'b', 'e', 'e', 'f', 0}; + static const WCHAR emptyW[] = {0}; static const GUID *tests[] = { &IID_ID3D12CommandAllocator, @@ -2994,6 +2996,15 @@ static void test_private_data(void) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); } + hr = ID3D12Object_SetName(object, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = ID3D12Object_SetName(object, emptyW); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = ID3D12Object_SetName(object, deadbeefW); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ID3D12Object_Release(object); refcount = IUnknown_Release(test_object); @@ -24044,7 +24055,7 @@ START_TEST(d3d12) run_test(test_create_compute_pipeline_state); run_test(test_create_graphics_pipeline_state); run_test(test_create_fence); - run_test(test_private_data); + run_test(test_object_interface); run_test(test_multithread_private_data); run_test(test_reset_command_allocator); run_test(test_cpu_signal_fence);
1
0
0
0
← Newer
1
...
57
58
59
60
61
62
63
...
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