Hi Mike,

Kevin,

Thanks.  I don't get that error when I try to delete something
Don't get that error under what circumstances?

but I get an
error on the debug OS 5 simulator.
What error? Houston, we need more info...

Thanks,

Mike

--- Kevin OKeefe <[EMAIL PROTECTED]> wrote:
 Try to delete it and get the dmErrDatabaseProtected error code?

 It doesn't appear that there is a public method for doing this...

 -----Original Message-----
 From: Mike McCollister [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 11, 2002 9:49 AM
 To: Palm Developer Forum
 > Subject: How to detect if a database is protected


I can protect a database using DmDatabaseProtect but how do I detect if it is
protected?
As others have noted, it doesn't look like there's a good non-destructive method for finding out if a database is protected. Some additional random ideas for pre-5.0, besides (re)writing your own PrvDatabaseIsProtected:

1. Register to receive the database removed notification. Patch out DmOpenDBNoOverlay, and then call DmDeleteDatabase. When DmOpenDBNoOverlay is called, return NULL so DmDeleteDatabase doesn't delete the DB. When DmDeleteDatabase returns, remove your patch.

2. Get the address of a routine like DmInit, and then search backwards for the PrvDatabaseIsProtected routine, and call it with a direct jump.

Both are pretty skanky. On 5.x it gets harder :)

-- Ken
--
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

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

Reply via email to