sbWindowsUSBDeviceUtils.cpp File Reference

Songbird Windows USB Device Utilities Source. More...

#include "sbWindowsUSBDeviceUtils.h"
#include "sbWindowsDeviceUtils.h"
#include <sbWindowsUtils.h>
#include <devioctl.h>
#include <usbioctl.h>
Include dependency graph for sbWindowsUSBDeviceUtils.cpp:

Go to the source code of this file.

Functions

nsresult sbUSBDeviceGetDescriptor (sbUSBDeviceRef *aDeviceRef, PRUint8 aDescriptorType, PRUint8 aDescriptorIndex, PRUint16 aDescriptorIndex2, PRUint16 aDescriptorLength, sbUSBDescriptor **aDescriptor)
 
nsresult sbWinUSBDeviceOpenRef (DEVINST aDevInst, sbWinUSBDeviceRef *aDeviceRef)
 
nsresult sbWinUSBDeviceCloseRef (sbWinUSBDeviceRef *aDeviceRef)
 
nsresult sbWinUSBDeviceGetHubAndPort (DEVINST aDevInst, HANDLE *aHubFile, ULONG *aPortIndex)
 
nsresult sbWinUSBHubFindDevicePort (HANDLE aHubFile, DEVINST aDevInst, ULONG *aPortIndex)
 
nsresult sbWinUSBHubGetPortDriverKey (HANDLE aHubFile, ULONG aPortIndex, nsAString &aDriverKey)
 
nsresult sbWinUSBMSCGetLUN (DEVINST aDevInst, PRUint32 *aLUN)
 

Variables

static const GUID GUID_DEVINTERFACE_USB_HUB
 

Detailed Description

Songbird Windows USB Device Utilities Source.

Definition in file sbWindowsUSBDeviceUtils.cpp.

Function Documentation

nsresult sbUSBDeviceGetDescriptor ( sbUSBDeviceRef aDeviceRef,
PRUint8  aDescriptorType,
PRUint8  aDescriptorIndex,
PRUint16  aDescriptorIndex2,
PRUint16  aDescriptorLength,
sbUSBDescriptor **  aDescriptor 
)

Return in aDescriptor the USB descriptor for the device specified by aDeviceRef of descriptor type specified by aDescriptorType and descriptor index specified by aDescriptorIndex and aDescriptorIndex2. Read up to aDescriptorLength bytes of descriptor data.

Parameters
aDeviceRefDevice reference for which to get descriptor.
aDescriptorTypeType of descriptor to get.
aDescriptorIndexIndex of descriptor to get.
aDescriptorIndex2Second index of descriptor to get (only used for string descriptors).
aDescriptorLengthNumber of bytes of descriptor data to get.
aDescriptorReturned descriptor.

Definition at line 109 of file sbWindowsUSBDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbWinUSBDeviceCloseRef ( sbWinUSBDeviceRef aDeviceRef)

Close the USB device reference specified by aDeviceRef.

Parameters
aDeviceRefUSB device reference to close.

Definition at line 228 of file sbWindowsUSBDeviceUtils.cpp.

Here is the caller graph for this function:

nsresult sbWinUSBDeviceGetHubAndPort ( DEVINST  aDevInst,
HANDLE *  aHubFile,
ULONG *  aPortIndex 
)

Return in aHubFile and aPortIndex the USB device hub file and port index for the USB device specified by aDevInst.

Parameters
aDevInstDevice instance for which to get hub and port.
aHubFileReturned USB hub file for device.
aPortIndexReturned USB hub port index for device.

Definition at line 253 of file sbWindowsUSBDeviceUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWinUSBDeviceOpenRef ( DEVINST  aDevInst,
sbWinUSBDeviceRef aDeviceRef 
)

Open a USB device reference to the device specified by aDevInst and return the reference in aDeviceRef.

Parameters
aDevInstUSB device instance to open.
aDeviceRefReturned device reference.

Definition at line 197 of file sbWindowsUSBDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbWinUSBHubFindDevicePort ( HANDLE  aHubFile,
DEVINST  aDevInst,
ULONG *  aPortIndex 
)

Return in aPortIndex the USB hub index of the USB hub specified by aHubFile for the USB device specified by aDevInst.

Parameters
aHubFileUSB hub for which to find port.
aDevInstUSB device instance for which to find port.
aPortIndexReturned USB hub port index for device.

Definition at line 303 of file sbWindowsUSBDeviceUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWinUSBHubGetPortDriverKey ( HANDLE  aHubFile,
ULONG  aPortIndex,
nsAString &  aDriverKey 
)

Return in aDriverKey the driver key for the device attached to the port specified by aPortIndex of the USB hub specified by aHubFile. If no device is attached to the port, aDriverKey is set to void.

Parameters
aHubFileUSB hub for which to get port driver key.
aPortIndexIndex of USB hub port for which to get driver key.
aDriverKeyReturned USB hub port driver key.

Definition at line 376 of file sbWindowsUSBDeviceUtils.cpp.

Here is the caller graph for this function:

nsresult sbWinUSBMSCGetLUN ( DEVINST  aDevInst,
PRUint32 *  aLUN 
)

Return in aLUN the USB MSC LUN for the disk device specified by aDevInst.

Parameters
aDevInstDisk for which to get LUN.
aLUNReturned LUN.

Definition at line 446 of file sbWindowsUSBDeviceUtils.cpp.

Here is the call graph for this function:

Variable Documentation

const GUID GUID_DEVINTERFACE_USB_HUB
static
Initial value:
=
{
0xF18A0E88,
0xC30C,
0x11D0,
{ 0x88, 0x15, 0x00, 0xA0, 0xC9, 0x06, 0xBE, 0xD8 }
}

Definition at line 78 of file sbWindowsUSBDeviceUtils.cpp.