Commit aa3e772a authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Mark the Wow64 TLS slots as reserved.

parent 881defc4
......@@ -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();
......
......@@ -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
/***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment