IopPerfCompleteRequest
VOID __stdcall IopPerfCompleteRequest(_IRP *Irp, INT8 PriorityBoost){
bool v2;
char StackCount;
char CurrentLocation;
__int64 CompletionRoutine;
_IO_STACK_LOCATION *CurrentStackLocation;
_IRP *v9;
_DRIVER_OBJECT *DriverObject;
__int64 MajorFunction;
signed __int32 v12;
bool v13;
char Control;
__int128 v15;
__int128 v16;
_IRP *v17;
int v18;
__int64 v19[2];
int v20;
__int64 *v21;
int v22;
int v23;
_IRP **v24;
int v25;
int v26;
v2 = Irp->Type == 6;
v15 = 0i64;
v16 = 0i64;
if( v2 )
{
StackCount = Irp->StackCount;
CurrentLocation = Irp->CurrentLocation;
if( CurrentLocation <= (char)(StackCount + 1) )
{
CompletionRoutine = 0i64;
CurrentStackLocation = 0i64;
if( CurrentLocation <= StackCount )
{
CurrentStackLocation = Irp->Tail.CurrentStackLocation;
if( CurrentStackLocation->DeviceObject )
{
if( (IopPerfStatus & 2) != 0 && IopIrpHasExtensionType(Irp, 1ui64) && !IopIrpHasExtensionType(v9, 4ui64) )
{
IopProcessIoTracking(
*(_QWORD *)&KUSER_SHARED_DATA.SystemTime.LowPart - *((_QWORD *)Irp->Tail.IrpExtension + 5),
CurrentStackLocation->DeviceObject->DeviceType);
IopFreeIrpExtension(Irp, IopTimestampType, 1u);
}
DriverObject = CurrentStackLocation->DeviceObject->DriverObject;
if( DriverObject )
{
MajorFunction = CurrentStackLocation->MajorFunction;
if( (unsigned __int8)MajorFunction <= 0x1Bu )
CompletionRoutine = (__int64)DriverObject->MajorFunction[MajorFunction];
}
}
else
{
CompletionRoutine = (__int64)CurrentStackLocation->CompletionRoutine;
}
}
if( (IopPerfStatus & 1) != 0 )
{
v23 = 0;
v19[0] = CompletionRoutine;
v19[1] = (__int64)Irp;
v12 = _InterlockedIncrement((_DWORD *)&stru_140C452E0 + 202);
v20 = v12;
v21 = v19;
v22 = 20;
EtwTraceKernelEvent((__int64)&v21, 1u, 0x20000010u, 0x134u, 0x401802u);
if( !CurrentStackLocation )
{
LABEL_19:
IopfCompleteRequest(Irp, PriorityBoost);
v26 = 0;
v24 = &v17;
v17 = Irp;
v18 = v12;
v25 = 12;
EtwTraceKernelEvent((__int64)&v24, 1u, 0x20000010u, 0x135u, 0x401802u);
return;
}
v13 = Irp->IoStatus.Status < 0;
*((_QWORD *)&v15 + 1) = CurrentStackLocation->Context;
*(_QWORD *)&v15 = CurrentStackLocation;
DWORD2(v16) = v12;
BYTE12(v16) = CurrentStackLocation->Control;
Control = CurrentStackLocation->Control;
if( v13 )
{
if( Control < 0 )
goto LABEL_17;
}
else if( (Control & 0x40) != 0 )
{
goto LABEL_17;
}
if( !Irp->Cancel || (Control & 0x20) == 0 )
{
CurrentStackLocation->Control = Control | 0xC0;
goto LABEL_18;
}
LABEL_17:
*(_QWORD *)&v16 = CurrentStackLocation->CompletionRoutine;
*((_QWORD *)&v15 + 1) = CurrentStackLocation->Context;
LABEL_18:
CurrentStackLocation->CompletionRoutine = (int(__fastcall *)(_DEVICE_OBJECT *, _IRP *, void *))IopPerfCompletionRoutine;
CurrentStackLocation->Context = &v15;
goto LABEL_19;
}
}
}
IopfCompleteRequest(Irp, PriorityBoost);
}Referenced by:
IofCompleteRequest
IovCompleteRequest