driver: address Code Analysis warning

In this case, we're referencing objects by handle for closing user space
handles. Should be UserMode, not Irp->RequestorMode as C28126 suggests.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2021-10-17 13:25:14 +02:00
parent c7b20de96c
commit c20b834674

View File

@ -925,6 +925,7 @@ TunDispatchPnp(DEVICE_OBJECT *DeviceObject, IRP *Irp)
continue;
KeStackAttachProcess(Process, &ApcState);
if (!VerifierFlags)
#pragma warning(suppress : 28126)
Status = ObReferenceObjectByHandle(
HandleTable->Handles[Index].HandleValue, 0, NULL, UserMode, &Object, &HandleInfo);
if (NT_SUCCESS(Status))