Sync with trunk (r48545)
[reactos.git] / include / ddk / swenum.h
1 #ifndef _SWENUM_
2 #define _SWENUM_
3
4 #define IOCTL_SWENUM_INSTALL_INTERFACE CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x000, METHOD_BUFFERED, FILE_ANY_ACCESS)
5 #define IOCTL_SWENUM_REMOVE_INTERFACE CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x001, METHOD_BUFFERED, FILE_ANY_ACCESS)
6 #define IOCTL_SWENUM_GET_BUS_ID CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x002, METHOD_NEITHER, FILE_READ_ACCESS)
7
8 typedef struct _SWENUM_INSTALL_INTERFACE {
9 GUID DeviceId;
10 GUID InterfaceId;
11 WCHAR ReferenceString[1];
12 } SWENUM_INSTALL_INTERFACE, *PSWENUM_INSTALL_INTERFACE;
13
14 #if defined(_KS_)
15 #define STATIC_BUSID_SoftwareDeviceEnumerator STATIC_KSMEDIUMSETID_Standard
16 #define BUSID_SoftwareDeviceEnumerator KSMEDIUMSETID_Standard
17 #else
18 #define STATIC_BUSID_SoftwareDeviceEnumerator \
19 0x4747B320L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
20 #endif /* _KS_ */
21
22 #if defined(_NTDDK_)
23
24 #if !defined(_KS_)
25 typedef VOID (NTAPI *PFNREFERENCEDEVICEOBJECT)(PVOID Context);
26 typedef VOID (NTAPI *PFNDEREFERENCEDEVICEOBJECT)(PVOID Context);
27 typedef NTSTATUS (NTAPI *PFNQUERYREFERENCESTRING)(PVOID Context, PWCHAR *String);
28 #endif /* _KS_ */
29
30 #define BUS_INTERFACE_SWENUM_VERSION 0x100
31
32 typedef struct _BUS_INTERFACE_SWENUM {
33 INTERFACE Interface;
34 PFNREFERENCEDEVICEOBJECT ReferenceDeviceObject;
35 PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject;
36 PFNQUERYREFERENCESTRING QueryReferenceString;
37 } BUS_INTERFACE_SWENUM, *PBUS_INTERFACE_SWENUM;
38
39 #if defined(__cplusplus)
40 extern "C" {
41 #endif
42
43 #if defined(_KS_)
44
45 KSDDKAPI
46 NTSTATUS
47 NTAPI
48 KsQuerySoftwareBusInterface(
49 IN PDEVICE_OBJECT PnpDeviceObject,
50 OUT PBUS_INTERFACE_SWENUM BusInterface);
51
52 KSDDKAPI
53 NTSTATUS
54 NTAPI
55 KsReferenceSoftwareBusObject(
56 IN KSDEVICE_HEADER Header);
57
58 KSDDKAPI
59 VOID
60 NTAPI
61 KsDereferenceSoftwareBusObject(
62 IN KSDEVICE_HEADER Header);
63
64 KSDDKAPI
65 NTSTATUS
66 NTAPI
67 KsCreateBusEnumObject(
68 IN PWSTR BusIdentifier,
69 IN PDEVICE_OBJECT BusDeviceObject,
70 IN PDEVICE_OBJECT PhysicalDeviceObject,
71 IN PDEVICE_OBJECT PnpDeviceObject,
72 IN REFGUID InterfaceGuid,
73 IN PWSTR ServiceRelativePath);
74
75 KSDDKAPI
76 NTSTATUS
77 NTAPI
78 KsGetBusEnumIdentifier(
79 IN OUT PIRP Irp);
80
81 KSDDKAPI
82 NTSTATUS
83 NTAPI
84 KsGetBusEnumPnpDeviceObject(
85 IN PDEVICE_OBJECT DeviceObject,
86 OUT PDEVICE_OBJECT *PnpDeviceObject);
87
88 KSDDKAPI
89 NTSTATUS
90 NTAPI
91 KsInstallBusEnumInterface(
92 IN PIRP Irp);
93
94 KSDDKAPI
95 NTSTATUS
96 NTAPI
97 KsIsBusEnumChildDevice(
98 IN PDEVICE_OBJECT DeviceObject,
99 OUT PBOOLEAN ChildDevice);
100
101 KSDDKAPI
102 NTSTATUS
103 NTAPI
104 KsRemoveBusEnumInterface(
105 IN PIRP Irp);
106
107 KSDDKAPI
108 NTSTATUS
109 NTAPI
110 KsServiceBusEnumPnpRequest(
111 IN PDEVICE_OBJECT DeviceObject,
112 IN OUT PIRP Irp);
113
114 KSDDKAPI
115 NTSTATUS
116 NTAPI
117 KsServiceBusEnumCreateRequest(
118 IN PDEVICE_OBJECT DeviceObject,
119 IN OUT PIRP Irp);
120
121 KSDDKAPI
122 NTSTATUS
123 NTAPI
124 KsGetBusEnumParentFDOFromChildPDO(
125 IN PDEVICE_OBJECT DeviceObject,
126 OUT PDEVICE_OBJECT *FunctionalDeviceObject);
127
128 #endif /* _KS_ */
129
130 #if defined(__cplusplus)
131 }
132 #endif
133
134 #endif /* _NTDDK_ */
135
136 #endif /* _SWENUM_ */