Error Constants

Header: portabledevice.h

Windows Portable Devices methods can return a variety of HRESULT error codes. Some are specific to Windows Portable Devices, while others are defined by other SDKs or porting kits used to build a device. This section describes the various error codes that can be returned, organized by origin.

WPD defines the following error constants.

SymbolicCodeDescription
E_WPD_DEVICE_ALREADY_OPENED0x802A0001The device connection has already been opened by a prior call to IPortableDevice::Open .
E_WPD_DEVICE_IS_HUNG0x802A0006The device will no longer respond to input.
E_WPD_DEVICE_NOT_OPEN0x802A0002The device connection has not yet been opened by a call to IPortableDevice::Open .
E_WPD_OBJECT_ALREADY_ATTACHED_TO_DEVICE0x802A0003The interface object has already been attached to the device interface.
E_WPD_OBJECT_ALREADY_ATTACHED_TO_SERVICE0x802A00CAThe interface object has already been attached to the IPortableDeviceService interface.
E_WPD_OBJECT_NOT_ATTACHED_TO_DEVICE0x802A0004The interface object has not been attached to the device.
E_WPD_OBJECT_NOT_ATTACHED_TO_SERVICE0x802A00CBThe interface object has not been attached to the IPortableDeviceService interface. Typically, this is returned if the application tries to access methods of an attached interface, such as IPortableDeviceServiceCapabilities , after IPortableDevice::Close is called.
E_WPD_OBJECT_NOT_COMMITED0x802A0005IStream::Commit was never called when creating an object with data on a device.
E_WPD_SERVICE_ALREADY_OPENED0x802A00C8The service connection has already been opened by a prior call to IPortableDevice::Open .
E_WPD_SERVICE_BAD_PARAMETER_ORDER0x802A00CCThe method parameters for IPortableDeviceServiceMethods::Invoke or IPortableDeviceServiceMethods::InvokeAsync are not set in the correct order. The parameter must be set in the ordering specified by WPD_PARAMETER_ATTRIBUTE_ORDER .
E_WPD_SERVICE_NOT_OPEN0x802A00C9The service connection has not yet been opened by a call to IPortableDeviceService::Open .
E_WPD_SMS_INVALID_RECIPIENT0x802A0064The recipient specified for an SMS message is invalid.
E_WPD_SMS_INVALID_MESSAGE_BODY0x802A0065The body of a message specified for an SMS message is invalid.
E_WPD_SMS_SERVICE_UNAVAILABLE0x802A0066The SMS service is unavailable.
NS_E_DRM_DEBUGGING_NOT_ALLOWED0xC00D2767You cannot debug when accessing DRM-protected content.
NS_E_NOT_LICENSED0xC00D00CDThe content is not licensed.
ERROR_ACCESS_DENIED0x80070005May be used to indicate that a read-only object or property cannot be modified or deleted. May be used to indicate that the object is being accessed outside its scope, for example a child object that falls outside the hierarchy of a device service. May be used to indicate that the application does not have the access (for example, if access control to devices is restricted by Group Policy) to send WPD commands to the device.
ERROR_ARITHMETIC_OVERFLOW0x80070216May be used to indicate that the number of elements in a data array has exceeded its limits ( ULONGLONG ).
ERROR_BUSY0x800700AAMay be used to indicate that the device is busy processing another operation. Applications should wait for that operation to complete before retrying.
ERROR_CANCELLED0x800704C7A command sent to the device has been aborted due to a cancellation, e.g. by calling one of the Cancel methods in the WPD API.
ERROR_DATATYPE_MISMATCH0x8007070CMay be used to indicate that an invalid data packet was received from the device.
ERROR_DEVICE_IN_USE0x80070964For an MTP/IP device, indicates that the connection has failed to initialize because the device is in use.
ERROR_DEVICE_NOT_CONNECTE0x8007048FThe device has been disconnected or unplugged.
ERROR_DIR_NOT_EMPTY0x80070091May be used to indicate that a non-recursive delete was called for an object with children. The application should use the recursive delete flag in IPortableDeviceContent::Delete .
ERROR_EMPTY0x800710D2May be used to indicate that the device failed to send any resource data when resource data was expected (e.g. a thumbnail or device icon). This usually indicates an error on the device.
ERROR_FILE_NOT_FOUND0x80070002May be used to indicate that the device has been disconnected or unplugged.
ERROR_GEN_FAILURE0x8007001FMay be used to indicate that the device has stopped responding (hung) or a general failure has occurred on the device. The device may need to be manually reset.
ERROR_INVALID_DATA0x8007000DMay be used to indicate that data sent to or received from the device cannot be parsed correctly. This may indicate a device-side or a transport error. If MTP vendor operations are sent to the device, this error may indicate that the specified operation parameters are not of the valid VARTYPE .
ERROR_INVALID_DATATYPE0x8007070CMay be used to indicate that the specified VARTYPE is invalid for a given property.
ERROR_INVALID_FUNCTION0x80070001A write request was made to a resource on the device that was opened in Read mode using IPortableDeviceResources::GetStream , or a read request was made to a resource opened for Write or Create .
ERROR_INVALID_OPERATION0x800710DDA non-recursive delete is called for an object with children.
ERROR_INVALID_PARAMETER0x80070057The parameter supplied by the application is not valid.
ERROR_INVALID_TIME0x8007076DMay be used to indicate that a conversion of a datetime property has failed.
ERROR_IO_DEVICE0x8007045DMay be used to indicate that the device has stopped responding (hung). The device may need to be manually reset.
ERROR_NOT_FOUND0x80070490May be used to indicate that the device supports a property, but that property value is currently empty or uninitialized. May be used to indicate that the internal context for a long-running operation no longer exists, as the operation has completed or has been cancelled. Examples of such operations include bulk properties, object enumeration, transfer, and invoking device service methods. Applications should retry the operation from the beginning. May be used to indicate that the specified object does not exist. The child object may be outside of the device service hierarchy.
ERROR_NOT_READY0x80070015May be used to indicate that an operation is not initialized correctly. This usually indicates an internal error, or that the application is using a stale device handle. The application should retry the operation from the beginning, or reopen the device.
ERROR_NOT_SUPPORTED0x80070032May be used to indicate that a property or command is not supported by the device.
ERROR_OPERATION_ABORTED0x800703E3A command sent to the device has been aborted due to a manual cancellation, e.g. by calling one of the Cancel methods in the WPD API.
ERROR_READ_FAULT0x8007001EMay be used to indicate that the device is not sending the correct amount of data.
ERROR_RESOURCE_NOT_AVAILABLE0x8007138EMay be used to indicate that a resource (such as a thumbnail or an icon) is not present on the device.
ERROR_SEM_TIMEOUT0x80070079May be used to indicate that the device has stopped responding (hung). The device may need to be manually reset.
ERROR_TIMEOUT0x800705B4May be used to indicate that the device has stopped responding (hung). The device may need to be manually reset.
ERROR_UNSUPPORTED_TYPE0x8007065EMay be used to indicate that the specified format is not supported by the device.
ERROR_WRITE_FAULT0x8007001DMay be used to indicate that the application was unable to send the requested amount of data to the device.
WSAETIMEDOUT0x8007274cFor an MTP/IP device, indicates that the connection to the device has timed out. The device may need to be manually reconnected.
45 entries

Article text from the Win32 documentation (opens in a new tab), by Microsoft, under the CC BY 4.0 (opens in a new tab) licence.