Article View: comp.sys.amiga.tech
Article #9354CreateProc() & WBStartup messages
From: Andrew Folkins
Date: Mon, 25 Jul 1988 05:29
Date: Mon, 25 Jul 1988 05:29
57 lines
2199 bytes
2199 bytes
[ For all you do, this line's for you. ]
Here's the scenario : I want to LoadSeg() and CreateProc() a subprogram
which uses the standard Lattice 4.0 startup code (c.o). Almost everything
works fine : I send the process a fake WBStartup message, it executes,
exits, and I get the message back. Fine. Except that I keep getting
a ToolWindow, even though the WBStartup->sm_ToolWindow is NULL. Any ideas?
short StartProcess(filename)
char *filename;
{
int seg;
struct WBStartup *msg;
struct MsgPort *proc_port;
msg = (struct WBStartup *)AllocMem(sizeof(struct WBStartup),
MEMF_CLEAR | MEMF_PUBLIC);
if (!msg) goto nostart;
msg->sm_Message.mn_Node.ln_Type = NT_MESSAGE;
msg->sm_Message.mn_ReplyPort = WBPort; /* previously CreatePort()ed */
msg->sm_Message.mn_Length = sizeof(struct WBStartup);
msg->sm_NumArgs = (long)0;
msg->sm_ArgList = (struct WBArg *)NULL;
msg->sm_ToolWindow = (char *)NULL; /* I know this is overkill, but ... */
if ((seg = LoadSeg(filename)) == NULL)
goto nostart;
if (proc_port = CreateProc(filename, PRIORITY, seg, STACKSIZE)) {
msg->sm_Process = proc_port;
msg->sm_Segment = seg;
PutMsg(proc_port, (struct Message *)msg); /* Fake WBStartup */
return(TRUE);
}
nostart :
if (msg) FreeMem((char *)msg, sizeof(struct WBStartup));
return(FALSE);
}
and in c.o's workbench startup code we find :
do_cons:
move.l sm_ToolWindow(a2),d1 * a2 = WBenchMsg
beq.s do_main
*
* call Open, etc. * It shouldn't be doing this, but it is
*
--
Andrew Folkins ...ihnp4!alberta!andrew
The University of Alberta, Edmonton, Alberta, Canada
Remember, when all else is said and done, at least *we* have someplace to
park our keyboards.
Technical Details
Message-ID:
<1472@pembina.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!alberta!andrewShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!alberta!andrew From: andrew@alberta.UUCP (Andrew Folkins) Newsgroups: comp.sys.amiga.tech Subject: CreateProc() & WBStartup messages Message-ID: <1472@pembina.UUCP> Date: 25 Jul 88 05:29:01 GMT Organization: U. of Alberta, Edmonton, AB Lines: 57