home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: nntp.coast.net!torn!utnut!utgpu!normb
- From: normb@gpu.utcc.utoronto.ca (Norman Baccari)
- Subject: Re: Problems With LoadSeg()
- Message-ID: <DMIrD2.Lso@gpu.utcc.utoronto.ca>
- Organization: UTCC Public Access
- References: <DMF0vK.LI0@gpu.utcc.utoronto.ca> <4fd4kr$cu7@oak68.doc.ic.ac.uk>
- Distribution: Earth
- Date: Fri, 9 Feb 1996 17:31:50 GMT
-
-
- Youll have to excuse me as this is my first time working with
- resident struct & LoadSeg(), so this is looking
- a little hairy.
-
- This section of code is from Ben Hutchings (thanks Ben)...
-
- > if( libseg = LoadSeg(libname) ) /* use _full_ pathname */
- > {
- > /* get pointer to embedded Resident structure */
- > libres = (struct Resident *)((LONG *)BADDR(libseg)+2);
- ^^^^^^
- This allways seems to work.
- >
- > /* check that it really is a library */
- > if( ((ULONG *)libres)[-1] != 0x70ff4e75 ||
- ^^^^^^^^^^
- This doesnt Allways work. Some valid libraries have this value.
- Any reason why I cant use the rt_Type Field and look for NT_LIBRARY??
-
- > libres->rt_MatchWord != RT_MATCHWORD ||
- ^^^^^^^^^^^^
- I guess you mean RTC_MATCHWORD
-
- > libres->rt_MatchPtr != (APTR)libres )
- > /* rt_MatchPtr is wrong - I forget the real name */
- I think this is rt_MatchTag and I've found that in most
- cases, if these pointers arent the same then I get bad data.
-
- > {
- > /* copy fields */
- > }
- > else
- > /* not a library */
- > UnLoadSeg(libseg);
- > }
-
- This code says to me that if any of these fields != then I have
- a valid library?? Can this be right.If I loadseg() say amigaguide.library
- then I get...
-
- libres[-1] == 0x70ff4e75,
- rt_MatchWord == RT_MATCHWORD
- rt_MatchPtr == (APTR)libres
-
- So that doesnt work.
-
-
- I also received the follwing from Martin Frost (thanks Martin)...
-
- > > ResLib=(struct Resident *)((LONG *)BADDR(LibSeg)+2);
- >
- > Don't you actually need
- >
- > for(ResLib=(struct Resident *)BADDR(LibSeg);
-
- Getting ResLib this way allways fails for me.
- Plus I Dont know why you have this in a for() loop.
-
- > ResLib->rt_MatchWord==0x4AFC && ResLib->rt_MatchPtr==ResLib;
- ^^^^^^^^^^^
- rt_MatchTag
- > (UWORD *)ResLib++);
- >
-
- In looking at the includes (exec/resident.h) the comment beside
- rt_MatchWord is /* word to match on (ILLEGAL) */ Does this mean
- its illegal to use this field??
-
-
- Thanks again for any and all help...
-
- Still many questions...isnt ignorance wonderfull!
-
- Norm.
-
- ---------------------------------------------------------------------
- Norman Baccari | "OK team! You start coding.
- normb@gpu.utcc.utoronto.ca | I'll go see what the user specs are."
- Toronto,Ontario,Canada |
- ---------------------------------------------------------------------
-