>Are you doing the two key things needed to lock a program? >1) Use DmGetResource and MemHandleLock to lock your resource in >place >2) Use DmProtectDatabase to protect your program's database from >being removed
This is exactly what we're doing now. (We don't have a current issue with NVFS anymore in our own apps) But, we had to discover this with trial and error as we couldn't find any documentation at the time (a few months ago), which was frustrating beyond belief! We check the lock count to make sure we don't inadvertantly overlock or unlock the resources, especially if the user soft resets the device before we save our app preferences. Because of this, we ended up moving the critical code to separate code resource and locking them there, because we were afraid the system might itself also lock an unlock the main code resource so we wouldn't know what the correct "baseline" lock count would be. >The DBCache layer is separated from the Memory Manager layer, but >DBCache >does check the lock status of a block before removing it from the >cache. That's fine, and I'm glad the newer devices will integrate the memory manager too, but from an application standpoint, NVFS should also be somewhat integrated with the notification manager to keep notification callbacks working. It's a simple fix, and it would keep a lot of applications that haven't been patched from crashing. This (using notification callbacks with NVFS) should also be specifically mentioned in the NVFS whitepaper. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
