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
June
May
April
March
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 -----
June 2025
May 2025
April 2025
March 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
Matteo Bruni : d3dx9/tests: Test D3DXAssembleShader() with both terminated and not terminated include data.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 0c7090a1daa255f60d6b0b17f6df5f64dd4021a7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c7090a1daa255f60d6b0b17…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Mar 30 19:37:21 2022 +0200 d3dx9/tests: Test D3DXAssembleShader() with both terminated and not terminated include data. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/tests/asm.c | 176 ++++++++++++++++++++++++++-------------------- 1 file changed, 101 insertions(+), 75 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0c7090a1daa255f60d6b…
1
0
0
0
Rémi Bernon : ntdll: Use next_block helper in heap_reallocate.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 90f766fa760433c9e7762f2c4e68fe6eb2e95f5e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=90f766fa760433c9e7762f2c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun May 1 20:23:27 2022 +0200 ntdll: Use next_block helper in heap_reallocate. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/heap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 0142328e978..374b4e1f209 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1683,7 +1683,7 @@ static NTSTATUS heap_reallocate( HEAP *heap, ULONG flags, void *ptr, SIZE_T size oldActualSize = (pArena->size & ARENA_SIZE_MASK) - pArena->unused_bytes; if (rounded_size > oldBlockSize) { - char *pNext = (char *)(pArena + 1) + oldBlockSize; + struct block *next; if (rounded_size >= HEAP_MIN_LARGE_BLOCK_SIZE && (flags & HEAP_GROWABLE)) { @@ -1694,14 +1694,14 @@ static NTSTATUS heap_reallocate( HEAP *heap, ULONG flags, void *ptr, SIZE_T size HEAP_MakeInUseBlockFree( subheap, pArena ); return STATUS_SUCCESS; } - if ((pNext < (char *)subheap->base + subheap->size) && - (*(DWORD *)pNext & ARENA_FLAG_FREE) && - (oldBlockSize + (*(DWORD *)pNext & ARENA_SIZE_MASK) + sizeof(ARENA_FREE) >= rounded_size)) + + if ((next = next_block( subheap, pArena )) && (block_get_flags( next ) & ARENA_FLAG_FREE) && + (oldBlockSize + block_get_size( next ) >= rounded_size)) { /* The next block is free and large enough */ - ARENA_FREE *pFree = (ARENA_FREE *)pNext; - list_remove( &pFree->entry ); - pArena->size += (pFree->size & ARENA_SIZE_MASK) + sizeof(*pFree); + struct entry *entry = (struct entry *)next; + list_remove( &entry->entry ); + pArena->size += block_get_size( next ); if (!HEAP_Commit( subheap, pArena, rounded_size )) return STATUS_NO_MEMORY; notify_realloc( pArena + 1, oldActualSize, size ); HEAP_ShrinkBlock( subheap, pArena, rounded_size );
1
0
0
0
Rémi Bernon : ntdll: Check that ptr is in committed blocks in find_subheap.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 39697a2c007026356f143379c2fe875722e46f7f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=39697a2c007026356f143379…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed May 4 21:12:15 2022 +0200 ntdll: Check that ptr is in committed blocks in find_subheap. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/heap.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 5174fe99fc3..0142328e978 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -614,15 +614,17 @@ static inline void HEAP_InsertFreeBlock( HEAP *heap, ARENA_FREE *pArena, BOOL la } -static SUBHEAP *find_subheap( const HEAP *heap, const void *ptr ) +static SUBHEAP *find_subheap( const HEAP *heap, const struct block *block, BOOL heap_walk ) { SUBHEAP *subheap; LIST_FOR_EACH_ENTRY( subheap, &heap->subheap_list, SUBHEAP, entry ) { + SIZE_T blocks_size = (char *)last_block( subheap ) - (char *)first_block( subheap ); if (!check_subheap( subheap )) return NULL; - if (contains( subheap_base( subheap ), subheap_size( subheap ), ptr, sizeof(struct block) )) - return subheap; + if (contains( first_block( subheap ), blocks_size, block, sizeof(*block) )) return subheap; + /* outside of blocks region, possible corruption or heap_walk */ + if (contains( subheap_base( subheap ), subheap_size( subheap ), block, 0 )) return heap_walk ? subheap : NULL; } return NULL; @@ -760,7 +762,7 @@ static void HEAP_MakeInUseBlockFree( SUBHEAP *subheap, ARENA_INUSE *pArena ) mark_block_free( pArena + 1, pArena->size & ARENA_SIZE_MASK, heap->flags ); if (!prev) return; pArena = prev; - subheap = find_subheap( heap, pArena ); + subheap = find_subheap( heap, pArena, FALSE ); } /* Check if we can merge with previous block */ @@ -1097,7 +1099,7 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T size, sizeof(ARENA_FREE) - sizeof(ARENA_INUSE); if (arena_size >= size) { - subheap = find_subheap( heap, pArena ); + subheap = find_subheap( heap, (struct block *)pArena, FALSE ); if (!HEAP_Commit( subheap, (ARENA_INUSE *)pArena, size )) return NULL; *ppSubHeap = subheap; return pArena; @@ -1145,9 +1147,7 @@ static BOOL is_valid_free_block( const HEAP *heap, const struct block *block ) const SUBHEAP *subheap; unsigned int i; - if (!(subheap = find_subheap( heap, block ))) return FALSE; - if ((char *)block >= (char *)subheap->base + subheap->headerSize) return TRUE; - if (subheap != &heap->subheap) return FALSE; + if ((subheap = find_subheap( heap, block, FALSE ))) return TRUE; for (i = 0; i < HEAP_NB_FREE_LISTS; i++) if (block == (struct block *)&heap->freeList[i].arena) return TRUE; return FALSE; } @@ -1155,7 +1155,6 @@ static BOOL is_valid_free_block( const HEAP *heap, const struct block *block ) static BOOL validate_free_block( const SUBHEAP *subheap, const struct block *block ) { const char *err = NULL, *base = subheap_base( subheap ), *commit_end = subheap_commit_end( subheap ); - SIZE_T blocks_size = (char *)last_block( subheap ) - (char *)first_block( subheap ); const struct entry *entry = (struct entry *)block; const struct block *prev, *next; HEAP *heap = subheap->heap; @@ -1163,8 +1162,6 @@ static BOOL validate_free_block( const SUBHEAP *subheap, const struct block *blo if ((ULONG_PTR)(block + 1) % ALIGNMENT) err = "invalid block alignment"; - else if (!contains( first_block( subheap ), blocks_size, block, sizeof(*block) )) - err = "invalid block pointer"; else if (block_get_type( block ) != ARENA_FREE_MAGIC) err = "invalid block header"; else if (!(block_get_flags( block ) & ARENA_FLAG_FREE) || (block_get_flags( block ) & ARENA_FLAG_PREV_FREE)) @@ -1211,7 +1208,6 @@ static BOOL validate_free_block( const SUBHEAP *subheap, const struct block *blo static BOOL validate_used_block( const SUBHEAP *subheap, const struct block *block ) { const char *err = NULL, *base = subheap_base( subheap ), *commit_end = subheap_commit_end( subheap ); - SIZE_T blocks_size = (char *)last_block( subheap ) - (char *)first_block( subheap ); const HEAP *heap = subheap->heap; DWORD flags = heap->flags; const struct block *next; @@ -1219,8 +1215,6 @@ static BOOL validate_used_block( const SUBHEAP *subheap, const struct block *blo if ((ULONG_PTR)(block + 1) % ALIGNMENT) err = "invalid block alignment"; - else if (!contains( first_block( subheap ), blocks_size, block, sizeof(*block) )) - err = "invalid block pointer"; else if (block_get_type( block ) != ARENA_INUSE_MAGIC && block_get_type( block ) != ARENA_PENDING_MAGIC) err = "invalid block header"; else if (block_get_flags( block ) & ARENA_FLAG_FREE) @@ -1272,12 +1266,11 @@ static BOOL heap_validate_ptr( const HEAP *heap, const void *ptr, SUBHEAP **subh const struct block *arena = (struct block *)ptr - 1; const ARENA_LARGE *large_arena; - if (!(*subheap = find_subheap( heap, arena )) || - ((const char *)arena < (char *)(*subheap)->base + (*subheap)->headerSize)) + if (!(*subheap = find_subheap( heap, arena, FALSE ))) { if (!(large_arena = find_large_block( heap, ptr ))) { - if (WARN_ON(heap)) WARN("heap %p, ptr %p is not inside heap\n", heap, ptr ); + if (WARN_ON(heap)) WARN("heap %p, ptr %p: block region not found\n", heap, ptr ); return FALSE; } @@ -1325,7 +1318,6 @@ static inline struct block *unsafe_block_from_ptr( const HEAP *heap, const void { struct block *block = (struct block *)ptr - 1; const char *err = NULL, *base, *commit_end; - SIZE_T blocks_size; if (heap->flags & HEAP_VALIDATE) { @@ -1333,11 +1325,10 @@ static inline struct block *unsafe_block_from_ptr( const HEAP *heap, const void return block; } - if ((*subheap = find_subheap( heap, block ))) + if ((*subheap = find_subheap( heap, block, FALSE ))) { base = subheap_base( *subheap ); commit_end = subheap_commit_end( *subheap ); - blocks_size = (char *)last_block( *subheap ) - (char *)first_block( *subheap ); } if (!*subheap) @@ -1347,8 +1338,6 @@ static inline struct block *unsafe_block_from_ptr( const HEAP *heap, const void } else if ((ULONG_PTR)ptr % ALIGNMENT) err = "invalid ptr alignment"; - else if (!contains( first_block( *subheap ), blocks_size, block, sizeof(*block) )) - err = "invalid block pointer"; else if (block_get_type( block ) == ARENA_PENDING_MAGIC || (block_get_flags( block ) & ARENA_FLAG_FREE)) err = "already freed block"; else if (block_get_type( block ) != ARENA_INUSE_MAGIC) @@ -1975,7 +1964,7 @@ static NTSTATUS heap_walk( const HEAP *heap, struct rtl_heap_entry *entry ) if ((large = find_large_block( heap, entry->lpData ))) next = &large->entry; - else if ((subheap = find_subheap( heap, entry->lpData ))) + else if ((subheap = find_subheap( heap, entry->lpData, TRUE ))) { if (!(status = heap_walk_blocks( heap, subheap, entry ))) return STATUS_SUCCESS; else if (status != STATUS_NO_MORE_ENTRIES) return status;
1
0
0
0
Rémi Bernon : ntdll: Use next_block helper to iterate in heap_set_debug_flags.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 8fc51f3c2188239ae66935472ef804db525310fe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8fc51f3c2188239ae6693547…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed May 4 20:39:00 2022 +0200 ntdll: Use next_block helper to iterate in heap_set_debug_flags. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/heap.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index b11218bc7a6..5174fe99fc3 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -1405,37 +1405,28 @@ static void heap_set_debug_flags( HANDLE handle ) if (flags & (HEAP_FREE_CHECKING_ENABLED | HEAP_TAIL_CHECKING_ENABLED)) /* fix existing blocks */ { - SUBHEAP *subheap; + struct block *block; ARENA_LARGE *large; + SUBHEAP *subheap; LIST_FOR_EACH_ENTRY( subheap, &heap->subheap_list, SUBHEAP, entry ) { - char *ptr = (char *)subheap->base + subheap->headerSize; - char *end = (char *)subheap->base + subheap->commitSize; + const char *commit_end = subheap_commit_end( subheap ); if (!check_subheap( subheap )) break; - while (ptr < end) + for (block = first_block( subheap ); block; block = next_block( subheap, block )) { - ARENA_INUSE *arena = (ARENA_INUSE *)ptr; - SIZE_T size = arena->size & ARENA_SIZE_MASK; - if (arena->size & ARENA_FLAG_FREE) + if (block_get_flags( block ) & ARENA_FLAG_FREE) { - SIZE_T count = size; - - ptr += sizeof(ARENA_FREE) + size; - if (ptr >= end) count = end - (char *)((ARENA_FREE *)arena + 1); - else count -= sizeof(ARENA_FREE *); - mark_block_free( (ARENA_FREE *)arena + 1, count, flags ); + char *data = (char *)block + block_get_overhead( block ), *end = (char *)block + block_get_size( block ); + if (end >= commit_end) mark_block_free( data, commit_end - data, flags ); + else mark_block_free( data, end - sizeof(struct block *) - data, flags ); } else { - if (arena->magic == ARENA_PENDING_MAGIC) - mark_block_free( arena + 1, size, flags ); - else - mark_block_tail( (char *)(arena + 1) + size - arena->unused_bytes, - arena->unused_bytes, flags ); - ptr += sizeof(ARENA_INUSE) + size; + if (block_get_type( block ) == ARENA_PENDING_MAGIC) mark_block_free( block + 1, block_get_size( block ) - sizeof(*block), flags ); + else mark_block_tail( (char *)block + block_get_size( block ) - block->unused_bytes, block->unused_bytes, flags ); } } }
1
0
0
0
Rémi Bernon : ntdll: Use block helpers to iterate blocks in heap_validate.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 3001a2ff3195af788ce0fa13d2fa96a830ea072a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3001a2ff3195af788ce0fa13…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed May 4 20:38:18 2022 +0200 ntdll: Use block helpers to iterate blocks in heap_validate. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/heap.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 85964d04a59..b11218bc7a6 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -286,7 +286,7 @@ static inline BOOL check_subheap( const SUBHEAP *subheap ) return contains( base, subheap->size, base + subheap->headerSize, subheap->commitSize - subheap->headerSize ); } -static BOOL heap_validate( HEAP *heap ); +static BOOL heap_validate( const HEAP *heap ); /* mark a block of memory as free for debugging purposes */ static inline void mark_block_free( void *ptr, SIZE_T size, DWORD flags ) @@ -1287,15 +1287,14 @@ static BOOL heap_validate_ptr( const HEAP *heap, const void *ptr, SUBHEAP **subh return validate_used_block( *subheap, arena ); } -static BOOL heap_validate( HEAP *heap ) +static BOOL heap_validate( const HEAP *heap ) { const ARENA_LARGE *large_arena; + const struct block *block; const SUBHEAP *subheap; LIST_FOR_EACH_ENTRY( subheap, &heap->subheap_list, SUBHEAP, entry ) { - char *ptr = (char *)subheap->base + subheap->headerSize; - if (!check_subheap( subheap )) { ERR( "heap %p, subheap %p corrupted sizes\n", heap, subheap ); @@ -1303,17 +1302,15 @@ static BOOL heap_validate( HEAP *heap ) return FALSE; } - while (ptr < (char *)subheap->base + subheap->size) + for (block = first_block( subheap ); block; block = next_block( subheap, block )) { - if (*(DWORD *)ptr & ARENA_FLAG_FREE) + if (block_get_flags( block ) & ARENA_FLAG_FREE) { - if (!validate_free_block( subheap, (ARENA_INUSE *)ptr )) return FALSE; - ptr += sizeof(ARENA_FREE) + (*(DWORD *)ptr & ARENA_SIZE_MASK); + if (!validate_free_block( subheap, block )) return FALSE; } else { - if (!validate_used_block( subheap, (ARENA_INUSE *)ptr )) return FALSE; - ptr += sizeof(ARENA_INUSE) + (*(DWORD *)ptr & ARENA_SIZE_MASK); + if (!validate_used_block( subheap, block )) return FALSE; } } }
1
0
0
0
Rémi Bernon : ntdll: Remove unused QUIET/NOISY constants and parameters.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 06681774af6de0ee1c546f779c70149ec13a625a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=06681774af6de0ee1c546f77…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed May 4 21:12:00 2022 +0200 ntdll: Remove unused QUIET/NOISY constants and parameters. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/heap.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index a23ab1a4c95..85964d04a59 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -127,9 +127,6 @@ C_ASSERT( sizeof(ARENA_LARGE) % LARGE_ALIGNMENT == 0 ); #define ROUND_SIZE(size) ((((size) + ALIGNMENT - 1) & ~(ALIGNMENT-1)) + ARENA_OFFSET) -#define QUIET 1 /* Suppress messages */ -#define NOISY 0 /* Report all errors */ - /* minimum data size (without arenas) of an allocated block */ /* make sure that it's larger than a free list entry */ #define HEAP_MIN_DATA_SIZE ROUND_SIZE(2 * sizeof(struct list)) @@ -289,7 +286,7 @@ static inline BOOL check_subheap( const SUBHEAP *subheap ) return contains( base, subheap->size, base + subheap->headerSize, subheap->commitSize - subheap->headerSize ); } -static BOOL heap_validate( HEAP *heap, BOOL quiet ); +static BOOL heap_validate( HEAP *heap ); /* mark a block of memory as free for debugging purposes */ static inline void mark_block_free( void *ptr, SIZE_T size, DWORD flags ) @@ -579,7 +576,7 @@ static HEAP *HEAP_GetPtr( if (heapPtr->flags & HEAP_VALIDATE_ALL) { heap_lock( heapPtr, 0 ); - valid = heap_validate( heapPtr, NOISY ); + valid = heap_validate( heapPtr ); heap_unlock( heapPtr, 0 ); if (!valid && TRACE_ON(heap)) @@ -1290,7 +1287,7 @@ static BOOL heap_validate_ptr( const HEAP *heap, const void *ptr, SUBHEAP **subh return validate_used_block( *subheap, arena ); } -static BOOL heap_validate( HEAP *heap, BOOL quiet ) +static BOOL heap_validate( HEAP *heap ) { const ARENA_LARGE *large_arena; const SUBHEAP *subheap; @@ -1930,7 +1927,7 @@ BOOLEAN WINAPI RtlValidateHeap( HANDLE heap, ULONG flags, const void *ptr ) { heap_lock( heapPtr, flags ); if (ptr) ret = heap_validate_ptr( heapPtr, ptr, &subheap ); - else ret = heap_validate( heapPtr, QUIET ); + else ret = heap_validate( heapPtr ); heap_unlock( heapPtr, flags ); }
1
0
0
0
Jacek Caban : winemac: Directly use ntdll for registry access in copy_system_cursor_name.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: c883822d2bf22216aa9799b0d48baefa457e9137 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c883822d2bf22216aa9799b0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 17 00:12:44 2022 +0200 winemac: Directly use ntdll for registry access in copy_system_cursor_name. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/Makefile.in | 2 +- dlls/winemac.drv/macdrv.h | 1 + dlls/winemac.drv/macdrv_main.c | 2 +- dlls/winemac.drv/mouse.c | 16 ++++++++-------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/winemac.drv/Makefile.in b/dlls/winemac.drv/Makefile.in index da2e5eaf4c4..e345249aac7 100644 --- a/dlls/winemac.drv/Makefile.in +++ b/dlls/winemac.drv/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = winemac.drv -IMPORTS = uuid rpcrt4 user32 gdi32 advapi32 win32u +IMPORTS = uuid rpcrt4 user32 gdi32 win32u DELAYIMPORTS = ole32 shell32 imm32 EXTRALIBS = -framework AppKit -framework Carbon -framework Security -framework OpenGL -framework IOKit -framework CoreVideo -framework QuartzCore $(METAL_LIBS) diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 922a2df75cb..0a0c42aefd0 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -295,6 +295,7 @@ extern BOOL query_ime_char_rect(macdrv_query* query) DECLSPEC_HIDDEN; /* registry helpers */ +extern HKEY open_hkcu_key( const char *name ) DECLSPEC_HIDDEN; extern ULONG query_reg_value(HKEY hkey, const WCHAR *name, KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size) DECLSPEC_HIDDEN; extern HKEY reg_create_ascii_key(HKEY root, const char *name, DWORD options, diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index b168e12439c..5f61c9491b7 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -122,7 +122,7 @@ HKEY reg_open_key(HKEY root, const WCHAR *name, ULONG name_len) } -static HKEY open_hkcu_key(const char *name) +HKEY open_hkcu_key(const char *name) { WCHAR bufferW[256]; static HKEY hkcu; diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index 34d6febdefa..55bed52ae8e 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -195,17 +195,17 @@ CFStringRef copy_system_cursor_name(ICONINFOEXW *info) else sprintfW(p, idW, info->wResID); /* @@ Wine registry key: HKCU\Software\Wine\Mac Driver\Cursors */ - if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Mac Driver\\Cursors", &key)) + if (!(key = open_hkcu_key("Software\\Wine\\Mac Driver\\Cursors"))) { - WCHAR value[64]; - DWORD size, ret; + char buffer[2048]; + KEY_VALUE_PARTIAL_INFORMATION *info = (void *)buffer; + DWORD ret; - value[0] = 0; - size = sizeof(value); - ret = RegQueryValueExW(key, name, NULL, NULL, (BYTE *)value, &size); - RegCloseKey(key); - if (!ret) + ret = query_reg_value(key, name, info, sizeof(buffer)); + NtClose(key); + if (ret) { + const WCHAR *value = (const WCHAR *)info->Data; if (!value[0]) { TRACE("registry forces standard cursor for %s\n", debugstr_w(name));
1
0
0
0
Jacek Caban : winemac: Directly use ntdll for registry access in create_original_display_mode_descriptor.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 7f7f9fa22c5cbe629e79a54257d5bd21403e80db URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7f7f9fa22c5cbe629e79a542…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun May 15 20:27:37 2022 +0200 winemac: Directly use ntdll for registry access in create_original_display_mode_descriptor. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/display.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index dc294df65ff..c6b54c5fd82 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -349,9 +349,13 @@ fail: static BOOL read_dword(HKEY hkey, const char* name, DWORD* val) { - DWORD type, size = sizeof(*val); - if (RegQueryValueExA(hkey, name, 0, &type, (BYTE*)val, &size) || type != REG_DWORD || size != sizeof(*val)) + char buffer[offsetof(KEY_VALUE_PARTIAL_INFORMATION, Data[sizeof(*val)])]; + KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer; + WCHAR nameW[64]; + asciiz_to_unicode(nameW, name); + if (query_reg_value(hkey, nameW, value, sizeof(buffer)) != sizeof(*val) || value->Type != REG_DWORD) return FALSE; + *val = *(DWORD *)value->Data; return TRUE; } @@ -369,20 +373,22 @@ static void free_display_mode_descriptor(struct display_mode_descriptor* desc) static struct display_mode_descriptor* create_original_display_mode_descriptor(CGDirectDisplayID displayID) { - static const char display_key_format[] = "Software\\Wine\\Mac Driver\\Initial Display Mode\\Display 0x%08x"; + static const char display_key_format[] = + "\\Registry\\Machine\\Software\\Wine\\Mac Driver\\Initial Display Mode\\Display 0x%08x"; struct display_mode_descriptor* ret = NULL; struct display_mode_descriptor* desc; char display_key[sizeof(display_key_format) + 10]; + WCHAR nameW[ARRAYSIZE(display_key)]; + char buffer[4096]; + KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer; HKEY hkey; - DWORD type, size; DWORD refresh100; - WCHAR* pixel_encoding = NULL; init_original_display_mode(); snprintf(display_key, sizeof(display_key), display_key_format, CGDisplayUnitNumber(displayID)); /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode\Display 0xnnnnnnnn */ - if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, display_key, 0, KEY_READ, &hkey)) + if (!(hkey = reg_open_key(NULL, nameW, asciiz_to_unicode(nameW, display_key)))) return NULL; desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc)); @@ -405,22 +411,17 @@ static struct display_mode_descriptor* create_original_display_mode_descriptor(C desc->pixel_height = desc->height; } - size = 0; - if (RegQueryValueExW(hkey, pixelencodingW, 0, &type, NULL, &size) || type != REG_SZ) + if (!query_reg_value(hkey, pixelencodingW, value, sizeof(buffer)) || value->Type != REG_SZ) goto done; - size += sizeof(WCHAR); - pixel_encoding = HeapAlloc(GetProcessHeap(), 0, size); - if (RegQueryValueExW(hkey, pixelencodingW, 0, &type, (BYTE*)pixel_encoding, &size) || type != REG_SZ) - goto done; - desc->pixel_encoding = CFStringCreateWithCharacters(NULL, (const UniChar*)pixel_encoding, strlenW(pixel_encoding)); + desc->pixel_encoding = CFStringCreateWithCharacters(NULL, (const UniChar*)value->Data, + lstrlenW((const WCHAR *)value->Data)); ret = desc; done: if (!ret) free_display_mode_descriptor(desc); - HeapFree(GetProcessHeap(), 0, pixel_encoding); - RegCloseKey(hkey); + NtClose(hkey); return ret; }
1
0
0
0
Jacek Caban : winemac: Directly use ntdll for registry access in write_display_settings.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 85d4a9cd53e12703408a60e1b51d9283f1a3f08a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=85d4a9cd53e12703408a60e1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun May 15 19:47:39 2022 +0200 winemac: Directly use ntdll for registry access in write_display_settings. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/display.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index 7913c5ed7bc..dc294df65ff 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -229,6 +229,7 @@ static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID char display_key_name[19]; HKEY display_hkey; CGDisplayModeRef display_mode; + UNICODE_STRING str; DWORD val; CFStringRef pixel_encoding; size_t len; @@ -236,8 +237,7 @@ static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID snprintf(display_key_name, sizeof(display_key_name), "Display 0x%08x", CGDisplayUnitNumber(displayID)); /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode\Display 0xnnnnnnnn */ - if (RegCreateKeyExA(parent_hkey, display_key_name, 0, NULL, - REG_OPTION_VOLATILE, KEY_WRITE, NULL, &display_hkey, NULL)) + if (!(display_hkey = reg_create_ascii_key(parent_hkey, display_key_name, REG_OPTION_VOLATILE, NULL))) return FALSE; display_mode = CGDisplayCopyDisplayMode(displayID); @@ -245,26 +245,26 @@ static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID goto fail; val = CGDisplayModeGetWidth(display_mode); - if (RegSetValueExA(display_hkey, "Width", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + if (!set_setting_value(display_hkey, "Width", val)) goto fail; val = CGDisplayModeGetHeight(display_mode); - if (RegSetValueExA(display_hkey, "Height", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + if (!set_setting_value(display_hkey, "Height", val)) goto fail; val = CGDisplayModeGetRefreshRate(display_mode) * 100; - if (RegSetValueExA(display_hkey, "RefreshRateTimes100", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + if (!set_setting_value(display_hkey, "RefreshRateTimes100", val)) goto fail; val = CGDisplayModeGetIOFlags(display_mode); - if (RegSetValueExA(display_hkey, "IOFlags", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + if (!set_setting_value(display_hkey, "IOFlags", val)) goto fail; #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 if (&CGDisplayModeGetPixelWidth != NULL && &CGDisplayModeGetPixelHeight != NULL) { val = CGDisplayModeGetPixelWidth(display_mode); - if (RegSetValueExA(display_hkey, "PixelWidth", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + if (!set_setting_value(display_hkey, "PixelWidth", val)) goto fail; val = CGDisplayModeGetPixelHeight(display_mode); - if (RegSetValueExA(display_hkey, "PixelHeight", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + if (!set_setting_value(display_hkey, "PixelHeight", val)) goto fail; } #endif @@ -275,7 +275,8 @@ static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID CFStringGetCharacters(pixel_encoding, CFRangeMake(0, len), (UniChar*)buf); buf[len] = 0; CFRelease(pixel_encoding); - if (RegSetValueExW(display_hkey, pixelencodingW, 0, REG_SZ, (const BYTE*)buf, (len + 1) * sizeof(WCHAR))) + RtlInitUnicodeString(&str, pixelencodingW); + if (NtSetValueKey(display_hkey, &str, 0, REG_SZ, (const BYTE*)buf, (len + 1) * sizeof(WCHAR))) goto fail; ret = TRUE; @@ -283,9 +284,12 @@ static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID fail: HeapFree(GetProcessHeap(), 0, buf); if (display_mode) CGDisplayModeRelease(display_mode); - RegCloseKey(display_hkey); + NtClose(display_hkey); if (!ret) - RegDeleteKeyA(parent_hkey, display_key_name); + { + WCHAR nameW[64]; + reg_delete_tree(parent_hkey, nameW, asciiz_to_unicode(nameW, display_key_name) - sizeof(WCHAR)); + } return ret; }
1
0
0
0
Jacek Caban : winemac: Directly use ntdll for registry access in init_original_display_mode.
by Alexandre Julliard
17 May '22
17 May '22
Module: wine Branch: master Commit: 6045ad5bcf875627eee2fce09c5600e6dba86f86 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6045ad5bcf875627eee2fce0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun May 15 19:02:54 2022 +0200 winemac: Directly use ntdll for registry access in init_original_display_mode. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/display.c | 18 +++++----- dlls/winemac.drv/macdrv.h | 5 +++ dlls/winemac.drv/macdrv_main.c | 79 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 8 deletions(-) diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index 182d5f122a5..7913c5ed7bc 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -46,7 +46,8 @@ struct display_mode_descriptor BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmode, DWORD flags); -static const char initial_mode_key[] = "Initial Display Mode"; +static const WCHAR initial_mode_keyW[] = {'I','n','i','t','i','a','l',' ','D','i','s','p','l','a','y', + ' ','M','o','d','e'}; static const WCHAR pixelencodingW[] = {'P','i','x','e','l','E','n','c','o','d','i','n','g',0}; static CFArrayRef modes; @@ -301,13 +302,14 @@ static void init_original_display_mode(void) return; /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver */ - if (RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Mac Driver", 0, NULL, - 0, KEY_ALL_ACCESS, NULL, &mac_driver_hkey, NULL)) + mac_driver_hkey = reg_create_ascii_key(NULL, "\\Registry\\Machine\\Software\\Wine\\Mac Driver", + 0, NULL); + if (!mac_driver_hkey) return; /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode */ - if (RegCreateKeyExA(mac_driver_hkey, initial_mode_key, 0, NULL, - REG_OPTION_VOLATILE, KEY_WRITE, NULL, &parent_hkey, &disposition)) + if (!(parent_hkey = reg_create_key(mac_driver_hkey, initial_mode_keyW, sizeof(initial_mode_keyW), + REG_OPTION_VOLATILE, &disposition))) { parent_hkey = NULL; goto fail; @@ -332,10 +334,10 @@ done: fail: macdrv_free_displays(displays); - RegCloseKey(parent_hkey); + NtClose(parent_hkey); if (!success && parent_hkey) - RegDeleteTreeA(mac_driver_hkey, initial_mode_key); - RegCloseKey(mac_driver_hkey); + reg_delete_tree(mac_driver_hkey, initial_mode_keyW, sizeof(initial_mode_keyW)); + NtClose(mac_driver_hkey); if (success) inited_original_display_mode = TRUE; } diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index c216cfb994f..922a2df75cb 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -297,6 +297,11 @@ extern BOOL query_ime_char_rect(macdrv_query* query) DECLSPEC_HIDDEN; extern ULONG query_reg_value(HKEY hkey, const WCHAR *name, KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size) DECLSPEC_HIDDEN; +extern HKEY reg_create_ascii_key(HKEY root, const char *name, DWORD options, + DWORD *disposition) DECLSPEC_HIDDEN; +extern HKEY reg_create_key(HKEY root, const WCHAR *name, ULONG name_len, + DWORD options, DWORD *disposition) DECLSPEC_HIDDEN; +extern BOOL reg_delete_tree(HKEY parent, const WCHAR *name, ULONG name_len) DECLSPEC_HIDDEN; extern HKEY reg_open_key(HKEY root, const WCHAR *name, ULONG name_len) DECLSPEC_HIDDEN; /* string helpers */ diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index 134842bbbfb..b168e12439c 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -24,6 +24,8 @@ #include <Security/AuthSession.h> #include <IOKit/pwr_mgt/IOPMLib.h> +#include "ntstatus.h" +#define WIN32_NO_STATUS #include "macdrv.h" #include "winuser.h" #include "winreg.h" @@ -152,6 +154,83 @@ static HKEY open_hkcu_key(const char *name) } +/* wrapper for NtCreateKey that creates the key recursively if necessary */ +HKEY reg_create_key(HKEY root, const WCHAR *name, ULONG name_len, + DWORD options, DWORD *disposition) +{ + UNICODE_STRING nameW = { name_len, name_len, (WCHAR *)name }; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + HANDLE ret; + + attr.Length = sizeof(attr); + attr.RootDirectory = root; + attr.ObjectName = &nameW; + attr.Attributes = 0; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + status = NtCreateKey(&ret, MAXIMUM_ALLOWED, &attr, 0, NULL, options, disposition); + if (status == STATUS_OBJECT_NAME_NOT_FOUND) + { + static const WCHAR registry_rootW[] = { '\\','R','e','g','i','s','t','r','y','\\' }; + DWORD pos = 0, i = 0, len = name_len / sizeof(WCHAR); + + /* don't try to create registry root */ + if (!root && len > ARRAY_SIZE(registry_rootW) && + !memcmp(name, registry_rootW, sizeof(registry_rootW))) + i += ARRAY_SIZE(registry_rootW); + + while (i < len && name[i] != '\\') i++; + if (i == len) return 0; + for (;;) + { + unsigned int subkey_options = options; + if (i < len) subkey_options &= ~(REG_OPTION_CREATE_LINK | REG_OPTION_OPEN_LINK); + nameW.Buffer = (WCHAR *)name + pos; + nameW.Length = (i - pos) * sizeof(WCHAR); + status = NtCreateKey(&ret, MAXIMUM_ALLOWED, &attr, 0, NULL, subkey_options, disposition); + + if (attr.RootDirectory != root) NtClose(attr.RootDirectory); + if (!NT_SUCCESS(status)) return 0; + if (i == len) break; + attr.RootDirectory = ret; + while (i < len && name[i] == '\\') i++; + pos = i; + while (i < len && name[i] != '\\') i++; + } + } + return ret; +} + + +HKEY reg_create_ascii_key(HKEY root, const char *name, DWORD options, DWORD *disposition) +{ + WCHAR buf[256]; + return reg_create_key(root, buf, asciiz_to_unicode(buf, name) - sizeof(WCHAR), + options, disposition); +} + + +BOOL reg_delete_tree(HKEY parent, const WCHAR *name, ULONG name_len) +{ + char buffer[4096]; + KEY_NODE_INFORMATION *key_info = (KEY_NODE_INFORMATION *)buffer; + DWORD size; + HKEY key; + BOOL ret = TRUE; + + if (!(key = reg_open_key(parent, name, name_len))) return FALSE; + + while (ret && !NtEnumerateKey(key, 0, KeyNodeInformation, key_info, sizeof(buffer), &size)) + ret = reg_delete_tree(key, key_info->Name, key_info->NameLength); + + if (ret) ret = !NtDeleteKey(key); + NtClose(key); + return ret; +} + + ULONG query_reg_value(HKEY hkey, const WCHAR *name, KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size) { UNICODE_STRING str;
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
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