2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include "intuition_intern.h"
10 /*****i***********************************************************************
13 #include <proto/intuition.h>
15 AROS_LH1(struct IntuiMessage
*, AllocIntuiMessage
,
18 AROS_LHA(struct Window
*, window
, A0
),
21 struct IntuitionBase
*, IntuitionBase
, 148, Intuition
)
24 Private to AROS: allocate an IntuiMessage. IntuiMessage->Window
25 will be set to window by this function.
28 window - The window to which the IntuiMessage will be sent
31 An allocated IntuiMessage structure. Must be freed with
35 This private function is also present in MorphOS v50.
45 *****************************************************************************/
49 struct IntuiMessage
*msg
;
52 ASSERT_VALID_PTR(window
);
53 SANITY_CHECKR(window
,0)
55 ASSERT_VALID_PTR_OR_NULL(window
);
58 if ((msg
= AllocPooled(GetPrivIBase(IntuitionBase
)->IDCMPPool
,sizeof(struct IntIntuiMessage
))))
60 memclr(msg
,sizeof(struct IntIntuiMessage
));
62 msg
->ExecMessage
.mn_Node
.ln_Type
= NT_MESSAGE
;
63 msg
->ExecMessage
.mn_Length
= sizeof(struct ExtIntuiMessage
);
64 msg
->ExecMessage
.mn_ReplyPort
= window
? window
->WindowPort
: GetPrivIBase(IntuitionBase
)->IntuiReplyPort
;
66 msg
->IDCMPWindow
= window
;
69 DEBUG_ALLOCINTUIMESSAGE(dprintf("AllocIntuiMessage: Window 0x%lx Port 0x%lx Msg 0x%lx\n",
70 window
, window
->WindowPort
, msg
));