(My apologies for the double post - OE obviously has problems with
multiple messages open for posting).

From: "Vesselin Bontchev" <[EMAIL PROTECTED]>
> > > From: Chris Tutty
> > >> From memory you create a code segment, attach it to your app
> > >> as a resource (Ben's answer to my question on how to do this
> > >> should be in the archive), load and lock it and then redirect the
> > >> trap through that code segment.
> > >
> > > Ugh. Why is that necessary? Can't you just use SysSetTrapAddress
> > > to intercept trap 0xA0A7 (sysTrapsysUIAppSwitch) with a function
> > > in your normal code segment?
>
> Hmmm... I just found an application that pretty much does what I want
> (except that it intercepts only application launching and I want to
intercept
> other things too) - and, from looking at the disassembly, it doesn't seem
> to be doing such stuff.
>
What's it called?  It might be the app I wrote  :-)  Alternatively it's a
competing app.  They both, of course, use the same underlying mechanisms.

> Yup, it checks the OS version and registers a notification under PalmOS
5.x. Under the lower versions it just uses SysSetTrapAddress to point trap
0xA0A7 to a subroutine in its code segment. It also uses FtrSet to remember
that it is intercepting something (because the interception can be turned
off). But it doesn't have additional code segments or anything like that...
In order to make sure that its code segment doesn't disappear, it locates it
(CurAppDatabase, DmOpenDatabase, DmGetResource) and locks it (MemHandleLock)
and protects the database where it resides (DmDatabaseProtect).
>
Sounds more like a different app.  I didn't want to keep the whole
app in memory so I built a code segment that just does the background
stuff and left that behind when the rest of the app unloaded.  Probably
doesn't matter in the modern devices, but people used to get serious
about a few bytes wasted in the old devices.

> > If you were willing to release a code sample that
> > implements the hackmaster-independent mechanism as open source
> > I'd be happy to contribute some of my existing code to it. I just
> > don't have the time to turn that code into a sample and document
> > it.
>
> Unfortunately, the nature of the application I'm developing is such
> that it simply cannot be released as open source
(snip)
> Furthermore, I'm a bit opposed to the concept of the GNU license
> myself. I mean, if I release something like that, it would mean that
anyone
> who uses any part of it in their application, has to release that
application
> as open source too - and I find such a restriction unacceptable.
>
I agree, as licenses go that sort of virus just forces people to reinvent
the same mechanism.  Not to mention that I"ve seen more confusion about
what the the GPL does and does not allow than any other license.  I've
also seen directly conflicting answers to the same question.  If you're
going to give something away then you give it away - the coercion associated
with the GPL has just confused it's use to the point where it becomes a
hindrance rather than an assistance.  I've worked in projects where the
managers issued a blanket ban on using any tool with a GPL license in
it, in spite of the fact that we weren't in violation of the license, simply
out of FUD.

> However, I am perfectly willing to develop a sample demonsrating how
> to intercept things (i.e., not the actual application I'm writing) and
release
> its source in the public domain (i.e., anyone is allowed to use it in any
> way they want).
>
Now THAT's what I think Palm OS needs more of.  There are a set of
quite complex subjects (accessing the addressbook is another) that
aren't well documented and for which the original PIM app source
code is just confusing.  I've been trying to put together some sample
source code for a while now but just don't have the time.

I'll mail you off-list on this, as I need to investigate the extent to which
I'm limited by an NDA on my original Palm OS 5 work in regards to
my giving away my Palm OS 4 work.

Chris Tutty


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to