次の方法で共有


Commands

banner art

Previous Next

Commands

The client application and the driver communicate by means of commands that are sent from the client (via the Windows Portable Device API) to the driver (via the User-Mode Driver Framework). Every command includes zero or more parameters, and returns zero or more results.

A client can send a command explicitly, by calling the IPortableDevice::SendCommand method, or implicitly, by calling any of the methods of the client interfaces. A few commands can only be sent explicitly; these are noted in the command's documentation. The command reference pages describe the purpose of a command, as well as what parameters it expects to receive, and what parameters it is expected to return.

A command is identified by a PROPERTYKEY structure. This is made up of two parts: a GUID part (the fmtid member) and a DWORD part (the pid member). The GUID part is used to indicate the category the command belongs to (that is, related commands belong to the same category, therefore will have the same fmtid). The DWORD part indicates the command ID, and is used to distinguish the individual commands within a command category (that is, the pid values for commands in the same category will be different).

The following table lists the categories of commands that Windows Portable Devices defines. Device manufacturers can define their own commands by creating their own command categories and command IDs (that is, a manufacturer should not add commands to the categories listed below, since these are reserved by Microsoft).

Command Categories

Command category Description
WPD_CATEGORY_COMMON Commands that are common to all objects and devices.
WPD_CATEGORY_DEVICE_HINTS Commands that are used to retrieve optional device information that can be used to improve end-user experience.
WPD_CATEGORY_SMS Commands that are used for devices that support short message service (SMS) functionality, which is typically exposed on mobile phones.
WPD_CATEGORY_STILL_IMAGE_CAPTURE Commands that are used for devices that support still image capture.
WPD_CATEGORY_STORAGE Commands for storage functional objects.

The specific commands that are defined for each of these types are given in the following tables, organized by command type.

WPD_CATEGORY_COMMON Category

Command Description
WPD_COMMAND_COMMON_RESET_DEVICE Resets the device.

WPD_CATEGORY_DEVICE_HINTS Category

 Command Description
WPD_COMMAND_DEVICE_HINTS_GET_CONTENT_LOCATION Retrieves the object IDs of folders that can hold an object of a specified type.

** WPD_CATEGORY_STORAGE Category**

Command Description
WPD_COMMAND_STORAGE_EJECT Ejects a storage medium that can be ejected remotely by the driver.
WPD_COMMAND_STORAGE_FORMAT Formats a storage functional object on the device.

** WPD_CATEGORY_SMS Category**

Command Description
WPD_COMMAND_SMS_SEND Initiates the sending of an SMS message by an SMS functional object.

** WPD_CATEGORY_STILL_IMAGE_CAPTURE Category**

Command Description
WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE Initiates a still image capture by a still image functional object.

See Also

Previous Next