ResFwGetContext

INT64 __fastcall ResFwGetContext(VOID **Context){
  char *v1; 
  char v3; 
  int v4; 
  unsigned int v5; 
  unsigned int v6; 
  PMDL PagesForMdl; 
  PMDL v8; 
  char *MappedSystemVa; 
  __int64 v10; 
  INT64 result; 
  v1 = 0i64;
  if( !Context )
    return 3221225485i64;
  v3 = dword_140C13310;
  *Context = 0i64;
  if( (v3 & 1) == 0 )
    return 3221225473i64;
  v4 = dword_140C1332C;
  if( dword_140C13330 >= (unsigned int)dword_140C1332C )
    v4 = dword_140C13330;
  v5 = (dword_140C1333C + v4 + dword_140C13338 + 20479) & 0xFFFFF000;
  v6 = ((v5 >> 3) + 4095) & 0xFFFFF000;
  PagesForMdl = MmAllocatePagesForMdlEx(0i64, MmNotMapped, 0);
  v8 = PagesForMdl;
  if( PagesForMdl )
  {
    if( (PagesForMdl->MdlFlags & 5) != 0 )
      MappedSystemVa = (char *)PagesForMdl->MappedSystemVa;
    else
      MappedSystemVa = (char *)MmMapLockedPagesSpecifyCache(PagesForMdl, 0, MmCached, 0i64, 0, 0x40000020u);
  }
  else
  {
    MappedSystemVa = 0i64;
  }
  v10 = qword_140C13340;
  *(_QWORD *)(qword_140C13340 + 8) = v8;
  *(_QWORD *)(v10 + 16) = MappedSystemVa;
  if( MappedSystemVa )
    v1 = &MappedSystemVa[v6];
  *(_DWORD *)(v10 + 24) = MappedSystemVa != 0i64 ? v5 + v6 : 0;
  *(_DWORD *)(v10 + 248) = MappedSystemVa != 0i64 ? v5 : 0;
  *(_QWORD *)(v10 + 240) = v1;
  BgpAnimationRegionSave = qword_140C133D0;
  BgpTextRegionSave = RegionHandle;
  result = 0i64;
  *Context = (VOID *)v10;
  return result;
}

Referenced by:

BgGetContext