ExAcquirePushLockSharedEx

INT64 __fastcall ExAcquirePushLockSharedEx(UINT64 P2, UINT64 P1){
  __int64 v2; 
  _ETHREAD *CurrentThread; 
  __int64 v5; 
  char v6; 
  int SessionId; 
  bool v8; 
  INT64 result; 
  unsigned int v10; 
  v2 = 0i64;
  if( (P1 & 0xFFFFFFFC) != 0 )
    KeBugCheckEx(0x152u, (unsigned int)P1, P2, 0i64, 0i64);
  if( (P1 & 2) == 0 )
  {
    v10 = 0;
    CurrentThread = (_ETHREAD *)KeGetCurrentThread();
    --*((_WORD *)CurrentThread + 243);
    if( ++*((_BYTE *)CurrentThread + 794) != 1 )
      KeBugCheckEx(0x192u, (ULONG_PTR)CurrentThread, P2, KeGetCurrentIrql(), 0i64);
    LOBYTE(v5) = *((_BYTE *)CurrentThread + 792);
    if( !(_BYTE)v5 )
    {
      if( !*((_BYTE *)CurrentThread + 870) )
        goto LABEL_21;
      v5 = *((unsigned __int8 *)CurrentThread + 870);
      *((_BYTE *)CurrentThread + 870) = 0;
      LOBYTE(v5) = *((_BYTE *)CurrentThread + 792) | v5;
    }
    v6 = v5;
    _BitScanForward((unsigned int *)&v5, (unsigned __int8)v5);
    *((_BYTE *)CurrentThread + 792) = v6 & ~(1 << v5);
    v2 = *((_QWORD *)CurrentThread + 100) + 96 * v5;
    if( v2 )
    {
      if( P2 >= 0xFFFF800000000000ui64 && *((_BYTE *)&antNameB + ((P2 >> 39) & 0x1FF) - 256) == 1 )
        SessionId = MmGetSessionIdEx(*((_QWORD *)CurrentThread + 23));
      else
        SessionId = -1;
      *(_DWORD *)(v2 + 40) = SessionId;
      *(_QWORD *)(v2 + 32) = P2 & 0x7FFFFFFFFFFFFFFCi64;
LABEL_10:
      --*((_BYTE *)CurrentThread + 794);
      KiAbThreadRemoveBoosts((ULONG_PTR)CurrentThread, P2, &v10);
      v8 = (*((_WORD *)CurrentThread + 243))++ == 0xFFFF;
      if( v8 && *((_ETHREAD **)CurrentThread + 19) != (_ETHREAD *)((char *)CurrentThread + 152) )
        KiCheckForKernelApcDelivery();
      goto LABEL_13;
    }
LABEL_21:
    _interlockedbittestandset((volatile signed __int32 *)CurrentThread + 30, 0x10u);
    goto LABEL_10;
  }
LABEL_13:
  result = _InterlockedCompareExchange64((volatile signed __int64 *)P2, 17i64, 0i64);
  if( result )
    result = ExfAcquirePushLockSharedEx((UINT64 *)P2, (VOID *)v2, (VOID *)P2);
  if( v2 )
    *(_BYTE *)(v2 + 26) |= 1u;
  return result;
}

Referenced by:

AlpcReferenceBlobByHandle
AlpcpAcceptConnectPort
AlpcpCancelMessage
AlpcpCreateClientPort
AlpcpCreateReserve
AlpcpCreateSection
AlpcpCreateSectionView
AlpcpCreateSecurityContext
AlpcpDisconnectPort
AlpcpDispatchConnectionRequest
AlpcpDispatchNewMessage
AlpcpDispatchReplyToPort
AlpcpDispatchReplyToWaitingThread
AlpcpEnumerateResourcesPort
AlpcpFlushMessagesPort
AlpcpInvokeLogCallbacks
AlpcpLocateSectionView
AlpcpLockCommunicationInfoShared
AlpcpLockPortShared
AlpcpMapLegacyPortRemoteView
AlpcpPortQueryConnectedSidInfo
AlpcpPortQueryServerSessionInfo
AlpcpProcessSynchronousRequest
AlpcpQueryRemoteView
AlpcpReceiveDirectMessagePort
AlpcpReceiveLegacyMessage
AlpcpReceiveMessagePort
AlpcpReceiveSynchronousReply
AlpcpReferenceAndLockTargetPortsAndCommunicationInfo
AlpcpReferenceConnectedPort
AlpcpReferenceMessageByWaitingThreadPort
AlpcpReplyLegacySynchronousRequest
AlpcpReturnMessageOnInsufficientBuffer
AlpcpSendLegacySynchronousRequest
AlpcpSendMessage
CcGetNumberOfMappedPages
CcGetVirtualAddress
CcGetVirtualAddressIfMapped
CcSlowReferenceSharedCacheMapFileObject
CmDumpKey
CmEnumerateValueKey
CmFcManagerQueryFeatureConfigurationSectionInformation
CmFcpManagerPublishChangeNotifications
CmKeyBodyNeedsVirtualImage
CmLockHiveSecurityShared
CmLockKeyForWrite
CmQueryMultipleValueKey
CmSetCallbackObjectContext
CmpAssignSecurityToKcb
CmpCallCallBacksEx
CmpCallbackFillObjectContext
CmpCloseKeyObject
CmpCreateKeyControlBlock
CmpEnumerateAllHigherLayerKcbs
CmpEnumerateCallback
CmpFindSubkeyInHashByChildCell
CmpGetCallbackObjectContext
CmpGetKeyNodeForKcb
CmpGetLastHive
CmpGetNextActiveHive
CmpGetNextHive
CmpGlobalLockKeyForWrite
CmpLazyCommitWorker
CmpLockHashEntryShared
CmpLockHashEntrySharedByKcb
CmpLockKcbShared
CmpLockKcbStackShared
CmpLockKcbStackTopExclusiveRestShared
CmpLockTwoKcbsShared
CmpLockTwoSecurityCachesExclusiveShared
CmpOKToFollowLink
CmpPerformSingleKcbCacheLookup
CmpPromoteKey
CmpReferenceKeyControlBlockLockNotHeld
CmpTrimHive
CmpUpdateHiveRootCellFlags
CmpVEExecuteOpenLogic
CmpVolumeContextLockShared
CmpVolumeContextMustHiveFilePagesBeKeptLocal
CmpVolumeManagerGetContextForFile
CmpWalkOneLevel
DbgkFlushErrorPort
DbgkpSendErrorMessage
EtwDeleteSiloState
EtwpAddRegEntryToGroup
EtwpCovSampContextGetModule
EtwpCovSampContextPruneModules
EtwpCoverageSamplerQuery
EtwpFindGuidEntryByGuid
EtwpGetCompressionSettings
EtwpGetDisallowList
EtwpGetNextGuidEntry
EtwpIsGuidAllowed
EtwpReferenceLoggerSecurityDescriptor
ExFetchLicenseData
ExGetLicenseTamperState
ExpGetKernelDataProtection
ExpGetNextCallback
ExpGetProcessInformation
ExpGetSystemPlatformBinary
ExpLoadAndSortLicensingCacheDescriptors
ExpSnapShotHandleTables
ExpWatchProductTypeWork
FsRtlLookupPerFileContext
FsRtlLookupPerFileObjectContext
FsRtlLookupPerStreamContextInternal
HvHiveConvertLockedPagesToCowByPolicy
HvLockHiveFlusherShared
IommuProcessPageRequestQueue
IopRegisterDeviceInterface
LOCK_ADDRESS_SPACE_SHARED
LockShutdownShared
MiCleanCfg
MiCoalesceFreeLargePages
MiEmptyWorkingSetPrivatePagesByVa
MiFindHotPatchRecord
MiFindProcessImageHotPatchRecord
MiGetChannelInformation
MiIsExtentDangling
MiIsRangeFullyCommitted
MiLockDynamicMemoryShared
MiLockLoaderEntry
MiLockVadShared
MiLogHotPatchRundown
MiObtainReferencedSecureVad
MiObtainReferencedVadEx
MiQueryLoadedPatches
MiQueryProcessActivePatches
MiRelocateImagePfn
MiRemoveBadPages
MiScrubProcessLargePages
MiTrimSection
MiTrimSharedPageFromViews
MiUpdateImagePfnImportRelocations
MiWaitForRotateToComplete
MiWalkEntireImage
MiZeroPage
MmAcquireSessionPoolRundown
MmCheckProcessShadow
MmManagePartitionNodeInformation
MmOutSwapVirtualAddresses
MmOutSwapWorkingSet
MmPostHotPatchDbgModuleMessages
MmSetPfnListInfo
NtAlpcDeleteSectionView
NtAlpcOpenSenderProcess
NtAlpcSetInformation
NtAreMappedFilesTheSame
NtDeleteKey
NtFlushKey
NtOpenProcessTokenEx
NtOpenThreadTokenEx
NtQueryInformationJobObject
NtQueryObject
NtSetInformationJobObject
ObIsDosDeviceLocallyMapped
ObLogSecurityDescriptor
ObOpenObjectByNameEx
ObOpenObjectByPointer
ObQueryDeviceMapInformation
ObQueryNameStringMode
ObpCallPreOperationCallbacks
ObpCreateHandle
ObpGetShadowDirectory
ObpLockDirectoryShared
ObpLookupObjectName
ObpReferenceDeviceMap
ObpReferenceSecurityDescriptor
PfCheckDeprioritizeImage
PfQuerySuperfetchInformation
PfSnGetPrefetchInstructions
PfSnIsHostingApplication
PfSnQueryPrefetcherInformation
PfpRpCHashDeleteEntries
PiControlGetDeviceInterfaceEnabled
PiDmListAddList
PiDmListAddObject
PiDmListEnumObjectsWithCallback
PiDmListRemoveList
PiDmListRemoveObject
PiDmObjectGetCachedObjectPropertyData
PiDmObjectGetCachedObjectReference
PiDmObjectIsEnumerable
PoFxPrepareDevice
PoFxStartDevicePowerManagement
PoFxSystemLatencyNotify
PoGetIdleTimes
PoIssueCoalescingNotification
PoQueryProcessEnergyTrackingState
PopAcquirePowerRequestPushLock
PopAcquireRwLockShared
PopAcquireUmpoPushLock
PopBatteryDeviceState
PopBatteryEtwCallback
PopCurrentPowerState
PopDiagTraceFxRundown
PopDirectedDripsUmMarkTestDevices
PopEtGetNextEnergyTracker
PopEtInternerLock
PopEtProcessEnumSnapshotCallback
PopFanReportBootStartDevices
PopFxAcpiPrepareDevice
PopFxActivateDevicesForSx
PopFxFindAcpiDeviceByUniqueId
PopFxFindAndReferenceAcpiDevice
PopFxIdleDevicesFromSx
PopFxLowPowerEpochCallback
PopFxPauseDeviceAccounting
PopFxRegisterDeviceWithPep
PopFxResidentTimeoutRoutine
PopFxResumeDeviceAccounting
PopFxSetDeviceAccountingCsPlatformState
PopFxStartDeviceAccounting
PopFxStopDeviceAccounting
PopGetEnergyCounter
PopPepDeviceStarted
PopPepIdleTimeoutRoutine
PopPepIterateDeviceList
PopPepPlatformStateRegistered
PopPepRemoveDevice
PopPepResetDeviceAccountingLevel
PopPepWork
PopProcessorInformation
PopQueryPowerButtonBugcheckEnabled
PopThermalPollingPowerSettingCallback
PopThermalSxEntry
PopThermalSxExit
PopThermalTelemetryWorker
PopThermalZoneUpdateCoolingPolicy
PpmEventTraceControlCallback
PpmIdleUsingStateSelection
PpmQueryPlatformStateResidency
PpmWmiGetAllData
PsCaptureExceptionPort
PsChangeQuantumTable
PsGetNextProcess
PsGetNextProcessThread
PsGetProcessDeepFreezeStats
PsImpersonateClient
PsQueryProcessEnergyValues
PsQueryRuntimeProcess
PsQueryStatisticsProcess
PsQueryTotalCycleTimeProcess
PsReferenceEffectiveToken
PsReferenceImpersonationTokenEx
PsReferencePartitionSystemProcess
PsReferencePrimaryToken
PsSwapProcessWorkingSet
PsTerminateVsmEnclave
PspAssignProcessQuotaBlock
PspChargeProcessWakeCounter
PspGetNextJob
PspGetPreviousProcessThread
PspLockJobMemoryLimitsShared
PspLockProcessListShared
PspLockProcessSecurityShared
PspLockProcessSharedUnsafe
PspLockThreadSecurityShared
PspLookupProcessQuotaBlock
PspMarkServerSiloAsTerminating
PspNotifyProcessBackgroundTransition
PspNotifyServerSiloCreation
PspNotifyServerSiloTermination
PspReferenceSystemDll
PspSelectVsmEnclaveByNumber
PspSetProcessAffinityUpdateMode
PspSetProcessTimerDelayForWin32
PspStorageGetObject
PspStorageInsertObject
PspUpdateSingleProcessAffinity
PspWow64ReadOrWriteThreadCpuArea
RtlFindDynamicEnforcedAddressInRanges
RtlpCSparseBitmapLock
RtlpFindDynamicEHContinuationTarget
RtlpHpAcquireLockShared
RtlpLookupUserFunctionTable
SLGetSubscriptionPfn
SLQueryLicenseValueInternal
SLUpdateLicenseDataInternal
SMKM_STORE::SmStDirectReadIssue
SMKM_STORE::SmStInSwapStore
SMKM_STORE::SmStMapVirtualRegion
SMKM_STORE::SmStOutSwapStore
SMKM_STORE::SmStPrioritizeRegionsStore
SMKM_STORE::SmStTrimWsStore
SMKM_STORE::SmStTrimWsStoreBatch
SMKM_STORE::SmStUnmapVirtualRegion
SMKM_STORE_MGR::SmFeAddInitiate
SMKM_STORE_MGR::SmFeReadInitiate
ST_STORE::StDmHandleDecompressionFailure
ST_STORE::StDmSinglePageCopy
SeCaptureSubjectContext
SeCaptureSubjectContextEx
SeComputeAutoInheritByObjectTypeEx
SeCreateClientSecurity
SeCreateClientSecurityEx
SepDereferenceLowBoxNumberEntry
SepIsParentOfChildAppContainer
SepIsValidProcUniqueLuid
SepRmReferenceFindCap
SepSetTokenLowboxNumber
SmKmKeyGenGenerate
SmKmVirtualLockCtxLockMemory
SmcGetCacheStats
SmpKeyedStoreEntryGet
SmpKeyedStoreReference
VrpFindOrCreateDiffHiveEntryForMountPoint
VrpPostEnumerateKey
VrpTranslatePath
VrpUnloadDifferencingHive
WdipSemDisableScenario
WdipSemEnableScenario
WdipTimeoutCheckRoutine
sub_1403B8E0C
sub_14094D610
sub_14094DC8C