Table of contents
TOC
Collapse the table of content
Expand the table of content

Supporting the Capability Commands

Last Updated: 1/24/2017

The sample driver supports ten capability commands for a device and 14 capability commands for a service. The code that supports the device-capability commands is found in WpdCapabilities.cpp. The code that supports the service-capability commands is found in WpdServiceCapabilities.cpp. WPD invokes these commands when an application retrieves device-capability or service-capability data. For example, when an application calls IPortableDeviceServiceCapabilities::GetSupportedFormats, WPD issues a corresponding WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMATS command to the driver to retrieve the supported formats for a given service.

The Device-Capability Commands

The device-capability commands are issued when an application calls one of several methods in the IPortableDeviceCapabilities interface. These commands are processed initially by the WpdCapabilities::DispatchMessage method that in turn, invokes a corresponding command handler. The DispatchMessage method and the individual handlers are found in the WpdCapabilities.cpp file.The following table describes each of the device-capability commands together with the names of the handlers that DispatchMessage calls when it processes a given command.

CommandHandlerDescription
WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDSOnGetSupportedCommandsIssued when an application tries to retrieve the set of commands that are supported by the device.
WPD_COMMAND_CAPABILITIES_GET_COMMAND_OPTIONSOnGetCommandOptionsIssued when an application tries to retrieve the options that are supported by a given command.
WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FUNCTIONAL_CATEGORIESOnGetFunctionalCategoriesIssued when an application tries to retrieve the set of functional categories that are supported by the device.
WPD_COMMAND_CAPABILITIES_GET_FUNCTIONAL_OBJECTSOnGetFunctionalObjectsIssued when an application tries to retrieve the set of functional objects that are supported by a given functional category.
WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_CONTENT_TYPESOnGetSupportedContentTypesIssued when an application tries to retrieve the content types that are supported by a given functional category.
WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMATSOnGetSupportedFormatsIssued when an application tries to retrieve the set of formats that are supported by a given content type.
WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIESOnGetSupportedFormatPropertiesIssued when an application tries to retrieve the set of properties that are supported by a given format.
WPD_COMMAND_CAPABILITIES_GET_FIXED_PROPERTY_ATTRIBUTESOnGetFixedPropertyAttributesIssued when an application tries to retrieve the set of property attributes that are identical (or fixed) for all objects of a given format.
WPD_COMMAND_CAPABILITIES_GET_EVENT_OPTIONSOnGetEventOptionsIssued when an application tries to retrieve the options that are associated with a given event.
WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_EVENTSOnGetSupportedEventsIssued when an application tries to retrieve the set of events that are supported by a device.

The Service-Capability Commands

The service-capability commands are issued when an application calls one of several methods in the IPortableDeviceServiceCapabilities interface. These commands are processed initially by the WpdServiceCapabilities::DispatchMessage method that, in turn, invokes a corresponding command handler. The DispatchMessage method and the individual handlers are found in the WpdServiceCapabilities.cpp file.The following table describes each of the device-capability commands together with the names of the handlers that DispatchMessage calls when it processes a given command.

CommandHandlerDescription
WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_COMMANDSOnGetSupportedCommandsIssued when an application tries to retrieve the set of commands that are supported by the given service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_COMMAND_OPTIONSOnGetCommandOptionsIssued when an application tries to retrieve the options that are supported by a given command.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODSOnGetSupportedMethodsIssued when an application tries to retrieve the methods that are supported by the given service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS_BY_FORMATOnGetSupportedMethodsByFormatIssued when an application tries to retrieve the methods that are supported by a given format on the given service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_ATTRIBUTESOnGetMethodAttributesIssued when an application tries to retrieve the attributes for a given method.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_PARAMETER_ATTRIBUTESOnGetMethodParameterAttributesIssued when an application tries to retrieve the attributes for a given method parameter.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FUNCTIONAL_CATEGORIESOnGetFunctionalCategoriesIssued when an application tries to retrieve the set of functional categories that are supported by the given service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMATSOnGetSupportedFormatsIssued when an application tries to retrieve the formats that are supported by a given service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_ATTRIBUTESOnGetFormatAttributesIssued when an application tries to retrieve the attributes of a given format that is supported by the service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIESOnGetSupportedFormatPropertiesIssued when an application tries to retrieve the set of properties that are supported by a given format.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_PROPERTY_ATTRIBUTESOnGetFormatPropertyAttributesIssued when an application tries to retrieve the set of property attributes for a given format on the service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_EVENTSOnGetSupportedEventsIssued when an application tries to retrieve the events that are supported by the given service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_ATTRIBUTESOnGetEventAttributesIssued when an application tries to retrieve the attributes for a given event on the service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_PARAMETER_ATTRIBUTESOnGetEventParameterAttributesIssued when an application tries to retrieve the parameter attributes for a given event on the service.
WPD_COMMAND_SERVICE_CAPABILITIES_GET_INHERITED_SERVICESOnGetInheritedServicesIssued when an application tries to retrieve the services that are inherited by the given service.

The WpdServiceSampleDriver

The WPD Driver Samples

Send comments about this topic to Microsoft

© 2017 Microsoft