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.

104 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. devenum.h
  5. Abstract:
  6. Code for enum IDE ans SCSI controllers and attached to them storage devices
  7. and calculate for them SCSI Address.
  8. Author:
  9. Souren Aghajanyan (sourenag) 05-June-2001
  10. Revision History:
  11. --*/
  12. #pragma once
  13. #define MAX_PNPID_SIZE MAX_PATH+1
  14. #define MAX_REG_SIZE 512
  15. #define INVALID_SCSI_PORT 0xffffffff
  16. #define REG_ENUM_INVALID_INDEX 0xffffffff
  17. typedef enum tagCONTROLLER_TYPE{
  18. CONTROLLER_UNKNOWN = 0,
  19. CONTROLLER_ON_BOARD_IDE = 1,
  20. CONTROLLER_EXTRA_IDE = 2,
  21. CONTROLLER_SCSI = 3,
  22. }CONTROLLER_TYPE;
  23. typedef struct tagCONTROLLER_INFO
  24. {
  25. CONTROLLER_TYPE ControllerType;
  26. TCHAR PNPID[MAX_PNPID_SIZE];
  27. UINT SCSIPortNumber;
  28. }CONTROLLER_INFO, *PCONTROLLER_INFO;
  29. typedef struct tagCONTROLLERS_COLLECTION{
  30. UINT NumberOfControllers;
  31. PCONTROLLER_INFO ControllersInfo;
  32. }CONTROLLERS_COLLECTION, *PCONTROLLERS_COLLECTION;
  33. typedef struct tagDRIVE_SCSI_ADDRESS
  34. {
  35. DWORD DriveType;
  36. TCHAR DriveLetter;
  37. UCHAR PortNumber;
  38. UCHAR TargetId;
  39. UCHAR Lun;
  40. }DRIVE_SCSI_ADDRESS, *PDRIVE_SCSI_ADDRESS;
  41. typedef BOOL (*GATHERCONTROLLERINFO)(
  42. IN OUT PCONTROLLER_INFO ActiveControllersOut,
  43. IN OUT PUINT NumberOfActiveControllersOut
  44. );
  45. typedef BOOL (*PDEVICE_ENUM_CALLBACK_FUNCTION)(
  46. IN HKEY hDevice,
  47. IN PCONTROLLERS_COLLECTION ControllersCollection,
  48. IN UINT ControllerIndex,
  49. IN PVOID CallbackData);
  50. BOOL
  51. GatherControllersInfo(
  52. IN OUT PCONTROLLERS_COLLECTION * ControllersCollectionOut
  53. );
  54. BOOL
  55. ReleaseControllersInfo(
  56. IN PCONTROLLERS_COLLECTION ControllersCollection
  57. );
  58. BOOL
  59. GetSCSIAddressFromPnPId(
  60. IN PCONTROLLERS_COLLECTION ControllersCollection,
  61. IN HKEY hDeviceRegKey,
  62. IN PCTSTR PnPIdString,
  63. OUT DRIVE_SCSI_ADDRESS * ScsiAddressOut
  64. );
  65. BOOL
  66. GetDeviceType(
  67. IN HKEY hDevice,
  68. OUT DWORD* DriveType
  69. );
  70. BOOL
  71. DoesDriveExist(
  72. IN HKEY hDevice,
  73. OUT DWORD* DriveType
  74. );
  75. BOOL
  76. DeviceEnum(
  77. IN PCONTROLLERS_COLLECTION ControllersCollection,
  78. IN PCTSTR DeviceCategory,
  79. IN PDEVICE_ENUM_CALLBACK_FUNCTION DeviceEnumCallbackFunction,
  80. IN PVOID CallbackData
  81. );