Partager via


Step 3: Configure Registry Settings in Your OS Design (Compact 7)

3/12/2014

To configure registry settings in your OS design to support Device Stage, modify the mediaapps.reg file, which you can find at:

%_WINCEROOT%\Public\Mediaapps\Oak\Files\Mediaapps.reg

This file contains a set of registry keys that you use to configure MTP Responder.

Device Information

To identify and install the device in Windows, associate the device with a metadata package on the computer, and display information about the device in a Device Stage baseline presentation, you must add the device information entries to the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder

The registry entries to include are listed in the following table.

Name Type Default value Description

DeviceModelName

REG_SZ

Windows Embedded Generic Device

The device model name that MTP uses to respond to GetDeviceInfo requests, for example, "Contoso GPS".

DeviceFriendlyName

REG_SZ

Windows Embedded Generic Device

The friendly, or display name that MTP uses to respond to GetDevicePropDesc requests, for example "Contoso GPS."

ModelID

REG_SZ

Generated if not specified

A 128-bit GUID that associates a device with a Device Stage presentation, regardless of how the device is connected to the computer. For example, "{52620BB4-2F18-4e92-9494-A03A38719}".

For more information about hardware IDs and model IDs, see the following documents in the Microsoft Device Experience Development Kit.

  • Windows 7 Device Stage Portable Device Class Development Guide
  • Windows 7 Device Stage Reference Guide

See also ModelID Element.

If you do not specify the ModelID, MTP Responder will generate one for you.

DeviceVersion

REG_SZ

No default

The version information that MTP uses to respond to GetDeviceInfo requests, for example "1.2".

FunctionalID

REG_SZ

Generated if not specified

The 128-bit GUID, which is permanent for the life of the device, that uniquely identifies an MTP device that is connected through multiple transports, for example "{2BB4074E-E469-4d1d-A028-615D91AA4D21}".

For more information about the functional ID, see the MTP Device Services Extension Specification

If you do not specify the FunctionalID, MTP Responder will generate one for you at device boot time.

ContainerID

REG_SZ

Generated if not specified

An identifier that informs Windows 7 that multiple functional device instances actually originate from the same physical device. For more information about container IDs, see Multifunction Device Support and Device Container Groupings

If you do not specify the ContainerID, MTP Responder will generate one for you at device boot time.

Note

Device Stage displays your device as a "Composite (multi transport) Device" even if the device has only one MTP transport configured. MTP Responder reports a functional ID to the MTP initiator on the user’s computer, even if you do not configure FunctionalID in the registry settings previously mentioned. Therefore, Device Stage assumes that your device supports MTP connections over more than one transport. For more about multi transport devices, see Multi-Transport Devices in Windows 7

To disable the FunctionalID or ModelID settings, modify the Devicesettings.xml file, which you can find at:

%_WINCEROOT%\Public\Mediaapps\Oak\Files\Devicesettings.xml

In <DevicePropertiesSupported>, find the declarations for the FunctionalID and ModelID properties.

<DevicePropertiesSupported>
<Base>0x5001</Base> <!-- BATTERYLEVEL -->
<Base>0xD301</Base> <!-- FUNCTIONID -->
<Base>0xD302</Base> <!-- MODELID -->
<Base>0xD401</Base> <!-- SYNCHRONIZATIONPARTNER -->
<Base>0xD402</Base> <!-- DEVICEFRIENDLYNAME -->
<Base>0xD405</Base> <!-- DEVICEICON -->
</DevicePropertiesSupported>

When you remove the FUNCTIONID element previously shown, MTP Responder will not report a functional ID to the MTP initiator, even if you specify the FunctionalID in the registry. When you remove the MODELID element previously shown, MTP Responder will not report a model ID to the MTP initiator, even if you specify the ModelID in the registry.

Transport Information

If you are using the MTP USB transport, you must add the product ID and vendor ID settings to the registry key:

HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\MTPUSBFn

These settings are described in the following table.

Name Type Default value Description

idProduct

REG_DWORD

0x0622

A bus-specific product identifier that associates a device with a Device Stage presentation, for example, DWORD:0622. For more information, see USB Function Client Driver Registry Settings.

IdVendor

REG_DWORD

The four-digit vendor code that the USB committee assigns to the vendor. Remember to change this value to your vendor ID; 045E is reserved for use by Microsoft.

For more information, see

To obtain a vendor ID, see Universal Serial Bus.

Also see Standard USB Identifiers.

If you are using the MTP IP transport, you must add the product description and manufacturer URL to the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder

These settings are described in the following table.

Name Type Default value Description

ProductDescription

REG_SZ

Empty String/NULL

The description of the device that is displayed. For example, "Portable Navigation Device with 4.3 inch screen".

ManufacturerURL

REG_SZ

Empty String/NULL

The URL for your company’s website.

Device Metadata Service

To transfer a customized presentation from the device to the computer when the device first connects to the MTP initiator, you must add the Path, ContentID, and Flags registry settings to the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder\Metadata\<Locale>

where <Locale> is the value from the Locale element in PackageInfo.xml in the device metadata package. These settings are described in the following table.

Name Type Default value Description

Path

REG_SZ

No default

The absolute path (on the device) to the device metadata package for the locale, for example Hard Disk1\WDS Metadata.

ContentID

REG_SZ

No default

A unique GUID string in the registry in CLSID format ( "{1234-…}" ) that is assigned by the Windows logo signing process, for example "{C23954F9-80A1-497d-AB9A-EFE0EFCEAA9C}".

Flags

REG_DWORD

No default

Set to 1 to designate that this package has the attribute <locale default="true"> in the PackageInfo.xml file in a device metadata package; otherwise, 0 (zero).

For a list of locale identifier strings, see Language Identifier Constants and Strings.

For more information about how Windows 7 uses the locales specified in device metadata packages, see "How to Localize Device Stage Experiences" in the Windows 7 Device Stage Reference Guide in the Microsoft Device Experience Development Kit.

MTP Storage Settings

For users to be able to browse files on their device from a computer you must define the location for storage of media files and MTP objects on the device. You define the storage location by configuring a registry key in mediaapps.reg, which you can find at:

%_WINCEROOT%\Public\Mediaapps\Oak\Files\Mediaapps.reg

Storage Location

For the storage location on your device, you create a registry key

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder\Storage\<Name>

where <NAME> is the unique name that you choose to label that story location.

For example, if your device has internal flash memory, you could define the following registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder\Storage\Internal

In the registry key for the storage location, you configure the StorageRoot, StorageDescription, and VolumeIdentifier settings, as listed in the following table.

Name Type Default value Description

StorageRoot

REG_SZ

None

The path to this MTP storage location.If you do not specify a StorageRoot path, MTP Responder uses the default storage described in the section "Default Storage".

StorageDescription

REG_SZ

"MTP Storage"

A human-readable string, for example, "Internal Flash Memory".

VolumeIdentifier

REG_SZ

"MTP Volume Identifier"

A unique identifier, such as a serial number. Only the first 128 characters are used to identify the storage device, and they must be unique for the storage device.

Default Storage

When an MTP initiator transfers a media file to MTP Responder without specifying a storage location on the device, MTP Responder stores this file in the default storage location. You can indicate the storage location for MTP Responder to use as the default storage location. To set the default storage location, you configure the DefaultStorage setting in the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder\Storage

This setting is described in the following table.

Name Type Default value Description

DefaultStorage

REG_SZ

None

The name of the default MTP storage location. This name must be identical to the registry key name that you used for this storage location. If you do not include a name here, MTP Responder uses the first enumerated storage. For more information, see Storage Location.

If you do not specify a value for the default storage location and you have not specified a storage location, MTP Responder will use the "My Documents" folder. If the "My Documents" folder is not available, MTP Responder uses "\MTPStorageRoot".

Using the names shown in the section "Storage Location," you can define the following mount point:

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder\Storage\Internal

using "\OnBoardFlash\MediaPartitionRoot" as the value of StorageRoot.

You then configure:

HKEY_LOCAL_MACHINE\Software\Microsoft\MTP\Responder\Storage

using the value "Internal" for DefaultStorage.

Media MDB Settings

To use the Media MDB storage, you must also configure a thumbnail storage location.

Note

Do not configure a watch location that monitors folders or subdirectories in any part of the MTP storage. If a watch location has been defined, the storage that is defined as the watch location will not be synchronized from the host computer.

Thumbnail Storage

With Media MDB storage, your device automatically supports storage and synchronization of thumbnails sent from the MTP initiator. Media MDB thumbnails, also referred to as "representative samples" in the MTP 1.0 Specification, can be small versions of album art for videos, photos, and albums that support them. You must configure the thumbnail storage location, size range, height range, and width range.

To configure the thumbnail storage location, specify the ThumbnailRoot setting in the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Thumbnail

These settings are described in the following table.

Name Type Default value Description

ThumbnailRoot

REG_SZ

\ThumbnailRoot

The path to the location where thumbnails are to be stored.

If you do not specify the default value, MTP Responder will default to "\ThumbnailRoot".

To configure the thumbnail size range, specify the MinimumSize, MaximumSize, and StepSize settings in the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Thumbnail\Size

These settings are described in the following table.

Name Type Default value Description

MinimumSize

REG_DWORD

0

The minimum size of the thumbnail.

MaximumSize

REG_DWORD

1200000 (1.2 MB)

The maximum size of the thumbnail.

StepSize

REG_DWORD

1

The step size between the minimum and maximum size of the thumbnail.

To configure the thumbnail height range, specify the MinimumHeight, MaximumHeight, and StepSize settings in the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Thumbnail\Height

These settings are described in the following table.

Name Type Default value Description

MinimumHeight

REG_DWORD

32

The minimum height of the thumbnail.

MaximumHeight

REG_DWORD

192

The maximum height of the thumbnail.

StepSize

REG_DWORD

16

The step size between the minimum and maximum height of the thumbnail.

To configure the thumbnail width range, specify the MinimumWidth, MaximumWidth, and StepSize settings in the registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Thumbnail\Width

These settings are described in the following table.

Name Type Default value Description

MinimumWidth

REG_DWORD

32

The minimum width of the thumbnail.

MaximumWidth

REG_DWORD

192

The maximum width of the thumbnail.

StepSize

REG_DWORD

16

The step size between the minimum and maximum width of the thumbnail.

The Media Library automatically generates thumbnails when it parses incoming images. You can configure the parameters for thumbnail configuration, including thumbnail size and thumbnail file format. In addition, the Media Library provides a registry location that you can change to disable automatic thumbnail generation. For more information, see Media Library.

After you configure registry settings, go to Step 4: Provide OAL Support for Device Stage.

See Also

Concepts

Implement Device Stage Support