And now for a specific answer, you can try the following:

// Return true if the database is in a read-only heap (ROM).
Boolean DmDatabaseIsROM ( UInt16 card, LocalID lid ) {
  void *gid;
  unsigned short heapid;

  // The following may be a fairly good indicator, but we need proof.
  gid = MemLocalIDToGlobal(lid, card);
  if ( MemLocalIDKind(lid) == memIDHandle )
    heapid = MemHandleHeapID(gid);
  else
    heapid = MemPtrHeapID(gid);

  // Check to see if the heap the DB is stored in is read only.
  // Read-only heaps are a good identifier of ROM.
  // And yes, I'd treat Handspring Visor Springboard Flash as ROM.
  if ( MemHeapFlags(heapid) & 0x0001 ) /* memHeapFlagReadOnly */
    return true;
  else
    return false;
}

If there are any errors in the above code, I would apprecaite comments.

-----Original Message-----
From: Prakash [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 25, 2004 9:41 PM
To: Palm Developer Forum
Subject: Re: checking if DB is in ROM

somehow i thought it would be easier to find the answer from docs. but i
couldnt too :( but searched in the forum, as i felt sure this question
must've been asked earlier..

check out Aaron's
answer..http://news.palmos.com/read/messages?id=152622#152622

Cheers,
Prakash



On Fri, 25 Jun 2004 15:49:20 -0600, Nathan Black <[EMAIL PROTECTED]>
wrote:
> 
> Ooops! nevermind about my last post, i didn't read right.
> 
> 
> 
> --
> For information on using the Palm Developer Forums, or to unsubscribe, 
> please see http://www.palmos.com/dev/support/forums/
>

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





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

Reply via email to