no, I missed that MR...
interesting indeed
1. I confirm that on Win10 when TLS directory has alignment requirement the returned ThreadLocalStoragePointer[] tls block is realigned from block returned by heap allocation 2. did some more tests and the actual (unaligned pointer) is stored just below the tls slot 3. successfully rerun tests on native from 6549 adapted with
``` diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 3d6e195e23c..f04ac7f264f 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -1710,7 +1710,7 @@ static void test_tls_links(void) NTSTATUS status; ULONG i, count; HANDLE thread; - SIZE_T size; + SIZE_T size, size2; void **ptr;
ok(!!teb->ThreadLocalStoragePointer, "got NULL.\n"); @@ -1743,6 +1743,9 @@ static void test_tls_links(void) if (!ptr[i]) continue; size = HeapSize(GetProcessHeap(), 0, (void **)ptr[i] - 2); ok(size && size < 100000, "got %Iu.\n", size); + size2 = HeapSize(GetProcessHeap(), 0, ((void **)ptr[i])[-1]); + ok(size2 && size2 < 100000, "got %Iu.\n", size2); + ok(size == size2, "mismatch %Ix %Ix\n", size, size2); }
ptr = thread_teb->ThreadLocalStoragePointer; ```
so it looks like tests from 6549 are based on a peculiar alignment option of TLS dir and should be adapted accordingly
since the two MR clearly overlap (yet complement each other), how to you want to proceed? shall we merge them into a single one ?
or order them? (anyway I update 7251 to store properly unaligned pointer)