Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.5 KiB

  1. #include "precomp.h"
  2. #include "utils.h"
  3. #ifdef ALLOC_PRAGMA
  4. #pragma alloc_text(PAGE, PortGetDeviceType)
  5. #endif // ALLOC_PRAGMA
  6. //
  7. // Port Driver Data
  8. //
  9. #ifdef ALLOC_PRAGMA
  10. #pragma data_seg("PAGEDATA")
  11. #endif
  12. const SCSI_DEVICE_TYPE PortScsiDeviceTypes [] = {
  13. // Name Generic Name DeviceMap IsStorage
  14. {"Disk", "GenDisk", L"DiskPeripheral", TRUE},
  15. {"Sequential", "", L"TapePeripheral", TRUE},
  16. {"Printer", "GenPrinter", L"PrinterPeripheral", FALSE},
  17. {"Processor", "", L"OtherPeripheral", FALSE},
  18. {"Worm", "GenWorm", L"WormPeripheral", TRUE},
  19. {"CdRom", "GenCdRom", L"CdRomPeripheral", TRUE},
  20. {"Scanner", "GenScanner", L"ScannerPeripheral", FALSE},
  21. {"Optical", "GenOptical", L"OpticalDiskPeripheral", TRUE},
  22. {"Changer", "ScsiChanger", L"MediumChangerPeripheral", TRUE},
  23. {"Net", "ScsiNet", L"CommunicationsPeripheral", FALSE},
  24. {"ASCIT8", "ScsiASCIT8", L"ASCPrePressGraphicsPeripheral", FALSE},
  25. {"ASCIT8", "ScsiASCIT8", L"ASCPrePressGraphicsPeripheral", FALSE},
  26. {"Array", "ScsiArray", L"ArrayPeripheral", FALSE},
  27. {"Enclosure", "ScsiEnclosure", L"EnclosurePeripheral", FALSE},
  28. {"RBC", "ScsiRBC", L"RBCPeripheral", TRUE},
  29. {"CardReader", "ScsiCardReader", L"CardReaderPeripheral", FALSE},
  30. {"Bridge", "ScsiBridge", L"BridgePeripheral", FALSE},
  31. {"Other", "ScsiOther", L"OtherPeripheral", FALSE}
  32. };
  33. #ifdef ALLOC_PRAGMA
  34. #pragma data_seg()
  35. #endif
  36. //
  37. // Functions
  38. //
  39. PCSCSI_DEVICE_TYPE
  40. PortGetDeviceType(
  41. IN ULONG DeviceType
  42. )
  43. /*++
  44. Routine Description:
  45. Get the SCSI_DEVICE_TYPE record for the specified device.
  46. Arguments:
  47. DeviceType - SCSI device type from the DeviceType field of the SCSI
  48. inquiry data.
  49. Return Value:
  50. Pointer to a SCSI device type record. This record must not be modified.
  51. --*/
  52. {
  53. PAGED_CODE();
  54. if (DeviceType >= ARRAY_COUNT (PortScsiDeviceTypes)) {
  55. DeviceType = ARRAY_COUNT (PortScsiDeviceTypes) - 1;
  56. }
  57. return &PortScsiDeviceTypes[DeviceType];
  58. }