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.

139 lines
3.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation
  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. CT_CHILD_WITH_INVALID_ID_NOTIFICATION
  18. } COLLECTION_TYPE, *PCOLLECTION_TYPE;
  19. typedef struct {
  20. LIST_ENTRY Link;
  21. TCHAR DeviceInstanceId[MAX_DEVICE_ID_LEN+1];
  22. PTSTR DeviceFriendlyName;
  23. ULONG Capabilities;
  24. GUID ClassGuid;
  25. } DEVICE_COLLECTION_ENTRY, *PDEVICE_COLLECTION_ENTRY;
  26. typedef struct {
  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. DeviceCollectionPopulateListView(
  64. IN PDEVICE_COLLECTION DeviceCollection,
  65. IN HWND ListHandle
  66. );
  67. BOOL
  68. DeviceCollectionGetDockDeviceIndex(
  69. IN PDEVICE_COLLECTION DeviceCollection,
  70. OUT ULONG *DockDeviceIndex
  71. );
  72. BOOL
  73. DeviceCollectionFormatDeviceText(
  74. IN PDEVICE_COLLECTION DeviceCollection,
  75. IN ULONG Index,
  76. IN PTSTR FormatString,
  77. IN ULONG BufferCharSize,
  78. OUT PTSTR BufferText
  79. );
  80. BOOL
  81. DeviceCollectionFormatServiceText(
  82. IN PDEVICE_COLLECTION DeviceCollection,
  83. IN ULONG Index,
  84. IN PTSTR FormatString,
  85. IN ULONG BufferCharSize,
  86. OUT PTSTR BufferText
  87. );
  88. PTSTR
  89. DeviceCollectionGetDeviceInstancePath(
  90. IN PDEVICE_COLLECTION DeviceCollection,
  91. IN ULONG Index
  92. );
  93. PTSTR
  94. DeviceCollectionGetDeviceFriendlyName(
  95. IN PDEVICE_COLLECTION DeviceCollection,
  96. IN ULONG Index
  97. );
  98. BOOL
  99. DeviceCollectionGetGuid(
  100. IN PDEVICE_COLLECTION DeviceCollection,
  101. IN OUT LPGUID Guid,
  102. IN ULONG Index
  103. );
  104. BOOL
  105. DeviceCollectionCheckIfAllRemoved(
  106. IN PDEVICE_COLLECTION DeviceCollection
  107. );