IovpCompleteRequest2
VOID __stdcall IovpCompleteRequest2(_IRP *Irp, _IOFCOMPLETEREQUEST_STACKDATA *CompletionPacket){
_DWORD *v2;
_QWORD *v5;
__int64 CurrentLocation;
__int64 v7;
__int64 v8;
__int64 v9;
int v10;
unsigned int v11;
_BOOL4 v12;
_IO_STACK_LOCATION *v13;
int v14;
_QWORD *v15;
_QWORD *v16;
__int64 v17;
int v18;
__int64 v19;
int v20;
unsigned __int8 v21;
unsigned __int64 v22;
__int64 v23;
int v24;
__int64 v25;
bool v26;
UINT8 *v27;
__int64 v28;
unsigned int i;
__int64 v30;
__int64 v31;
UINT64 RequestFinalized;
INT64 OriginalStatus;
INT64 IrpStatus;
v2 = *(_DWORD **)CompletionPacket;
if( !*(_QWORD *)CompletionPacket )
return;
v5 = (_QWORD *)*((_QWORD *)CompletionPacket + 1);
*((_BYTE *)v5 + 16) = KeAcquireSpinLockRaiseToDpc(v5 + 1);
if( v5[31] )
ViWdIrpBeforeCompletionRoutine((_VF_WATCHDOG_IRP **)v5 + 31);
CurrentLocation = Irp->CurrentLocation;
v7 = 30 * CurrentLocation;
LODWORD(IrpStatus) = Irp->IoStatus.Status;
v8 = (__int64)&v2[30 * CurrentLocation - 10];
v9 = *(_QWORD *)(v8 + 8);
v10 = *(_DWORD *)(v9 + 4);
if( (v10 & 0x40000000) != 0 )
{
v11 = 0;
}
else
{
v11 = 1;
*(_DWORD *)(v9 + 4) = v10 | 0x40000000;
LOBYTE(CurrentLocation) = Irp->CurrentLocation;
}
v12 = v8 == v9;
v13 = Irp->Tail.CurrentStackLocation - 1;
if( (char)CurrentLocation <= Irp->StackCount
&& (unsigned __int8)(v13->MajorFunction - 3) <= 1u
&& Irp->MdlAddress
&& (MmVerifierData & 0x6000) != 0 )
{
MdlInvariantPostProcessing1((_IOV_REQUEST_PACKET *)v5, (ULONG_PTR)Irp, Irp->Tail.CurrentStackLocation - 1);
v8 = (__int64)&v2[v7 - 10];
}
LODWORD(RequestFinalized) = v12;
VfMajorVerifyIrpStackUpward((_IOV_REQUEST_PACKET *)v5, v13, (_IOV_STACK_LOCATION *)v8, v11, RequestFinalized);
v14 = v2[8];
LODWORD(OriginalStatus) = IrpStatus;
if( (v14 & 2) == 0 && (v2[v7 - 9] & 0x4000000) != 0 && !Irp->PendingReturned )
{
if( (Irp->Flags & 0x800) != 0 )
{
ViErrorReport6(574, *(VOID **)&v2[v7], Irp, (unsigned int)IrpStatus);
v14 = v2[8];
}
v2[8] = v14 | 2;
}
v15 = &v2[v7 - 6];
while( 1 )
{
v16 = (_QWORD *)*v15;
if( (_QWORD *)*v15 == v15 )
break;
if( (_QWORD *)v16[1] != v15 || (v17 = *v16, *(_QWORD **)(*v16 + 8i64) != v16) )
__fastfail(3u);
*v15 = v17;
*(_QWORD *)(v17 + 8) = v15;
v18 = *((_DWORD *)v16 - 2) | 0x40000000;
*((_DWORD *)v16 - 2) = v18;
*((_DWORD *)v16 + 6) = IrpStatus;
if( Irp->PendingReturned )
*((_DWORD *)v16 - 2) = v18 | 0x2000000;
v19 = v16[5];
if( (*(_BYTE *)(v19 + 16) & 0x70) == 112 )
{
v20 = *(_DWORD *)(v19 + 48);
if( v20 != -2147483626 && (v20 & 0xC0000000) != -1073741824 )
{
v21 = *((_BYTE *)v16 + 48);
if( v21 == 3 || v21 == 5 || v21 == 7 || v21 == 10 )
goto LABEL_35;
if( v21 <= 0xBu )
goto LABEL_38;
if( v21 <= 0xDu )
{
LABEL_35:
v22 = *((unsigned int *)v16 + 14);
}
else
{
if( v21 > 0xFu )
{
if( v21 != 25 )
goto LABEL_38;
goto LABEL_35;
}
v23 = v5[25];
if( !v23 || v23 != *(_QWORD *)(v19 + 24) )
goto LABEL_38;
v22 = *((unsigned int *)v5 + 52);
}
if( *(_QWORD *)(v19 + 56) > v22 )
ViErrorReport1(786, *((VOID **)CompletionPacket + 4), (const VOID *)v19);
}
}
LABEL_38:
if( (v5[7] & 0x20) == 0 )
{
if( VfMajorAdvanceIrpStatus(v13, (unsigned int)OriginalStatus, &IrpStatus) )
{
*((_DWORD *)v16 - 2) |= 0x8000000u;
*((_DWORD *)v16 + 7) = IrpStatus;
}
}
}
Irp->IoStatus.Status = IrpStatus;
memset(&v2[v7 - 10], 0i64, 0x78u);
v15[1] = v15;
*v15 = v15;
v24 = *((unsigned __int8 *)v5 + 184);
*((_BYTE *)v5 + 186) = Irp->CurrentLocation + 1;
if( v24 == Irp->CurrentLocation )
{
*(_QWORD *)CompletionPacket = 0i64;
*((_QWORD *)CompletionPacket + 1) = 0i64;
VfMajorVerifyFinalIrpStack((_IOV_REQUEST_PACKET *)v5, Irp->Tail.CurrentStackLocation - 1);
v25 = *(_QWORD *)v2;
*(_DWORD *)(v25 + 56) &= ~1u;
*(_QWORD *)(v25 + 240) = 0i64;
IovpSessionDataDereference(v2);
v26 = (*((_DWORD *)v5 + 6))-- == 1;
LOBYTE(OriginalStatus) = 0;
if( v26 )
{
ViIrpDatabaseAcquireLockExclusive((UINT8 *)&OriginalStatus);
v27 = (UINT8 *)*v5;
((void(__fastcall *)(_QWORD *, _QWORD, __int64))v5[6])(v5, *v5, 1i64);
*v5 = 0i64;
VfUtilAddressRangeRemoveCheckEmpty(
(_VF_ADDRESS_RANGE *)(ViIrpDatabaseAddressRanges
+ 16i64 * (unsigned __int8)(-125 * ((unsigned __int64)v27 >> 12))),
v27);
ViIrpDatabaseReleaseLockExclusive(OriginalStatus);
}
_InterlockedDecrement((volatile signed __int32 *)v5 + 5);
v28 = v5[28];
if( v28 )
{
for( i = 0; i < *(_DWORD *)v28; ++i )
{
v30 = *(_QWORD *)(v28 + 8);
v31 = 32i64 * i;
if( *(_QWORD *)(v31 + v30) )
{
*(_OWORD *)(v31 + v30) = 0i64;
*(_OWORD *)(v31 + v30 + 16) = 0i64;
}
v28 = v5[28];
}
*(_QWORD *)(v28 + 16) = 0i64;
}
}
else
{
IovpSessionDataReference(v2);
_InterlockedAdd((volatile signed __int32 *)v5 + 5, 1u);
}
VfIrpDatabaseEntryReleaseLock((_IOV_DATABASE_HEADER *)v5);
--CompletionPacket[5];
}Referenced by:
IovpLocalCompletionRoutine