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
May 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
907 discussions
Start a n
N
ew thread
Nikolay Sivov : ntdll/tests: Add a basic test for MEM_RESERVE_PLACEHOLDER.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 811a0e0b068cc3ea8ed1104e100d1e08724e7191 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=811a0e0b068cc3ea8ed1104e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri May 20 13:20:19 2022 +0300 ntdll/tests: Add a basic test for MEM_RESERVE_PLACEHOLDER. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/virtual.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 74e3facca13..f8bb3e97c86 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -264,6 +264,12 @@ static void test_NtAllocateVirtualMemory(void) ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %lx\n", status); ok( size == 0x10000, "wrong size %Ix\n", size ); ok( addr2 == addr1, "wrong addr %p\n", addr2 ); + + /* Placeholder functionality */ + size = 0x10000; + addr1 = NULL; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size, MEM_RESERVE | MEM_RESERVE_PLACEHOLDER, PAGE_NOACCESS); + ok(!!status, "Unexpected status %08lx.\n", status); } static void test_NtAllocateVirtualMemoryEx(void) @@ -298,6 +304,24 @@ static void test_NtAllocateVirtualMemoryEx(void) addr1 = NULL; status = pNtAllocateVirtualMemoryEx(NULL, &addr1, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE, NULL, 0); ok(status == STATUS_INVALID_HANDLE, "Unexpected status %08lx.\n", status); + + /* Placeholder functionality */ + size = 0x10000; + addr1 = NULL; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size, MEM_RESERVE | MEM_RESERVE_PLACEHOLDER, PAGE_NOACCESS); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + status = pNtAllocateVirtualMemoryEx(NtCurrentProcess(), &addr1, &size, MEM_RESERVE | MEM_RESERVE_PLACEHOLDER, + PAGE_NOACCESS, NULL, 0); + todo_wine + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + + if (addr1) + { + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + } } struct test_stack_size_thread_args
1
0
0
0
Nikolay Sivov : kernelbase: Fix VirtualAlloc2() when called with NULL process handle.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 6fe7535c977ea5b6639561b0bce42e324217695f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6fe7535c977ea5b6639561b0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri May 20 09:36:53 2022 +0300 kernelbase: Fix VirtualAlloc2() when called with NULL process handle. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/memory.c | 1 + dlls/kernelbase/tests/process.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 656569220fa..416d7b52a16 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -352,6 +352,7 @@ LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAlloc2( HANDLE process, void *addr, SIZE_ { LPVOID ret = addr; + if (!process) process = GetCurrentProcess(); if (!set_ntstatus( NtAllocateVirtualMemoryEx( process, &ret, &size, type, protect, parameters, count ))) return NULL; return ret; diff --git a/dlls/kernelbase/tests/process.c b/dlls/kernelbase/tests/process.c index 52c481a59e8..b83a25015b2 100644 --- a/dlls/kernelbase/tests/process.c +++ b/dlls/kernelbase/tests/process.c @@ -142,10 +142,8 @@ static void test_VirtualAlloc2(void) size = 0x80000; addr = pVirtualAlloc2(NULL, NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE, NULL, 0); - todo_wine ok(!!addr, "Failed to allocate, error %lu.\n", GetLastError()); ret = VirtualFree(addr, 0, MEM_RELEASE); - todo_wine ok(ret, "Unexpected return value %d, error %lu.\n", ret, GetLastError()); /* Placeholder splitting functionality */
1
0
0
0
Nikolay Sivov : kernelbase/tests: Add some VirtualAlloc2() tests.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 30f1777e87c2bbb27094048eab3805e39d5f9214 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=30f1777e87c2bbb27094048e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri May 20 09:36:52 2022 +0300 kernelbase/tests: Add some VirtualAlloc2() tests. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/tests/process.c | 73 +++++++++++++++++++++++++++++++++++++++++ include/winnt.h | 23 ++++++++----- 2 files changed, 88 insertions(+), 8 deletions(-) diff --git a/dlls/kernelbase/tests/process.c b/dlls/kernelbase/tests/process.c index bacf9057836..52c481a59e8 100644 --- a/dlls/kernelbase/tests/process.c +++ b/dlls/kernelbase/tests/process.c @@ -33,6 +33,7 @@ static BOOL (WINAPI *pCompareObjectHandles)(HANDLE, HANDLE); static LPVOID (WINAPI *pMapViewOfFile3)(HANDLE, HANDLE, PVOID, ULONG64 offset, SIZE_T size, ULONG, ULONG, MEM_EXTENDED_PARAMETER *, ULONG); +static LPVOID (WINAPI *pVirtualAlloc2)(HANDLE, void *, SIZE_T, DWORD, DWORD, MEM_EXTENDED_PARAMETER *, ULONG); static void test_CompareObjectHandles(void) { @@ -125,6 +126,76 @@ static void test_MapViewOfFile3(void) ok(ret, "Failed to delete a test file.\n"); } +static void test_VirtualAlloc2(void) +{ + void *placeholder1, *placeholder2, *view1, *view2, *addr; + MEMORY_BASIC_INFORMATION info; + HANDLE section; + SIZE_T size; + BOOL ret; + + if (!pVirtualAlloc2) + { + win_skip("VirtualAlloc2() is not supported.\n"); + return; + } + + size = 0x80000; + addr = pVirtualAlloc2(NULL, NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE, NULL, 0); + todo_wine + ok(!!addr, "Failed to allocate, error %lu.\n", GetLastError()); + ret = VirtualFree(addr, 0, MEM_RELEASE); + todo_wine + ok(ret, "Unexpected return value %d, error %lu.\n", ret, GetLastError()); + + /* Placeholder splitting functionality */ + placeholder1 = pVirtualAlloc2(NULL, NULL, 2 * size, MEM_RESERVE_PLACEHOLDER | MEM_RESERVE, PAGE_NOACCESS, NULL, 0); + todo_wine + ok(!!placeholder1, "Failed to create a placeholder range.\n"); + if (!placeholder1) return; + + memset(&info, 0, sizeof(info)); + VirtualQuery(placeholder1, &info, sizeof(info)); + ok(info.AllocationProtect == PAGE_NOACCESS, "Unexpected protection %#lx.\n", info.AllocationProtect); + ok(info.State == MEM_RESERVE, "Unexpected state %#lx.\n", info.State); + ok(info.Type == MEM_PRIVATE, "Unexpected type %#lx.\n", info.Type); + ok(info.RegionSize == 2 * size, "Unexpected size.\n"); + + ret = VirtualFree(placeholder1, size, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER); + ok(ret, "Failed to split placeholder.\n"); + + memset(&info, 0, sizeof(info)); + VirtualQuery(placeholder1, &info, sizeof(info)); + ok(info.AllocationProtect == PAGE_NOACCESS, "Unexpected protection %#lx.\n", info.AllocationProtect); + ok(info.State == MEM_RESERVE, "Unexpected state %#lx.\n", info.State); + ok(info.Type == MEM_PRIVATE, "Unexpected type %#lx.\n", info.Type); + ok(info.RegionSize == size, "Unexpected size.\n"); + + placeholder2 = (void *)((BYTE *)placeholder1 + size); + memset(&info, 0, sizeof(info)); + VirtualQuery(placeholder2, &info, sizeof(info)); + ok(info.AllocationProtect == PAGE_NOACCESS, "Unexpected protection %#lx.\n", info.AllocationProtect); + ok(info.State == MEM_RESERVE, "Unexpected state %#lx.\n", info.State); + ok(info.Type == MEM_PRIVATE, "Unexpected type %#lx.\n", info.Type); + ok(info.RegionSize == size, "Unexpected size.\n"); + + section = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, NULL); + ok(!!section, "Failed to create a section.\n"); + + view1 = pMapViewOfFile3(section, NULL, placeholder1, 0, size, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, NULL, 0); + ok(!!view1, "Failed to map a section.\n"); + + view2 = pMapViewOfFile3(section, NULL, placeholder2, 0, size, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, NULL, 0); + ok(!!view2, "Failed to map a section.\n"); + + CloseHandle(section); + UnmapViewOfFile(view1); + UnmapViewOfFile(view2); + + VirtualFree(placeholder1, 0, MEM_RELEASE); + VirtualFree(placeholder2, 0, MEM_RELEASE); +} + START_TEST(process) { HMODULE hmod; @@ -136,7 +207,9 @@ START_TEST(process) hmod = GetModuleHandleA("kernelbase.dll"); pCompareObjectHandles = (void *)GetProcAddress(hmod, "CompareObjectHandles"); pMapViewOfFile3 = (void *)GetProcAddress(hmod, "MapViewOfFile3"); + pVirtualAlloc2 = (void *)GetProcAddress(hmod, "VirtualAlloc2"); test_CompareObjectHandles(); test_MapViewOfFile3(); + test_VirtualAlloc2(); } diff --git a/include/winnt.h b/include/winnt.h index 5ca106d1031..7aafbcf0cfe 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -806,18 +806,25 @@ typedef struct _WIN32_MEMORY_RANGE_ENTRY #define PAGE_NOCACHE 0x200 #define PAGE_WRITECOMBINE 0x400 -#define MEM_COMMIT 0x00001000 -#define MEM_RESERVE 0x00002000 -#define MEM_DECOMMIT 0x00004000 -#define MEM_RELEASE 0x00008000 +#define MEM_COMMIT 0x00001000 +#define MEM_RESERVE 0x00002000 +#define MEM_REPLACE_PLACEHOLDER 0x00004000 +#define MEM_RESERVE_PLACEHOLDER 0x00040000 +#define MEM_RESET 0x00080000 +#define MEM_TOP_DOWN 0x00100000 +#define MEM_PHYSICAL 0x00400000 +#define MEM_RESET_UNDO 0x10000000 +#define MEM_LARGE_PAGES 0x20000000 + +#define MEM_COALESCE_PLACEHOLDERS 0x00000001 +#define MEM_PRESERVE_PLACEHOLDER 0x00000002 +#define MEM_DECOMMIT 0x00004000 +#define MEM_RELEASE 0x00008000 + #define MEM_FREE 0x00010000 #define MEM_PRIVATE 0x00020000 #define MEM_MAPPED 0x00040000 -#define MEM_RESET 0x00080000 -#define MEM_TOP_DOWN 0x00100000 #define MEM_WRITE_WATCH 0x00200000 -#define MEM_PHYSICAL 0x00400000 -#define MEM_LARGE_PAGES 0x20000000 #define MEM_4MB_PAGES 0x80000000 #define SEC_FILE 0x00800000
1
0
0
0
Nikolay Sivov : kernel32/tests: Extend VirtualAllocEx() tests.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 116c718a53069ace02ebaa9574af7ab6f558af66 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=116c718a53069ace02ebaa95…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri May 20 09:36:51 2022 +0300 kernel32/tests: Extend VirtualAllocEx() tests. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/virtual.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 365194b9065..6d4d34e2e81 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -78,11 +78,21 @@ static void test_VirtualAllocEx(void) char *src, *dst; SIZE_T bytes_written = 0, bytes_read = 0, i; void *addr1, *addr2; - BOOL b; + BOOL b, ret; DWORD old_prot; MEMORY_BASIC_INFORMATION info; HANDLE hProcess; + /* Same process */ + addr1 = VirtualAllocEx(GetCurrentProcess(), NULL, alloc_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + ok(!!addr1, "Failed to allocated, error %lu.\n", GetLastError()); + ret = VirtualFreeEx(NULL, addr1, 0, MEM_RELEASE); + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Unexpected value %d, error %lu.\n", ret, GetLastError()); + addr2 = VirtualAllocEx(NULL, NULL, alloc_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + ok(!addr2 && GetLastError() == ERROR_INVALID_HANDLE, "Unexpected value %p, error %lu.\n", addr2, GetLastError()); + ret = VirtualFreeEx(GetCurrentProcess(), addr1, 0, MEM_RELEASE); + ok(ret, "Unexpected value %d, error %lu.\n", ret, GetLastError()); + hProcess = create_target_process("sleep"); ok(hProcess != NULL, "Can't start process\n");
1
0
0
0
Nikolay Sivov : ntdll/tests: Add a bit more tests for VM functions.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: ff13b8beed8208020494ab30be5af8b1bb16fc4f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff13b8beed8208020494ab30…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri May 20 09:36:50 2022 +0300 ntdll/tests: Add a bit more tests for VM functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/virtual.c | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index aeef2ed8fb9..74e3facca13 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -264,6 +264,13 @@ static void test_NtAllocateVirtualMemory(void) ok(status == STATUS_SUCCESS, "NtFreeVirtualMemory failed %lx\n", status); ok( size == 0x10000, "wrong size %Ix\n", size ); ok( addr2 == addr1, "wrong addr %p\n", addr2 ); +} + +static void test_NtAllocateVirtualMemoryEx(void) +{ + void *addr1, *addr2; + NTSTATUS status; + SIZE_T size; if (!pNtAllocateVirtualMemoryEx) { @@ -271,17 +278,26 @@ static void test_NtAllocateVirtualMemory(void) return; } - /* simple allocation should succeed */ size = 0x1000; addr1 = NULL; status = pNtAllocateVirtualMemoryEx(NtCurrentProcess(), &addr1, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE, NULL, 0); - ok(status == STATUS_SUCCESS, "NtAllocateVirtualMemoryEx returned %08lx\n", status); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + + size = 0; + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr2, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); /* specifying a count of >0 with NULL parameters should fail */ status = pNtAllocateVirtualMemoryEx(NtCurrentProcess(), &addr1, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE, NULL, 1); - ok(status == STATUS_INVALID_PARAMETER, "NtAllocateVirtualMemoryEx returned %08lx\n", status); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + /* NULL process handle */ + size = 0x1000; + addr1 = NULL; + status = pNtAllocateVirtualMemoryEx(NULL, &addr1, &size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE, NULL, 0); + ok(status == STATUS_INVALID_HANDLE, "Unexpected status %08lx.\n", status); } struct test_stack_size_thread_args @@ -1279,6 +1295,25 @@ static void test_syscalls(void) UnmapViewOfFile( ptr ); } +static void test_NtFreeVirtualMemory(void) +{ + NTSTATUS status; + void *addr1; + SIZE_T size; + + size = 0x10000; + addr1 = NULL; + status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size, MEM_RESERVE, PAGE_READWRITE); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); + + size = 0; + status = NtFreeVirtualMemory(NULL, &addr1, &size, MEM_RELEASE); + ok(status == STATUS_INVALID_HANDLE, "Unexpected status %08lx.\n", status); + + status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE); + ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status); +} + START_TEST(virtual) { HMODULE mod; @@ -1315,6 +1350,8 @@ START_TEST(virtual) if (!pIsWow64Process || !pIsWow64Process(NtCurrentProcess(), &is_wow64)) is_wow64 = FALSE; test_NtAllocateVirtualMemory(); + test_NtAllocateVirtualMemoryEx(); + test_NtFreeVirtualMemory(); test_RtlCreateUserStack(); test_NtMapViewOfSection(); test_NtMapViewOfSectionEx();
1
0
0
0
Ziqing Hui : uuid: Add d2d1effectauthor.h.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 0f883c0925478a487467ace83a3dea8f6a435f3d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0f883c0925478a487467ace8…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu May 19 11:15:05 2022 +0800 uuid: Add d2d1effectauthor.h. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/d2d1_private.h | 2 +- libs/uuid/d2d.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 29469f5142e..9564f19a3cf 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -29,12 +29,12 @@ #include <math.h> #define COBJMACROS #include "d2d1_3.h" +#include "d2d1effectauthor.h" #include "d3d11_1.h" #ifdef D2D1_INIT_GUID #include "initguid.h" #endif #include "dwrite_2.h" -#include "d2d1effectauthor.h" enum d2d_brush_type { diff --git a/libs/uuid/d2d.c b/libs/uuid/d2d.c index 801bcaeab92..d8d97fb7913 100644 --- a/libs/uuid/d2d.c +++ b/libs/uuid/d2d.c @@ -19,3 +19,4 @@ #include "d3d10_1.h" #include "initguid.h" #include "d2d1_3.h" +#include "d2d1effectauthor.h"
1
0
0
0
Ziqing Hui : d2d1/tests: Introduce create_factory().
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: f1ab4714062a5d9c56887f4dd1fd02b244359854 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1ab4714062a5d9c56887f4d…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu May 19 11:15:04 2022 +0800 d2d1/tests: Introduce create_factory(). Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/tests/d2d1.c | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 035915491fd..663fc150df8 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -10069,6 +10069,36 @@ static void test_mt_factory(BOOL d3d11) ID2D1Factory_Release(factory); } +static void *create_factory(const GUID *iid, UINT32 *factory_version) +{ + IUnknown *factory, *tmp; + unsigned int i; + + static const GUID *const factory_iid[] = + { + &IID_ID2D1Factory, + &IID_ID2D1Factory1, + &IID_ID2D1Factory2, + &IID_ID2D1Factory3, + }; + + if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, iid, NULL, (void **)&factory))) + return NULL; + + if (factory_version) + { + for (i = 0; i < ARRAY_SIZE(factory_iid); ++i) + { + if (FAILED(IUnknown_QueryInterface(factory, factory_iid[i], (void **)&tmp))) + break; + IUnknown_Release(tmp); + } + *factory_version = i - 1; + } + + return factory; +} + static void test_effect(BOOL d3d11) { unsigned int i, j, min_inputs, max_inputs, str_size, input_count, factory_version; @@ -10077,9 +10107,7 @@ static void test_effect(BOOL d3d11) ID2D1Image *image_a, *image_b; struct d2d1_test_context ctx; ID2D1DeviceContext *context; - ID2D1Factory1 *factory1; - ID2D1Factory2 *factory2; - ID2D1Factory3 *factory3; + ID2D1Factory1 *factory; ID2D1Bitmap *bitmap; ID2D1Effect *effect; D2D1_SIZE_U size; @@ -10109,23 +10137,12 @@ static void test_effect(BOOL d3d11) if (!init_test_context(&ctx, d3d11)) return; - if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory1))) + if (!(factory = create_factory(&IID_ID2D1Factory1, &factory_version))) { win_skip("ID2D1Factory1 is not supported.\n"); release_test_context(&ctx); return; } - factory_version = 1; - if (SUCCEEDED(ID2D1Factory1_QueryInterface(factory1, &IID_ID2D1Factory2, (void **)&factory2))) - { - ID2D1Factory2_Release(factory2); - factory_version = 2; - } - if (SUCCEEDED(ID2D1Factory1_QueryInterface(factory1, &IID_ID2D1Factory3, (void **)&factory3))) - { - ID2D1Factory3_Release(factory3); - factory_version = 3; - } if (factory_version < 3) win_skip("ID2D1Factory%u is not supported.\n", factory_version + 1); @@ -10275,7 +10292,7 @@ static void test_effect(BOOL d3d11) } ID2D1DeviceContext_Release(context); - ID2D1Factory1_Release(factory1); + ID2D1Factory1_Release(factory); release_test_context(&ctx); }
1
0
0
0
Julian Klemann : ws2_32: Add stub for SIO_ENABLE_CIRCULAR_QUEUEING in WSAIoctl().
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 881ee71a5c844d69695789be0edc3f22619847cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=881ee71a5c844d69695789be…
Author: Julian Klemann <jklemann(a)codeweavers.com> Date: Wed May 18 14:04:13 2022 -0500 ws2_32: Add stub for SIO_ENABLE_CIRCULAR_QUEUEING in WSAIoctl(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47233
Signed-off-by: Julian Klemann <jklemann(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 12 ++++++++++++ dlls/ws2_32/tests/sock.c | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 3d0c2deca35..88089fa8d74 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2371,6 +2371,18 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID return ret ? -1 : 0; } + case SIO_ENABLE_CIRCULAR_QUEUEING: + { + NTSTATUS status = STATUS_SUCCESS; + DWORD ret; + + FIXME( "SIO_ENABLE_CIRCULAR_QUEUEING stub\n" ); + ret = server_ioctl_sock( s, IOCTL_AFD_WINE_COMPLETE_ASYNC, &status, sizeof(status), + NULL, 0, ret_size, overlapped, completion ); + SetLastError( ret ); + return ret ? -1 : 0; + } + case SIO_BASE_HANDLE: { NTSTATUS status; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index f17ffba7a85..bdb683e6796 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5113,6 +5113,19 @@ static void test_base_handle(void) } } +static void test_circular_queueing(void) +{ + SOCKET s; + DWORD size; + int ret; + + s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + ret = WSAIoctl(s, SIO_ENABLE_CIRCULAR_QUEUEING, NULL, 0, NULL, 0, &size, NULL, NULL); + ok(!ret, "expected 0, got %d\n", ret); + + closesocket(s); +} + static BOOL drain_pause = FALSE; static DWORD WINAPI drain_socket_thread(LPVOID arg) { @@ -12578,6 +12591,7 @@ START_TEST( sock ) test_sioRoutingInterfaceQuery(); test_sioAddressListChange(); test_base_handle(); + test_circular_queueing(); test_unsupported_ioctls(); test_WSASendMsg();
1
0
0
0
Zhiyi Zhang : dxgi/tests: Test adapter video memory budget notification.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 14237e321b30bd3f9eaa441586f82c44c15bc5cf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=14237e321b30bd3f9eaa4415…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed May 18 14:49:28 2022 +0800 dxgi/tests: Test adapter video memory budget notification. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/tests/dxgi.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index a199ba486ba..04bba29e8e5 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -7514,6 +7514,66 @@ static void test_swapchain_present_count(IUnknown *device, BOOL is_d3d12) DestroyWindow(window); } +static void test_video_memory_budget_notification(void) +{ + DXGI_QUERY_VIDEO_MEMORY_INFO memory_info; + IDXGIAdapter3 *adapter3; + IDXGIAdapter *adapter; + IDXGIDevice *device; + DWORD cookie, ret; + ULONG refcount; + HANDLE event; + HRESULT hr; + + if (!(device = create_device(0))) + { + skip("Failed to create device.\n"); + return; + } + + hr = IDXGIDevice_GetAdapter(device, &adapter); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDXGIAdapter_QueryInterface(adapter, &IID_IDXGIAdapter3, (void **)&adapter3); + ok(hr == S_OK || hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr); + if (hr == E_NOINTERFACE) + goto done; + + hr = IDXGIAdapter3_RegisterVideoMemoryBudgetChangeNotificationEvent(adapter3, NULL, &cookie); + todo_wine + ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); + + event = CreateEventW(NULL, FALSE, FALSE, NULL); + hr = IDXGIAdapter3_RegisterVideoMemoryBudgetChangeNotificationEvent(adapter3, event, NULL); + todo_wine + ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#lx.\n", hr); + + hr = IDXGIAdapter3_RegisterVideoMemoryBudgetChangeNotificationEvent(adapter3, event, &cookie); + todo_wine + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDXGIAdapter3_QueryVideoMemoryInfo(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, &memory_info); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (!memory_info.Budget) + { + hr = IDXGIAdapter3_QueryVideoMemoryInfo(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL, &memory_info); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + } + if (memory_info.Budget) + { + ret = WaitForSingleObject(event, 1000); + todo_wine + ok(ret == WAIT_OBJECT_0, "Expected event fired.\n"); + } + + IDXGIAdapter3_UnregisterVideoMemoryBudgetChangeNotification(adapter3, cookie); + IDXGIAdapter3_Release(adapter3); + CloseHandle(event); + +done: + IDXGIAdapter_Release(adapter); + refcount = IDXGIDevice_Release(device); + ok(!refcount, "Device has %lu references left.\n", refcount); +} + static void run_on_d3d10(void (*test_func)(IUnknown *device, BOOL is_d3d12)) { IDXGIDevice *device; @@ -7613,6 +7673,7 @@ START_TEST(dxgi) queue_test(test_output_desc); queue_test(test_object_wrapping); queue_test(test_factory_check_feature_support); + queue_test(test_video_memory_budget_notification); run_queued_tests();
1
0
0
0
Zhiyi Zhang : wined3d: Fill fake adapter video memory usage.
by Alexandre Julliard
20 May '22
20 May '22
Module: wine Branch: master Commit: 6ebfc35fc43c62ba9b16d158025e66b5b6cb6bf3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6ebfc35fc43c62ba9b16d158…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed May 18 14:49:21 2022 +0800 wined3d: Fill fake adapter video memory usage. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index f8a44be0b3e..8c58a346add 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1035,7 +1035,7 @@ HRESULT CDECL wined3d_adapter_get_video_memory_info(const struct wined3d_adapter { case WINED3D_MEMORY_SEGMENT_GROUP_LOCAL: info->budget = adapter_id.video_memory; - info->current_usage = 0; + info->current_usage = adapter->vram_bytes_used; info->available_reservation = adapter_id.video_memory / 2; info->current_reservation = 0; break;
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
91
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Results per page:
10
25
50
100
200