Newer
Older
AMI-Aptio-BIOS-Reversed / PurleyPlatPkg / Platform / Pei / EarlyVideoPei / ImageRenderSetPixel.c
@Ajax Dong Ajax Dong 2 days ago 799 bytes Full restructure
int __fastcall ImageRenderSetPixel(unsigned int *p_count_1, unsigned int *p_count)
{
  unsigned int count; // ecx
  char *Pool; // eax
  int Pool_1; // ebx

  if ( !p_count )
    return -1;
  if ( !*p_count )
    return 0;
  count = *p_count_1;
  if ( !*p_count_1 )
  {
    if ( ImageRenderCheckContext(p_count_1, (void *)*p_count) )
      return -1;
    if ( *p_count )
      CopyMem((char *)p_count_1[1], (char *)p_count[1], *p_count);
    return 0;
  }
  Pool = (char *)PeiAllocatePool((void *)(*p_count + count));
  Pool_1 = (int)Pool;
  if ( !Pool )
    return -1;
  if ( *p_count_1 )
    CopyMem(Pool, (char *)p_count_1[1], *p_count_1);
  if ( *p_count )
    CopyMem((char *)(Pool_1 + *p_count_1), (char *)p_count[1], *p_count);
  *p_count_1 += *p_count;
  p_count_1[1] = Pool_1;
  return 0;
}