B.8  WinDriver Status Codes

B.8.1  Introduction

Most of the WinDriver functions return a status code, where zero (WD_STATUS_SUCCESS) means success and a non-zero value means failure.
The Stat2Str() functions can be used to retrieve the status description string for a given status code. The status codes and their descriptive strings are listed below.

B.8.2  Status Codes Returned by WinDriver

Status CodeDescription
WD_STATUS_SUCCESSSuccess
WD_STATUS_INVALID_WD_HANDLEInvalid WinDriver handle
WD_WINDRIVER_STATUS_ERRORError
WD_INVALID_HANDLEInvalid handle
WD_INVALID_PIPE_NUMBERInvalid pipe number
WD_READ_WRITE_CONFLICTConflict between read and write operations
WD_ZERO_PACKET_SIZEPacket size is zero
WD_INSUFFICIENT_RESOURCESInsufficient resources
WD_UNKNOWN_PIPE_TYPEUnknown pipe type
WD_SYSTEM_INTERNAL_ERRORInternal system error
WD_DATA_MISMATCHData mismatch
WD_NO_LICENSENo valid license
WD_NOT_IMPLEMENTEDFunction not implemented
WD_FAILED_ENABLING_INTERRUPTFailed enabling interrupt
WD_INTERRUPT_NOT_ENABLEDInterrupt not enabled
WD_RESOURCE_OVERLAPResource overlap
WD_DEVICE_NOT_FOUNDDevice not found
WD_WRONG_UNIQUE_IDWrong unique ID
WD_OPERATION_ALREADY_DONEOperation already done
WD_USB_DESCRIPTOR_ERRORUSB descriptor error
WD_SET_CONFIGURATION_FAILEDSet configuration operation failed
WD_CANT_OBTAIN_PDOCannot obtain PDO
WD_TIME_OUT_EXPIREDTimeout expired
WD_IRP_CANCELEDIRP operation cancelled
WD_FAILED_USER_MAPPINGFailed to map in user space
WD_FAILED_KERNEL_MAPPINGFailed to map in kernel space
WD_NO_RESOURCES_ON_DEVICENo resources on the device
WD_NO_EVENTSNo events
WD_INVALID_PARAMETERInvalid parameter
WD_INCORRECT_VERSIONIncorrect WinDriver version installed
WD_TRY_AGAINTry again
WD_INVALID_IOCTLReceived an invalid IOCTL
WD_OPERATION_FAILEDOperation failed
WD_INVALID_32BIT_APPReceived an invalid 32-bit IOCTL
WD_TOO_MANY_HANDLESNo room to add handle
WD_NO_DEVICE_OBJECTDriver not installed

B.8.3  Status Codes Returned by USBD

The following WinDriver status codes comply with USBD_XXX status codes returned by the USB stack drivers.

Status CodeDescription
USBD Status Types
WD_USBD_STATUS_SUCCESSUSBD: Success
WD_USBD_STATUS_PENDINGUSBD: Operation pending
WD_USBD_STATUS_ERRORUSBD: Error
WD_USBD_STATUS_HALTEDUSBD: Halted
USBD Status Codes
(NOTE: The status codes consist of one of the status types above and an error code, i.e., 0xXYYYYYYYL, where X=status type and YYYYYYY=error code. The same error codes may also appear with one of the other status types as well.)
HC (Host Controller) Status Codes
(NOTE: These use the WD_USBD_STATUS_HALTED status type.)
WD_USBD_STATUS_CRCHC status: CRC
WD_USBD_STATUS_BTSTUFFHC status: Bit stuffing
WD_USBD_STATUS_DATA_TOGGLE_MISMATCHHC status: Data toggle mismatch
WD_USBD_STATUS_STALL_PIDHC status: PID stall
WD_USBD_STATUS_DEV_NOT_RESPONDINGHC status: Device not responding
WD_USBD_STATUS_PID_CHECK_FAILUREHC status: PID check failed
WD_USBD_STATUS_UNEXPECTED_PIDHC status: Unexpected PID
WD_USBD_STATUS_DATA_OVERRUNHC status: Data overrun
WD_USBD_STATUS_DATA_UNDERRUNHC status: Data underrun
WD_USBD_STATUS_RESERVED1HC status: Reserved1
WD_USBD_STATUS_RESERVED2HC status: Reserved2
WD_USBD_STATUS_BUFFER_OVERRUNHC status: Buffer overrun
WD_USBD_STATUS_BUFFER_UNDERRUNHC status: Buffer Underrun
WD_USBD_STATUS_NOT_ACCESSEDHC status: Not accessed
WD_USBD_STATUS_FIFOHC status: FIFO
For Windows only:
WD_USBD_STATUS_XACT_ERROR HC status: The host controller has set the Transaction Error (XactErr) bit in the transfer descriptor's status field
WD_USBD_STATUS_BABBLE_DETECTEDHC status: Babble detected
WD_USBD_STATUS_DATA_BUFFER_ERRORHC status: Data buffer error
For Windows CE only:
WD_USBD_STATUS_ISOCHUSBD: Isochronous transfer failed
WD_USBD_STATUS_NOT_COMPLETEUSBD: Transfer not completed
WD_USBD_STATUS_CLIENT_BUFFERUSBD: Cannot write to buffer
For all platforms:
WD_USBD_STATUS_CANCELEDUSBD: Transfer cancelled
Returned by HCD (Host Controller Driver) if a transfer is submitted to an endpoint that is stalled:
WD_USBD_STATUS_ENDPOINT_HALTEDHCD: Transfer submitted to stalled endpoint
Software Status Codes (NOTE: Only the error bit is set):
WD_USBD_STATUS_NO_MEMORYUSBD: Out of memory
WD_USBD_STATUS_INVALID_URB_FUNCTIONUSBD: Invalid URB function
WD_USBD_STATUS_INVALID_PARAMETERUSBD: Invalid parameter
Returned if client driver attempts to close an endpoint/interface or configuration with outstanding transfers:
WD_USBD_STATUS_ERROR_BUSY USBD: Attempted to close endpoint/interface/configuration with outstanding transfer
Returned by USBD if it cannot complete a URB request. Typically this will be returned in the URB status field (when the IRP is completed) with a more specific error code. The IRP status codes are indicated in WinDriver's Debug Monitor tool (wddebug_gui / wddebug):
WD_USBD_STATUS_REQUEST_FAILEDUSBD: URB request failed
WD_USBD_STATUS_INVALID_PIPE_HANDLEUSBD: Invalid pipe handle
Returned when there is not enough bandwidth available to open a requested endpoint:
WD_USBD_STATUS_NO_BANDWIDTHUSBD: Not enough bandwidth for endpoint
Generic HC (Host Controller) error:
WD_USBD_STATUS_INTERNAL_HC_ERRORUSBD: Host controller error
Returned when a short packet terminates the transfer, i.e., USBD_SHORT_TRANSFER_OK bit not set:
WD_USBD_STATUS_ERROR_SHORT_TRANSFERUSBD: Transfer terminated with short packet
Returned if the requested start frame is not within USBD_ISO_START_FRAME_RANGE of the current USB frame (NOTE: The stall bit is set):
WD_USBD_STATUS_BAD_START_FRAMEUSBD: Start frame outside range
Returned by HCD (Host Controller Driver) if all packets in an isochronous transfer complete with an error:
WD_USBD_STATUS_ISOCH_REQUEST_FAILEDHCD: Isochronous transfer completed with error
Returned by USBD if the frame length control for a given HC (Host Controller) is already taken by another driver:
WD_USBD_STATUS_FRAME_CONTROL_OWNEDUSBD: Frame length control already taken
Returned by USBD if the caller does not own frame length control and attempts to release or modify the HC frame length:
WD_USBD_STATUS_FRAME_CONTROL_NOT_OWNED USBD: Attempted operation on frame length control not owned by caller
Additional software error codes added for USB 2.0 (for Windows only) :
WD_USBD_STATUS_NOT_SUPPORTEDUSBD: API not supported/ implemented
WD_USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR USBD: Invalid configuration descriptor
WD_USBD_STATUS_INSUFFICIENT_RESOURCESUSBD: Insufficient resources
WD_USBD_STATUS_SET_CONFIG_FAILEDUSBD: Set configuration failed
WD_USBD_STATUS_BUFFER_TOO_SMALLUSBD: Buffer too small
WD_USBD_STATUS_INTERFACE_NOT_FOUNDUSBD: Interface not found
WD_USBD_STATUS_INAVLID_PIPE_FLAGSUSBD: Invalid pipe flags
WD_USBD_STATUS_TIMEOUTUSBD: Timeout
WD_USBD_STATUS_DEVICE_GONEUSBD: Device gone
WD_USBD_STATUS_STATUS_NOT_MAPPEDUSBD: Status not mapped
Extended isochronous error codes returned by USBD
These errors appear in the packet status field of an isochronous transfer:
WD_USBD_STATUS_ISO_NOT_ACCESSED_BY_HWUSBD: The controller did not access the TD associated with this packet
WD_USBD_STATUS_ISO_TD_ERRORUSBD: Controller reported an error in the TD
WD_USBD_STATUS_ISO_NA_LATE_USBPORTUSBD: The packet was submitted in time by the client but failed to reach the miniport in time
WD_USBD_STATUS_ISO_NOT_ACCESSED_LATEUSBD: The packet was not sent because the client submitted it too late to transmit