The client application and the driver communicate with each other by using commands that are sent from the client. The commands are sent via the Microsoft Windows Portable Devices (WPD) application programming interface (API), to the driver, via the Windows Driver Frameworks (WDF)-User-Mode Driver Framework (UMDF). Every command includes zero or more parameters, and returns zero or more results.
A client can send a command explicitly, by calling either the IPortableDevice::SendCommand or IPortableDeviceService::SendCommand method, or implicitly, by calling any of the methods of the client interfaces. For more information about the methods in the client interfaces, see the WPD Software Development Kit (SDK). A few commands can only be sent explicitly. This information is noted in the documentation for the specific command. 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 structure consists 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 that 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. However, a manufacturer should not add commands to the categories that are listed below, because these are reserved by Microsoft.
|WPD_CATEGORY_CAPABILITIES||Commands that are used to query device capabilities.|
|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 the experience for the end user.|
|WPD_CATEGORY_MEDIA_CAPTURE||Commands that are used to capture media.|
|WPD_CATEGORY_NETWORK_CONFIGURATION||Commands that are used to associate network devices or configure WiFi devices.|
|WPD_CATEGORY_OBJECT_ENUMERATION||Commands that are used for basic object enumeration.|
|WPD_CATEGORY_OBJECT_MANAGEMENT||Commands that create and delete objects on the device.|
|WPD_CATEGORY_OBJECT_PROPERTIES||Commands that are used to perform simple manipulation of object properties, also known as metadata, such as reading and writing values, and listing supported values.|
|WPD_CATEGORY_OBJECT_PROPERTIES_BULK||Commands that are used to perform property manipulation on multiple objects for a bulk operation call.|
|WPD_CATEGORY_OBJECT_RESOURCES||Commands that are performed on object resources.|
|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.|
|WPD_CLASS_EXTENSION_V1||Commands that support the WPD Class Extension component.|
|WPD_CLASS_EXTENSION_V2||Additional commands that are implemented by the WPD Class Extension component for device service registration.|
|WPD_CATEGORY_SERVICE_COMMON||Commands that are common for all device services.|
|WPD_CATEGORY_SERVICE_CAPABILITIES||Commands that are used to query device service capabilities.|
|WPD_CATEGORY_SERVICE_METHODS||Commands that are used to invoke methods on a device service.|
The specific commands that are defined for each of these types are listed in the following tables and lists, organized by command type.
|WPD_COMMAND_COMMON_GET_OBJECT_IDS_FROM_PERSISTENT_UNIQUE_IDS||Retrieves the current object IDs of one or more objects, given their Persistent Unique IDs (PUIDs).|
|WPD_COMMAND_COMMON_RESET_DEVICE||Resets the device.|
|WPD_COMMAND_COMMON_SAVE_CLIENT_INFORMATION||Provides information about a client that opened a connection to this device driver.|
|WPD_COMMAND_CAPABILITIES_GET_COMMAND_OPTIONS||Retrieves a list of options, if any, that are supported by a specified command.|
|WPD_COMMAND_CAPABILITIES_GET_FIXED_PROPERTY_ATTRIBUTES||Retrieves a list of property attributes that have the same value on all objects of a specified format, on a device.|
|WPD_COMMAND_CAPABILITIES_GET_FUNCTIONAL_OBJECTS||Retrieves the object IDs of functional objects of a specific category on a device.|
|WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS||Retrieves all commands supported by the driver.|
|WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_CONTENT_TYPES||Retrieves the content types that are supported for a given functional category.|
|WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES||Retrieves all the properties that a device supports for an object of a given format.|
|WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMATS||Retrieves the formats that are supported for a given content type, on the device.|
|WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FUNCTIONAL_CATEGORIES||Retrieves the functional categories that are supported by the driver.|
|WPD_COMMAND_DEVICE_HINTS_GET_CONTENT_LOCATION||Retrieves the object IDs of folders that can hold an object of a specified type.|
|WPD_COMMAND_MEDIA_CAPTURE_START||Initiates a media capture operation.|
|WPD_COMMAND_MEDIA_CAPTURE_STOP||Stops a media capture operation.|
|WPD_COMMAND_MEDIA_CAPTURE_PAUSE||Pauses a media capture operation|
|WPD_COMMAND_GENERATE_KEYPAIR||Initiates the generation of a public/private key pair and returns the public key.|
|WPD_COMMAND_COMMIT_KEYPAIR||Instructs the device to save a previously generated public/private key pair in secure storage and to establish a private link between a NETWORK_ASSOCIATION object and the key pair|
|WPD_COMMAND_PROCESS_WIRELESS_PROFILE||Instructs the device to interpret a specified WIRELESS_PROFILE object.|
|WPD_COMMAND_OBJECT_ENUMERATION_START_FIND||Initiates an object enumeration session on the device.|
|WPD_COMMAND_OBJECT_ENUMERATION_FIND_NEXT||Requests the next group of object IDs during an enumeration session that WPD_COMMAND_OBJECT_ENUMERATION_START_FIND opened.|
|WPD_COMMAND_OBJECT_ENUMERATION_END_FIND||Closes an enumeration session that WPD_COMMAND_OBJECT_ENUMERATION_START_FIND opened.|
|WPD_COMMAND_OBJECT_PROPERTIES_DELETE||Deletes properties from a specified object.|
|WPD_COMMAND_OBJECT_PROPERTIES_GET||Requests one or more property values for a specified object.|
|WPD_COMMAND_OBJECT_PROPERTIES_GET_ALL||Retrieves all property values for a specified object.|
|WPD_COMMAND_OBJECT_PROPERTIES_GET_ATTRIBUTES||Requests all property attributes for a specified property of a specified object.|
|WPD_COMMAND_OBJECT_PROPERTIES_GET_SUPPORTED||Requests a list of properties available on a specified object.|
|WPD_COMMAND_OBJECT_PROPERTIES_SET||Writes a set of property values to a specified object.|
Initializes a bulk request for multiple property values from multiple objects that are filtered by object format.
Requests a batch of property values for a specific format in a bulk session that was opened by WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_START
Ends a bulk property request that WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_START began.
Initializes a bulk request for multiple property values of specified objects.
Retrieves a batch of property values in a bulk request was started when WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_START was called.
Ends a bulk property request was started when WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_START was called.
Initializes a bulk request to set multiple property values of specified objects.
Specifies the next group of properties to set in a bulk property assignment that was started when WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_START was called.
Ends a bulk property set request that started when WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_FORMAT_START was called.
|WPD_COMMAND_OBJECT_RESOURCES_CLOSE||Closes a read/write channel to a resource that WPD_COMMAND_OBJECT_RESOURCES_OPEN or WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE opened.|
|WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE||Creates a new resource for the specified object.|
|WPD_COMMAND_OBJECT_RESOURCES_DELETE||Deletes one or more resources from an object.|
|WPD_COMMAND_OBJECT_RESOURCES_GET_ATTRIBUTES||Retrieves all attribute values for a specified resource on an object.|
|WPD_COMMAND_OBJECT_RESOURCES_GET_SUPPORTED||Retrieves a list of resources that an object can support.|
|WPD_COMMAND_OBJECT_RESOURCES_OPEN||Opens a channel to read from or write to a resource on an object.|
|WPD_COMMAND_OBJECT_RESOURCES_READ||Reads a block of data from a resource that was opened with WPD_COMMAND_OBJECT_RESOURCES_OPEN.|
|WPD_COMMAND_OBJECT_RESOURCES_REVERT||Cancels a resource creation process that was started with WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE.|
|WPD_COMMAND_OBJECT_RESOURCES_SEEK||Seeks to a specified offset in the resource data stream that was opened in WPD_COMMAND_OBJECT_RESOURCES_OPEN or WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE.|
|WPD_COMMAND_OBJECT_RESOURCES_WRITE||Writes a block of data to a resource that was opened with WPD_COMMAND_OBJECT_RESOURCES_OPEN or WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE.|
Completes the creation of an object with resource data on a device.
Creates a new object with both properties and resources on the device.
Creates a new object with only properties (that has no resources) on a device.
Copies the specified objects to a new location on the device.
Removes a set of objects from the device.
Moves objects on the device to another destination folder on the device.
Cancels an object creation process that is currently in progress.
Writes a block of data to an object that is newly created by calling WPD_COMMAND_OBJECT_MANAGEMENT_CREATE_OBJECT_WITH_PROPERTIES_AND_DATA.
|WPD_COMMAND_STORAGE_EJECT||Ejects a storage that can be ejected remotely by the driver.|
|WPD_COMMAND_STORAGE_FORMAT||Formats a storage functional object on the device.|
|WPD_COMMAND_SMS_SEND||Initiates the sending of a short message service (SMS) message by an SMS functional object.|
|WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE||Initiates a still image capture by a still image functional object.|
|WPD_COMMAND_CLASS_EXTENSION_WRITE_DEVICE_INFORMATION||Updates the device-specific information that is required by the class extension such as the device's friendly name.|
|WPD_COMMAND_CLASS_EXTENSION_REGISTER_SERVICE_INTERFACES||Registers a device service to enable WPD clients to discover and connect to the service.|
|WPD_COMMAND_CLASS_EXTENSION_UNREGISTER_SERVICE_INTERFACES||Unregisters a device service so that WPD clients can no longer discover or connect to the service.|
|WPD_COMMAND_SERVICE_COMMON_GET_SERVICE_OBJECT_ID||Retrieves the device service’s object identifier|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS||Retrieves all methods that a device service supports.|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS_BY_FORMAT||Retrieves the methods that apply to a format that a device service supports|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_ATTRIBUTES||Retrieves the attributes of a method that a device service supports (such as the method’s name, associated format, and parameters).|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_PARAMETER_ATTRIBUTES||Retrieves the attributes of a method parameter that a device service supports (such as the parameter’s name, data type, form, and order).|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMATS||Retrieves the formats that a device service supports.|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_ATTRIBUTES||Retrieves the attributes of a format that a device service supports (such as the format’s name).|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES||Retrieves the properties for a given format that a device service supports.|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_PROPERTY_ATTRIBUTES||Retrieves the attributes on a property of a given format that a device service supports.|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_EVENTS||Retrieves the events that a device service supports|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_ATTRIBUTES||Retrieves the attributes of an event that a device service supports (such as the event name, parameters, and whether the event is for notification or action purposes).|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_PARAMETER_ATTRIBUTES||Retrieves the attributes of an event parameter that a device service supports (such as the parameter’s name, data type, form, and order).|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_INHERITED_SERVICES||Retrieves the services that a device service inherits from.|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_RENDERING_PROFILES||Retrieves the resource rendering profiles for a format that a device service supports.|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_COMMANDS||Retrieves the commands that a device service supports.|
|WPD_COMMAND_SERVICE_CAPABILITIES_GET_COMMAND_OPTIONS||Retrieves the options on a command that a device service supports.|
|WPD_COMMAND_SERVICE_METHODS_START_INVOKE||Starts the invocation of a method on a device service.|
|WPD_COMMAND_SERVICE_METHODS_END_INVOKE||Completes the invocation of a method on a device service.|
|WPD_COMMAND_SERVICE_METHODS_CANCEL_INVOKE||Cancels the invocation of a method on a device service.|