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 2023
----- 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
775 discussions
Start a n
N
ew thread
Davide Beatrici : winepulse: Move AudioStreamVolume into mmdevapi.
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: 7244666dc96a929090c68e24b482950fd65ab7db URL:
https://gitlab.winehq.org/wine/wine/-/commit/7244666dc96a929090c68e24b48295…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Tue May 9 21:36:07 2023 +0200 winepulse: Move AudioStreamVolume into mmdevapi. --- dlls/mmdevapi/Makefile.in | 1 + dlls/mmdevapi/client.c | 208 +++++++++++++++++++++++++++++++++++++++++ dlls/mmdevapi/session.c | 25 +++-- dlls/winepulse.drv/Makefile.in | 1 + dlls/winepulse.drv/mmdevdrv.c | 168 +-------------------------------- 5 files changed, 223 insertions(+), 180 deletions(-)
1
0
0
0
Alexandre Julliard : wow64: Convert MEM_EXTENDED_PARAMETER also for NtMapViewOfSectionEx().
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: f0a6c3f6bc908d1f389348730edc353bc8c257a2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f0a6c3f6bc908d1f389348730edc35…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 18:20:40 2023 +0200 wow64: Convert MEM_EXTENDED_PARAMETER also for NtMapViewOfSectionEx(). --- dlls/wow64/virtual.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index e58ae805914..21ce0905654 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -375,15 +375,19 @@ NTSTATUS WINAPI wow64_NtMapViewOfSectionEx( UINT *args ) ULONG *size32 = get_ptr( &args ); ULONG alloc = get_ulong( &args ); ULONG protect = get_ulong( &args ); - MEM_EXTENDED_PARAMETER *params = get_ptr( &args ); - ULONG params_count = get_ulong( &args ); + MEM_EXTENDED_PARAMETER32 *params32 = get_ptr( &args ); + ULONG count = get_ulong( &args ); void *addr; SIZE_T size; NTSTATUS status; + MEM_EXTENDED_PARAMETER *params64; + BOOL set_limit = (!*addr32 && process == GetCurrentProcess()); + + if ((status = mem_extended_parameters_32to64( ¶ms64, params32, &count, set_limit ))) return status; - status = NtMapViewOfSectionEx( handle, process, addr_32to64( &addr, addr32 ), offset, size_32to64( &size, size32 ), alloc, - protect, params, params_count ); + status = NtMapViewOfSectionEx( handle, process, addr_32to64( &addr, addr32 ), offset, + size_32to64( &size, size32 ), alloc, protect, params64, count ); if (NT_SUCCESS(status)) { SECTION_IMAGE_INFORMATION info;
1
0
0
0
Alexandre Julliard : wow64: Add a helper function to convert MEM_EXTENDED_PARAMETER.
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: e0311411786c85a560b6f9969a7adf1f544982ab URL:
https://gitlab.winehq.org/wine/wine/-/commit/e0311411786c85a560b6f9969a7adf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 18:18:21 2023 +0200 wow64: Add a helper function to convert MEM_EXTENDED_PARAMETER. And use the correct 32-bit types for the conversion. --- dlls/wow64/struct32.h | 23 ++++++++-- dlls/wow64/virtual.c | 122 +++++++++++++++++++++++++------------------------- 2 files changed, 82 insertions(+), 63 deletions(-) diff --git a/dlls/wow64/struct32.h b/dlls/wow64/struct32.h index 76308a7f659..0a560ac0f92 100644 --- a/dlls/wow64/struct32.h +++ b/dlls/wow64/struct32.h @@ -667,9 +667,26 @@ typedef struct typedef struct { - ULONG LowestStartingAddress; - ULONG HighestEndingAddress; - ULONG Alignment; + ULONG LowestStartingAddress; + ULONG HighestEndingAddress; + ULONG Alignment; } MEM_ADDRESS_REQUIREMENTS32; +typedef struct DECLSPEC_ALIGN(8) +{ + struct + { + DWORD64 Type : MEM_EXTENDED_PARAMETER_TYPE_BITS; + DWORD64 Reserved : 64 - MEM_EXTENDED_PARAMETER_TYPE_BITS; + }; + union + { + DWORD64 ULong64; + ULONG Pointer; + ULONG Size; + ULONG Handle; + ULONG ULong; + }; +} MEM_EXTENDED_PARAMETER32; + #endif /* __WOW64_STRUCT32_H */ diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index 0f34e8aec27..e58ae805914 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -48,6 +48,64 @@ static MEMORY_RANGE_ENTRY *memory_range_entry_array_32to64( const MEMORY_RANGE_E return addresses; } +static NTSTATUS mem_extended_parameters_32to64( MEM_EXTENDED_PARAMETER **ret_params, + const MEM_EXTENDED_PARAMETER32 *params32, ULONG *count, + BOOL set_limit ) +{ + ULONG i; + MEM_EXTENDED_PARAMETER *params; + MEM_ADDRESS_REQUIREMENTS *req; + MEM_ADDRESS_REQUIREMENTS32 *req32 = NULL; + + if (*count && !params32) return STATUS_INVALID_PARAMETER; + + params = Wow64AllocateTemp( (*count + 1) * sizeof(*params) + sizeof(*req) ); + req = (MEM_ADDRESS_REQUIREMENTS *)(params + *count + 1); + + for (i = 0; i < *count; i++) + { + params[i].Type = params32[i].Type; + params[i].Reserved = 0; + switch (params[i].Type) + { + case MemExtendedParameterAddressRequirements: + req32 = ULongToPtr( params32[i].Pointer ); + params[i].Pointer = req; + break; + case MemExtendedParameterAttributeFlags: + case MemExtendedParameterNumaNode: + case MemExtendedParameterImageMachine: + params[i].ULong = params32[i].ULong; + break; + case MemExtendedParameterPartitionHandle: + case MemExtendedParameterUserPhysicalHandle: + params[i].Handle = ULongToHandle( params32[i].Handle ); + break; + } + } + + if (req32) + { + if (req32->HighestEndingAddress > highest_user_address) return STATUS_INVALID_PARAMETER; + req->LowestStartingAddress = ULongToPtr( req32->LowestStartingAddress ); + req->HighestEndingAddress = ULongToPtr( req32->HighestEndingAddress ); + req->Alignment = req32->Alignment; + } + else if (set_limit) + { + req->LowestStartingAddress = NULL; + req->HighestEndingAddress = (void *)highest_user_address; + req->Alignment = 0; + + params[i].Type = MemExtendedParameterAddressRequirements; + params[i].Reserved = 0; + params[i].Pointer = req; + *count = i + 1; + } + *ret_params = params; + return STATUS_SUCCESS; +} + /********************************************************************** * wow64_NtAllocateVirtualMemory */ @@ -85,75 +143,19 @@ NTSTATUS WINAPI wow64_NtAllocateVirtualMemoryEx( UINT *args ) ULONG *size32 = get_ptr( &args ); ULONG type = get_ulong( &args ); ULONG protect = get_ulong( &args ); - MEM_EXTENDED_PARAMETER *params = get_ptr( &args ); + MEM_EXTENDED_PARAMETER32 *params32 = get_ptr( &args ); ULONG count = get_ulong( &args ); void *addr; SIZE_T size; NTSTATUS status; - SIZE_T alloc_size = count * sizeof(*params); MEM_EXTENDED_PARAMETER *params64; - BOOL set_highest_address = (!*addr32 && process == GetCurrentProcess()); - BOOL add_address_requirements = set_highest_address; - MEM_ADDRESS_REQUIREMENTS *buf; - unsigned int i; - - if (count && !params) return STATUS_INVALID_PARAMETER; - - for (i = 0; i < count; ++i) - { - if (params[i].Type == MemExtendedParameterAddressRequirements) - { - alloc_size += sizeof(MEM_ADDRESS_REQUIREMENTS); - add_address_requirements = FALSE; - } - else if (params[i].Type && params[i].Type < MemExtendedParameterMax) - { - FIXME( "Unsupported parameter type %d.\n", params[i].Type); - } - } + BOOL set_limit = (!*addr32 && process == GetCurrentProcess()); - if (add_address_requirements) - alloc_size += sizeof(*params) + sizeof(MEM_ADDRESS_REQUIREMENTS); - params64 = Wow64AllocateTemp( alloc_size ); - memcpy( params64, params, count * sizeof(*params64) ); - if (add_address_requirements) - { - buf = (MEM_ADDRESS_REQUIREMENTS *)((char *)params64 + (count + 1) * sizeof(*params64)); - params64[count].Type = MemExtendedParameterAddressRequirements; - params64[count].Pointer = buf; - memset(buf, 0, sizeof(*buf)); - buf->HighestEndingAddress = (void *)highest_user_address; - ++buf; - } - else - { - buf = (MEM_ADDRESS_REQUIREMENTS *)((char *)params64 + count * sizeof(*params64)); - } - for (i = 0; i < count; ++i) - { - if (params64[i].Type == MemExtendedParameterAddressRequirements) - { - MEM_ADDRESS_REQUIREMENTS32 *p = (MEM_ADDRESS_REQUIREMENTS32 *)params[i].Pointer; - - buf->LowestStartingAddress = ULongToPtr(p->LowestStartingAddress); - if (p->HighestEndingAddress) - { - if (p->HighestEndingAddress > highest_user_address) return STATUS_INVALID_PARAMETER; - buf->HighestEndingAddress = ULongToPtr(p->HighestEndingAddress); - } - else - { - buf->HighestEndingAddress = set_highest_address ? (void *)highest_user_address : NULL; - } - buf->Alignment = p->Alignment; - params64[i].Pointer = buf; - ++buf; - } - } + if ((status = mem_extended_parameters_32to64( ¶ms64, params32, &count, set_limit ))) return status; status = NtAllocateVirtualMemoryEx( process, addr_32to64( &addr, addr32 ), size_32to64( &size, size32 ), - type, protect, params64, count + add_address_requirements ); + type, protect, params64, count ); if (!status) { put_addr( addr32, addr );
1
0
0
0
Alexandre Julliard : ntdll/tests: Add tests for address requirements in NtMapViewOfSectionEx().
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: 9099289aff083abedd2ab36cbe59c6164e072f05 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9099289aff083abedd2ab36cbe59c6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 17:07:38 2023 +0200 ntdll/tests: Add tests for address requirements in NtMapViewOfSectionEx(). Based on the similar tests for NtAllocateVirtualMemoryEx(). --- dlls/ntdll/tests/virtual.c | 120 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 111 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 425d02473ba..bfd27f498e2 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -490,7 +490,8 @@ static void test_NtAllocateVirtualMemoryEx(void) } } #endif - ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + ok(status == STATUS_INVALID_PARAMETER || status == STATUS_NOT_SUPPORTED, + "Unexpected status %08lx.\n", status); } static void test_NtAllocateVirtualMemoryEx_address_requirements(void) @@ -1370,6 +1371,9 @@ static void test_NtMapViewOfSectionEx(void) static const char testfile[] = "testfile.xxx"; static const char data[] = "test data for NtMapViewOfSectionEx"; char buffer[sizeof(data)]; + MEM_EXTENDED_PARAMETER ext[2]; + MEM_ADDRESS_REQUIREMENTS a; + SYSTEM_INFO si; HANDLE file, mapping, process; DWORD status, written; SIZE_T size, result; @@ -1384,23 +1388,24 @@ static void test_NtMapViewOfSectionEx(void) } if (!pIsWow64Process || !pIsWow64Process(NtCurrentProcess(), &is_wow64)) is_wow64 = FALSE; + GetSystemInfo(&si); file = CreateFileA(testfile, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); ok(file != INVALID_HANDLE_VALUE, "Failed to create test file\n"); WriteFile(file, data, sizeof(data), &written, NULL); - SetFilePointer(file, 4096, NULL, FILE_BEGIN); + SetFilePointer(file, 0x40000, NULL, FILE_BEGIN); SetEndOfFile(file); /* read/write mapping */ - mapping = CreateFileMappingA(file, NULL, PAGE_READWRITE, 0, 4096, NULL); + mapping = CreateFileMappingA(file, NULL, PAGE_READWRITE, 0, 0x40000, NULL); ok(mapping != 0, "CreateFileMapping failed\n"); process = create_target_process("sleep"); ok(process != NULL, "Can't start process\n"); ptr = NULL; - size = 0; + size = 0x1000; offset.QuadPart = 0; status = pNtMapViewOfSectionEx(mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, NULL, 0); ok(status == STATUS_SUCCESS, "Unexpected status %08lx\n", status); @@ -1443,20 +1448,20 @@ static void test_NtMapViewOfSectionEx(void) { /* new memory region conflicts with previous mapping */ ptr2 = ptr; - size = 0; + size = 0x1000; offset.QuadPart = 0; status = pNtMapViewOfSectionEx(mapping, process, &ptr2, &offset, &size, AT_ROUND_TO_PAGE, PAGE_READWRITE, NULL, 0); ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx\n", status); ptr2 = (char *)ptr + 42; - size = 0; + size = 0x1000; offset.QuadPart = 0; status = pNtMapViewOfSectionEx(mapping, process, &ptr2, &offset, &size, AT_ROUND_TO_PAGE, PAGE_READWRITE, NULL, 0); ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx\n", status); /* in contrary to regular NtMapViewOfSection, only 4kb align is enforced */ ptr2 = (char *)ptr + 0x1000; - size = 0; + size = 0x1000; offset.QuadPart = 0; status = pNtMapViewOfSectionEx(mapping, process, &ptr2, &offset, &size, AT_ROUND_TO_PAGE, PAGE_READWRITE, NULL, 0); ok(status == STATUS_SUCCESS, "Unexpected status %08lx\n", status); @@ -1467,7 +1472,7 @@ static void test_NtMapViewOfSectionEx(void) /* the address is rounded down if not on a page boundary */ ptr2 = (char *)ptr + 0x1001; - size = 0; + size = 0x1000; offset.QuadPart = 0; status = pNtMapViewOfSectionEx(mapping, process, &ptr2, &offset, &size, AT_ROUND_TO_PAGE, PAGE_READWRITE, NULL, 0); ok(status == STATUS_SUCCESS, "Unexpected status %08lx\n", status); @@ -1477,7 +1482,7 @@ static void test_NtMapViewOfSectionEx(void) ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status); ptr2 = (char *)ptr + 0x2000; - size = 0; + size = 0x1000; offset.QuadPart = 0; status = pNtMapViewOfSectionEx(mapping, process, &ptr2, &offset, &size, AT_ROUND_TO_PAGE, PAGE_READWRITE, NULL, 0); ok(status == STATUS_SUCCESS, "Unexpected status %08lx\n", status); @@ -1500,6 +1505,103 @@ static void test_NtMapViewOfSectionEx(void) status = NtUnmapViewOfSection(process, ptr); ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status); + /* extended parameters */ + + memset(&ext, 0, sizeof(ext)); + ext[0].Type = 0; + size = 0x1000; + ptr = NULL; + offset.QuadPart = 0; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + memset(&ext, 0, sizeof(ext)); + ext[0].Type = MemExtendedParameterMax; + size = 0x1000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + memset(&a, 0, sizeof(a)); + ext[0].Type = MemExtendedParameterAddressRequirements; + ext[0].Pointer = &a; + size = 0x1000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(!status, "Unexpected status %08lx.\n", status); + status = NtUnmapViewOfSection(process, ptr); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status); + + ext[1] = ext[0]; + size = 0x1000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 2 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + a.LowestStartingAddress = NULL; + a.Alignment = 0; + a.HighestEndingAddress = (void *)(0x20001000 + 1); + size = 0x10000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + a.HighestEndingAddress = (void *)(0x20001000 - 2); + size = 0x10000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + a.HighestEndingAddress = (void *)(0x20000800 - 1); + size = 0x10000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + a.HighestEndingAddress = (char *)si.lpMaximumApplicationAddress + 0x1000; + size = 0x10000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + a.HighestEndingAddress = (char *)si.lpMaximumApplicationAddress; + size = 0x10000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(!status, "Unexpected status %08lx.\n", status); + status = NtUnmapViewOfSection(process, ptr); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status); + + a.HighestEndingAddress = (void *)(0x20001000 - 1); + size = 0x40000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(!status, "Unexpected status %08lx.\n", status); + ok(!((ULONG_PTR)ptr & 0xffff), "Unexpected addr %p.\n", ptr); + ok((ULONG_PTR)ptr + size <= 0x20001000, "Unexpected addr %p.\n", ptr); + status = NtUnmapViewOfSection(process, ptr); + ok(status == STATUS_SUCCESS, "NtUnmapViewOfSection returned %08lx\n", status); + + size = 0x40000; + a.HighestEndingAddress = (void *)(0x20001000 - 1); + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + a.HighestEndingAddress = NULL; + a.Alignment = 0x30000; + size = 0x1000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Unexpected status %08lx.\n", status); + + for (a.Alignment = 1; a.Alignment; a.Alignment *= 2) + { + size = 0x1000; + ptr = NULL; + status = pNtMapViewOfSectionEx( mapping, process, &ptr, &offset, &size, 0, PAGE_READWRITE, ext, 1 ); + ok(status == STATUS_INVALID_PARAMETER, "Align %Ix unexpected status %08lx.\n", a.Alignment, status); + } + NtClose(mapping); CloseHandle(file);
1
0
0
0
Alexandre Julliard : ntdll: Support extended address requirements in NtMapViewOfSectionEx().
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: 4b8f3dd9a56db4fd6a63895f7ee6ee26c1ef2bc7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4b8f3dd9a56db4fd6a63895f7ee6ee…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 17:07:08 2023 +0200 ntdll: Support extended address requirements in NtMapViewOfSectionEx(). --- dlls/ntdll/unix/server.c | 39 ++++++++++++++++++++++++++ dlls/ntdll/unix/virtual.c | 63 ++++++++++++++++++++++++++++++++++++++---- include/wine/server_protocol.h | 21 +++++++++++++- server/protocol.def | 21 +++++++++++++- server/thread.c | 1 + server/trace.c | 12 ++++++-- 6 files changed, 148 insertions(+), 9 deletions(-)
1
0
0
0
Alexandre Julliard : ntdll: Add a helper function to process MEM_EXTENDED_PARAMETER parameters.
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: 185e168accf0e31044d2c25c98376fca9e143e42 URL:
https://gitlab.winehq.org/wine/wine/-/commit/185e168accf0e31044d2c25c98376f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 17:05:34 2023 +0200 ntdll: Add a helper function to process MEM_EXTENDED_PARAMETER parameters. --- dlls/ntdll/unix/virtual.c | 60 ++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 8154ff148eb..5c746df9693 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4041,22 +4041,11 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR z } -/*********************************************************************** - * NtAllocateVirtualMemoryEx (NTDLL.@) - * ZwAllocateVirtualMemoryEx (NTDLL.@) - */ -NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *size_ptr, ULONG type, - ULONG protect, MEM_EXTENDED_PARAMETER *parameters, - ULONG count ) +static NTSTATUS get_extended_params( const MEM_EXTENDED_PARAMETER *parameters, ULONG count, + ULONG_PTR *limit, ULONG_PTR *align, ULONG *attributes ) { - ULONG_PTR limit = 0; - ULONG_PTR align = 0; - ULONG attributes = 0; MEM_ADDRESS_REQUIREMENTS *r = NULL; - unsigned int i; - - TRACE( "%p %p %08lx %x %08x %p %u\n", - process, *ret, *size_ptr, (int)type, (int)protect, parameters, (int)count ); + ULONG i; if (count && !parameters) return STATUS_INVALID_PARAMETER; @@ -4074,25 +4063,26 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s if (r->Alignment) { - if (*ret || (r->Alignment & (r->Alignment - 1)) || r->Alignment - 1 < granularity_mask) + if ((r->Alignment & (r->Alignment - 1)) || r->Alignment - 1 < granularity_mask) { WARN( "Invalid alignment %lu.\n", r->Alignment ); return STATUS_INVALID_PARAMETER; } - align = r->Alignment; + *align = r->Alignment; } - - limit = (ULONG_PTR)r->HighestEndingAddress; - if (limit && (*ret || limit > (ULONG_PTR)user_space_limit || ((limit + 1) & (page_mask - 1)))) + if (r->HighestEndingAddress) { - WARN( "Invalid limit %p.\n", r->HighestEndingAddress); - return STATUS_INVALID_PARAMETER; + *limit = (ULONG_PTR)r->HighestEndingAddress; + if (*limit > (ULONG_PTR)user_space_limit || ((*limit + 1) & (page_mask - 1))) + { + WARN( "Invalid limit %p.\n", r->HighestEndingAddress ); + return STATUS_INVALID_PARAMETER; + } } - TRACE( "limit %p, align %p.\n", (void *)limit, (void *)align ); break; case MemExtendedParameterAttributeFlags: - attributes = parameters[i].ULong; + *attributes = parameters[i].ULong; break; case MemExtendedParameterNumaNode: @@ -4107,14 +4097,36 @@ NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *s return STATUS_INVALID_PARAMETER; } } + return STATUS_SUCCESS; +} + +/*********************************************************************** + * NtAllocateVirtualMemoryEx (NTDLL.@) + * ZwAllocateVirtualMemoryEx (NTDLL.@) + */ +NTSTATUS WINAPI NtAllocateVirtualMemoryEx( HANDLE process, PVOID *ret, SIZE_T *size_ptr, ULONG type, + ULONG protect, MEM_EXTENDED_PARAMETER *parameters, + ULONG count ) +{ + ULONG_PTR limit = 0; + ULONG_PTR align = 0; + ULONG attributes = 0; + unsigned int status; + + TRACE( "%p %p %08lx %x %08x %p %u\n", + process, *ret, *size_ptr, (int)type, (int)protect, parameters, (int)count ); + + status = get_extended_params( parameters, count, &limit, &align, &attributes ); + if (status) return status; + + if (*ret && (align || limit)) return STATUS_INVALID_PARAMETER; if (!*size_ptr) return STATUS_INVALID_PARAMETER; if (process != NtCurrentProcess()) { apc_call_t call; apc_result_t result; - unsigned int status; memset( &call, 0, sizeof(call) );
1
0
0
0
Alexandre Julliard : ntdll: Pass limit instead of zero bits to internal memory mapping functions.
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: 04ef02f6ffd7eb19fb5883b29a646686572c5f5f URL:
https://gitlab.winehq.org/wine/wine/-/commit/04ef02f6ffd7eb19fb5883b29a6466…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 10 16:21:15 2023 +0200 ntdll: Pass limit instead of zero bits to internal memory mapping functions. --- dlls/ntdll/unix/loader.c | 20 +++++++-------- dlls/ntdll/unix/thread.c | 8 +++--- dlls/ntdll/unix/unix_private.h | 31 +++++++++++++++++++++--- dlls/ntdll/unix/virtual.c | 55 +++++++++++------------------------------- 4 files changed, 55 insertions(+), 59 deletions(-)
1
0
0
0
Zebediah Figura : wined3d: Do not declare resources as multisampled if the sample count is 1.
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: 9aac2d95ede5291dc491b6cd2594daac4547873a URL:
https://gitlab.winehq.org/wine/wine/-/commit/9aac2d95ede5291dc491b6cd2594da…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue May 9 15:01:11 2023 -0500 wined3d: Do not declare resources as multisampled if the sample count is 1. Based on vkd3d commit d8ef0c69a817d059b1d4fc62520131eed80aba29. --- dlls/wined3d/shader.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 7ee68a3436d..b4df79508ec 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1070,6 +1070,10 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co break; } reg_maps->resource_info[reg_idx].type = semantic->resource_type; + if (semantic->resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2DMS && semantic->sample_count == 1) + reg_maps->resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_TEXTURE_2D; + if (semantic->resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY && semantic->sample_count == 1) + reg_maps->resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY; reg_maps->resource_info[reg_idx].data_type = semantic->resource_data_type; wined3d_bitmap_set(reg_maps->resource_map, reg_idx); break;
1
0
0
0
Zebediah Figura : wined3d: Read the sm4 sample count in DCL instructions.
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: d53fd401651285eeff30216a8858c5623f35b2e1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d53fd401651285eeff30216a8858c5…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue May 9 15:00:07 2023 -0500 wined3d: Read the sm4 sample count in DCL instructions. Based on vkd3d commit ee52ad810635cf504a49d5267a5942fffb16836e. --- dlls/wined3d/shader_sm4.c | 10 ++++++++++ dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 11 insertions(+) diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index b87d45b0fb7..78abdbe81ac 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -49,6 +49,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode); #define WINED3D_SM4_RESOURCE_TYPE_SHIFT 11 #define WINED3D_SM4_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM4_RESOURCE_TYPE_SHIFT) +#define WINED3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT 16 +#define WINED3D_SM4_RESOURCE_SAMPLE_COUNT_MASK (0xfu << WINED3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT) + #define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT 11 #define WINED3D_SM4_PRIMITIVE_TYPE_MASK (0x3fu << WINED3D_SM4_PRIMITIVE_TYPE_SHIFT) @@ -592,6 +595,13 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, { ins->declaration.semantic.resource_type = resource_type_table[resource_type]; } + + if (ins->declaration.semantic.resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2DMS + || ins->declaration.semantic.resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY) + { + ins->declaration.semantic.sample_count = (opcode_token & WINED3D_SM4_RESOURCE_SAMPLE_COUNT_MASK) >> WINED3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT; + } + reg_data_type = opcode == WINED3D_SM4_OP_DCL_RESOURCE ? WINED3D_DATA_RESOURCE : WINED3D_DATA_UAV; shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], reg_data_type, &ins->declaration.semantic.reg); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f793c6c0cde..d28a86f77c2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1311,6 +1311,7 @@ struct wined3d_shader_semantic enum wined3d_decl_usage usage; UINT usage_idx; enum wined3d_shader_resource_type resource_type; + unsigned int sample_count; enum wined3d_data_type resource_data_type; struct wined3d_shader_dst_param reg; };
1
0
0
0
Zebediah Figura : wined3d: Do not forward texture references to the swapchain.
by Alexandre Julliard
10 May '23
10 May '23
Module: wine Branch: master Commit: 2cfd75f7c5b0e8ffe0f4c161c3c174c4bfc3a046 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2cfd75f7c5b0e8ffe0f4c161c3c174…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Apr 14 19:13:06 2023 -0500 wined3d: Do not forward texture references to the swapchain. Rely on the swapchain to reference its individual textures, and rely on the parent texture object to keep the swapchain alive if necessary. This is necessary to allow detaching textures from a swapchain. --- dlls/wined3d/texture.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 4cd6d7035eb..1bf9adf869c 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1513,9 +1513,6 @@ ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture) TRACE("texture %p, swapchain %p.\n", texture, texture->swapchain); - if (texture->swapchain) - return wined3d_swapchain_incref(texture->swapchain); - refcount = InterlockedIncrement(&texture->resource.ref); TRACE("%p increasing refcount to %u.\n", texture, refcount); @@ -1606,9 +1603,6 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) TRACE("texture %p, swapchain %p.\n", texture, texture->swapchain); - if (texture->swapchain) - return wined3d_swapchain_decref(texture->swapchain); - refcount = InterlockedDecrement(&texture->resource.ref); TRACE("%p decreasing refcount to %u.\n", texture, refcount);
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
...
78
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
Results per page:
10
25
50
100
200