From 7b056231cea8f81f3d6c5014ad39a06a020fc31a Mon Sep 17 00:00:00 2001 From: mazze Date: Thu, 26 Jan 2012 20:43:43 +0000 Subject: [PATCH] Fix for a crash which happened because: Scalos patches in EMU mode the functions AddAppIconA() AddAppMenuItemA() AddAppWindowA() RemoveAppIcon() RemoveAppMenuItem() RemoveAppWindow() The first 3 functions return a Scalos specific structure [1] which was NOT compatible with AROS. Scalos calls unpatched AddAppWindowDropZoneA() which causes crashes because of different offsets of the structure elements. This fix: - changes the AROS specific AppXXX structures so that the elements till the object pointer have the same offsets - adds a APTR Dummy[3] at a place where Scalos has some private fields to avoid interference. [1] struct AppObject in https://sourceforge.net/p/scalos/code/904/tree/trunk/main/scalos_structures.h git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@43725 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/workbench/workbench_intern.h | 42 ++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/workbench/libs/workbench/workbench_intern.h b/workbench/libs/workbench/workbench_intern.h index e26afa78bb..3992ec4aea 100644 --- a/workbench/libs/workbench/workbench_intern.h +++ b/workbench/libs/workbench/workbench_intern.h @@ -2,7 +2,7 @@ #define __WORKBENCH_INTERN_H__ /* - Copyright 1995-2006, The AROS Development Team. All rights reserved. + Copyright 1995-2012, The AROS Development Team. All rights reserved. $Id$ Internal header file for workbench.library. @@ -84,17 +84,25 @@ struct WorkbenchBase struct AppIcon { - struct Node ai_Node; + struct MinNode ai_Node; + UWORD ai_AppID; + UWORD ai_Type; ULONG ai_ID; IPTR ai_UserData; + struct MsgPort *ai_MsgPort; + + struct DiskObject *ai_DiskObject; + + APTR ai_Dummy[3]; // Scalos has some private fields after the object + + // don't change above elements to keep compatibility with Scalos + ULONG ai_Flags; CONST_STRPTR ai_Text; - struct DiskObject *ai_DiskObject; struct Hook *ai_RenderHook; - struct MsgPort *ai_MsgPort; }; /* Valid values for ai_Flags. These correspond to the tag items @@ -116,15 +124,22 @@ struct AppIcon struct AppWindow { - struct Node aw_Node; + struct MinNode aw_Node; + UWORD aw_AppID; + UWORD aw_Type; ULONG aw_ID; IPTR aw_UserData; + struct MsgPort *aw_MsgPort; + struct Window *aw_Window; - struct List aw_DropZones; // List of AppWindowDropZones for this AppWindow. - struct MsgPort *aw_MsgPort; + APTR aw_Dummy[3]; // Scalos has some private fields after the object + + // don't change above elements to keep compatibility with Scalos + + struct List aw_DropZones; // List of AppWindowDropZones for this AppWindow. }; #define AWDZFlag_fix 0 /* IBox value is actual coordinate */ @@ -155,15 +170,22 @@ struct AppWindowDropZone struct AppMenuItem { - struct Node ami_Node; + struct MinNode aw_Node; + UWORD aw_AppID; + UWORD aw_Type; ULONG ami_ID; IPTR ami_UserData; + struct MsgPort *ami_MsgPort; + STRPTR ami_Text; - STRPTR ami_CommandKey; - struct MsgPort *ami_MsgPort; + APTR ami_Dummy[3]; // Scalos has some private fields after the object + + // don't change above elements to keep compatibility with Scalos + + STRPTR ami_CommandKey; }; /* Internal WBHM structure, used to hold data which the user doesn't -- 2.11.4.GIT