Skip to content

Commit 18c4043

Browse files
committed
Update teb32.h to make sure the size is valid
this is for ensure `static_assert(sizeof(TEB_) == 0x1000, "");` The dwordFDC is split out for make sure the align of struct is 8 so the sizeof (TEB_) is valid
1 parent 41fb09a commit 18c4043

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

teb32.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,25 +1152,27 @@ struct TEB_
11521152
voidp TxnScopeExitCallback; //0x0FD0
11531153
voidp TxnScopeContext; //0x0FD4
11541154
DWORD LockCount; //0x0FD8
1155+
union
1156+
{
1157+
DWORD ProcessRundown; //0x0FDC (Vista)
1158+
DWORD SpareUlong0; //0x0FDC (Win7-Win8)
1159+
INT32 WowTebOffset; //0x0FDC (Win10+)
1160+
} dwordFDC;
1161+
11551162
union
11561163
{
11571164
struct
11581165
{
1159-
DWORD ProcessRundown; //0x0FDC (Vista)
11601166
QWORD LastSwitchTime; //0x0FE0 (Vista)
11611167
QWORD TotalSwitchOutTime; //0x0FE8 (Vista)
11621168
LARGE_INTEGER_ WaitReasonBitMap; //0x0FF0 (Vista)
1163-
} vista;
11641169

1165-
//end of Vista members
1170+
//end of Vista members
1171+
1172+
} vista;
11661173

11671174
struct
11681175
{
1169-
union
1170-
{
1171-
DWORD SpareUlong0; //0x0FDC (Win7-Win8)
1172-
INT32 WowTebOffset; //0x0FDC (Win10+)
1173-
} dwordFDC;
11741176
voidp ResourceRetValue; //0x0FE0 (Win7+)
11751177

11761178
//end of Windows 7 members (TEB_ shrunk after Vista)
@@ -1179,11 +1181,9 @@ struct TEB_
11791181

11801182
//end of Windows 8 members
11811183

1182-
} afterVista;
1183-
} dwordFDC;
1184-
1185-
//members that follow available on Windows 10 and up (currently unknown)
1186-
1187-
BYTE ReservedForWin10[0x18]; //0x0FE8
1184+
//members that follow available on Windows 10 and up (currently unknown)
11881185

1186+
BYTE ReservedForWin10[0x18]; //0x0FE8
1187+
} afterVista;
1188+
} dwordFE0;
11891189
}; //struct TEB_

0 commit comments

Comments
 (0)