sbWindowsStorageDeviceUtils.cpp File Reference

Songbird Windows Storage Device Utilities Source. More...

#include "sbWindowsStorageDeviceUtils.h"
#include "sbWindowsDeviceUtils.h"
#include <sbWindowsUtils.h>
#include <ntddscsi.h>
Include dependency graph for sbWindowsStorageDeviceUtils.cpp:

Go to the source code of this file.

Classes

struct  _SCSI_PASS_THROUGH_WITH_BUFFERS
 

Macros

#define CDB6GENERIC_LENGTH   6
 
#define SCSIOP_INQUIRY   0x12
 

Typedefs

typedef struct
_SCSI_PASS_THROUGH_WITH_BUFFERS 
SCSI_PASS_THROUGH_WITH_BUFFERS
 
typedef struct
_SCSI_PASS_THROUGH_WITH_BUFFERS
PSCSI_PASS_THROUGH_WITH_BUFFERS
 

Functions

nsresult sbWinFindDevicesByStorageDevNum (STORAGE_DEVICE_NUMBER *aStorageDevNum, PRBool aMatchPartitionNumber, const GUID *aGUID, nsTArray< DEVINST > &aDevInstList)
 
nsresult sbWinGetStorageDevNum (DEVINST aDevInst, const GUID *aGUID, STORAGE_DEVICE_NUMBER *aStorageDevNum)
 
nsresult sbWinGetStorageDevNum (LPCTSTR aDevPath, STORAGE_DEVICE_NUMBER *aStorageDevNum)
 
nsresult sbWinVolumeIsReady (DEVINST aDevInst, PRBool *aIsReady)
 
nsresult sbWinVolumeGetIsReadOnly (const nsAString &aVolumeMountPath, PRBool *aIsReadOnly)
 
nsresult sbWinGetVolumeGUIDPath (DEVINST aDevInst, nsAString &aVolumeGUIDPath)
 
nsresult sbWinGetVolumeGUID (DEVINST aDevInst, nsAString &aVolumeGUID)
 
nsresult sbWinGetVolumePathNames (DEVINST aDevInst, nsTArray< nsString > &aPathNames)
 
nsresult sbWinGetVolumePathNames (nsAString &aVolumeGUIDPath, nsTArray< nsString > &aPathNames)
 
nsresult sbWinGetVolumeLabel (const nsAString &aVolumeMountPath, nsACString &aVolumeLabel)
 
nsresult sbWinSetVolumeLabel (const nsAString &aVolumeMountPath, const nsACString &aVolumeLabel)
 
nsresult sbWinGetSCSIProductInfo (DEVINST aDevInst, nsAString &aVendorID, nsAString &aProductID)
 

Detailed Description

Songbird Windows Storage Device Utilities Source.

Definition in file sbWindowsStorageDeviceUtils.cpp.

Macro Definition Documentation

#define CDB6GENERIC_LENGTH   6

Definition at line 574 of file sbWindowsStorageDeviceUtils.cpp.

#define SCSIOP_INQUIRY   0x12

Definition at line 583 of file sbWindowsStorageDeviceUtils.cpp.

Typedef Documentation

Function Documentation

nsresult sbWinFindDevicesByStorageDevNum ( STORAGE_DEVICE_NUMBER *  aStorageDevNum,
PRBool  aMatchPartitionNumber,
const GUID *  aGUID,
nsTArray< DEVINST > &  aDevInstList 
)

Search for devices with the storage device number specified by aStorageDevNum and interface class specified by aGUID. Return all matching device instances in aDevInstList. If aMatchPartitionNumber is true, look for device instances with a matching partition number. This should be set to true when looking for partition or volume interfaces and false when looking for disk interfaces.

Parameters
aStorageDevNumStorage device number for which to find device.
aMatchPartitionNumberMatch partition numbers when looking for a device interface.
aGUIDDevice interface class for which to search.
aDevInstListList of matching device instances.

Definition at line 79 of file sbWindowsStorageDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbWinGetSCSIProductInfo ( DEVINST  aDevInst,
nsAString &  aVendorID,
nsAString &  aProductID 
)

Return in aVendorID and aProductID the SCSI vendor and product IDs for the device specified by aDevInst.

Parameters
aDevInstDevice for which to get SCSI product info.
aVendorIDSCSI vendor ID.
aProductIDSCSI product ID.

Definition at line 596 of file sbWindowsStorageDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbWinGetStorageDevNum ( DEVINST  aDevInst,
const GUID *  aGUID,
STORAGE_DEVICE_NUMBER *  aStorageDevNum 
)

Return in aStorageDevNum the storage device number for the device instance specified by aDevInst using the device interface class specified by aGUID.

Parameters
aDevInstDevice instance for which to get device number.
aGUIDDevice interface class.
aDevNumDevice number.
Returns
NS_ERROR_NOT_AVAILABLE if device does not have a storage device number.

Definition at line 157 of file sbWindowsStorageDeviceUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWinGetStorageDevNum ( LPCTSTR  aDevPath,
STORAGE_DEVICE_NUMBER *  aStorageDevNum 
)

Return in aStorageDevNum the storage device number for the device with the device path specified by aDevPath.

Parameters
aDevPathDevice path.
aStorageDevNumReturned storage device number.
Returns
NS_ERROR_NOT_AVAILABLE if device does not have a storage device number.

Definition at line 189 of file sbWindowsStorageDeviceUtils.cpp.

nsresult sbWinGetVolumeGUID ( DEVINST  aDevInst,
nsAString &  aVolumeGUID 
)

Return in aVolumeGUID the volume GUID for the volume device specified by aDevInst. The volume GUID is extracted from the volume GUID path.

See http://msdn.microsoft.com/en-us/library/aa365248(VS.85).aspx

Parameters
aDevInstVolume device instance.
aVolumeGUIDReturned volume GUID.

Definition at line 395 of file sbWindowsStorageDeviceUtils.cpp.

Here is the call graph for this function:

nsresult sbWinGetVolumeGUIDPath ( DEVINST  aDevInst,
nsAString &  aVolumeGUIDPath 
)

Return in aVolumeGUIDPath the volume GUID path for the volume device specified by aDevInst.

See http://msdn.microsoft.com/en-us/library/aa365248(VS.85).aspx

Parameters
aDevInstVolume device instance.
aVolumeGUIDPathReturned volume GUID path.

Definition at line 356 of file sbWindowsStorageDeviceUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWinGetVolumeLabel ( const nsAString &  aVolumeMountPath,
nsACString &  aVolumeLabel 
)

Get the label for the volume mounted at the path specified by aVolumeMountPath and return the label in aVolumeLabel.

Parameters
aVolumeMountPathVolume mount path.
aVolumeLabelReturned volume label in UTF-8.

Definition at line 516 of file sbWindowsStorageDeviceUtils.cpp.

nsresult sbWinGetVolumePathNames ( DEVINST  aDevInst,
nsTArray< nsString > &  aPathNames 
)

Return in aPathNames the list of paths names for the volume device specified by aDevInst.

Parameters
aDevInstVolume device instance.
aPathNamesList of volume path names.

Definition at line 428 of file sbWindowsStorageDeviceUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbWinGetVolumePathNames ( nsAString &  aVolumeGUIDPath,
nsTArray< nsString > &  aPathNames 
)

Return in aPathNames the list of paths names for the volume device specified by aVolumeGUIDPath.

Parameters
aVolumeGUIDPathVolume GUID path.
aPathNamesList of volume path names.

Definition at line 455 of file sbWindowsStorageDeviceUtils.cpp.

nsresult sbWinSetVolumeLabel ( const nsAString &  aVolumeMountPath,
const nsACString &  aVolumeLabel 
)

Set the label for the volume mounted at the path specified by aVolumeMountPath to the label specified by aVolumeLabel.

Parameters
aVolumeMountPathVolume mount path.
aVolumeLabelVolume label to set in UTF-8.

Definition at line 550 of file sbWindowsStorageDeviceUtils.cpp.

nsresult sbWinVolumeGetIsReadOnly ( const nsAString &  aVolumeMountPath,
PRBool *  aIsReadOnly 
)

Return true in aIsReadOnly if the volume with the mount path specified by aVolumeMountPath is a read-only volue; otherwise, return false.

Parameters
aVolumeMountPathVolume mount path.
aIsReadOnlyReturned read-only state.

Definition at line 312 of file sbWindowsStorageDeviceUtils.cpp.

nsresult sbWinVolumeIsReady ( DEVINST  aDevInst,
PRBool *  aIsReady 
)

Return true in aIsReady if the volume device specified by aDevInst is ready; otherwise, return false in aIsReady.

Parameters
aDevInstVolume device instance.
aIsReadyReturned is ready state.

Definition at line 250 of file sbWindowsStorageDeviceUtils.cpp.

Here is the call graph for this function: