Commit 19549d11 authored by Chip Davis's avatar Chip Davis Committed by Alexandre Julliard

mountmgr: Populate HKLM\HARDWARE\DEVICEMAP\Scsi here instead of in kernel32.

parent 8388ea84
......@@ -24,7 +24,6 @@ C_SRCS = \
lzexpand.c \
module.c \
nameprep.c \
oldconfig.c \
path.c \
powermgnt.c \
process.c \
......
......@@ -214,7 +214,6 @@ void * CDECL __wine_kernel_init(void)
RtlSetUnhandledExceptionFilter( UnhandledExceptionFilter );
LOCALE_Init();
convert_old_config();
set_library_argv( __wine_main_wargv );
if (!params->CurrentDirectory.Handle) chdir("/"); /* avoid locking removable devices */
......
......@@ -101,6 +101,7 @@ static DBusConnection *connection;
DO_FUNC(libhal_ctx_set_device_removed); \
DO_FUNC(libhal_ctx_shutdown); \
DO_FUNC(libhal_device_get_property_bool); \
DO_FUNC(libhal_device_get_property_int); \
DO_FUNC(libhal_device_get_property_string); \
DO_FUNC(libhal_device_add_property_watch); \
DO_FUNC(libhal_device_remove_property_watch); \
......@@ -318,7 +319,7 @@ static void udisks_new_device( const char *udi )
if (device)
{
if (removable) add_dos_device( -1, udi, device, mount_point, drive_type, guid_ptr );
if (removable) add_dos_device( -1, udi, device, mount_point, drive_type, guid_ptr, NULL );
else if (guid_ptr) add_volume( udi, device, mount_point, DEVICE_HARDDISK_VOL, guid_ptr );
}
......@@ -484,7 +485,7 @@ static void udisks2_add_device( const char *udi, DBusMessageIter *dict, DBusMess
}
if (device)
{
if (removable) add_dos_device( -1, udi, device, mount_point, drive_type, guid_ptr );
if (removable) add_dos_device( -1, udi, device, mount_point, drive_type, guid_ptr, NULL );
else if (guid_ptr) add_volume( udi, device, mount_point, DEVICE_HARDDISK_VOL, guid_ptr );
}
}
......@@ -582,6 +583,178 @@ static DBusHandlerResult udisks_filter( DBusConnection *ctx, DBusMessage *msg, v
#ifdef SONAME_LIBHAL
static BOOL hal_get_ide_parameters( LibHalContext *ctx, const char *udi, SCSI_ADDRESS *scsi_addr, UCHAR *devtype, char *ident, size_t ident_size )
{
DBusError error;
char *parent = NULL;
char *type = NULL;
char *model = NULL;
int host, chan;
BOOL ret = FALSE;
p_dbus_error_init( &error );
if (!(parent = p_libhal_device_get_property_string( ctx, udi, "info.parent", &error )))
goto done;
if ((host = p_libhal_device_get_property_int( ctx, parent, "ide.host", &error )) < 0)
goto done;
if ((chan = p_libhal_device_get_property_int( ctx, parent, "ide.channel", &error )) < 0)
goto done;
ret = TRUE;
if (devtype)
{
if (!(type = p_libhal_device_get_property_string( ctx, udi, "storage.drive_type", &error )))
*devtype = SCSI_UNKNOWN_PERIPHERAL;
else if (!strcmp( type, "disk" ) || !strcmp( type, "floppy" ))
*devtype = SCSI_DISK_PERIPHERAL;
else if (!strcmp( type, "tape" ))
*devtype = SCSI_TAPE_PERIPHERAL;
else if (!strcmp( type, "cdrom" ))
*devtype = SCSI_CDROM_PERIPHERAL;
else if (!strcmp( type, "raid" ))
*devtype = SCSI_ARRAY_PERIPHERAL;
else
*devtype = SCSI_UNKNOWN_PERIPHERAL;
}
if (ident)
{
if (!(model = p_libhal_device_get_property_string( ctx, udi, "storage.model", &error )))
p_dbus_error_free( &error ); /* ignore error */
else
lstrcpynA( ident, model, ident_size );
}
scsi_addr->PortNumber = host;
scsi_addr->PathId = 0;
scsi_addr->TargetId = chan;
scsi_addr->Lun = 0;
done:
if (model) p_libhal_free_string( model );
if (type) p_libhal_free_string( type );
if (parent) p_libhal_free_string( parent );
p_dbus_error_free( &error );
return ret;
}
static BOOL hal_get_scsi_parameters( LibHalContext *ctx, const char *udi, SCSI_ADDRESS *scsi_addr, UCHAR *devtype, char *ident, size_t ident_size )
{
DBusError error;
char *type = NULL;
char *vendor = NULL;
char *model = NULL;
int host, bus, target, lun;
BOOL ret = FALSE;
p_dbus_error_init( &error );
if ((host = p_libhal_device_get_property_int( ctx, udi, "scsi.host", &error )) < 0)
goto done;
if ((bus = p_libhal_device_get_property_int( ctx, udi, "scsi.bus", &error )) < 0)
goto done;
if ((target = p_libhal_device_get_property_int( ctx, udi, "scsi.target", &error )) < 0)
goto done;
if ((lun = p_libhal_device_get_property_int( ctx, udi, "scsi.lun", &error )) < 0)
goto done;
ret = TRUE;
scsi_addr->PortNumber = host;
scsi_addr->PathId = bus;
scsi_addr->TargetId = target;
scsi_addr->Lun = lun;
if (ident)
{
if (!(vendor = p_libhal_device_get_property_string( ctx, udi, "scsi.vendor", &error )))
p_dbus_error_free( &error ); /* ignore error */
if (!(model = p_libhal_device_get_property_string( ctx, udi, "scsi.model", &error )))
p_dbus_error_free( &error ); /* ignore error */
snprintf( ident, ident_size, "%-8s%-16s", vendor ? vendor : "WINE", model ? model : "SCSI" );
}
if (devtype)
{
if (!(type = p_libhal_device_get_property_string( ctx, udi, "scsi.type", &error )))
{
*devtype = SCSI_UNKNOWN_PERIPHERAL;
goto done;
}
if (!strcmp( type, "disk" ))
*devtype = SCSI_DISK_PERIPHERAL;
else if (!strcmp( type, "tape" ))
*devtype = SCSI_TAPE_PERIPHERAL;
else if (!strcmp( type, "printer" ))
*devtype = SCSI_PRINTER_PERIPHERAL;
else if (!strcmp( type, "processor" ))
*devtype = SCSI_PROCESSOR_PERIPHERAL;
else if (!strcmp( type, "cdrom" ))
*devtype = SCSI_CDROM_PERIPHERAL;
else if (!strcmp( type, "scanner" ))
*devtype = SCSI_SCANNER_PERIPHERAL;
else if (!strcmp( type, "medium_changer" ))
*devtype = SCSI_MEDIUM_CHANGER_PERIPHERAL;
else if (!strcmp( type, "comm" ))
*devtype = SCSI_COMMS_PERIPHERAL;
else if (!strcmp( type, "raid" ))
*devtype = SCSI_ARRAY_PERIPHERAL;
else
*devtype = SCSI_UNKNOWN_PERIPHERAL;
}
done:
if (type) p_libhal_free_string( type );
if (vendor) p_libhal_free_string( vendor );
if (model) p_libhal_free_string( model );
p_dbus_error_free( &error );
return ret;
}
static void hal_new_ide_device( LibHalContext *ctx, const char *udi )
{
SCSI_ADDRESS scsi_addr;
UCHAR devtype;
char ident[40];
if (!hal_get_ide_parameters( ctx, udi, &scsi_addr, &devtype, ident, sizeof(ident) )) return;
create_scsi_entry( &scsi_addr, 255, devtype == SCSI_CDROM_PERIPHERAL ? "atapi" : "WINE SCSI", devtype, ident, NULL );
}
static void hal_set_device_name( LibHalContext *ctx, const char *udi, const UNICODE_STRING *devname )
{
DBusError error;
SCSI_ADDRESS scsi_addr;
char *parent = NULL;
p_dbus_error_init( &error );
if (!hal_get_ide_parameters( ctx, udi, &scsi_addr, NULL, NULL, 0 ))
{
if (!(parent = p_libhal_device_get_property_string( ctx, udi, "info.parent", &error )))
goto done;
if (!hal_get_scsi_parameters( ctx, parent, &scsi_addr, NULL, NULL, 0 ))
goto done;
}
set_scsi_device_name( &scsi_addr, devname );
done:
if (parent) p_libhal_free_string( parent );
p_dbus_error_free( &error );
}
static void hal_new_scsi_device( LibHalContext *ctx, const char *udi )
{
SCSI_ADDRESS scsi_addr;
UCHAR devtype;
char ident[40];
if (!hal_get_scsi_parameters( ctx, udi, &scsi_addr, &devtype, ident, sizeof(ident) )) return;
/* FIXME: get real controller Id for SCSI */
create_scsi_entry( &scsi_addr, 255, "WINE SCSI", devtype, ident, NULL );
}
/* HAL callback for new device */
static void hal_new_device( LibHalContext *ctx, const char *udi )
{
......@@ -596,6 +769,9 @@ static void hal_new_device( LibHalContext *ctx, const char *udi )
p_dbus_error_init( &error );
hal_new_scsi_device( ctx, udi );
hal_new_ide_device( ctx, udi );
if (!(device = p_libhal_device_get_property_string( ctx, udi, "block.device", &error )))
goto done;
......@@ -619,7 +795,10 @@ static void hal_new_device( LibHalContext *ctx, const char *udi )
if (p_libhal_device_get_property_bool( ctx, parent, "storage.removable", &error ))
{
add_dos_device( -1, udi, device, mount_point, drive_type, guid_ptr );
UNICODE_STRING devname;
add_dos_device( -1, udi, device, mount_point, drive_type, guid_ptr, &devname );
hal_set_device_name( ctx, parent, &devname );
/* add property watch for mount point */
p_libhal_device_add_property_watch( ctx, udi, &error );
}
......
......@@ -25,7 +25,11 @@
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/time.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#define NONAMELESSUNION
......@@ -60,6 +64,12 @@ static const WCHAR drives_keyW[] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','D','r','i','v','e','s',0};
static const WCHAR ports_keyW[] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','P','o','r','t','s',0};
static const WCHAR scsi_keyW[] = {'H','A','R','D','W','A','R','E','\\','D','E','V','I','C','E','M','A','P','\\','S','c','s','i',0};
static const WCHAR scsi_port_keyW[] = {'S','c','s','i',' ','P','o','r','t',' ','%','d',0};
static const WCHAR scsi_bus_keyW[] = {'S','c','s','i',' ','B','u','s',' ','%','d',0};
static const WCHAR target_id_keyW[] = {'T','a','r','g','e','t',' ','I','d',' ','%','d',0};
static const WCHAR lun_keyW[] = {'L','o','g','i','c','a','l',' ','U','n','i','t',' ','I','d',' ','%','d',0};
static const WCHAR devnameW[] = {'D','e','v','i','c','e','N','a','m','e',0};
struct disk_device
{
......@@ -686,6 +696,144 @@ static void create_drive_devices(void)
RtlFreeHeap( GetProcessHeap(), 0, path );
}
/* open the "Logical Unit" key for a given SCSI address */
static HKEY get_scsi_device_lun_key( SCSI_ADDRESS *scsi_addr )
{
WCHAR dataW[50];
HKEY scsi_key, port_key, bus_key, target_key, lun_key;
if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, scsi_keyW, 0, KEY_READ|KEY_WRITE, &scsi_key )) return NULL;
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_port_keyW, scsi_addr->PortNumber );
if (RegCreateKeyExW( scsi_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &port_key, NULL )) return NULL;
RegCloseKey( scsi_key );
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_bus_keyW, scsi_addr->PathId );
if (RegCreateKeyExW( port_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &bus_key, NULL )) return NULL;
RegCloseKey( port_key );
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), target_id_keyW, scsi_addr->TargetId );
if (RegCreateKeyExW( bus_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &target_key, NULL )) return NULL;
RegCloseKey( bus_key );
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), lun_keyW, scsi_addr->Lun );
if (RegCreateKeyExW( target_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &lun_key, NULL )) return NULL;
RegCloseKey( target_key );
return lun_key;
}
/* fill in the "Logical Unit" key for a given SCSI address */
void create_scsi_entry( SCSI_ADDRESS *scsi_addr, UINT init_id, const char *driver, UINT type, const char *model, const UNICODE_STRING *dev )
{
static UCHAR tape_no = 0;
static const WCHAR tapeW[] = {'T','a','p','e','%','d',0};
static const WCHAR init_id_keyW[] = {'I','n','i','t','i','a','t','o','r',' ','I','d',' ','%','d',0};
static const WCHAR driverW[] = {'D','r','i','v','e','r',0};
static const WCHAR bus_time_scanW[] = {'F','i','r','s','t','B','u','s','T','i','m','e','S','c','a','n','I','n','M','s',0};
static const WCHAR typeW[] = {'T','y','p','e',0};
static const WCHAR identW[] = {'I','d','e','n','t','i','f','i','e','r',0};
WCHAR dataW[50];
DWORD sizeW;
DWORD value;
const char *data;
HKEY scsi_key;
HKEY port_key;
HKEY bus_key;
HKEY target_key;
HKEY lun_key;
if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, scsi_keyW, 0, KEY_READ|KEY_WRITE, &scsi_key )) return;
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_port_keyW, scsi_addr->PortNumber );
if (RegCreateKeyExW( scsi_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &port_key, NULL )) return;
RegCloseKey( scsi_key );
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, driver, strlen(driver)+1);
RegSetValueExW( port_key, driverW, 0, REG_SZ, (const BYTE *)dataW, sizeW );
value = 10;
RegSetValueExW( port_key, bus_time_scanW, 0, REG_DWORD, (const BYTE *)&value, sizeof(value));
value = 0;
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_bus_keyW, scsi_addr->PathId );
if (RegCreateKeyExW( port_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &bus_key, NULL )) return;
RegCloseKey( port_key );
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), init_id_keyW, init_id );
if (RegCreateKeyExW( bus_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &target_key, NULL )) return;
RegCloseKey( target_key );
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), target_id_keyW, scsi_addr->TargetId );
if (RegCreateKeyExW( bus_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &target_key, NULL )) return;
RegCloseKey( bus_key );
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), lun_keyW, scsi_addr->Lun );
if (RegCreateKeyExW( target_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &lun_key, NULL )) return;
RegCloseKey( target_key );
switch (type)
{
case SCSI_DISK_PERIPHERAL: data = "DiskPeripheral"; break;
case SCSI_TAPE_PERIPHERAL: data = "TapePeripheral"; break;
case SCSI_PRINTER_PERIPHERAL: data = "PrinterPeripheral"; break;
case SCSI_WORM_PERIPHERAL: data = "WormPeripheral"; break;
case SCSI_CDROM_PERIPHERAL: data = "CdRomPeripheral"; break;
case SCSI_SCANNER_PERIPHERAL: data = "ScannerPeripheral"; break;
case SCSI_OPTICAL_DISK_PERIPHERAL: data = "OpticalDiskPeripheral"; break;
case SCSI_MEDIUM_CHANGER_PERIPHERAL: data = "MediumChangerPeripheral"; break;
case SCSI_COMMS_PERIPHERAL: data = "CommunicationsPeripheral"; break;
case SCSI_ASC_GRAPHICS_PERIPHERAL:
case SCSI_ASC_GRAPHICS2_PERIPHERAL: data = "ASCPrePressGraphicsPeripheral"; break;
case SCSI_ARRAY_PERIPHERAL: data = "ArrayPeripheral"; break;
case SCSI_ENCLOSURE_PERIPHERAL: data = "EnclosurePeripheral"; break;
case SCSI_REDUCED_DISK_PERIPHERAL: data = "RBCPeripheral"; break;
case SCSI_CARD_READER_PERIPHERAL: data = "CardReaderPeripheral"; break;
case SCSI_BRIDGE_PERIPHERAL: data = "BridgePeripheral"; break;
case SCSI_OBJECT_STORAGE_PERIPHERAL: /* Object-based storage devices */
case SCSI_DRIVE_CONTROLLER_PERIPHERAL: /* Automation/drive controllers */
case SCSI_REDUCED_CDROM_PERIPHERAL: /* Reduced-commands MM devices */
case SCSI_PROCESSOR_PERIPHERAL: /* Processor devices (considered to be "Other" by Windows) */
default: data = "OtherPeripheral"; break;
}
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, data, strlen(data)+1);
RegSetValueExW( lun_key, typeW, 0, REG_SZ, (const BYTE *)dataW, sizeW );
RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, model, strlen(model)+1);
RegSetValueExW( lun_key, identW, 0, REG_SZ, (const BYTE *)dataW, sizeW );
if (dev)
{
WCHAR *buffer = memchrW( dev->Buffer+1, '\\', dev->Length )+1;
ULONG length = dev->Length - (buffer - dev->Buffer)*sizeof(WCHAR);
RegSetValueExW( lun_key, devnameW, 0, REG_SZ, (const BYTE *)buffer, length );
}
else if (type == SCSI_TAPE_PERIPHERAL)
{
snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), tapeW, tape_no++ );
RegSetValueExW( lun_key, devnameW, 0, REG_SZ, (const BYTE *)dataW, strlenW( dataW ) );
}
RegCloseKey( lun_key );
}
/* set the "DeviceName" for a given SCSI address */
void set_scsi_device_name( SCSI_ADDRESS *scsi_addr, const UNICODE_STRING *dev )
{
HKEY lun_key;
WCHAR *buffer;
ULONG length;
lun_key = get_scsi_device_lun_key( scsi_addr );
buffer = memchrW( dev->Buffer+1, '\\', dev->Length )+1;
length = dev->Length - (buffer - dev->Buffer)*sizeof(WCHAR);
RegSetValueExW( lun_key, devnameW, 0, REG_SZ, (const BYTE *)buffer, length );
RegCloseKey( lun_key );
}
/* create a new disk volume */
NTSTATUS add_volume( const char *udi, const char *device, const char *mount_point,
enum device_type type, const GUID *guid )
......@@ -736,7 +884,8 @@ NTSTATUS remove_volume( const char *udi )
/* create a new dos drive */
NTSTATUS add_dos_device( int letter, const char *udi, const char *device,
const char *mount_point, enum device_type type, const GUID *guid )
const char *mount_point, enum device_type type, const GUID *guid,
UNICODE_STRING *devname )
{
char *path, *p;
HKEY hkey;
......@@ -812,6 +961,8 @@ found:
if (udi) notify = drive->drive;
if (devname) *devname = volume->device->name;
done:
if (volume) release_volume( volume );
LeaveCriticalSection( &device_section );
......
......@@ -89,7 +89,7 @@ static void appeared_callback( DADiskRef disk, void *context )
device, mount_point, wine_dbgstr_guid(guid_ptr) );
if ((ref = CFDictionaryGetValue( dict, CFSTR("DAMediaRemovable") )) && CFBooleanGetValue( ref ))
add_dos_device( -1, device, device, mount_point, type, guid_ptr );
add_dos_device( -1, device, device, mount_point, type, guid_ptr, NULL );
else
if (guid_ptr) add_volume( device, device, mount_point, DEVICE_HARDDISK_VOL, guid_ptr );
......
......@@ -268,7 +268,7 @@ static NTSTATUS define_unix_drive( const void *in_buff, SIZE_T insize )
case DRIVE_RAMDISK: type = DEVICE_RAMDISK; break;
case DRIVE_FIXED: type = DEVICE_HARDDISK_VOL; break;
}
return add_dos_device( letter - 'a', NULL, device, mount_point, type, NULL );
return add_dos_device( letter - 'a', NULL, device, mount_point, type, NULL, NULL );
}
else
{
......@@ -461,6 +461,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
static const WCHAR harddiskW[] = {'\\','D','r','i','v','e','r','\\','H','a','r','d','d','i','s','k',0};
static const WCHAR driver_serialW[] = {'\\','D','r','i','v','e','r','\\','S','e','r','i','a','l',0};
static const WCHAR driver_parallelW[] = {'\\','D','r','i','v','e','r','\\','P','a','r','a','l','l','e','l',0};
static const WCHAR devicemapW[] = {'H','A','R','D','W','A','R','E','\\','D','E','V','I','C','E','M','A','P','\\','S','c','s','i',0};
#ifdef _WIN64
static const WCHAR qualified_ports_keyW[] = {'\\','R','E','G','I','S','T','R','Y','\\',
......@@ -475,6 +476,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
UNICODE_STRING nameW, linkW;
DEVICE_OBJECT *device;
HKEY devicemap_key;
NTSTATUS status;
TRACE( "%s\n", debugstr_w(path->Buffer) );
......@@ -494,6 +496,10 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
RegCreateKeyExW( HKEY_LOCAL_MACHINE, mounted_devicesW, 0, NULL,
REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &mount_key, NULL );
if (!RegCreateKeyExW( HKEY_LOCAL_MACHINE, devicemapW, 0, NULL, REG_OPTION_VOLATILE,
KEY_ALL_ACCESS, NULL, &devicemap_key, NULL ))
RegCloseKey( devicemap_key );
RtlInitUnicodeString( &nameW, harddiskW );
status = IoCreateDriver( &nameW, harddisk_driver_entry );
......
......@@ -27,6 +27,7 @@
#include "winternl.h"
#include "winioctl.h"
#include "ntddstor.h"
#include "ntddscsi.h"
#include "ntddcdrm.h"
#include "ddk/wdm.h"
#define WINE_MOUNTMGR_EXTENSIONS
......@@ -53,13 +54,46 @@ extern NTSTATUS add_volume( const char *udi, const char *device, const char *mou
enum device_type type, const GUID *guid ) DECLSPEC_HIDDEN;
extern NTSTATUS remove_volume( const char *udi ) DECLSPEC_HIDDEN;
extern NTSTATUS add_dos_device( int letter, const char *udi, const char *device,
const char *mount_point, enum device_type type, const GUID *guid ) DECLSPEC_HIDDEN;
const char *mount_point, enum device_type type, const GUID *guid,
UNICODE_STRING *devname ) DECLSPEC_HIDDEN;
extern NTSTATUS remove_dos_device( int letter, const char *udi ) DECLSPEC_HIDDEN;
extern NTSTATUS query_dos_device( int letter, enum device_type *type, char **device, char **mount_point ) DECLSPEC_HIDDEN;
extern NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) DECLSPEC_HIDDEN;
extern NTSTATUS WINAPI serial_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) DECLSPEC_HIDDEN;
extern NTSTATUS WINAPI parallel_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) DECLSPEC_HIDDEN;
/* SCSI entry functions */
enum scsi_device_type
{
SCSI_DISK_PERIPHERAL = 0x00,
SCSI_TAPE_PERIPHERAL = 0x01,
SCSI_PRINTER_PERIPHERAL = 0x02,
SCSI_PROCESSOR_PERIPHERAL = 0x03,
SCSI_WORM_PERIPHERAL = 0x04,
SCSI_CDROM_PERIPHERAL = 0x05,
SCSI_SCANNER_PERIPHERAL = 0x06,
SCSI_OPTICAL_DISK_PERIPHERAL = 0x07,
SCSI_MEDIUM_CHANGER_PERIPHERAL = 0x08,
SCSI_COMMS_PERIPHERAL = 0x09,
SCSI_ASC_GRAPHICS_PERIPHERAL = 0x0A,
SCSI_ASC_GRAPHICS2_PERIPHERAL = 0x0B,
SCSI_ARRAY_PERIPHERAL = 0x0C,
SCSI_ENCLOSURE_PERIPHERAL = 0x0D,
SCSI_REDUCED_DISK_PERIPHERAL = 0x0E,
SCSI_CARD_READER_PERIPHERAL = 0x0F,
SCSI_BRIDGE_PERIPHERAL = 0x10,
SCSI_OBJECT_STORAGE_PERIPHERAL = 0x11,
SCSI_DRIVE_CONTROLLER_PERIPHERAL = 0x12,
SCSI_REDUCED_CDROM_PERIPHERAL = 0x15,
SCSI_UNKNOWN_PERIPHERAL = ~0
};
extern void create_scsi_entry( SCSI_ADDRESS *scsi_addr, UINT init_id,
const char *driver, UINT type, const char *drive,
const UNICODE_STRING *devname ) DECLSPEC_HIDDEN;
extern void set_scsi_device_name( SCSI_ADDRESS *scsi_addr, const UNICODE_STRING *devname ) DECLSPEC_HIDDEN;
/* mount point functions */
struct mount_point;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment