Freigeben über


Mounting an Installable File System as the Root Directory (Windows CE 5.0)

Send Feedback

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_MACHINE\System\StorageManager\Profiles\<MyProfile>\<MyFileSystem> registry key.

Value:type Description
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.

Example

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_MACHINE\System\StorageManager\Profiles\<MyProfile>\FATFS]
    "MountAsRoot"=dword:1
    "MountAsBootable"=dword:1
    "MountPermanent"=dword:1

File shadowing

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.

See Also

Installable File System

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.