win: Fix TEB.TlsSlots offset

The Crashpad representation of the TEB struct had an incorrect PVOID
reserved of len 397. This should be 402 once we calculate that the other
members occupy 40/80 (32 vs 64) bytes.

Wine has a well documented copy
4df0162caf/include/winternl.h (L309)
that shows the offsets TlsSlots should be at. This patch makes that
change. TlsSlots is now at offset 3600 on 32-bit and offset 5248 on
64-bit.

Change-Id: I4ea4c44b1e49d3ea02d433f386f164703a373dab
Reviewed-on: https://chromium-review.googlesource.com/717040
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Nikhil Marathe 2017-10-13 10:57:31 -07:00 committed by Commit Bot
parent c958c16491
commit dabe8477da

View File

@ -319,12 +319,12 @@ struct CLIENT_ID {
template <class Traits>
struct TEB {
NT_TIB<Traits> NtTib;
typename Traits::Pointer ProcessEnvironmentBlock;
typename Traits::Pointer EnvironmentPointer;
CLIENT_ID<Traits> ClientId;
// Not identical to Reserved2 in winternl's _TEB because we define ClientId.
typename Traits::Pointer RemainderOfReserved2[397];
typename Traits::Pointer ActiveRpcHandle;
typename Traits::Pointer ThreadLocalStoragePointer;
typename Traits::Pointer ProcessEnvironmentBlock;
typename Traits::Pointer RemainderOfReserved2[399];
BYTE Reserved3[1952];
typename Traits::Pointer TlsSlots[64];
BYTE Reserved4[8];