[0.4.14][KERNEL32][TCPIP] A big squashed fix for CORE-16757 CORE-17596 CORE-17647 CORE-6473 (#3170)

The interesting kernel32 part is a port of
0.4.15-dev-2069-g fd8080b094
CORE-16757 'Task Manager failed to show process's priority'
which I actually wanted to improve for 0.4.14.

But if we took that on its own, then it would unhide
CORE-17596 'Google Earth 7.1.8 regressed AGAIN by the same work'
That's why we take with us:
0.4.15-dev-2766-g 27fcfe66a2 (is also part of CORE-6473, I left the 2nd commit out that added an assert in NTOSKRNL)

Small hack: this backport required me to define _Unreferenced_parameter_ myself in tcp.c
stolen from newer sdk/include/psdk/specstrings.h. I didn't want to port back that entire file as well.

In combination those two fixes allow both 'Google Earth and to change process priority' to be fixed within the same build.

But I felt a bit more safe then by taking
0.4.15-dev-2793-g 979b7d4d8e
with me as well, because I was too afraid, that I might otherwise introduce
CORE-17647 'BSOD 0xc2 BAD_POOL_CALLER induced by networking, triggered by using KeePass 2.23'
although I could not trigger that in practice when leaving that third commit out as an experiment.

And since it was a safe no-brainer-fix, I couldn't resist to also pick
0.4.15-dev-764-g 4aeb45ce0c (#3170)
This commit is contained in:
Joachim Henze 2021-11-20 05:09:54 +01:00
parent 5917fa575b
commit e7cfa907e9
16 changed files with 470 additions and 483 deletions

View file

@ -215,7 +215,7 @@ ReassembleDatagram(
RtlCopyMemory(&IPPacket->DstAddr, &IPDR->DstAddr, sizeof(IP_ADDRESS));
/* Allocate space for full IP datagram */
IPPacket->Header = ExAllocatePoolWithTag(PagedPool, IPPacket->TotalSize, PACKET_BUFFER_TAG);
IPPacket->Header = ExAllocatePoolWithTag(NonPagedPool, IPPacket->TotalSize, PACKET_BUFFER_TAG);
if (!IPPacket->Header) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
(*IPPacket->Free)(IPPacket);
@ -303,7 +303,7 @@ VOID ProcessFragment(
TI_DbgPrint(DEBUG_IP, ("Continueing assembly.\n"));
/* We have a reassembly structure */
TcpipAcquireSpinLock(&IPDR->Lock, &OldIrql);
/* Reset the timeout since we received a fragment */
IPDR->TimeoutCount = 0;
} else {
@ -454,7 +454,7 @@ VOID ProcessFragment(
Assemble the datagram and pass it to an upper layer protocol */
TI_DbgPrint(DEBUG_IP, ("Complete datagram received.\n"));
RemoveIPDR(IPDR);
TcpipReleaseSpinLock(&IPDR->Lock, OldIrql);
@ -539,7 +539,7 @@ VOID IPDatagramReassemblyTimeout(
TcpipReleaseSpinLockFromDpcLevel(&CurrentIPDR->Lock);
RemoveEntryList(CurrentEntry);
FreeIPDR(CurrentIPDR);
}
}
else
{
ASSERT(CurrentIPDR->TimeoutCount < MAX_TIMEOUT_COUNT);
@ -562,9 +562,9 @@ VOID IPv4Receive(PIP_INTERFACE IF, PIP_PACKET IPPacket)
{
UCHAR FirstByte;
ULONG BytesCopied;
TI_DbgPrint(DEBUG_IP, ("Received IPv4 datagram.\n"));
/* Read in the first IP header byte for size information */
BytesCopied = CopyPacketToBuffer((PCHAR)&FirstByte,
IPPacket->NdisPacket,
@ -623,7 +623,7 @@ VOID IPv4Receive(PIP_INTERFACE IF, PIP_PACKET IPPacket)
AddrInitIPv4(&IPPacket->SrcAddr, ((PIPv4_HEADER)IPPacket->Header)->SrcAddr);
AddrInitIPv4(&IPPacket->DstAddr, ((PIPv4_HEADER)IPPacket->Header)->DstAddr);
TI_DbgPrint(MID_TRACE,("IPPacket->Position = %d\n",
IPPacket->Position));