A surprise power-off is safe in many situations, but not always. WinCE does access the flash memory only when triggered by the user application in the following situations:
The user application requests to flush the registry
The user application writes data to the ConfigBlock
The user application writes/modifies files on any flash drive (\SD Card, \USB HD\ or \Flashdisk\
(1) and (2) are rare operations, and typically triggered by user interactions.
(3) can be more of an issue. Even though using a TFAT file system helps a lot, we have no control over the firmware inside a flash drive.
You can finish all OS writes by dismounting the flash drive. However, any write operation is reported to the OS as finished as soon as the data arrives in the flash drive’s cache.
If you want to cover the worst case situation, I recommend to wait for 1-2 seconds after the OS dismounted the flash drives in order to give the flash drive firmware time to program the cached data into the actual flash.