ExAcquireResourceExclusiveLite
INT8 __fastcall ExAcquireResourceExclusiveLite(UINT64 a1, INT8 a2, INT64 a3){
unsigned __int8 v5;
__int16 v6;
_ETHREAD *v7;
INT64 v8;
CHAR v9;
int v10;
unsigned __int8 CurrentIrql;
_ETHREAD *CurrentThread;
_KLOCK_QUEUE_HANDLE LockHandle;
INT64 Object[2];
__int128 v16;
__int128 v17;
v5 = (a2 == 0) + 1;
if( (*(_WORD *)(a1 + 26) & 0x41) == 1 )
KeBugCheckEx(0x1C6u, (PVOID)0xF, (PVOID)a1, 0i64, 0i64);
v6 = *(_WORD *)(a1 + 26) & 1;
if( v6 )
{
CurrentIrql = KeGetCurrentIrql();
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
if( CurrentIrql > v5 )
KeBugCheckEx(0x1C6u, 0i64, (PVOID)CurrentIrql, (PVOID)v5, 0i64);
if( CurrentIrql >= 2u && (KeGetPcr()->Prcb._bf_0 & 0x10001) != 0 )
KeBugCheckEx(0x1C6u, (PVOID)5, 0i64, 0i64, 0i64);
if( (CurrentThread->Tcb.ApcState.InProgressFlags & 2) != 0 )
KeBugCheckEx(0x1C6u, (PVOID)6, 0i64, 0i64, 0i64);
if( !CurrentIrql && (CurrentThread->Tcb._bf_0 & 0x400) == 0 && !CurrentThread->Tcb.WaitBlock[3].SpareLong )
KeBugCheckEx(0x1C6u, (PVOID)7, 0i64, 0i64, 0i64);
}
if( !v6 )
{
memset(&LockHandle, 0, sizeof(LockHandle));
*(_OWORD *)Object = 0i64;
v16 = 0i64;
v17 = 0i64;
v7 = (_ETHREAD *)KeGetCurrentThread();
__incgsdword(0x8678u);
KeAcquireInStackQueuedSpinLock((PKSPIN_LOCK)(a1 + 96), &LockHandle);
v9 = ExpTryAcquireResourceExclusive(a1);
if( v9 )
{
v10 = *(_DWORD *)(a1 + 56) & 7;
*(_QWORD *)(a1 + 48) = v7;
*(_DWORD *)(a1 + 56) = v10 | 8;
KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
__writecr8(LockHandle.OldIrql);
__incgsdword(0x867Cu);
__incgsdword(0x8664u);
}
else
{
if( *(char *)(a1 + 26) < 0 && *(_ETHREAD **)(a1 + 48) == v7 )
{
*(_DWORD *)(a1 + 56) += 8;
KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
__writecr8(LockHandle.OldIrql);
__incgsdword(0x8680u);
__incgsdword(0x8664u);
}
else
{
if( !a2 )
{
KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
__writecr8(LockHandle.OldIrql);
__incgsdword(0x8688u);
return 0;
}
ExpPrepareToWaitForResourceExclusive(v8, (INT64)v7, (INT64)Object);
KeReleaseInStackQueuedSpinLockFromDpcLevel(&LockHandle);
__writecr8(LockHandle.OldIrql);
__incgsdword(0x8684u);
ExpApplyPrewaitBoost();
ExpWaitForResource((_ERESOURCE *)a1, Object);
ExpBoostIoAfterAcquire((_ERESOURCE *)a1, (UINT64)v7);
__incgsdword(0x867Cu);
__incgsdword(0x8664u);
}
return 1;
}
return v9;
}
return ExpFastResourceLegacyAcquireExclusive((PVOID)a1);
}Referenced by:
AdtpBuildAccessesString
CcAcquireByteRangeForWrite
CcPinFileData
CcUnpinRepinnedBcb
CmGetDeviceSoftwareKey
CmpAccountForLogReservation
CmpLockRegistryExclusive
CmpStartRMLog
CmpStopRMLog
CmpTransWriteLog
DrvDbAcquireDatabaseNodeBaseKey
DrvDbOpenDriverDatabaseRegKey
DrvDbReleaseDatabaseNodeBaseKey
DrvDbSetDriverDatabaseMappedProperty
ExAcquireTimeRefreshLock
ExEnterPriorityRegionAndAcquireResourceExclusive
ExpQuerySingleModuleInformation
ExpQuerySystemInformation
ExpRegisterFirmwareTableInformationHandler
FsRtlAcquireFileExclusiveCommon
FsRtlAcquireFileForCcFlushEx
FsRtlAcquireFileForModWriteEx
FsRtlCopyWrite
FsRtlPrepareMdlWriteDev
FsRtlpHeatRegisterVolume
FsRtlpHeatUnregisterVolume
IoCaptureLiveDump
IoConfigureCrashDump
IoEnumerateRegisteredFiltersList
IoGetDeviceInterfaceAlias
IoInitializeCrashDump
IoOpenDeviceInterfaceRegistryKey
IoOpenDeviceRegistryKey
IoRegisterFileSystem
IoRegisterFsRegistrationChangeMountAware
IoReportDetectedDevice
IoReportRootDevice
IoSetDeviceInterfaceState
IoShutdownSystem
IoUnregisterFsRegistrationChange
IoUpdateDumpPhysicalRanges
IopBootLog
IopBootLogToFile
IopCopyBootLogRegistryToFile
IopDoDeferredSetInterfaceState
IopGetDeviceInterfaces
IopGetRootDevices
IopGetSetSecurityObject
IopInitCrashDumpRegCallback
IopInitializeBootLogging
IopLoadDriver
IopRegisterDeviceInterface
IopSetDeviceSecurityDescriptor
MiCancelPhase0Locking
MiInitializeKernelCfg
MiProcessLoaderEntry
MiRememberUnloadedDriver
MiUnlockBootPageSections
MiWriteProtectSystemImages
MmChangeImageProtection
MmFreeBootDriverInitializationCode
MmLockPagableDataSection
NtAdjustGroupsToken
NtAdjustPrivilegesToken
NtCreateLowBoxToken
NtCreateTimer
NtFlushInstallUILanguage
NtGetMUIRegistryInfo
NtMapCMFModule
NtSetInformationJobObject
NtSetInformationToken
PfSnCheckActionsNeeded
PfSnPrefetchCacheEntryUpdate
PiCMCreateDevice
PiCMDeleteDevice
PiCMGenerateDeviceInstance
PiCMUnregisterDeviceInterface
PiDcHandleCustomDeviceEvent
PiDmAddCacheReferenceForObject
PiDmRemoveCacheReferenceForObject
PiDmaGuardQueueFlush
PiDmaGuardQueueRemoveEntry
PiDqObjectManagerServiceActionQueue
PiDrvDbLoadNode
PiDrvDbUnloadNode
PiDrvDbUnloadNodeWaitWorkerCallback
PiDrvDbUnloadNodeWorkerCallback
PiGetDeviceRegistryProperty
PiInitializeDevice
PiPnpRtlBeginOperation
PiPnpRtlEndOperation
PiPnpRtlObjectEventWorker
PiPnpRtlSetDeviceRegProperty
PiPnpRtlSetObjectProperty
PiProcessNewDeviceNode
PiSwCompleteCreate
PiSwDeviceFree
PiSwIrpCancelStartCreate
PiSwIrpCleanup
PiSwIrpGetLifetime
PiSwIrpInterfacePropertySet
PiSwIrpPropertySet
PiSwIrpSetLifetime
PiSwLock
PiSwPdoPnPDispatch
PiSwProcessParentRemoveIrp
PiSwProcessParentStartIrp
PiSwStopDestroy
PipDgqInsertEntry
PipKsrNotifyDrivers
PipResetDevices
PnpAcquireDependencyRelationsLock
PnpChainDereferenceComplete
PnpCtxCloseMachine
PnpDelayedRemoveWorker
PnpDeleteDeviceInterfaces
PnpDisableDeviceInterfaces
PnpGetDeviceInstanceRegistryValue
PnpNotifyDeviceClassChange
PnpNotifyHwProfileChange
PnpNotifyTargetDeviceChange
PnpNotifyTargetDeviceChangeNotifyEntry
PnpQueuePendingSurpriseRemoval
PnpSetDeviceInterfacePropertyData
PnpSetDevicePropertyData
PnpUnlinkDeviceRemovalRelations
PnpUnregisterPlugPlayNotification
PopAcquireAdaptiveLock
PopAcquirePolicyLock
PopDripsWatchdogAcquireContextLock
PopDripsWatchdogDiagnosticWorker
PopDripsWatchdogNotifySessionStart
PopDripsWatchdogStartWatchdog
PopDripsWatchdogStopWatchdog
PpCheckInDriverDatabase
PpDevCfgProcessDevices
PpDevNodeLockTree
PpDeviceRegistration
PpReleaseBootDDB
PspAllocateAndQueryNotificationChannel
PspApplyWorkingSetLimitsToProcess
PspFreezeJobTree
PspGetMemoryPartitionFromJobList
PspLockJobChain
PspLockJobConditionally
PspLockJobExclusive
PspLockJobsAndProcessExclusive
PspLockRootJobExclusive
PspSetJobMemoryPartition
PspSetQuotaLimits
RtlZeroHeap
RtlpAllocateHeap
RtlpFreeHeap
RtlpSetupExtendedBlock
SeExchangePrimaryToken
SeMarkLogonSessionForTerminationNotificationEx
SeSetMandatoryPolicyToken
SeSetPrivateNameSpaceToken
SeSetSecurityAttributesTokenEx
SeSetSessionIdToken
SeSetVirtualizationToken
SeTokenSetNoChildProcessRestricted
SeTokenSetRedirectionTrustPolicy
SepAddTokenLogonSession
SepBlockAccessForLogonSession
SepCreateLogonSessionTrack
SepDeReferenceLogonSession
SepDeleteLogonSessionTrack
SepDeleteUnreferencedLogonSessionsInSilo
SepInternalSetSecurityAttributesToken
SepMakeLogonSessionsSiblings
SepQueueWorkItem
SepReferenceLogonSessionSilo
SepRemoveTokenLogonSession
SepRmCallLsa
SepRmCommandServerThread
SepRmGlobalSaclSetWrkr
SepSetServerSiloToken
SepUpdateLogonSessionTrack
TtmiCloseEventQueue
TtmiRetrieveEventFromQueue
TtmiWriteEventToSingleQueue
TtmpAcquireSessionById
TtmpAcquireSessionFromTerminalHandle
TtmpCloseTerminalHandle
TtmpDeleteQueue
TtmpInitiateModernStandbyTransition
TtmpScheduledEvaluationWorker
TtmpSessionPowerControl
TtmpSessionWorker
TtmpStopCallout
TtmpTerminal0PowerSettingCallback
WmiAcquireSmbiosLockExclusive