ExAcquireFastMutexUnsafe
VOID *__stdcall ExAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex){
_ETHREAD *CurrentThread;
__int64 v2;
__int64 v4;
char v5;
NTSTATUS SessionId;
VOID *result;
bool v8;
unsigned __int8 AbOrphanedEntrySummary;
UINT64 a3;
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
v2 = 0i64;
LODWORD(a3) = 0;
--CurrentThread->Tcb.SpecialApcDisable;
if( ++CurrentThread->Tcb.AbAllocationRegionCount != 1 )
KeBugCheckEx(0x192u, CurrentThread, FastMutex, (PVOID)KeGetCurrentIrql(), 0i64);
LOBYTE(v4) = CurrentThread->Tcb.AbEntrySummary;
if( !(_BYTE)v4 )
{
if( !CurrentThread->Tcb.AbOrphanedEntrySummary )
goto LABEL_18;
AbOrphanedEntrySummary = CurrentThread->Tcb.AbOrphanedEntrySummary;
CurrentThread->Tcb.AbOrphanedEntrySummary = 0;
LOBYTE(v4) = AbOrphanedEntrySummary | CurrentThread->Tcb.AbEntrySummary;
}
v5 = v4;
_BitScanForward((unsigned int *)&v4, (unsigned __int8)v4);
CurrentThread->Tcb.AbEntrySummary = v5 & ~(1 << v4);
v2 = (__int64)&CurrentThread->Tcb.LockEntries[v4];
if( !v2 )
{
LABEL_18:
_interlockedbittestandset((volatile signed __int32 *)&CurrentThread->Tcb.116 + 1, 0x10u);
goto LABEL_8;
}
if( (unsigned __int64)FastMutex >= 0xFFFF800000000000ui64
&& *((_BYTE *)&stru_140C4DB30 + (((unsigned __int64)FastMutex >> 39) & 0x1FF) + 6872) == 1 )
{
SessionId = MmGetSessionIdEx(CurrentThread->Tcb.ApcState.Process);
}
else
{
SessionId = -1;
}
*(_DWORD *)(v2 + 40) = SessionId;
*(_QWORD *)(v2 + 32) = (unsigned __int64)FastMutex & 0x7FFFFFFFFFFFFFFCi64;
LABEL_8:
--CurrentThread->Tcb.AbAllocationRegionCount;
KiAbThreadRemoveBoosts(&CurrentThread->Tcb, FastMutex, &a3);
v8 = CurrentThread->Tcb.SpecialApcDisable++ == -1;
if( v8
&& ($F25F8C4BA33AF922A5F1AF68CD89DDDF *)CurrentThread->Tcb.ApcState.ApcListHead[0].Flink != &CurrentThread->Tcb.152 )
{
KiCheckForKernelApcDelivery();
}
if( !_interlockedbittestandreset(&FastMutex->Count, 0) )
ExpAcquireFastMutexContended(FastMutex, (VOID *)v2);
if( v2 )
*(_BYTE *)(v2 + 26) |= 1u;
FastMutex->Owner = CurrentThread;
return result;
}Referenced by:
CmKtmNotification
CmNotifyRunDown
CmRmFinalizeRecovery
CmSnapshotRMTxArray
CmpCleanupLightWeightTransaction
CmpCommitPreparedLightWeightTransaction
CmpIsCmRm
CmpLazyCommitWorker
CmpLogCheckpoint
CmpNotifyTriggerCheck
CmpPostNotify
CmpQueueLazyCommitWorker
CmpRunDownCmRM
CmpTransInitializeTransaction
CmpTransMgrRollback
CmpTransSearchAddLightWeightTrans
CmpTransSearchAddTrans
ExpGetFirmwareEnvironmentVariable
ExpSetBootEntry
ExpSetDriverEntry
ExpSetFirmwareEnvironmentVariable
FsRtlCancelNotify
FsRtlCheckOplockEx2
FsRtlCheckUpperOplock
FsRtlNotifyCleanup
FsRtlNotifyCleanupAll
FsRtlNotifyFilterChangeDirectory
FsRtlNotifyFilterChangeDirectoryLite
FsRtlNotifyFilterReportChange
FsRtlNotifyFilterReportChangeLiteEx
FsRtlOplockBreakH
FsRtlOplockBreakToNoneEx
FsRtlOplockGetAnyBreakOwnerProcess
FsRtlUninitializeOplock
FsRtlpAcknowledgeOplockBreak
FsRtlpAcknowledgeOplockBreakByCacheFlags
FsRtlpOpBatchBreakClosePending
FsRtlpOplockBreakNotify
FsRtlpOplockFsctrlInternal
FsRtlpOplockStoreKeyForDeleteOperation
FsRtlpRequestExclusiveOplock
FsRtlpRequestShareableOplock
KeAcquireGuardedMutexUnsafe
KeInitSystem
KeStartDynamicProcessor
LOCK_CM_RM_LIST
LOCK_POST_LIST
LOCK_TRANSACTION_LIST
NtDeleteBootEntry
NtDeleteDriverEntry
NtEnumerateBootEntries
NtEnumerateDriverEntries
NtEnumerateSystemEnvironmentValuesEx
NtGetEnvironmentVariableEx
NtQueryBootEntryOrder
NtQueryBootOptions
NtQueryDriverEntryOrder
NtQueryEnvironmentVariableInfoEx
NtQuerySystemEnvironmentValue
NtSetBootEntryOrder
NtSetBootOptions
NtSetDriverEntryOrder
NtSetSystemEnvironmentValue
SeRegisterLogonSessionTerminatedRoutine
SeRegisterLogonSessionTerminatedRoutineEx
SeUnregisterLogonSessionTerminatedRoutine
SeUnregisterLogonSessionTerminatedRoutineEx
SepNotifyFileSystems