rem: if( ! SetProperties( pd->m_UserContext, pd->m_Properties.m_UserCustom, ~0UL, 0xdff000, pd->m_CustomSize, TAG_DONE ) || ! SetProperties( pd->m_SuperContext, pd->m_Properties.m_SuperCustom, ~0UL, 0xdff000, pd->m_CustomSize, TAG_DONE ) )
add: BOOL activate = TRUE;  if( pd->m_ROMShadowBuffer != NULL )
context: RestoreMemory( struct PUHData* pd ){  BOOL            rc = FALSE;  struct MinList* user_mapping;  struct MinList* super_mapping;  LockContextList();  LockMMUContext( pd->m_UserContext );  LockMMUContext( pd->m_SuperContext );  // Save current mapping if we have to abort!  user_mapping  = GetMapping( pd->m_UserContext );  super_mapping = GetMapping( pd->m_SuperContext );  if( user_mapping == NULL || super_mapping == NULL )  {    printf( "Failed to get mappings.\n" );  }  else  {    if( ! SetProperties( pd->m_UserContext,                         pd->m_Properties.m_UserCustomShadow, ~0UL,                         (ULONG) pd->m_CustomShadowBuffer,                          pd->m_CustomSize,                         TAG_DONE ) ||        ! SetProperties( pd->m_SuperContext,                         pd->m_Properties.m_SuperCustomShadow, ~0UL,                         (ULONG) pd->m_CustomShadowBuffer,                         pd->m_CustomSize,                         TAG_DONE ) )    {      printf( "Failed to set properties for for re-mapped area.\n" );    }    else    {      if( ! SetProperties( pd->m_UserContext,                           pd->m_Properties.m_UserCustom, ~0UL,                           0xdff000, pd->m_CustomSize,                           TAG_DONE ) ||          ! SetProperties( pd->m_SuperContext,                           pd->m_Properties.m_SuperCustom, ~0UL,                           0xdff000, pd->m_CustomSize,                           TAG_DONE ) )      {        printf( "Failed to set properties for custom chip register area.\n" );      }      else      {        BOOL activate = TRUE;                if( pd->m_ROMShadowBuffer != NULL )        {          if( ! SetProperties( pd->m_UserContext,                               pd->m_Properties.m_UserROMShadow, ~0UL,                               (ULONG) pd->m_ROMShadowBuffer,                                pd->m_ROMSize,                               TAG_DONE ) ||              ! SetProperties( pd->m_SuperContext,                               pd->m_Properties.m_SuperROMShadow, ~0UL,                               (ULONG) pd->m_ROMShadowBuffer,                               pd->m_ROMSize,                               TAG_DONE ) )          {            printf( "Failed to set properties for for patched ROM area.\n" );            activate = FALSE;          }          else          {            if( ! SetProperties( pd->m_UserContext,                                 pd->m_Properties.m_UserROM, ~0UL,                                 (ULONG) pd->m_ROM,                                  pd->m_ROMSize,                                 TAG_DONE ) ||                ! SetProperties( pd->m_SuperContext,                                 pd->m_Properties.m_SuperROM, ~0UL,                                 (ULONG) pd->m_ROM,                                 pd->m_ROMSize,                                 TAG_DONE ) )            {              printf( "Failed to set properties for for ROM area.\n" );              activate = FALSE;            }          }        }        if( activate )        {          struct MMUContext* ctxs[ 3 ] =           {            pd->m_UserContext,            pd->m_SuperContext,            NULL          };          // We need to disable, since we may have patched exec.library!          Disable();          rc = RebuildTreesA( ctxs );          Enable();          if( ! rc )          {            printf( "Failed to rebuild MMU trees.\n" );          }        }      }    }    if( ! rc )    {      // Roll-back!      SetPropertyList( pd->m_UserContext, user_mapping );      SetPropertyList( pd->m_SuperContext, super_mapping );    }  }  if( user_mapping != NULL )  {    ReleaseMapping( pd->m_UserContext, user_mapping );  }  if( super_mapping != NULL )  {    ReleaseMapping( pd->m_SuperContext, super_mapping );  }  UnlockMMUContext( pd->m_SuperContext );  UnlockMMUContext( pd->m_UserContext );  UnlockContextList();    return rc;}