Mounting an Installable File System as the Root Directory (Windows Embedded CE 6.0)
1/6/2010
A Windows Embedded CE-based device can mount an installable file system as the root of the virtual file system represented by a backslash (\). When you mount an external file system at the root directory, all data below the root directory is stored in the mounted file system. Files and directories of the external file system appear as directories of the root directory. Subdirectories of the external file system appear as subdirectories of the root directory. Calls that are routed to other external volumes, such as \NETWORK or \HardDisk, retain those names, and calls into those volumes are routed appropriately.
Including the ROM-Only Component
To implement an installable file system as the root directory, you must include the ROM-only file system component in the run-time image, instead of the ROM/RAM file system component (SYSGEN_FSROMONLY is set to 1). If the combined RAM and ROM object store system is present in the run-time image, the object store always becomes the root file system.
Note
You must include the file system replication filter in your OS design for ActiveSync to work correctly when you are mounting a file system as the root directory.
Only one file system can be registered as the root file system. After one root file system is registered, any subsequent file system that attempts to register is registered, but it does not become the root file system. To register a different file system as the root file system, first deregister the previous root file system. At that point, there is no root file system, and the Windows directory is no longer shadowed (protected).
Registering the File System as Root Directory
When drivers are loaded and file systems are mounted, the desired file system is registered to indicate that it becomes the root directory. Before this registration, all file API calls that access files or directories in paths off the root directory fail, except for paths that are in ROM.
The following list describes important registry values that must be set in the HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\<MyProfile>\<MyFileSystem> registry key.
Value:type | Description |
---|---|
MountAsRoot: DWORD |
To explicitly mount a file system as the root directory, set MountAsRoot 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 MountAsBootable to 1. If multiple mounted file systems have the MountAsBootable value set, the first one to mount is used as the boot file system. For most target devices, Microsoft recommends mounting the same file system as both the root file system and the boot file system. |
MountPermanent |
To explicitly prevent a file system from being programmatically dismounted, set MountPermanent 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. |
Example
The following example mounts the first FATFS partition on a storage device reporting the profile MyProfile as both the root file system and the boot file system, and makes the partition permanent to prevent programmatic dismounting:
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\<MyProfile>\FATFS]
"MountAsRoot"=dword:1
"MountAsBootable"=dword:1
"MountPermanent"=dword:1
File Shadowing
In Windows Embedded CE 4.x, true shadowing is not possible. The \Windows directory is either the installed file system or a ROM-only file system, rather than a combination of both.
In Windows CE 5.0 and later, an installed file system provides true shadowing between a Windows directory at the root directory and the ROM. That is, the files that a user sees are in two places.