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
November 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
1 participants
1171 discussions
Start a n
N
ew thread
Rémi Bernon : ntdll: Move large block alloc out of heap_allocate.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 523d4cc416fc991c739a15b586cf47e1fbd5c7f7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/523d4cc416fc991c739a15b586cf47…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Nov 14 15:17:50 2022 +0100 ntdll: Move large block alloc out of heap_allocate. --- dlls/ntdll/heap.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 31650433aa5..69ffc3cd0ac 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -819,23 +819,21 @@ static inline void shrink_used_block( struct heap *heap, ULONG flags, struct blo } -/*********************************************************************** - * allocate_large_block - */ -static struct block *allocate_large_block( struct heap *heap, DWORD flags, SIZE_T size ) +static NTSTATUS heap_allocate_large( struct heap *heap, ULONG flags, SIZE_T block_size, + SIZE_T size, void **ret ) { ARENA_LARGE *arena; SIZE_T total_size = ROUND_SIZE( sizeof(*arena) + size, REGION_ALIGN - 1 ); LPVOID address = NULL; struct block *block; - if (!(flags & HEAP_GROWABLE)) return NULL; - if (total_size < size) return NULL; /* overflow */ + if (!(flags & HEAP_GROWABLE)) return STATUS_NO_MEMORY; + if (total_size < size) return STATUS_NO_MEMORY; /* overflow */ if (NtAllocateVirtualMemory( NtCurrentProcess(), &address, 0, &total_size, MEM_COMMIT, get_protection_type( heap->flags ) )) { WARN( "Could not allocate block for %#Ix bytes\n", size ); - return NULL; + return STATUS_NO_MEMORY; } arena = address; @@ -847,11 +845,16 @@ static struct block *allocate_large_block( struct heap *heap, DWORD flags, SIZE_ block_set_base( block, arena ); block_set_flags( block, ~0, BLOCK_FLAG_LARGE | BLOCK_USER_FLAGS( flags ) ); block_set_size( block, 0 ); + + heap_lock( heap, flags ); list_add_tail( &heap->large_list, &arena->entry ); + heap_unlock( heap, flags ); + valgrind_make_noaccess( (char *)block + sizeof(*block) + arena->data_size, arena->block_size - sizeof(*block) - arena->data_size ); - return block; + *ret = block + 1; + return STATUS_SUCCESS; } @@ -1501,19 +1504,11 @@ static SIZE_T heap_get_block_size( const struct heap *heap, ULONG flags, SIZE_T return block_size; } -static NTSTATUS heap_allocate( struct heap *heap, ULONG flags, SIZE_T block_size, SIZE_T size, void **ret ) +static NTSTATUS heap_allocate_block( struct heap *heap, ULONG flags, SIZE_T block_size, SIZE_T size, void **ret ) { SIZE_T old_block_size; struct block *block; - if (block_size >= HEAP_MIN_LARGE_BLOCK_SIZE) - { - if (!(block = allocate_large_block( heap, flags, size ))) return STATUS_NO_MEMORY; - - *ret = block + 1; - return STATUS_SUCCESS; - } - /* Locate a suitable free block */ if (!(block = find_free_block( heap, flags, block_size ))) return STATUS_NO_MEMORY; @@ -1545,10 +1540,12 @@ void *WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE handle, ULONG flags, SIZE status = STATUS_INVALID_HANDLE; else if ((block_size = heap_get_block_size( heap, heap_flags, size )) == ~0U) status = STATUS_NO_MEMORY; + else if (block_size >= HEAP_MIN_LARGE_BLOCK_SIZE) + status = heap_allocate_large( heap, heap_flags, block_size, size, &ptr ); else { heap_lock( heap, heap_flags ); - status = heap_allocate( heap, heap_flags, block_size, size, &ptr ); + status = heap_allocate_block( heap, heap_flags, block_size, size, &ptr ); heap_unlock( heap, heap_flags ); }
1
0
0
0
Rémi Bernon : ntdll: Make realloc implementation more generic.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: a7fda2f8cb7e09b16fd7dc0ce2e40b5939757e78 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a7fda2f8cb7e09b16fd7dc0ce2e40b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Nov 15 00:50:05 2022 +0100 ntdll: Make realloc implementation more generic. Either resizing a block in place, or reallocating through RtlHeap calls. --- dlls/ntdll/heap.c | 74 ++++++++++++++++++------------------------------------- 1 file changed, 24 insertions(+), 50 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index d2c5ee1ff3a..31650433aa5 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -869,31 +869,6 @@ static void free_large_block( struct heap *heap, struct block *block ) } -/*********************************************************************** - * realloc_large_block - */ -static struct block *realloc_large_block( struct heap *heap, DWORD flags, struct block *block, SIZE_T size ) -{ - ARENA_LARGE *arena = CONTAINING_RECORD( block, ARENA_LARGE, block ); - SIZE_T old_size = arena->data_size; - char *data = (char *)(block + 1); - - if (flags & HEAP_REALLOC_IN_PLACE_ONLY) return NULL; - if (!(block = allocate_large_block( heap, flags, size ))) - { - WARN( "Could not allocate block for %#Ix bytes\n", size ); - return NULL; - } - - valgrind_notify_alloc( block + 1, size, 0 ); - memcpy( block + 1, data, old_size ); - valgrind_notify_free( data ); - free_large_block( heap, &arena->block ); - - return block; -} - - /*********************************************************************** * find_large_block */ @@ -1622,15 +1597,13 @@ BOOLEAN WINAPI DECLSPEC_HOTPATCH RtlFreeHeap( HANDLE handle, ULONG flags, void * return !status; } - -static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *block, SIZE_T block_size, - SIZE_T size, SIZE_T *old_size, void **ret ) +static NTSTATUS heap_resize_block( struct heap *heap, ULONG flags, struct block *block, SIZE_T block_size, + SIZE_T size, SIZE_T *old_size, void **ret ) { SUBHEAP *subheap = block_get_subheap( heap, block ); SIZE_T old_block_size; struct entry *entry; struct block *next; - NTSTATUS status; if (block_get_flags( block ) & BLOCK_FLAG_LARGE) { @@ -1638,12 +1611,8 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b old_block_size = large->block_size; *old_size = large->data_size; - if (old_block_size - sizeof(*block) < size) - { - if (!(block = realloc_large_block( heap, flags, block, size ))) return STATUS_NO_MEMORY; - *ret = block + 1; - return STATUS_SUCCESS; - } + if (block_size < HEAP_MIN_LARGE_BLOCK_SIZE / 4) return STATUS_NO_MEMORY; /* shrinking large block to small block */ + if (old_block_size < block_size) return STATUS_NO_MEMORY; /* FIXME: we could remap zero-pages instead */ valgrind_notify_resize( block + 1, *old_size, size ); @@ -1657,25 +1626,20 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b return STATUS_SUCCESS; } - /* Check if we need to grow the block */ - old_block_size = block_get_size( block ); *old_size = old_block_size - block_get_overhead( block ); + if (block_size >= HEAP_MIN_LARGE_BLOCK_SIZE) return STATUS_NO_MEMORY; /* growing small block to large block */ + + heap_lock( heap, flags ); + if (block_size > old_block_size) { if (!(next = next_block( subheap, block )) || !(block_get_flags( next ) & BLOCK_FLAG_FREE) || - block_size >= HEAP_MIN_LARGE_BLOCK_SIZE || block_size > old_block_size + block_get_size( next ) || !subheap_commit( heap, subheap, block, block_size )) { - if (flags & HEAP_REALLOC_IN_PLACE_ONLY) return STATUS_NO_MEMORY; - if ((status = heap_allocate( heap, flags & ~HEAP_ZERO_MEMORY, block_size, size, ret ))) return status; - valgrind_notify_alloc( *ret, size, 0 ); - memcpy( *ret, block + 1, *old_size ); - if (flags & HEAP_ZERO_MEMORY) memset( (char *)*ret + *old_size, 0, size - *old_size ); - valgrind_notify_free( block + 1 ); - free_used_block( heap, flags, block ); - return STATUS_SUCCESS; + heap_unlock( heap, flags ); + return STATUS_NO_MEMORY; } } @@ -1694,6 +1658,8 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b initialize_block( block, *old_size, size, flags ); mark_block_tail( block, flags ); + heap_unlock( heap, flags ); + *ret = block + 1; return STATUS_SUCCESS; } @@ -1718,11 +1684,19 @@ void *WINAPI RtlReAllocateHeap( HANDLE handle, ULONG flags, void *ptr, SIZE_T si status = STATUS_NO_MEMORY; else if (!(block = unsafe_block_from_ptr( heap, heap_flags, ptr ))) status = STATUS_INVALID_PARAMETER; - else + else if ((status = heap_resize_block( heap, heap_flags, block, block_size, size, + &old_size, &ret ))) { - heap_lock( heap, heap_flags ); - status = heap_reallocate( heap, heap_flags, block, block_size, size, &old_size, &ret ); - heap_unlock( heap, heap_flags ); + if (flags & HEAP_REALLOC_IN_PLACE_ONLY) + status = STATUS_NO_MEMORY; + else if (!(ret = RtlAllocateHeap( heap, flags, size ))) + status = STATUS_NO_MEMORY; + else + { + memcpy( ret, ptr, min( size, old_size ) ); + RtlFreeHeap( heap, flags, ptr ); + status = STATUS_SUCCESS; + } } TRACE( "handle %p, flags %#lx, ptr %p, size %#Ix, return %p, status %#lx.\n", handle, flags, ptr, size, ret, status );
1
0
0
0
Rémi Bernon : ntdll: Return the old data size from heap_reallocate.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: ce450253bd282fc92dd9f1a5e48abd2522a901ba URL:
https://gitlab.winehq.org/wine/wine/-/commit/ce450253bd282fc92dd9f1a5e48abd…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Nov 25 00:18:21 2022 +0100 ntdll: Return the old data size from heap_reallocate. --- dlls/ntdll/heap.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 505900b2573..d2c5ee1ff3a 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1623,11 +1623,11 @@ BOOLEAN WINAPI DECLSPEC_HOTPATCH RtlFreeHeap( HANDLE handle, ULONG flags, void * } -static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *block, - SIZE_T block_size, SIZE_T size, void **ret ) +static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *block, SIZE_T block_size, + SIZE_T size, SIZE_T *old_size, void **ret ) { SUBHEAP *subheap = block_get_subheap( heap, block ); - SIZE_T old_block_size, old_size; + SIZE_T old_block_size; struct entry *entry; struct block *next; NTSTATUS status; @@ -1636,7 +1636,7 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b { ARENA_LARGE *large = CONTAINING_RECORD( block, ARENA_LARGE, block ); old_block_size = large->block_size; - old_size = large->data_size; + *old_size = large->data_size; if (old_block_size - sizeof(*block) < size) { @@ -1646,8 +1646,8 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b } /* FIXME: we could remap zero-pages instead */ - valgrind_notify_resize( block + 1, old_size, size ); - initialize_block( block, old_size, size, flags ); + valgrind_notify_resize( block + 1, *old_size, size ); + initialize_block( block, *old_size, size, flags ); large->data_size = size; valgrind_make_noaccess( (char *)block + sizeof(*block) + large->data_size, @@ -1660,7 +1660,7 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b /* Check if we need to grow the block */ old_block_size = block_get_size( block ); - old_size = old_block_size - block_get_overhead( block ); + *old_size = old_block_size - block_get_overhead( block ); if (block_size > old_block_size) { @@ -1671,8 +1671,8 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b if (flags & HEAP_REALLOC_IN_PLACE_ONLY) return STATUS_NO_MEMORY; if ((status = heap_allocate( heap, flags & ~HEAP_ZERO_MEMORY, block_size, size, ret ))) return status; valgrind_notify_alloc( *ret, size, 0 ); - memcpy( *ret, block + 1, old_size ); - if (flags & HEAP_ZERO_MEMORY) memset( (char *)*ret + old_size, 0, size - old_size ); + memcpy( *ret, block + 1, *old_size ); + if (flags & HEAP_ZERO_MEMORY) memset( (char *)*ret + *old_size, 0, size - *old_size ); valgrind_notify_free( block + 1 ); free_used_block( heap, flags, block ); return STATUS_SUCCESS; @@ -1687,11 +1687,11 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b old_block_size += block_get_size( next ); } - valgrind_notify_resize( block + 1, old_size, size ); + valgrind_notify_resize( block + 1, *old_size, size ); block_set_flags( block, BLOCK_FLAG_USER_MASK & ~BLOCK_FLAG_USER_INFO, BLOCK_USER_FLAGS( flags ) ); shrink_used_block( heap, flags, block, old_block_size, block_size, size ); - initialize_block( block, old_size, size, flags ); + initialize_block( block, *old_size, size, flags ); mark_block_tail( block, flags ); *ret = block + 1; @@ -1703,9 +1703,9 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b */ void *WINAPI RtlReAllocateHeap( HANDLE handle, ULONG flags, void *ptr, SIZE_T size ) { + SIZE_T block_size, old_size; struct block *block; struct heap *heap; - SIZE_T block_size; ULONG heap_flags; void *ret = NULL; NTSTATUS status; @@ -1721,7 +1721,7 @@ void *WINAPI RtlReAllocateHeap( HANDLE handle, ULONG flags, void *ptr, SIZE_T si else { heap_lock( heap, heap_flags ); - status = heap_reallocate( heap, heap_flags, block, block_size, size, &ret ); + status = heap_reallocate( heap, heap_flags, block, block_size, size, &old_size, &ret ); heap_unlock( heap, heap_flags ); }
1
0
0
0
Rémi Bernon : ntdll: Move large block resize in heap_reallocate.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 4334c5b0c10ecc5675e4bb595f5d0e50eeb2eb1b URL:
https://gitlab.winehq.org/wine/wine/-/commit/4334c5b0c10ecc5675e4bb595f5d0e…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Nov 25 00:14:57 2022 +0100 ntdll: Move large block resize in heap_reallocate. --- dlls/ntdll/heap.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 9a524b1a1aa..505900b2573 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -878,19 +878,6 @@ static struct block *realloc_large_block( struct heap *heap, DWORD flags, struct SIZE_T old_size = arena->data_size; char *data = (char *)(block + 1); - if (arena->block_size - sizeof(*block) >= size) - { - /* FIXME: we could remap zero-pages instead */ - valgrind_notify_resize( data, old_size, size ); - initialize_block( block, old_size, size, flags ); - - arena->data_size = size; - valgrind_make_noaccess( (char *)block + sizeof(*block) + arena->data_size, - arena->block_size - sizeof(*block) - arena->data_size ); - - return block; - } - if (flags & HEAP_REALLOC_IN_PLACE_ONLY) return NULL; if (!(block = allocate_large_block( heap, flags, size ))) { @@ -1647,7 +1634,24 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b if (block_get_flags( block ) & BLOCK_FLAG_LARGE) { - if (!(block = realloc_large_block( heap, flags, block, size ))) return STATUS_NO_MEMORY; + ARENA_LARGE *large = CONTAINING_RECORD( block, ARENA_LARGE, block ); + old_block_size = large->block_size; + old_size = large->data_size; + + if (old_block_size - sizeof(*block) < size) + { + if (!(block = realloc_large_block( heap, flags, block, size ))) return STATUS_NO_MEMORY; + *ret = block + 1; + return STATUS_SUCCESS; + } + + /* FIXME: we could remap zero-pages instead */ + valgrind_notify_resize( block + 1, old_size, size ); + initialize_block( block, old_size, size, flags ); + + large->data_size = size; + valgrind_make_noaccess( (char *)block + sizeof(*block) + large->data_size, + old_block_size - sizeof(*block) - large->data_size ); *ret = block + 1; return STATUS_SUCCESS;
1
0
0
0
Rémi Bernon : ntdll: Merge next free block before resizing in heap_reallocate.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 0c5f9e8d4ee0603ebf0a5f13065e520e08c58f2d URL:
https://gitlab.winehq.org/wine/wine/-/commit/0c5f9e8d4ee0603ebf0a5f13065e52…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Nov 25 18:00:52 2022 +0100 ntdll: Merge next free block before resizing in heap_reallocate. --- dlls/ntdll/heap.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 0c7300f8055..9a524b1a1aa 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1639,7 +1639,10 @@ BOOLEAN WINAPI DECLSPEC_HOTPATCH RtlFreeHeap( HANDLE handle, ULONG flags, void * static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *block, SIZE_T block_size, SIZE_T size, void **ret ) { + SUBHEAP *subheap = block_get_subheap( heap, block ); SIZE_T old_block_size, old_size; + struct entry *entry; + struct block *next; NTSTATUS status; if (block_get_flags( block ) & BLOCK_FLAG_LARGE) @@ -1654,12 +1657,9 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b old_block_size = block_get_size( block ); old_size = old_block_size - block_get_overhead( block ); + if (block_size > old_block_size) { - SUBHEAP *subheap = block_get_subheap( heap, block ); - struct entry *entry; - struct block *next; - if (!(next = next_block( subheap, block )) || !(block_get_flags( next ) & BLOCK_FLAG_FREE) || block_size >= HEAP_MIN_LARGE_BLOCK_SIZE || block_size > old_block_size + block_get_size( next ) || !subheap_commit( heap, subheap, block, block_size )) @@ -1673,8 +1673,11 @@ static NTSTATUS heap_reallocate( struct heap *heap, ULONG flags, struct block *b free_used_block( heap, flags, block ); return STATUS_SUCCESS; } + } - /* The next block is free and large enough */ + if ((next = next_block( subheap, block )) && (block_get_flags( next ) & BLOCK_FLAG_FREE)) + { + /* merge with next block if it is free */ entry = (struct entry *)next; list_remove( &entry->entry ); old_block_size += block_get_size( next );
1
0
0
0
Connor McAdams : uiautomationcore: Add UiaAddEvent stub.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: c0360db5611cd70f8a00eee77191db546bcc5b3a URL:
https://gitlab.winehq.org/wine/wine/-/commit/c0360db5611cd70f8a00eee77191db…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Sun Oct 30 14:58:30 2022 -0400 uiautomationcore: Add UiaAddEvent stub. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_client.c | 11 +++++++++++ dlls/uiautomationcore/uiautomationcore.spec | 2 +- include/uiautomationcoreapi.h | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index f7b3536802f..14f9977a4d6 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -3014,6 +3014,17 @@ exit: return hr; } +/*********************************************************************** + * UiaAddEvent (uiautomationcore.@) + */ +HRESULT WINAPI UiaAddEvent(HUIANODE huianode, EVENTID event_id, UiaEventCallback *callback, enum TreeScope scope, + PROPERTYID *prop_ids, int prop_ids_count, struct UiaCacheRequest *cache_req, HUIAEVENT *huiaevent) +{ + FIXME("(%p, %d, %p, %#x, %p, %d, %p, %p)\n", huianode, event_id, callback, scope, prop_ids, prop_ids_count, + cache_req, huiaevent); + return E_NOTIMPL; +} + /*********************************************************************** * UiaRemoveEvent (uiautomationcore.@) */ diff --git a/dlls/uiautomationcore/uiautomationcore.spec b/dlls/uiautomationcore/uiautomationcore.spec index 63df49980fc..11ca7be7f97 100644 --- a/dlls/uiautomationcore/uiautomationcore.spec +++ b/dlls/uiautomationcore/uiautomationcore.spec @@ -53,7 +53,7 @@ @ stub TransformPattern_Move @ stub TransformPattern_Resize @ stub TransformPattern_Rotate -@ stub UiaAddEvent +@ stdcall UiaAddEvent(ptr long ptr long ptr long ptr ptr) @ stdcall UiaClientsAreListening() #@ stub UiaDisconnectAllProviders @ stdcall UiaDisconnectProvider(ptr) diff --git a/include/uiautomationcoreapi.h b/include/uiautomationcoreapi.h index 9902a6d68e4..ef94c72d162 100644 --- a/include/uiautomationcoreapi.h +++ b/include/uiautomationcoreapi.h @@ -393,6 +393,7 @@ struct UiaFindParams { }; typedef SAFEARRAY * WINAPI UiaProviderCallback(HWND hwnd,enum ProviderType providerType); +typedef void WINAPI UiaEventCallback(struct UiaEventArgs *pArgs,SAFEARRAY *pRequestedData,BSTR pTreeStructure); HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value); HRESULT WINAPI UiaGetReservedNotSupportedValue(IUnknown **value); @@ -418,6 +419,8 @@ HRESULT WINAPI UiaNavigate(HUIANODE huianode, enum NavigateDirection dir, struct struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, BSTR *tree_struct); HRESULT WINAPI UiaFind(HUIANODE huianode, struct UiaFindParams *find_params, struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, SAFEARRAY **out_offsets, SAFEARRAY **out_tree_structs); +HRESULT WINAPI UiaAddEvent(HUIANODE huianode, EVENTID event_id, UiaEventCallback *callback, enum TreeScope scope, + PROPERTYID *prop_ids, int prop_ids_count, struct UiaCacheRequest *cache_req, HUIAEVENT *huiaevent); HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent); HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd); HRESULT WINAPI UiaEventRemoveWindow(HUIAEVENT huiaevent, HWND hwnd);
1
0
0
0
Connor McAdams : uiautomationcore: Add UiaEventRemoveWindow stub.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 41736eb5542561a3db3af639a18c27775e8ce19c URL:
https://gitlab.winehq.org/wine/wine/-/commit/41736eb5542561a3db3af639a18c27…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Sun Oct 30 14:39:57 2022 -0400 uiautomationcore: Add UiaEventRemoveWindow stub. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_client.c | 9 +++++++++ dlls/uiautomationcore/uiautomationcore.spec | 2 +- include/uiautomationcoreapi.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index cc77d8ab8a4..f7b3536802f 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -3031,3 +3031,12 @@ HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd) FIXME("(%p, %p): stub\n", huiaevent, hwnd); return E_NOTIMPL; } + +/*********************************************************************** + * UiaEventRemoveWindow (uiautomationcore.@) + */ +HRESULT WINAPI UiaEventRemoveWindow(HUIAEVENT huiaevent, HWND hwnd) +{ + FIXME("(%p, %p): stub\n", huiaevent, hwnd); + return E_NOTIMPL; +} diff --git a/dlls/uiautomationcore/uiautomationcore.spec b/dlls/uiautomationcore/uiautomationcore.spec index 1df5dfda851..63df49980fc 100644 --- a/dlls/uiautomationcore/uiautomationcore.spec +++ b/dlls/uiautomationcore/uiautomationcore.spec @@ -58,7 +58,7 @@ #@ stub UiaDisconnectAllProviders @ stdcall UiaDisconnectProvider(ptr) @ stdcall UiaEventAddWindow(ptr long) -@ stub UiaEventRemoveWindow +@ stdcall UiaEventRemoveWindow(ptr long) @ stdcall UiaFind(ptr ptr ptr ptr ptr ptr) @ stub UiaGetErrorDescription @ stub UiaGetPatternProvider diff --git a/include/uiautomationcoreapi.h b/include/uiautomationcoreapi.h index f5adb29393b..9902a6d68e4 100644 --- a/include/uiautomationcoreapi.h +++ b/include/uiautomationcoreapi.h @@ -420,6 +420,7 @@ HRESULT WINAPI UiaFind(HUIANODE huianode, struct UiaFindParams *find_params, str SAFEARRAY **out_offsets, SAFEARRAY **out_tree_structs); HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent); HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd); +HRESULT WINAPI UiaEventRemoveWindow(HUIAEVENT huiaevent, HWND hwnd); #ifdef __cplusplus }
1
0
0
0
Connor McAdams : uiautomationcore: Add UiaEventAddWindow stub.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 9ea53ec2f6c4d67792507b8a3ed80f8cfffacf98 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9ea53ec2f6c4d67792507b8a3ed80f…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Sun Oct 30 14:37:53 2022 -0400 uiautomationcore: Add UiaEventAddWindow stub. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_client.c | 9 +++++++++ dlls/uiautomationcore/uiautomationcore.spec | 2 +- include/uiautomationcoreapi.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index badbf8a1618..cc77d8ab8a4 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -3022,3 +3022,12 @@ HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent) FIXME("(%p): stub\n", huiaevent); return E_NOTIMPL; } + +/*********************************************************************** + * UiaEventAddWindow (uiautomationcore.@) + */ +HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd) +{ + FIXME("(%p, %p): stub\n", huiaevent, hwnd); + return E_NOTIMPL; +} diff --git a/dlls/uiautomationcore/uiautomationcore.spec b/dlls/uiautomationcore/uiautomationcore.spec index 5c33e1e926a..1df5dfda851 100644 --- a/dlls/uiautomationcore/uiautomationcore.spec +++ b/dlls/uiautomationcore/uiautomationcore.spec @@ -57,7 +57,7 @@ @ stdcall UiaClientsAreListening() #@ stub UiaDisconnectAllProviders @ stdcall UiaDisconnectProvider(ptr) -@ stub UiaEventAddWindow +@ stdcall UiaEventAddWindow(ptr long) @ stub UiaEventRemoveWindow @ stdcall UiaFind(ptr ptr ptr ptr ptr ptr) @ stub UiaGetErrorDescription diff --git a/include/uiautomationcoreapi.h b/include/uiautomationcoreapi.h index cc38354f713..f5adb29393b 100644 --- a/include/uiautomationcoreapi.h +++ b/include/uiautomationcoreapi.h @@ -419,6 +419,7 @@ HRESULT WINAPI UiaNavigate(HUIANODE huianode, enum NavigateDirection dir, struct HRESULT WINAPI UiaFind(HUIANODE huianode, struct UiaFindParams *find_params, struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, SAFEARRAY **out_offsets, SAFEARRAY **out_tree_structs); HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent); +HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd); #ifdef __cplusplus }
1
0
0
0
Connor McAdams : uiautomationcore: Add UiaRemoveEvent stub.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 922706bd1e7ac4da9d77bb5be7f7c395d3374ec1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/922706bd1e7ac4da9d77bb5be7f7c3…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Sun Oct 30 14:33:46 2022 -0400 uiautomationcore: Add UiaRemoveEvent stub. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_client.c | 9 +++++++++ dlls/uiautomationcore/uiautomationcore.spec | 2 +- include/uiautomationcoreapi.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 5e2026536d5..badbf8a1618 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -3013,3 +3013,12 @@ exit: return hr; } + +/*********************************************************************** + * UiaRemoveEvent (uiautomationcore.@) + */ +HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent) +{ + FIXME("(%p): stub\n", huiaevent); + return E_NOTIMPL; +} diff --git a/dlls/uiautomationcore/uiautomationcore.spec b/dlls/uiautomationcore/uiautomationcore.spec index 0ad0cb6f437..5c33e1e926a 100644 --- a/dlls/uiautomationcore/uiautomationcore.spec +++ b/dlls/uiautomationcore/uiautomationcore.spec @@ -92,7 +92,7 @@ @ stub UiaRaiseStructureChangedEvent #@ stub UiaRaiseTextEditTextChangedEvent @ stdcall UiaRegisterProviderCallback(ptr) -@ stub UiaRemoveEvent +@ stdcall UiaRemoveEvent(ptr) @ stdcall UiaReturnRawElementProvider(long long long ptr) @ stub UiaSetFocus @ stub UiaTextRangeRelease diff --git a/include/uiautomationcoreapi.h b/include/uiautomationcoreapi.h index efb5eb35d06..cc38354f713 100644 --- a/include/uiautomationcoreapi.h +++ b/include/uiautomationcoreapi.h @@ -418,6 +418,7 @@ HRESULT WINAPI UiaNavigate(HUIANODE huianode, enum NavigateDirection dir, struct struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, BSTR *tree_struct); HRESULT WINAPI UiaFind(HUIANODE huianode, struct UiaFindParams *find_params, struct UiaCacheRequest *cache_req, SAFEARRAY **out_req, SAFEARRAY **out_offsets, SAFEARRAY **out_tree_structs); +HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent); #ifdef __cplusplus }
1
0
0
0
Michael Stefaniuc : dmstyle: Move a struct declaration to the file it is used in.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: b58c88d14dd1943a265ead68cb83e8dd1dd9a112 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b58c88d14dd1943a265ead68cb83e8…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Nov 30 00:08:26 2022 +0100 dmstyle: Move a struct declaration to the file it is used in. And get rid of the typedef for that struct. --- dlls/dmstyle/dmstyle_private.h | 7 ------- dlls/dmstyle/styletrack.c | 32 +++++++++++++++++--------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/dlls/dmstyle/dmstyle_private.h b/dlls/dmstyle/dmstyle_private.h index fbe635e4388..0d7ede7f00d 100644 --- a/dlls/dmstyle/dmstyle_private.h +++ b/dlls/dmstyle/dmstyle_private.h @@ -55,13 +55,6 @@ extern HRESULT create_dmstyletrack(REFIID riid, void **ret_iface) DECLSPEC_HIDDE /***************************************************************************** * Auxiliary definitions */ -typedef struct _DMUS_PRIVATE_STYLE_ITEM { - struct list entry; /* for listing elements */ - DWORD timestamp; - IDirectMusicStyle8* pObject; -} DMUS_PRIVATE_STYLE_ITEM, *LPDMUS_PRIVATE_STYLE_ITEM; - - typedef struct _DMUS_PRIVATE_COMMAND { struct list entry; /* for listing elements */ DMUS_IO_COMMAND pCommand; diff --git a/dlls/dmstyle/styletrack.c b/dlls/dmstyle/styletrack.c index 822072bdb27..83b03807ddf 100644 --- a/dlls/dmstyle/styletrack.c +++ b/dlls/dmstyle/styletrack.c @@ -27,6 +27,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmstyle); /***************************************************************************** * IDirectMusicStyleTrack implementation */ +struct style_item { + struct list entry; + DWORD timestamp; + IDirectMusicStyle8 *dmstyle; +}; + typedef struct IDirectMusicStyleTrack { IDirectMusicTrack8 IDirectMusicTrack8_iface; struct dmobject dmobj; /* IPersistStream only */ @@ -81,14 +87,11 @@ static ULONG WINAPI style_track_Release(IDirectMusicTrack8 *iface) TRACE("(%p) ref=%ld\n", This, ref); if (!ref) { - struct list *cursor, *cursor2; - DMUS_PRIVATE_STYLE_ITEM *item; - - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->Items) { - item = LIST_ENTRY(cursor, DMUS_PRIVATE_STYLE_ITEM, entry); - list_remove(cursor); + struct style_item *item, *item2; - IDirectMusicStyle8_Release(item->pObject); + LIST_FOR_EACH_ENTRY_SAFE(item, item2, &This->Items, struct style_item, entry) { + list_remove(&item->entry); + IDirectMusicStyle8_Release(item->dmstyle); free(item); } @@ -135,7 +138,7 @@ static HRESULT WINAPI style_track_GetParam(IDirectMusicTrack8 *iface, REFGUID ty MUSIC_TIME time, MUSIC_TIME *next, void *param) { IDirectMusicStyleTrack *This = impl_from_IDirectMusicTrack8(iface); - struct list *item = NULL; + struct style_item *item; TRACE("(%p, %s, %ld, %p, %p):\n", This, debugstr_dmguid(type), time, next, param); @@ -143,10 +146,9 @@ static HRESULT WINAPI style_track_GetParam(IDirectMusicTrack8 *iface, REFGUID ty return E_POINTER; if (IsEqualGUID(&GUID_IDirectMusicStyle, type)) { - LIST_FOR_EACH (item, &This->Items) { - DMUS_PRIVATE_STYLE_ITEM *style = LIST_ENTRY(item, DMUS_PRIVATE_STYLE_ITEM, entry); - IDirectMusicStyle8_AddRef(style->pObject); - *((IDirectMusicStyle8 **)param) = style->pObject; + LIST_FOR_EACH_ENTRY(item, &This->Items, struct style_item, entry) { + IDirectMusicStyle8_AddRef(item->dmstyle); + *((IDirectMusicStyle8 **)param) = item->dmstyle; return S_OK; } @@ -304,7 +306,7 @@ static HRESULT parse_style_ref(IDirectMusicStyleTrack *This, IStream *stream, co { struct chunk_entry chunk = {.parent = strf}; IDirectMusicObject *dmobj; - DMUS_PRIVATE_STYLE_ITEM *item; + struct style_item *item; HRESULT hr; /* First chunk is a timestamp */ @@ -326,7 +328,7 @@ static HRESULT parse_style_ref(IDirectMusicStyleTrack *This, IStream *stream, co WARN("Failed to load reference: %#lx\n", hr); goto error; } - hr = IDirectMusicObject_QueryInterface(dmobj, &IID_IDirectMusicStyle8, (void **)&item->pObject); + hr = IDirectMusicObject_QueryInterface(dmobj, &IID_IDirectMusicStyle8, (void **)&item->dmstyle); if (FAILED(hr)) { WARN("Reference not an IDirectMusicStyle8\n"); IDirectMusicObject_Release(dmobj); @@ -334,7 +336,7 @@ static HRESULT parse_style_ref(IDirectMusicStyleTrack *This, IStream *stream, co } list_add_tail(&This->Items, &item->entry); - TRACE("Found reference to style %p with timestamp %lu\n", item->pObject, item->timestamp); + TRACE("Found reference to style %p with timestamp %lu\n", item->dmstyle, item->timestamp); return S_OK;
1
0
0
0
← Newer
1
2
3
4
5
6
...
118
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200