PopExtendConnectionState

VOID __stdcall PopExtendConnectionState(UINT64 SessionId){
  unsigned int v1; 
  UINT8 *PoolWithTag; 
  UINT8 *v3; 
  PVOID v4; 
  if( PopMaximumConnectionSessions )
  {
    if( 2 * PopMaximumConnectionSessions <= (unsigned int)SessionId )
      v1 = (unsigned int)(SessionId + 8) >> 3;
    else
      v1 = (unsigned int)PopMaximumConnectionSessions >> 2;
  }
  else
  {
    v1 = 8;
  }
  PoolWithTag = (UINT8 *)ExAllocatePoolWithTag(PagedPool, v1, 0x73655350ui64);
  v3 = PoolWithTag;
  if( PoolWithTag )
  {
    memset((INT64)PoolWithTag, 0i64);
    v4 = PopConnectionState;
    if( PopConnectionState )
    {
      memmove(v3, (UINT8 *)PopConnectionState, (unsigned __int64)(unsigned int)PopMaximumConnectionSessions >> 3);
      ExFreePoolWithTag(v4, 0x73655350u);
    }
    PopConnectionState = v3;
    PopMaximumConnectionSessions = 8 * v1;
    PopConnectionBitmap.SizeOfBitMap = 8 * v1;
    PopConnectionBitmap.Buffer = (unsigned int *)v3;
  }
  else
  {
    PopMaximumConnectionSessions = 0;
  }
}

Referenced by:

PopInitializeAdpm
PopSetSessionUserStatus