FsRtlCheckUpperOplock

NTSTATUS __fastcall FsRtlCheckUpperOplock(INT64 *a1, INT8 a2, INT64 a3, INT64 a4, INT64 PrePendRoutine, INT64 Flags){
  unsigned int v7; 
  _NONOPAQUE_OPLOCK *v8; 
  bool v9; 
  int v10; 
  NTSTATUS v11; 
  unsigned int OplockState; 
  _NONOPAQUE_OPLOCK *i; 
  __int16 v14; 
  char v15; 
  int v16; 
  __int64 v17; 
  bool v18; 
  __int64 v19; 
  int v20; 
  int v22; 
  __int16 v23; 
  unsigned __int8 v24; 
  int v25; 
  __int64 v26; 
  __int64 v27; 
  _NONOPAQUE_OPLOCK *v28; 
  char v29[72]; 

  v26 = a4;
  v27 = PrePendRoutine;
  v7 = ((a2 & 1) << 12) | ((a2 & 6) << 12);
  v28 = (_NONOPAQUE_OPLOCK *)*a1;
  v8 = v28;
  v23 = 0;
  v9 = 0;
  v10 = 0;
  v24 = 0;
  memset(v29, 0i64, sizeof(v29));
  v11 = 0;
  if( !v28 )
    return v11;
  ExAcquireFastMutexUnsafe(v28->FastMutex);
  LOBYTE(v23) = 1;
  OplockState = v28->OplockState;
  if( OplockState != 1 )
  {
    if( (Flags & 0x20000) != 0 )
    {
      if( ((OplockState - 4096) & 0xFFFFFFEF) != 0 )
      {
        v11 = -1073739511;
        v25 = -1073739511;
      }
      else
      {
        for( i = (_NONOPAQUE_OPLOCK *)v28->IrpOplocksR.Flink;
              i != (_NONOPAQUE_OPLOCK *)&v28->IrpOplocksR;
              i = (_NONOPAQUE_OPLOCK *)i->IrpExclusiveOplock )
        {
          if( LODWORD(i->ExclusiveOplockOwner->Pcb.ProfileListHead.Flink) == 590400 )
          {
            i = (_NONOPAQUE_OPLOCK *)i->FileObject;
            FsRtlpRemoveAndCompleteReadOnlyIrp((_LIST_ENTRY *)i->IrpExclusiveOplock, 0i64, 0x1000ui64);
          }
        }
        FsRtlpComputeShareableOplockState(v28);
      }
      goto LABEL_36;
    }
    if( !FsRtlpOplockUpperLowerCompatible(OplockState, v7) )
    {
      if( v7 )
      {
        if( v7 != 4096 )
        {
          if( v7 != 12288 )
          {
            if( v7 != 20480 )
            {
              v11 = -1073741597;
              v25 = -1073741597;
              goto LABEL_36;
            }
            v10 = 0x2000;
            v9 = (v14 & 4) != 0;
            goto LABEL_19;
          }
          v9 = 1;
LABEL_21:
          v10 = 0x4000;
LABEL_19:
          v15 = HIBYTE(v23);
          goto LABEL_27;
        }
        v9 = 1;
        v16 = v14 & 0x5000;
        if( v16 == 20480 )
        {
          v24 = 1;
          goto LABEL_21;
        }
        v15 = HIBYTE(v23);
        if( v16 )
          v10 = v16;
      }
      else
      {
        v15 = 1;
        v10 = 28672;
      }
LABEL_27:
      v29[0] = 3;
      v17 = v27;
      v18 = !v9;
      v19 = v26;
      if( v18 )
      {
        if( !v15 )
        {
LABEL_32:
          if( !v11 && (v8->OplockState & v10) != 0 )
          {
            v11 = FsRtlpOplockBreakByCacheFlags(
                    v8,
                    (__int64)v29,
                    0i64,
                    (unsigned int)Flags | v24,
                    0,
                    v10,
                    a3,
                    v19,
                    v17,
                    0i64,
                    0i64,
                    0i64,
                    (__int64)&v23,
                    0i64);
            v25 = v11;
            if( v24 )
            {
              v11 = FsRtlpOplockBreakByCacheFlags(
                      v8,
                      (__int64)v29,
                      0i64,
                      Flags,
                      0,
                      0x2000,
                      a3,
                      v19,
                      v17,
                      0i64,
                      0i64,
                      0i64,
                      (__int64)&v23,
                      0i64);
              v25 = v11;
            }
          }
          goto LABEL_36;
        }
        v20 = FsRtlpOplockBreakToNone(
                v28,
                (__int64)v29,
                0i64,
                Flags,
                v22,
                a3,
                v26,
                v27,
                0i64,
                0i64,
                0i64,
                (__int64)&v23,
                0i64);
      }
      else
      {
        v20 = FsRtlpOplockBreakToII(
                v28,
                (__int64)v29,
                0i64,
                Flags,
                v22,
                a3,
                v26,
                v27,
                0i64,
                0i64,
                0i64,
                (__int64)&v23,
                0i64);
      }
      v25 = v20;
      v11 = v20;
      goto LABEL_32;
    }
  }
LABEL_36:
  if( (_BYTE)v23 )
    ExReleaseFastMutexUnsafe(v8->FastMutex);
  return v11;
}

Referenced by:

No references.