SmFpFree

VOID __stdcall SmFpFree(
        _SM_FORWARD_PROGRESS_CTX *FpContext,
        _SM_FP_RESOURCE_TYPE ResourceType,
        VOID *Context,
        VOID *Resource){
  _MDL *v4; 
  _MDL *v7; 

  v4 = (_MDL *)Resource;
  v7 = (_MDL *)Resource;
  if( ResourceType >= SmFpResourceMapping )
    v4 = (_MDL *)*((_QWORD *)Resource + 3);
  if( ResourceType < SmFpResourceMapping )
    v7 = 0i64;
  if( *((VOID **)FpContext + 13) == Context && (unsigned int)SmpFpReleaseResource(FpContext, ResourceType, v4) )
  {
    if( ResourceType >= SmFpResourceMapping )
      MmUnmapReservedMapping((UINT64)v4, 0x6D526D73ui64, (INT64)v7);
    if( !*((_BYTE *)FpContext + 86) )
    {
      _InterlockedExchange64((volatile __int64 *)FpContext + 13, 0i64);
      KeSetEvent((PRKEVENT)(FpContext + 2), 0, 0);
    }
  }
  else if( ResourceType < SmFpResourceMapping )
  {
    if( ResourceType == SmFpResourceLockMdl )
    {
      SmKmFreeMdlForLock(v4);
    }
    else if( ResourceType == SmFpResourceCommit )
    {
      SmAcquireReleaseCharges((unsigned __int64)*((unsigned __int16 *)FpContext + 47) << 12, 1ui64, 1ui64);
    }
    else
    {
      ExFreePoolWithTag(v4, 0);
    }
  }
  else
  {
    MmUnmapLockedPages(v4, v7);
  }
}

Referenced by:

SMKM_STORE::SmStCompareRegionDataCallback
SMKM_STORE::SmStReadThread
SMKM_STORE::SmStUnmapVirtualRegion
SMKM_STORE_MGR::SmIoCtxQueueWork
SMKM_STORE_MGR::SmIoCtxWorkItemComplete
SMKM_STORE_MGR::SmWorkItemFree
SMKM_STORE_MGR::SmWorkItemFreeResource
SMKM_STORE_MGR::SmpPageEvict
ST_STORE::StDmpSinglePageRetrieve
ST_STORE::StMapAndLockRegion
ST_STORE::StUnlockAndUnmapRegion
SmKmStoreHelperCommandCleanup
SmKmStoreHelperCommandProcess
SmKmUnlockMdl