IPortableDeviceService::SendCommand method (portabledeviceapi.h)
The SendCommand method sends a standard WPD command and its parameters to the service.
Syntax
HRESULT SendCommand(
[in] const DWORD dwFlags,
[in] IPortableDeviceValues *pParameters,
[out] IPortableDeviceValues **ppResults
);
Parameters
[in] dwFlags
Not used.
[in] pParameters
The IPortableDeviceValues interface specifying the command parameters.
[out] ppResults
The IPortableDeviceValues interface specifying the command results.
Return value
If the method succeeds, it returns S_OK. Any other HRESULT value indicates that the call failed.
Remarks
This method should only be used to send standard WPD commands to the service. To invoke service methods, use the IPortableDeviceServiceMethods interface.
This method may fail even though it returns S_OK as its HRESULT value. To determine if a command succeeded, an application should always examine the properties referenced by the ppResults parameter:
- The WPD_PROPERTY_COMMON_HRESULT property indicates if the command succeeded.
- If the command failed, the WPD_PROPERTY_COMMON_DRIVER_ERROR_CODE property will contain driver-specific error codes.
- WPD_PROPERTY_COMMON_COMMAND_CATEGORY, which should contain a command category, such as the fmtid member of the WPD_COMMAND_COMMON_RESET_DEVICE property
- WPD_PROPERTY_COMMON_COMMAND_ID, which should contain a command identifier, such as the pid member of the WPD_COMMAND_COMMON_RESET_DEVICE property.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps | UWP apps] |
Minimum supported server | None supported |
Target Platform | Windows |
Header | portabledeviceapi.h |