summaryrefslogtreecommitdiff
path: root/rbutil/autodetection.h
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/autodetection.h')
-rw-r--r--rbutil/autodetection.h86
1 files changed, 17 insertions, 69 deletions
diff --git a/rbutil/autodetection.h b/rbutil/autodetection.h
index dc2d7d2490..a69b9e4bca 100644
--- a/rbutil/autodetection.h
+++ b/rbutil/autodetection.h
@@ -29,6 +29,7 @@
29 29
30#define TOMANYDEVICES 2 30#define TOMANYDEVICES 2
31#define NODEVICE 1 31#define NODEVICE 1
32#define DEVICEFOUND 0
32 33
33struct UsbDeviceInfo 34struct UsbDeviceInfo
34{ 35{
@@ -37,87 +38,24 @@ struct UsbDeviceInfo
37 int status; 38 int status;
38}; 39};
39 40
40UsbDeviceInfo detectDevicesViaPatchers(); 41
42bool detectDevices(UsbDeviceInfo* tempdevice);
43
44wxArrayString getPossibleMountPoints(); /* this funktion has to be implemented for every OS
41 45
42 46
43/******************************** 47/********************************
44* Windows code for USB Device detection and information 48* Windows header for USB Device detection and information
45**************************************/ 49**************************************/
46 50
47#if defined( __WXMSW__ ) 51#if defined( __WXMSW__ )
48 52
49#include <dbt.h> // For DeviceChange.
50#include <winioctl.h> // For DeviceIOCtl.
51
52// IOCTL control code
53#define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
54
55//// The following structures all can find at MSDN.
56// enumeration type specifies the various types of storage buses
57typedef enum _STORAGE_BUS_TYPE {
58 BusTypeUnknown = 0x00,
59 BusTypeScsi,
60 BusTypeAtapi,
61 BusTypeAta,
62 BusType1394,
63 BusTypeSsa,
64 BusTypeFibre,
65 BusTypeUsb,
66 BusTypeRAID,
67 BusTypeMaxReserved = 0x7F
68} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
69// retrieve the storage device descriptor data for a device.
70typedef struct _STORAGE_DEVICE_DESCRIPTOR {
71 ULONG Version;
72 ULONG Size;
73 UCHAR DeviceType;
74 UCHAR DeviceTypeModifier;
75 BOOLEAN RemovableMedia;
76 BOOLEAN CommandQueueing;
77 ULONG VendorIdOffset;
78 ULONG ProductIdOffset;
79 ULONG ProductRevisionOffset;
80 ULONG SerialNumberOffset;
81 STORAGE_BUS_TYPE BusType;
82 ULONG RawPropertiesLength;
83 UCHAR RawDeviceProperties[1];
84
85} STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;
86// retrieve the properties of a storage device or adapter.
87typedef enum _STORAGE_QUERY_TYPE {
88 PropertyStandardQuery = 0,
89 PropertyExistsQuery,
90 PropertyMaskQuery,
91 PropertyQueryMaxDefined
92
93} STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;
94
95// retrieve the properties of a storage device or adapter.
96typedef enum _STORAGE_PROPERTY_ID {
97 StorageDeviceProperty = 0,
98 StorageAdapterProperty,
99 StorageDeviceIdProperty
100
101} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
102// retrieve the properties of a storage device or adapter.
103typedef struct _STORAGE_PROPERTY_QUERY {
104 STORAGE_PROPERTY_ID PropertyId;
105 STORAGE_QUERY_TYPE QueryType;
106 UCHAR AdditionalParameters[1];
107
108} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
109
110
111wxString guess_mount_point();
112
113BOOL GetDisksProperty(HANDLE hDevice, PSTORAGE_DEVICE_DESCRIPTOR pDevDesc);
114char chFirstDriveFromMask (ULONG unitmask);
115 53
116#endif /*__WXMSW__ */ 54#endif /*__WXMSW__ */
117 55
118 56
119/************************************************************************+ 57/************************************************************************+
120*Linux code for autodetection 58*Linux header for autodetection
121**************************************************************************/ 59**************************************************************************/
122 60
123 61
@@ -131,6 +69,16 @@ wxString resolve_mount_point( const wxString device );
131 69
132 70
133 71
72/************************************************************************+
73*MAc header for autodetection
74**************************************************************************/
75
76
77#if defined( __DARWIN__)
78
79
80
81#endif /* MAc Code */
134 82
135 83
136 84