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
June 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
865 discussions
Start a n
N
ew thread
Zebediah Figura : ucrtbase: Write the %hh prefix as a single char.
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: 9445bed2981c5a68a57c749b9354649980a31c39 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9445bed2981c5a68a57c749b…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Jun 10 20:19:50 2019 -0400 ucrtbase: Write the %hh prefix as a single char. This fixes a crash in Planet Coaster on startup. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/scanf.h | 3 +++ dlls/ucrtbase/tests/scanf.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/scanf.h b/dlls/msvcrt/scanf.h index 0903d69..1058a7a 100644 --- a/dlls/msvcrt/scanf.h +++ b/dlls/msvcrt/scanf.h @@ -309,6 +309,9 @@ _FUNCTION_ { if (I64_prefix) _SET_NUMBER_(LONGLONG); else if (l_prefix) _SET_NUMBER_(LONG); else if (h_prefix == 1) _SET_NUMBER_(short int); +#if _MSVCR_VER >= 140 + else if (h_prefix == 2) _SET_NUMBER_(char); +#endif else _SET_NUMBER_(int); } } diff --git a/dlls/ucrtbase/tests/scanf.c b/dlls/ucrtbase/tests/scanf.c index 7f44b7f..bf886e7 100644 --- a/dlls/ucrtbase/tests/scanf.c +++ b/dlls/ucrtbase/tests/scanf.c @@ -188,7 +188,7 @@ static void test_sscanf(void) result = 0xdeadbeef; ret = vsscanf_wrapper(tests[i], "12345678", "%hhd", &result); ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]); - todo_wine ok(result == 0xdeadbe4e, "got wrong number %#x for flags %#x\n", result, tests[i]); + ok(result == 0xdeadbe4e, "got wrong number %#x for flags %#x\n", result, tests[i]); ret = vsscanf_wrapper(tests[i], "12345678901234", "%lld", &result64); ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]);
1
0
0
0
Zebediah Figura : ucrtbase/tests: Add some tests for __stdio_common_vsscanf().
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: 353ea070f3874e1eb9ed658f7eb283ddb84a1e74 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=353ea070f3874e1eb9ed658f…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Jun 10 20:19:49 2019 -0400 ucrtbase/tests: Add some tests for __stdio_common_vsscanf(). Based on msvcrt:scanf tests. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ucrtbase/tests/Makefile.in | 1 + dlls/ucrtbase/tests/scanf.c | 276 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 277 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=353ea070f3874e1eb9ed…
1
0
0
0
Rémi Bernon : ntdll/tests: Add NtAllocateVirtualMemory tests for zero_bits behavior.
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: 8878492d3b4eb67b50bcdb1cb3ec00be42a0cdce URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8878492d3b4eb67b50bcdb1c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 11 11:22:46 2019 +0100 ntdll/tests: Add NtAllocateVirtualMemory tests for zero_bits behavior. The zero_bits parameter doesn't behave as expected, and some 64bit code use it to allocate memory in the lower 32bit address space. The expected full behaviour is: * zero_bits == 0: no constraint on address range * 0 < zero_bits <= 15: returned address should have as many upper bits set to 0, starting at bit 31. In 64bit mode, upper 32bits should all be 0 as well. * 15 < zero_bits <= 31: unsure, but probably same as zero_bits == 15. * zero_bits > 31: (64bit/WoW64 only) zero_bits behaves as a bitmask, as if it was set to the number of leading 0 in the bitmask, works in the whole 64bit range. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/virtual.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index c1b46c9..195a547 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -26,11 +26,15 @@ #include "winternl.h" #include "wine/test.h" +static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); + static void test_AllocateVirtualMemory(void) { void *addr1, *addr2; NTSTATUS status; SIZE_T size; + ULONG zero_bits; + BOOL is_wow64; /* simple allocation should success */ size = 0x1000; @@ -60,6 +64,46 @@ static void test_AllocateVirtualMemory(void) ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); } + /* 1 zero bits should zero 63-31 upper bits */ + size = 0x1000; + addr2 = NULL; + zero_bits = 1; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 1, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY || + broken(status == STATUS_INVALID_PARAMETER_3) /* winxp */, + "NtAllocateVirtualMemory returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, + "NtAllocateVirtualMemory returned address: %p\n", addr2); + + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + + for (zero_bits = 2; zero_bits <= 20; zero_bits++) + { + size = 0x1000; + addr2 = NULL; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY || + broken(zero_bits == 20 && status == STATUS_CONFLICTING_ADDRESSES) /* w1064v1809 */, + "NtAllocateVirtualMemory with %d zero_bits returned %08x\n", zero_bits, status); + if (status == STATUS_SUCCESS) + { + todo_wine_if((UINT_PTR)addr2 >> (32 - zero_bits)) + ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, + "NtAllocateVirtualMemory with %d zero_bits returned address %p\n", zero_bits, addr2); + + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + } + /* 21 zero bits never succeeds */ size = 0x1000; addr2 = NULL; @@ -83,6 +127,35 @@ static void test_AllocateVirtualMemory(void) ok(status == STATUS_INVALID_PARAMETER_3 || status == STATUS_INVALID_PARAMETER, "NtAllocateVirtualMemory returned %08x\n", status); + /* zero bits > 31 should be considered as bitmask on 64bit and WoW64 */ + size = 0x1000; + addr2 = NULL; + zero_bits = 0x1fffffff; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + + if (sizeof(void *) == sizeof(int) && (!pIsWow64Process || + !pIsWow64Process(NtCurrentProcess(), &is_wow64) || !is_wow64)) + { + ok(status == STATUS_INVALID_PARAMETER_3, "NtAllocateVirtualMemory returned %08x\n", status); + } + else + { + todo_wine + ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, + "NtAllocateVirtualMemory returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + todo_wine + ok(((UINT_PTR)addr2 & ~zero_bits) == 0, + "NtAllocateVirtualMemory returned address %p\n", addr2); + + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + } + /* AT_ROUND_TO_PAGE flag is not supported for NtAllocateVirtualMemory */ size = 0x1000; addr2 = (char *)addr1 + 0x1000; @@ -99,6 +172,10 @@ static void test_AllocateVirtualMemory(void) START_TEST(virtual) { SYSTEM_BASIC_INFORMATION sbi; + HMODULE hkernel32; + + hkernel32 = GetModuleHandleA("kernel32.dll"); + pIsWow64Process = (void *)GetProcAddress(hkernel32, "IsWow64Process"); NtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL); trace("system page size %#x\n", sbi.PageSize);
1
0
0
0
Rémi Bernon : ntdll/tests: Move NtAllocateVirtualMemory tests that were in kernel32.
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: f39c1eee49681de5a553d89bc75030bcfa94a391 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f39c1eee49681de5a553d89b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 11 11:22:45 2019 +0100 ntdll/tests: Move NtAllocateVirtualMemory tests that were in kernel32. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/virtual.c | 49 ------------------- dlls/ntdll/tests/Makefile.in | 3 +- dlls/ntdll/tests/virtual.c | 107 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 50 deletions(-) diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index d797df2..0b71860 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -52,8 +52,6 @@ static ULONG (WINAPI *pRtlRemoveVectoredExceptionHandler)(PVOID); static BOOL (WINAPI *pGetProcessDEPPolicy)(HANDLE, LPDWORD, PBOOL); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static NTSTATUS (WINAPI *pNtProtectVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG, ULONG *); -static NTSTATUS (WINAPI *pNtAllocateVirtualMemory)(HANDLE, PVOID *, ULONG, SIZE_T *, ULONG, ULONG); -static NTSTATUS (WINAPI *pNtFreeVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG); /* ############################### */ @@ -230,8 +228,6 @@ static void test_VirtualAlloc(void) void *addr1, *addr2; DWORD old_prot; MEMORY_BASIC_INFORMATION info; - NTSTATUS status; - SIZE_T size; SetLastError(0xdeadbeef); addr1 = VirtualAlloc(0, 0, MEM_RESERVE, PAGE_NOACCESS); @@ -440,55 +436,12 @@ static void test_VirtualAlloc(void) addr2 = VirtualAlloc(addr1, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); ok(addr2 == addr1, "VirtualAlloc returned %p, expected %p\n", addr2, addr1); - /* allocation conflicts because of 64k align */ - size = 0x1000; - addr2 = (char *)addr1 + 0x1000; - status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 0, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status); - - /* it should conflict, even when zero_bits is explicitly set */ - size = 0x1000; - addr2 = (char *)addr1 + 0x1000; - status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 12, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - todo_wine - ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status); - if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n"); - - /* 21 zero bits never succeeds */ - size = 0x1000; - addr2 = NULL; - status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 21, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - todo_wine - ok(status == STATUS_NO_MEMORY || status == STATUS_INVALID_PARAMETER, - "NtAllocateVirtualMemory returned %08x\n", status); - if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n"); - - /* 22 zero bits is invalid */ - size = 0x1000; - addr2 = NULL; - status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 22, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - ok(status == STATUS_INVALID_PARAMETER_3 || status == STATUS_INVALID_PARAMETER, - "NtAllocateVirtualMemory returned %08x\n", status); - if (status == STATUS_SUCCESS) ok(VirtualFree(addr2, 0, MEM_RELEASE), "VirtualFree failed\n"); - /* AT_ROUND_TO_PAGE flag is not supported for VirtualAlloc */ SetLastError(0xdeadbeef); addr2 = VirtualAlloc(addr1, 0x1000, MEM_RESERVE | MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE); ok(!addr2, "VirtualAlloc unexpectedly succeeded\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", GetLastError()); - /* AT_ROUND_TO_PAGE flag is not supported for NtAllocateVirtualMemory */ - size = 0x1000; - addr2 = (char *)addr1 + 0x1000; - status = pNtAllocateVirtualMemory(GetCurrentProcess(), &addr2, 0, &size, MEM_RESERVE | - MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE); - ok(status == STATUS_INVALID_PARAMETER_5 || status == STATUS_INVALID_PARAMETER, - "NtAllocateVirtualMemory returned %08x\n", status); - ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n"); } @@ -4438,8 +4391,6 @@ START_TEST(virtual) pRtlAddVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlAddVectoredExceptionHandler" ); pRtlRemoveVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlRemoveVectoredExceptionHandler" ); pNtProtectVirtualMemory = (void *)GetProcAddress( hntdll, "NtProtectVirtualMemory" ); - pNtAllocateVirtualMemory = (void *)GetProcAddress( hntdll, "NtAllocateVirtualMemory" ); - pNtFreeVirtualMemory = (void *)GetProcAddress( hntdll, "NtFreeVirtualMemory" ); GetSystemInfo(&si); trace("system page size %#x\n", si.dwPageSize); diff --git a/dlls/ntdll/tests/Makefile.in b/dlls/ntdll/tests/Makefile.in index 5c70f3f..ed15c51 100644 --- a/dlls/ntdll/tests/Makefile.in +++ b/dlls/ntdll/tests/Makefile.in @@ -22,4 +22,5 @@ C_SRCS = \ rtlstr.c \ string.c \ threadpool.c \ - time.c + time.c \ + virtual.c diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c new file mode 100644 index 0000000..c1b46c9 --- /dev/null +++ b/dlls/ntdll/tests/virtual.c @@ -0,0 +1,107 @@ +/* + * Unit test suite for the virtual memory APIs. + * + * Copyright 2019 Remi Bernon for CodeWeavers + * + * 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 + */ + +#include <stdio.h> + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winternl.h" +#include "wine/test.h" + +static void test_AllocateVirtualMemory(void) +{ + void *addr1, *addr2; + NTSTATUS status; + SIZE_T size; + + /* simple allocation should success */ + size = 0x1000; + addr1 = NULL; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); + ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemory returned %08x\n", status); + + /* allocation conflicts because of 64k align */ + size = 0x1000; + addr2 = (char *)addr1 + 0x1000; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 0, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); + ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status); + + /* it should conflict, even when zero_bits is explicitly set */ + size = 0x1000; + addr2 = (char *)addr1 + 0x1000; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 12, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); + todo_wine + ok(status == STATUS_CONFLICTING_ADDRESSES, "NtAllocateVirtualMemory returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + + /* 21 zero bits never succeeds */ + size = 0x1000; + addr2 = NULL; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 21, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); + todo_wine + ok(status == STATUS_NO_MEMORY || status == STATUS_INVALID_PARAMETER, + "NtAllocateVirtualMemory returned %08x\n", status); + if (status == STATUS_SUCCESS) + { + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory return %08x, addr2: %p\n", status, addr2); + } + + /* 22 zero bits is invalid */ + size = 0x1000; + addr2 = NULL; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 22, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); + ok(status == STATUS_INVALID_PARAMETER_3 || status == STATUS_INVALID_PARAMETER, + "NtAllocateVirtualMemory returned %08x\n", status); + + /* AT_ROUND_TO_PAGE flag is not supported for NtAllocateVirtualMemory */ + size = 0x1000; + addr2 = (char *)addr1 + 0x1000; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, 0, &size, + MEM_RESERVE | MEM_COMMIT | AT_ROUND_TO_PAGE, PAGE_EXECUTE_READWRITE); + ok(status == STATUS_INVALID_PARAMETER_5 || status == STATUS_INVALID_PARAMETER, + "NtAllocateVirtualMemory returned %08x\n", status); + + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed\n"); +} + +START_TEST(virtual) +{ + SYSTEM_BASIC_INFORMATION sbi; + + NtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL); + trace("system page size %#x\n", sbi.PageSize); + + test_AllocateVirtualMemory(); +}
1
0
0
0
Alexandre Julliard : ksecdd.sys: Fix duplicate dll flags.
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: d34d87cf879b876d69500ced23e1aa6f1efc9666 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d34d87cf879b876d69500ced…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 11 15:36:26 2019 +0200 ksecdd.sys: Fix duplicate dll flags. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ksecdd.sys/Makefile.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/ksecdd.sys/Makefile.in b/dlls/ksecdd.sys/Makefile.in index ae537b2..821256a 100644 --- a/dlls/ksecdd.sys/Makefile.in +++ b/dlls/ksecdd.sys/Makefile.in @@ -1,7 +1,5 @@ MODULE = ksecdd.sys -EXTRADLLFLAGS = -Wl,--subsystem,native - -EXTRADLLFLAGS = -mno-cygwin +EXTRADLLFLAGS = -mno-cygwin -Wl,--subsystem,native C_SRCS = \ main.c
1
0
0
0
Alexandre Julliard : fltmgr.sys: Fix duplicate dll flags.
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: a6b1c493be482c3301163f61675d001eaa7ce841 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a6b1c493be482c3301163f61…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 11 15:36:17 2019 +0200 fltmgr.sys: Fix duplicate dll flags. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/fltmgr.sys/Makefile.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/fltmgr.sys/Makefile.in b/dlls/fltmgr.sys/Makefile.in index 87fe4c3..cbe124c 100644 --- a/dlls/fltmgr.sys/Makefile.in +++ b/dlls/fltmgr.sys/Makefile.in @@ -1,7 +1,5 @@ MODULE = fltmgr.sys -EXTRADLLFLAGS = -Wl,--subsystem,native - -EXTRADLLFLAGS = -mno-cygwin +EXTRADLLFLAGS = -mno-cygwin -Wl,--subsystem,native C_SRCS = \ main.c
1
0
0
0
Alexandre Julliard : ntdll: Don' t use native subsystem heuristic against builtin modules.
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: c36b3d3e4a16e5c9b30627cdbafedf20406d1198 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c36b3d3e4a16e5c9b30627cd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 11 15:32:39 2019 +0200 ntdll: Don't use native subsystem heuristic against builtin modules. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index a90167f..3f422a9 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -898,7 +898,7 @@ static NTSTATUS create_module_activation_context( LDR_MODULE *module ) * Some dlls (corpol.dll from IE6 for instance) are incorrectly marked as native * while being perfectly normal DLLs. This heuristic should catch such breakages. */ -static BOOL is_dll_native_subsystem( HMODULE module, const IMAGE_NT_HEADERS *nt, LPCWSTR filename ) +static BOOL is_dll_native_subsystem( LDR_MODULE *mod, const IMAGE_NT_HEADERS *nt, LPCWSTR filename ) { static const WCHAR ntdllW[] = {'n','t','d','l','l','.','d','l','l',0}; static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0}; @@ -908,13 +908,14 @@ static BOOL is_dll_native_subsystem( HMODULE module, const IMAGE_NT_HEADERS *nt, if (nt->OptionalHeader.Subsystem != IMAGE_SUBSYSTEM_NATIVE) return FALSE; if (nt->OptionalHeader.SectionAlignment < page_size) return TRUE; + if (mod->Flags & LDR_WINE_INTERNAL) return TRUE; - if ((imports = RtlImageDirectoryEntryToData( module, TRUE, + if ((imports = RtlImageDirectoryEntryToData( mod->BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &size ))) { for (i = 0; imports[i].Name; i++) { - const char *name = get_rva( module, imports[i].Name ); + const char *name = get_rva( mod->BaseAddress, imports[i].Name ); DWORD len = strlen(name); if (len * sizeof(WCHAR) >= sizeof(buffer)) continue; ascii_to_unicode( buffer, name, len + 1 ); @@ -1141,7 +1142,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) * Allocate a WINE_MODREF structure and add it to the process list * The loader_section must be locked while calling this function. */ -static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name ) +static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name, BOOL builtin ) { WINE_MODREF *wm; const WCHAR *p; @@ -1151,7 +1152,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name wm->ldr.BaseAddress = hModule; wm->ldr.SizeOfImage = nt->OptionalHeader.SizeOfImage; - wm->ldr.Flags = LDR_DONT_RESOLVE_REFS; + wm->ldr.Flags = LDR_DONT_RESOLVE_REFS | (builtin ? LDR_WINE_INTERNAL : 0); wm->ldr.TlsIndex = -1; wm->ldr.LoadCount = 1; @@ -1160,7 +1161,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name else p = wm->ldr.FullDllName.Buffer; RtlInitUnicodeString( &wm->ldr.BaseDllName, p ); - if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL) || !is_dll_native_subsystem( hModule, nt, p )) + if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL) || !is_dll_native_subsystem( &wm->ldr, nt, p )) { if (nt->FileHeader.Characteristics & IMAGE_FILE_DLL) wm->ldr.Flags |= LDR_IMAGE_IS_DLL; @@ -1804,7 +1805,7 @@ static void load_builtin_callback( void *module, const char *filename ) return; } - wm = alloc_module( module, &nt_name ); + wm = alloc_module( module, &nt_name, TRUE ); RtlFreeUnicodeString( &nt_name ); if (!wm) { @@ -1812,7 +1813,6 @@ static void load_builtin_callback( void *module, const char *filename ) builtin_load_info->status = STATUS_NO_MEMORY; return; } - wm->ldr.Flags |= LDR_WINE_INTERNAL; if ((nt->FileHeader.Characteristics & IMAGE_FILE_DLL) || nt->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_NATIVE || @@ -2170,13 +2170,13 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam /* create the MODREF */ - if (!(wm = alloc_module( *module, nt_name ))) return STATUS_NO_MEMORY; + if (!(wm = alloc_module( *module, nt_name, (image_info->image_flags & IMAGE_FLAGS_WineBuiltin) ))) + return STATUS_NO_MEMORY; wm->dev = st->st_dev; wm->ino = st->st_ino; if (image_info->loader_flags) wm->ldr.Flags |= LDR_COR_IMAGE; if (image_info->image_flags & IMAGE_FLAGS_ComPlusILOnly) wm->ldr.Flags |= LDR_COR_ILONLY; - if (image_info->image_flags & IMAGE_FLAGS_WineBuiltin) wm->ldr.Flags |= LDR_WINE_INTERNAL; set_security_cookie( *module, image_info->map_size );
1
0
0
0
Aric Stewart : winemac.drv: Send state change notifications from ImeSelect.
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: bb501445f1c97b4daddf4b048f3a7ce5b637093b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bb501445f1c97b4daddf4b04…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jun 10 08:02:02 2019 -0500 winemac.drv: Send state change notifications from ImeSelect. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/ime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index a071408..dabe665 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -630,6 +630,10 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect) { LPIMEPRIVATE myPrivate; myPrivate = ImmLockIMCC(lpIMC->hPrivate); + if (myPrivate->bInComposition) + GenerateIMEMessage(hIMC, WM_IME_ENDCOMPOSITION, 0, 0); + if (myPrivate->bInternalState) + ImmSetOpenStatus(RealIMC(FROM_MACDRV), FALSE); myPrivate->bInComposition = FALSE; myPrivate->bInternalState = FALSE; myPrivate->textfont = NULL;
1
0
0
0
Henri Verbeet : wined3d: Upload texture data through the texture ops in wined3d_cs_exec_update_sub_resource ().
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: f6b533700aea79ff42f76ec7750bf31b1532611f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f6b533700aea79ff42f76ec7…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 11 01:03:30 2019 +0430 wined3d: Upload texture data through the texture ops in wined3d_cs_exec_update_sub_resource(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index a95ba50..05d3903 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2340,11 +2340,11 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi wined3d_texture_prepare_texture(texture, context, FALSE); else wined3d_texture_load_location(texture, op->sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_gl_bind_and_dirtify(wined3d_texture_gl(texture), wined3d_context_gl(context), FALSE); wined3d_box_set(&src_box, 0, 0, box->right - box->left, box->bottom - box->top, 0, box->back - box->front); - wined3d_texture_upload_data(texture, op->sub_resource_idx, context, texture->resource.format, &src_box, - &addr, op->data.row_pitch, op->data.slice_pitch, box->left, box->top, box->front, FALSE); + texture->texture_ops->texture_upload_data(context, &addr, texture->resource.format, &src_box, + op->data.row_pitch, op->data.slice_pitch, texture, op->sub_resource_idx, + WINED3D_LOCATION_TEXTURE_RGB, box->left, box->top, box->front); wined3d_texture_validate_location(texture, op->sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
1
0
0
0
Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to context_unload_tex_coords().
by Alexandre Julliard
11 Jun '19
11 Jun '19
Module: wine Branch: master Commit: 45c3b125c7a0219168488a284d810e11c6cc26b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=45c3b125c7a0219168488a28…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jun 11 01:03:29 2019 +0430 wined3d: Pass a wined3d_context_gl structure to context_unload_tex_coords(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 7 ++++--- dlls/wined3d/state.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 01d350d..be24baf 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -5015,9 +5015,9 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s context_release(context); } -void context_unload_tex_coords(const struct wined3d_context *context) +void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl) { - const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_gl_info *gl_info = context_gl->c.gl_info; unsigned int texture_idx; for (texture_idx = 0; texture_idx < gl_info->limits.texture_coords; ++texture_idx) @@ -5091,6 +5091,7 @@ void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context /* This should match any arrays loaded in context_load_vertex_data(). */ static void context_unload_vertex_data(struct wined3d_context *context) { + struct wined3d_context_gl *context_gl = wined3d_context_gl(context); const struct wined3d_gl_info *gl_info = context->gl_info; if (!context->namedArraysLoaded) @@ -5100,7 +5101,7 @@ static void context_unload_vertex_data(struct wined3d_context *context) gl_info->gl_ops.gl.p_glDisableClientState(GL_COLOR_ARRAY); if (gl_info->supported[EXT_SECONDARY_COLOR]) gl_info->gl_ops.gl.p_glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); - context_unload_tex_coords(context); + wined3d_context_gl_unload_tex_coords(context_gl); context->namedArraysLoaded = FALSE; } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index a31f085..1e13557 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3474,7 +3474,7 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d */ GLuint curVBO = gl_info->supported[ARB_VERTEX_BUFFER_OBJECT] ? ~0U : 0; - context_unload_tex_coords(context); + wined3d_context_gl_unload_tex_coords(context_gl); wined3d_context_gl_load_tex_coords(context_gl, &context->stream_info, &curVBO, state); } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0dd1fc1..4f0b91a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2111,6 +2111,7 @@ void wined3d_context_gl_release(struct wined3d_context_gl *context_gl) DECLSPEC_ void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer) DECLSPEC_HIDDEN; void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl) DECLSPEC_HIDDEN; +void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2268,7 +2269,6 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; -void context_unload_tex_coords(const struct wined3d_context *context) DECLSPEC_HIDDEN; void context_unmap_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, GLenum binding) DECLSPEC_HIDDEN;
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
87
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
Results per page:
10
25
50
100
200