ntdll: Mark the Wow64 TLS slots as reserved.

This commit is contained in:
Alexandre Julliard 2023-02-24 11:51:35 +01:00
parent 881defc4b2
commit aa3e772abf
2 changed files with 3 additions and 1 deletions

View file

@ -4176,7 +4176,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
RtlInitializeBitMap( &tls_bitmap, peb->TlsBitmapBits, sizeof(peb->TlsBitmapBits) * 8 );
RtlInitializeBitMap( &tls_expansion_bitmap, peb->TlsExpansionBitmapBits,
sizeof(peb->TlsExpansionBitmapBits) * 8 );
RtlSetBits( peb->TlsBitmap, 0, 1 ); /* TLS index 0 is reserved and should be initialized to NULL. */
/* TLS index 0 is always reserved, and wow64 reserves extra TLS entries */
RtlSetBits( peb->TlsBitmap, 0, NtCurrentTeb()->WowTebOffset ? WOW64_TLS_MAX_NUMBER : 1 );
init_user_process_params();
load_global_options();

View file

@ -1084,6 +1084,7 @@ typedef struct _TEB64
#define WOW64_TLS_TEMPLIST 3
#define WOW64_TLS_USERCALLBACKDATA 5
#define WOW64_TLS_FILESYSREDIR 8
#define WOW64_TLS_MAX_NUMBER 19
/***********************************************************************