IopSetLockOperationProcess

NTSTATUS __stdcall IopSetLockOperationProcess(
        UINT16 CompressionFormat,
        UINT8 *UncompressedFragment,
        UINT64 UncompressedFragmentSize,
        UINT8 *CompressedBuffer,
        UINT64 CompressedBufferSize,
        UINT64 FragmentOffset,
        UINT64 UncompressedChunkSize,
        UINT64 *FinalUncompressedSize,
        PVOID WorkSpace){
  VOID **v9; 
  char v10; 
  char v11; 
  __int64 v13; 
  NTSTATUS result; 
  __int64 v15; 
  NTSTATUS v16; 
  VOID **Pool_0; 
  _QWORD *v18; 
  unsigned __int8 v19; 
  VOID *v20; 
  unsigned __int64 v21; 
  __int64 **v22; 
  char v23; 
  _QWORD *FileObjectExtension; 

  FileObjectExtension = 0i64;
  v9 = 0i64;
  v10 = 0;
  v11 = UncompressedFragmentSize;
  v13 = CompressionFormat;
  if( !UncompressedFragment )
    return -1073741811;
  if( (_BYTE)UncompressedFragmentSize )
  {
    v16 = 0;
    FileObjectExtension = IopGetFileObjectExtension((_FILE_OBJECT *)CompressionFormat, FoExtTypeInternal, 0i64);
    v18 = FileObjectExtension;
    if( !FileObjectExtension )
      return -1073741823;
  }
  else
  {
    IopGetSetSpecificExtension(
      (_FILE_OBJECT *)CompressionFormat,
      FoExtTypeInternal,
      0x20ui64,
      1u,
      (VOID **)&FileObjectExtension,
      0i64);
    v16 = result;
    if( result < 0 )
      return result;
    Pool_0 = IopVerifierExAllocatePool_0(v15, 0x10ui64);
    v18 = FileObjectExtension;
    v9 = Pool_0;
  }
  v19 = KeAcquireSpinLockRaiseToDpc((UINT64 *)(v13 + 184));
  v20 = (VOID *)v18[2];
  v21 = v19;
  v23 = *(_BYTE *)(v13 + 72);
  if( v20 )
  {
    v22 = (__int64 **)v18[2];
    while( v22[1] != (__int64 *)UncompressedFragment )
    {
      v22 = (__int64 **)*v22;
      if( !v22 )
        goto LABEL_17;
    }
    v10 = 1;
  }
  else
  {
LABEL_17:
    if( !v11 )
    {
      if( v9 )
      {
        *v9 = v20;
        v18[2] = v9;
        v9[1] = UncompressedFragment;
      }
      else
      {
        v16 = -1073741670;
      }
    }
  }
  KxReleaseSpinLock((UINT64 *)(v13 + 184));
  __writecr8(v21);
  if( v10 && v9 )
    ExFreePoolWithTag(v9, 0);
  if( v11 )
  {
    if( v23 && v10 )
      return 0;
    return -1073741823;
  }
  return v16;
}

Referenced by:

IopCloseFile
NtLockFile