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.

154 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. mf.h
  5. Abstract:
  6. This header describes the structures and interfaces required to interact
  7. with the multifunction enumerator.
  8. Author:
  9. Andy Thornton (andrewth) 20-Oct-97
  10. Revision History:
  11. --*/
  12. #if !defined(_MF_)
  13. #define _MF_
  14. //
  15. // MfFlags value
  16. //
  17. #define MF_FLAGS_EVEN_IF_NO_RESOURCE 0x00000001
  18. #define MF_FLAGS_NO_CREATE_IF_NO_RESOURCE 0x00000002
  19. #define MF_FLAGS_FILL_IN_UNKNOWN_RESOURCE 0x00000004
  20. #define MF_FLAGS_CREATE_BUT_NO_SHOW_DISABLED 0x00000008
  21. typedef struct _MF_RESOURCE_MAP {
  22. ULONG Count;
  23. UCHAR Resources[ANYSIZE_ARRAY];
  24. } MF_RESOURCE_MAP, *PMF_RESOURCE_MAP;
  25. typedef struct _MF_VARYING_RESOURCE_ENTRY {
  26. UCHAR ResourceIndex;
  27. UCHAR Reserved[3]; // Packing
  28. ULONG Offset;
  29. ULONG Size;
  30. ULONG MaxCount;
  31. } MF_VARYING_RESOURCE_ENTRY, *PMF_VARYING_RESOURCE_ENTRY;
  32. typedef struct _MF_VARYING_RESOURCE_MAP {
  33. ULONG Count;
  34. MF_VARYING_RESOURCE_ENTRY Resources[ANYSIZE_ARRAY];
  35. } MF_VARYING_RESOURCE_MAP, *PMF_VARYING_RESOURCE_MAP;
  36. typedef struct _MF_DEVICE_INFO *PMF_DEVICE_INFO;
  37. typedef struct _MF_DEVICE_INFO {
  38. //
  39. // Name for this child, unique with respect to the other children
  40. //
  41. UNICODE_STRING Name;
  42. //
  43. // A REG_MULTI_SZ style list of hardware IDs
  44. //
  45. UNICODE_STRING HardwareID;
  46. //
  47. // A REG_MULTI_SZ style list of compatible IDs
  48. //
  49. UNICODE_STRING CompatibleID;
  50. //
  51. // Map of resource that we totally consume
  52. //
  53. PMF_RESOURCE_MAP ResourceMap;
  54. //
  55. // Map of resource that we partially consume
  56. //
  57. PMF_VARYING_RESOURCE_MAP VaryingResourceMap;
  58. //
  59. // Flags -
  60. // MF_FLAGS_FILL_IN_UNKNOWN_RESOURCE - if the parent resource doesn't
  61. // contain a descriptor referenced in the ResourceMap use a
  62. // null (CmResourceTypeNull) descriptor instead.
  63. //
  64. ULONG MfFlags;
  65. } MF_DEVICE_INFO;
  66. typedef
  67. NTSTATUS
  68. (*PMF_ENUMERATE_CHILD)(
  69. IN PVOID Context,
  70. IN ULONG Index,
  71. OUT PMF_DEVICE_INFO ChildInfo
  72. );
  73. /*++
  74. Routine Description:
  75. This returns information about children to be enumerated by a multifunction
  76. driver.
  77. Arguments:
  78. Context - Context from the MF_ENUMERATION_INTERFACE
  79. Index - Zero based index of the children
  80. ChildInfo - Pointer to a caller allocated buffer that should be filled in
  81. by the callee. This will involve allocation of extra buffers for each
  82. piece of information. These will be freed by calling ExFreePool when
  83. they are no longer required.
  84. Return Value:
  85. Status code that indicates whether or not the function was successful.
  86. STATUS_NO_MORE_ENTRIES indicates that the are no more children to enumerate
  87. --*/
  88. typedef struct _MF_ENUMERATION_INTERFACE {
  89. //
  90. // Generic interface header
  91. //
  92. USHORT Size;
  93. USHORT Version;
  94. PVOID Context;
  95. PINTERFACE_REFERENCE InterfaceReference;
  96. PINTERFACE_DEREFERENCE InterfaceDereference;
  97. //
  98. // Multi-function enumeration data
  99. //
  100. PMF_ENUMERATE_CHILD EnumerateChild;
  101. } MF_ENUMERATION_INTERFACE, *PMF_ENUMERATION_INTERFACE;
  102. #endif