master
idl 207 lines 6.53 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft Corporation. All rights reserved.
4
5 Module Name:
6
7 windowsdefs.idl
8
9 Abstract:
10
11 This file contains the COM object used by WSL.
12
13 --*/
14
15 import "unknwn.idl";
16 import "wtypes.idl";
17
18 [
19 object,
20 uuid(3e57bd3c-5a5d-4bdc-a0a6-5b4193d4b719),
21 pointer_default( unique )
22 ]
23 interface IVmVirtualDeviceAccess : IUnknown
24 {
25 [local]
26 HRESULT _Reserved();
27
28 // N.B. The original declaration has another method before GetDevice(), but that method is declared as call_as, which doesn't generate an entry in the vtable.
29 [local]
30 HRESULT
31 GetDevice(
32 [in] REFGUID CategoryID,
33 [in] REFGUID DeviceID,
34 [out, retval] IUnknown** Device
35 );
36 };
37
38 typedef[v1_enum] enum {
39 FIOV_BAR0 = 0, ///< Bar 0 of the virtual device
40 FIOV_BAR1, ///< Bar 1 of the virtual device
41 FIOV_BAR2, ///< Bar 2 of the virtual device
42 FIOV_BAR3, ///< Bar 3 of the virtual device
43 FIOV_BAR4, ///< Bar 4 of the virtual device
44 FIOV_BAR5, ///< Bar 5 of the virtual device
45 FIOV_ROMBAR ///< ROM BAR of the virtual device
46 } FIOV_BAR_SELECTOR;
47
48 typedef[v1_enum] enum {
49 FiovMmioMappingFlagNone = 0x00000000,
50 FiovMmioMappingFlagWriteable = 0x00000001,
51 FiovMmioMappingFlagExecutable = 0x00000002
52
53 } FiovMmioMappingFlags;
54 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(FiovMmioMappingFlags);")
55
56 [
57 object,
58 uuid(f5dfbec1-b9f3-4b26-bf6f-c251448bcf7a),
59 helpstring("IVmFiovGuestMemoryFastNotification Interface"),
60 pointer_default(unique),
61 ]
62 interface IVmFiovGuestMemoryFastNotification : IUnknown
63 {
64 HRESULT
65 RegisterDoorbell(
66 [in] FIOV_BAR_SELECTOR BarIndex,
67 [in] UINT64 BarOffset,
68 [in] UINT64 TriggerValue,
69 [in] UINT64 Flags,
70 [in, system_handle(sh_event)] HANDLE NotificationEvent
71 );
72
73 HRESULT
74 UnregisterDoorbell(
75 [in] FIOV_BAR_SELECTOR BarIndex,
76 [in] UINT64 BarOffset,
77 [in] UINT64 TriggerValue,
78 [in] UINT64 Flags
79 );
80 };
81
82 [
83 local,
84 object,
85 uuid(68c6a1b9-de39-42c3-8d28-bf40a5126541)
86 ]
87 interface ICallingProcessInfo : IUnknown
88 {
89 HRESULT OpenCallerProcessHandle(DWORD desiredAccess, [out, annotation("_Out_")] HANDLE *callerProcessHandle);
90 };
91
92 [
93 object,
94 uuid(9d416457-abbc-46cf-8b93-901c68bec627),
95 helpstring("IVmFiovGuestMmioMappings Interface"),
96 pointer_default(unique),
97 ]
98 interface IVmFiovGuestMmioMappings : IUnknown
99 {
100 HRESULT
101 CreateSectionBackedMmioRange(
102 [in] FIOV_BAR_SELECTOR BarIndex,
103 [in] ULONG64 BarOffsetInPages,
104 [in] UINT64 PageCount,
105 [in] FiovMmioMappingFlags MappingFlags,
106 [in, system_handle(sh_section)] HANDLE SectionHandle,
107 [in] UINT64 SectionOffsetInPages
108 );
109
110 HRESULT
111 DestroySectionBackedMmioRange(
112 [in] FIOV_BAR_SELECTOR BarIndex,
113 [in] ULONG64 BarOffsetInPages
114 );
115 };
116
117 [
118 object,
119 uuid(78523d62-d919-47ca-9cd7-08139172d685),
120 helpstring("IVmDeviceHost Interface"),
121 pointer_default(unique)
122 ]
123 interface IVmDeviceHost : IUnknown
124 {
125 HRESULT
126 GetDeviceInstance(
127 [in] REFGUID DeviceClassId,
128 [in] REFGUID DeviceInstanceId,
129 [out, retval] IUnknown** DeviceInstance
130 );
131 };
132
133 [
134 object,
135 uuid(e31aa49b-0914-465e-b145-1b9ba13efb10),
136 helpstring("IVmDeviceHostSupport Interface"),
137 pointer_default(unique)
138 ]
139 interface IVmDeviceHostSupport : IUnknown
140 {
141 HRESULT
142 RegisterDeviceHost(
143 [in] IVmDeviceHost* DeviceHost,
144 [in] DWORD ProcessId,
145 [out] UINT64* IpcSectionHandle
146 );
147 };
148
149 [
150 uuid(7649D52D-D275-4289-901E-EB626C967ECE),
151 pointer_default(unique),
152 object
153 ]
154 interface IPlan9FileSystem : IUnknown
155 {
156 HRESULT AddShare([in, unique] LPCWSTR name, [in, system_handle(sh_file)] HANDLE handle, [in] UINT32 flags);
157 HRESULT RemoveShare([in, unique] LPCWSTR name);
158 HRESULT Pause();
159 HRESULT Resume();
160 HRESULT Teardown();
161 HRESULT SetAllowedFiles([in, unique] LPCWSTR shareName, [in, size_is(count)] const LPCWSTR *files, [in] int count);
162 HRESULT Init([in, unique] LPCGUID vmId, [in] ULONG port);
163 HRESULT AddSharePath([in, unique] LPCWSTR name, [in, unique] LPCWSTR path, [in] UINT32 flags);
164 HRESULT CreateVirtioDevice([in, unique] LPCWSTR vmId,
165 [in, unique] IUnknown *deviceHostSupport,
166 [in, unique] LPCWSTR tag,
167 [in, unique, defaultvalue(NULL)] GUID *instanceId);
168 HRESULT IsRunning();
169 };
170
171 [
172 uuid(8434F839-CA86-495D-8A75-7EB36D073FFE),
173 pointer_default(unique),
174 object
175 ]
176 interface IPlan9FileSystemHost : IUnknown
177 {
178 HRESULT NotifyAllDevicesInUse([in, unique] LPCWSTR tag);
179 HRESULT RegisterDoorbell([in] REFGUID InstanceId,
180 [in] UINT8 BarIndex,
181 [in] UINT64 Offset,
182 [in] UINT64 TriggerValue,
183 [in] UINT64 Flags,
184 [in, system_handle(sh_event)] HANDLE Event);
185 HRESULT UnregisterDoorbell([in] REFGUID InstanceId,
186 [in] UINT8 BarIndex,
187 [in] UINT64 Offset,
188 [in] UINT64 TriggerValue,
189 [in] UINT64 Flags);
190 HRESULT CreateSectionBackedMmioRange([in] REFGUID InstanceId,
191 [in] UINT8 BarIndex,
192 [in] UINT64 BarOffsetInPages,
193 [in] UINT64 PageCount,
194 [in] UINT64 MappingFlags,
195 [in, system_handle(sh_section)] HANDLE SectionHandle,
196 [in] UINT64 SectionOffsetInPages);
197 HRESULT DestroySectionBackedMmioRange([in] REFGUID InstanceId,
198 [in] UINT8 BarIndex,
199 [in] UINT64 BarOffsetInPages);
200 };
201
202 cpp_quote("#ifdef __cplusplus")
203 cpp_quote("namespace p9fs")
204 cpp_quote("{")
205 cpp_quote("class DECLSPEC_UUID(\"AFC7B6DE-D642-41B7-AB0C-A01019510741\") Plan9FileSystem;")
206 cpp_quote("}")
207 cpp_quote("#endif")