The internal file system in your target device controls access to ROM. The file system can also provide file storage in the object store, which is in RAM. Two internal file system options are available: the RAM and ROM file system and the ROM-only file system. These have different properties and you will want to select the correct one for your target device. Both internal file systems provide the ability to mount additional external file systems, such as file allocation table (FAT).
The RAM and ROM file system provides file storage in the object store, as well as access to the ROM. The object store is the root of the file system, and all data under the root is stored in the object store, with the exception of external file systems, which are mounted as directories under the root. Data in ROM is accessible through the Windows directory. The RAM and ROM file system is most useful in target devices that continuously power RAM because the object store is lost when RAM is not refreshed.
The ROM-only file system does not allow applications to place files in the object store. Data in ROM is accessible through the Windows directory, and external file systems are again mounted as directories under the root. Additionally, with the ROM-only file system, you have the option of choosing an external file system to be placed at the root of the file system. If you mount a file system as the root, all data below the root directory is stored in that file system, with the exception of other external file systems.
|Platform Builder for Microsoft Windows CE 5.0|
Send Feedback on this topic to the authors
A Windows Mobile-based device can mount an installable file system as the root of the virtual file system (“"). When you mount an external file system as the root, all data below the root directory is stored in the mounted file system. Files and directories of the external file system appear as directories off the root directory; subdirectories of the external file system appear as subdirectories of the root directory. Calls routed to other external volumes, such as NETWORK or HardDisk, will retain those names, and calls into those volumes will be routed appropriately.
Including the ROM-only component
To implement an installable file system as the root, you must include the ROM-only file system component in the run-time image instead of the ROM/RAM file system component (SYSGEN_FSROMONLY=1). If the combined RAM and ROM object store system is present in the run-time image, then the object store will always become the root file system.
Note If you choose to use a file system other than the object store as the root file system, the majority of ActiveSync functionality will not work correctly. ActiveSync assumes that the object store is used as the root file system.
Only one file system may be registered as the root file system. After one root file system is registered, any subsequent file system making the attempt will be registered, but will not become the root file system. To register a different file system as the root file system, first de-register the previous root file system. At that point, there will be no root file system and the directory Windows will no longer be shadowed.
Registering the file system as root
When drivers are loaded and file systems are mounted, the desired file system is registered in a special way to indicate that it should become the root. Before this registration is made, all file API calls accessing files or directories in paths off the root will fail, except those paths that are in ROM.
The following list describes important registry values that must be set in the HKEY_LOCAL_MACHINESystemStorageManagerProfiles<MyProfile><MyFileSystem> registry key.
|MountAsRoot: dword||To explicitly mount a file system as the root directory, set the MountAsRoot value to 1.
The root file system is defined as the first file system volume to mount that has the MountAsRoot property. The property is specified in the registry profile of a storage device.
|MountAsBootable: dword||To explicitly mount a file system as the boot file system, set the MountAsBootable value to 1.
If multiple mounted file systems have the MountAsBootable value set, the first one to mount will be used as the boot file system.
For most target devices, Microsoft recommends mounting the same file system as both the root and boot file system.
|MountPermanent||To explicitly prevent a file system from being programmatically dismounted, set the MountPermanent value to 1.
A boot partition typically contains critical system files, such as the registry. If you mount a partition as bootable, this value ensures that the bootable partition cannot later be programmatically dismounted.
The following example mounts the first FATFS partition on a storage device reporting profile MyProfile as both the root and boot file system, and makes the partition permanent to prevent programmatic dismounting:
[HKEY_LOCAL_MACHINESystemStorageManagerProfiles<MyProfile>FATFS] "MountAsRoot"=dword:1 "MountAsBootable"=dword:1 "MountPermanent"=dword:1
In Windows CE 4.x, true shadowing was not possible; the Windows directory was either the installed file system, or a ROM-only file system, rather than the combination of both implied by the term shadow.
In Windows CE versions 5.0 and later, an installed file system provides true shadowing between a Windows directory at the root and the ROM; that is, the files a user sees are in a combination of the two places.