SmKmAllocateMdlForLock

MDL *__stdcall SmKmAllocateMdlForLock(UINT64 Size){
  MDL *v2; 
  int v3; 
  UINT64 v4; 
  MDL *PoolWithTag; 
  MDL *v6; 
  v2 = 0i64;
  v3 = SmAcquireReleaseCharges(Size, 3ui64, 0i64);
  if( v3 )
  {
    v4 = (Size + 4095) >> 12;
    PoolWithTag = (MDL *)ExAllocatePoolWithTag(NonPagedPoolNx, 8 * v4 + 48, 0x4C506D73ui64);
    v6 = PoolWithTag;
    if( PoolWithTag )
    {
      PoolWithTag->Next = 0i64;
      v2 = PoolWithTag;
      PoolWithTag->Size = 8 * (v4 + 6);
      v6 = 0i64;
      PoolWithTag->MdlFlags = 0;
      v3 = 0;
      PoolWithTag->StartVa = 0i64;
      PoolWithTag->ByteOffset = 0;
      PoolWithTag->ByteCount = Size;
    }
    if( v3 )
      SmAcquireReleaseCharges(Size, 3ui64, 1ui64);
    if( v6 )
      ExFreePoolWithTag(v6, 0);
  }
  return v2;
}

Referenced by:

SmFpAllocate
SmFpPreAllocate