FsRtlProcessFileLock

NTSTATUS __stdcall FsRtlProcessFileLock(PFILE_LOCK FileLock, PIRP Irp, PVOID Context){
  __int64 v3; 
  _EPROCESS *v7; 
  int v8; 
  _EPROCESS *v9; 
  _EPROCESS *ProcessId; 
  __int64(__fastcall *CompleteLockIrpRoutine)(__int64, __int64); 
  UINT8 v12; 
  bool v13; 
  _EPROCESS *RequestorProcess; 
  UINT64 Key; 
  struct _IO_STATUS_BLOCK Iosb; 
  LARGE_INTEGER FileOffset; 
  v3 = *((_QWORD *)Irp + 23);
  Iosb.Pointer = 0i64;
  Iosb.Information = 0i64;
  switch( *(_BYTE *)(v3 + 1) )
  {
    case 1:
      v12 = *(_BYTE *)(v3 + 2) & 1;
      v13 = (*(_BYTE *)(v3 + 2) & 2) != 0;
      FileOffset = *(LARGE_INTEGER *)(v3 + 24);
      RequestorProcess = IoGetRequestorProcess(Irp);
      LODWORD(Key) = *(_DWORD *)(v3 + 16);
      FsRtlPrivateLock(
        FileLock,
        *(_FILE_OBJECT **)(v3 + 48),
        &FileOffset,
        *(_LARGE_INTEGER **)(v3 + 8),
        RequestorProcess,
        Key,
        v12,
        v13,
        &Iosb,
        Irp,
        Context,
        0);
      return Iosb.Status;
    case 2:
      FileOffset = *(LARGE_INTEGER *)(v3 + 24);
      ProcessId = IoGetRequestorProcess(Irp);
      v8 = FsRtlFastUnlockSingle(
             FileLock,
             *(PFILE_OBJECT *)(v3 + 48),
             &FileOffset,
             *(PLARGE_INTEGER *)(v3 + 8),
             (PEPROCESS)ProcessId,
             *(_DWORD *)(v3 + 16),
             Context,
             0);
      goto LABEL_10;
    case 3:
      v9 = IoGetRequestorProcess(Irp);
      FsRtlPrivateFastUnlockAll(FileLock, *(_FILE_OBJECT **)(v3 + 48), v9, 0i64, 0, Context);
      goto LABEL_10;
    case 4:
      v7 = IoGetRequestorProcess(Irp);
      FsRtlPrivateFastUnlockAll(FileLock, *(_FILE_OBJECT **)(v3 + 48), v7, *(unsigned int *)(v3 + 16), 1u, Context);
LABEL_10:
      CompleteLockIrpRoutine = (__int64(__fastcall *)(__int64, __int64))FileLock->CompleteLockIrpRoutine;
      Iosb.Status = v8;
      FsRtlCompleteLockIrpReal(CompleteLockIrpRoutine, (__int64)Context, (__int64)Irp, v8, &Iosb, 0i64);
      return Iosb.Status;
  }
  *((_DWORD *)Irp + 12) = -1073741808;
  IofCompleteRequest(Irp, 1);
  Iosb.Status = -1073741808;
  return Iosb.Status;
}

Referenced by:

No references.