mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[TCPIP] Don't assume the TEB is always defined
Fixes the crash in kmtest:TcpIpConnect test.
This commit is contained in:
parent
ccb8c906b0
commit
89a4cde14a
1 changed files with 7 additions and 1 deletions
|
@ -396,6 +396,7 @@ NTSTATUS FileOpenAddress(
|
|||
PVOID Options)
|
||||
{
|
||||
PADDRESS_FILE AddrFile;
|
||||
PTEB Teb;
|
||||
|
||||
TI_DbgPrint(MID_TRACE, ("Called (Proto %d).\n", Protocol));
|
||||
|
||||
|
@ -429,7 +430,12 @@ NTSTATUS FileOpenAddress(
|
|||
AddrFile->BCast = 1;
|
||||
AddrFile->HeaderIncl = 1;
|
||||
AddrFile->ProcessId = PsGetCurrentProcessId();
|
||||
AddrFile->SubProcessTag = ((PTEB)PsGetCurrentThreadTeb())->SubProcessTag;
|
||||
|
||||
Teb = PsGetCurrentThreadTeb();
|
||||
if (Teb != NULL) {
|
||||
AddrFile->SubProcessTag = Teb->SubProcessTag;
|
||||
}
|
||||
|
||||
KeQuerySystemTime(&AddrFile->CreationTime);
|
||||
|
||||
/* Make sure address is a local unicast address or 0 */
|
||||
|
|
Loading…
Reference in a new issue