Source code of Windows XP (NT5)
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.

145 lines
3.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 2001
  6. //
  7. // File: devicecol.h
  8. //
  9. // Description: This header exposes support for device collections.
  10. //
  11. //--------------------------------------------------------------------------
  12. typedef enum {
  13. CT_SAFE_REMOVAL_NOTIFICATION,
  14. CT_VETOED_REMOVAL_NOTIFICATION,
  15. CT_SURPRISE_REMOVAL_WARNING,
  16. CT_BLOCKED_DRIVER_NOTIFICATION
  17. } COLLECTION_TYPE, *PCOLLECTION_TYPE;
  18. typedef struct {
  19. LIST_ENTRY Link;
  20. TCHAR DeviceInstanceId[MAX_DEVICE_ID_LEN+1];
  21. PTSTR DeviceFriendlyName;
  22. ULONG Capabilities;
  23. GUID ClassGuid;
  24. } DEVICE_COLLECTION_ENTRY, *PDEVICE_COLLECTION_ENTRY;
  25. typedef struct {
  26. HMACHINE hMachine;
  27. LIST_ENTRY DeviceListHead;
  28. INT NumDevices;
  29. BOOL DockInList;
  30. SP_CLASSIMAGELIST_DATA ClassImageList;
  31. } DEVICE_COLLECTION, *PDEVICE_COLLECTION;
  32. typedef enum {
  33. VETOED_EJECT = 1,
  34. VETOED_REMOVAL,
  35. VETOED_UNDOCK,
  36. VETOED_STANDBY,
  37. VETOED_HIBERNATE,
  38. VETOED_WARM_EJECT,
  39. VETOED_WARM_UNDOCK
  40. } VETOED_OPERATION;
  41. typedef struct {
  42. DEVICE_COLLECTION dc;
  43. PNP_VETO_TYPE VetoType;
  44. VETOED_OPERATION VetoedOperation;
  45. } VETO_DEVICE_COLLECTION, *PVETO_DEVICE_COLLECTION;
  46. typedef struct {
  47. DEVICE_COLLECTION dc;
  48. BOOL SuppressSurprise;
  49. ULONG DialogTicker;
  50. ULONG MaxWaitForDock;
  51. } SURPRISE_WARN_COLLECTION, *PSURPRISE_WARN_COLLECTION;
  52. BOOL
  53. DeviceCollectionBuildFromPipe(
  54. IN HANDLE ReadPipe,
  55. IN COLLECTION_TYPE CollectionType,
  56. OUT PDEVICE_COLLECTION DeviceCollection
  57. );
  58. VOID
  59. DeviceCollectionDestroy(
  60. IN PDEVICE_COLLECTION DeviceCollection
  61. );
  62. VOID
  63. DeviceCollectionSuppressSurprise(
  64. IN PDEVICE_COLLECTION DeviceCollection
  65. );
  66. VOID
  67. DeviceCollectionPopulateListView(
  68. IN PDEVICE_COLLECTION DeviceCollection,
  69. IN HWND ListHandle
  70. );
  71. BOOL
  72. DeviceCollectionGetDockDeviceIndex(
  73. IN PDEVICE_COLLECTION DeviceCollection,
  74. OUT ULONG *DockDeviceIndex
  75. );
  76. BOOL
  77. DeviceCollectionFormatDeviceText(
  78. IN PDEVICE_COLLECTION DeviceCollection,
  79. IN ULONG Index,
  80. IN PTSTR FormatString,
  81. IN ULONG BufferCharSize,
  82. OUT PTSTR BufferText
  83. );
  84. BOOL
  85. DeviceCollectionFormatServiceText(
  86. IN PDEVICE_COLLECTION DeviceCollection,
  87. IN ULONG Index,
  88. IN PTSTR FormatString,
  89. IN ULONG BufferCharSize,
  90. OUT PTSTR BufferText
  91. );
  92. PTSTR
  93. DeviceCollectionGetDeviceInstancePath(
  94. IN PDEVICE_COLLECTION DeviceCollection,
  95. IN ULONG Index
  96. );
  97. BOOL
  98. DeviceCollectionGetGuid(
  99. IN PDEVICE_COLLECTION DeviceCollection,
  100. IN OUT LPGUID Guid,
  101. IN ULONG Index
  102. );
  103. #if BUBBLES
  104. BOOL
  105. DeviceCollectionCheckIfAllPresent(
  106. IN PDEVICE_COLLECTION DeviceCollection
  107. );
  108. #endif // BUBBLES
  109. BOOL
  110. DeviceCollectionCheckIfAllRemoved(
  111. IN PDEVICE_COLLECTION DeviceCollection
  112. );