Share via


USB Function Mass Storage Client Driver Configuration and Implementation (Windows Embedded CE 6.0)

1/6/2010

To implement a USB mass storage class driver, you must provide an emulation implementation for a particular type of mass storage device. The transport handles all USB communication, and the emulation implementation handles commands.

The USB mass storage class driver must abstract one mass storage device. In the USB mass storage class driver registry settings, you must include the arguments to supply to CreateFile: lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, and dwFlagsAndAttributes. In the registry settings for the USB mass storage class driver, you must include the appropriate USB mass storage SubClass and Protocol codes. For more information about the SubClass and Protocol codes, see the USB Mass Storage Class Specification.

During initialization, the emulator reads the SubClass code from the registry to determine whether it can emulate it. Then, the emulator reads the Protocol code from the registry and initializes the transport. The BOT_Init function, CBIT_Init function, or an equivalent function, initializes the transport.

Through the initialization function, the transport determines whether it can support the specified transport protocol. If it can support the specified transport protocol, then the transport adds the specified SubClass and Protocol to the interface descriptor that describes the mass storage device. Otherwise, the transport fails to initialize. The transport layer might contain multiple transport schemes and apply the scheme appropriate to the Protocol code specified at initialization. The transport utilizes CBIT with 64-byte bulk DATA_IN and DATA_OUT endpoints, and a 16-byte interrupt endpoint.

After the emulator initializes the transport, it continues to initialize itself by mounting its associated device. Before exposing the store to the USB host, the USB function mass storage driver dismounts all of partitions in the device storage, including logical partitions. Although the partitions are still visible, they appear unmounted when accessed using the Storage Manager. The device storage partitions should not be remounted while the device storage is exposed to the USB host, because remounting while being exposed can corrupt the device storage.

See Also

Concepts

USB Function Mass Storage Client Driver Development Concepts
USB Function Mass Storage Client Driver

Other Resources

File Systems