FsRtlGetVirtualDiskNestingLevel
VOID __fastcall FsRtlGetVirtualDiskNestingLevel(
_DEVICE_OBJECT *DeviceObject,
UINT64 *NestingLevel,
UINT64 *NestingFlags){
unsigned __int64 DeviceType;
int v7;
int v8;
__int64 v9;
char v10;
char v11;
_IRP *v12;
INT64 v13;
_BYTE *v14;
NTSTATUS Status;
_BYTE *v16;
unsigned int v17;
int v18;
int v19;
UINT64 OutputBufferLength;
__int16 Object;
char v22;
char v23;
int v24;
__int64 v25[2];
__int64 InputBuffer;
_IO_STATUS_BLOCK IoStatusBlock;
__int128 OutputBuffer;
INT64 v29;
VOID *ReturnAddress;
DeviceType = DeviceObject->DeviceType;
v23 = 0;
v7 = 0;
v8 = 1;
IoStatusBlock = 0i64;
if( (unsigned int)DeviceType <= 0x24 )
{
v9 = 0x100000018Ci64;
if( _bittest64(&v9, DeviceType) )
{
Object = 0;
v25[1] = (__int64)v25;
v22 = 6;
v25[0] = (__int64)v25;
v24 = 0;
IoSetThreadHardErrorMode(0);
v11 = v10;
InputBuffer = 1i64;
LODWORD(v29) = 0;
LODWORD(OutputBufferLength) = 20;
OutputBuffer = 0i64;
v12 = IopBuildDeviceIoControlRequest(
0x2D1190ui64,
DeviceObject,
&InputBuffer,
8ui64,
&OutputBuffer,
OutputBufferLength,
0,
(_KEVENT *)&Object,
&IoStatusBlock,
ReturnAddress);
if( v12 )
{
Status = IofCallDriver((UINT64)DeviceObject, (UINT64)v12);
if( Status == 259 )
{
KeWaitForSingleObject((UINT64)&Object, 0, 0, 0, 0i64);
Status = IoStatusBlock.Status;
}
if( Status >= 0 && IoStatusBlock.Information >= 0x14 && (_DWORD)OutputBuffer == 1 )
{
FsRtlQueryMaximumVirtualDiskNestingLevel(v13, v14);
if( (unsigned int)v29 > v17 )
{
FsRtlQueryMaximumVirtualDiskNestingLevel((unsigned int)v29, v16);
v7 = v19;
}
else if( (_DWORD)v29 )
{
v7 = v29;
}
BYTE1(v13) = BYTE13(OutputBuffer);
if( BYTE4(OutputBuffer) )
v8 = 0;
v18 = v8;
v8 |= 2u;
if( (BYTE12(OutputBuffer) & 2) == 0 )
v8 = v18;
}
}
*(_DWORD *)NestingLevel = v7;
if( NestingFlags )
*(_DWORD *)NestingFlags = v8;
LOBYTE(v13) = v11;
IoSetThreadHardErrorMode(v13);
}
}
}Referenced by:
No references.