aboutsummaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-09-29 15:39:17 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2021-09-29 15:45:45 +0000
commit826f9d1a4c669e5b57fecfc35cd1cf466766d8b4 (patch)
treebce78b594cbebac77210d4e37a074980399ddd03 /driver
parentdriver: socket: fix IRQL annotations (diff)
downloadwireguard-nt-826f9d1a4c669e5b57fecfc35cd1cf466766d8b4.tar.xz
wireguard-nt-826f9d1a4c669e5b57fecfc35cd1cf466766d8b4.zip
driver: ioctl: remove old pid check
Since this is now a kernel thread, it doesn't make sense to compare to the current PID. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'driver')
-rw-r--r--driver/ioctl.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/driver/ioctl.c b/driver/ioctl.c
index 2f74c7e..7ecc039 100644
--- a/driver/ioctl.c
+++ b/driver/ioctl.c
@@ -630,16 +630,12 @@ ForceCloseHandlesAfterDelay(PVOID StartContext)
if (!NT_SUCCESS(Status) || !HandleTable)
goto cleanup;
- HANDLE CurrentProcessId = PsGetCurrentProcessId();
for (ULONG_PTR Index = 0; Index < HandleTable->NumberOfHandles; ++Index)
{
FILE_OBJECT *FileObject = HandleTable->Handles[Index].Object;
if (!FileObject || FileObject->Type != 5 || FileObject->DeviceObject != DeviceObject)
continue;
- HANDLE ProcessId = HandleTable->Handles[Index].UniqueProcessId;
- if (ProcessId == CurrentProcessId)
- continue;
- Status = PsLookupProcessByProcessId(ProcessId, &Process);
+ Status = PsLookupProcessByProcessId(HandleTable->Handles[Index].UniqueProcessId, &Process);
if (!NT_SUCCESS(Status))
continue;
KeStackAttachProcess(Process, &ApcState);