]> git.proxmox.com Git - rustc.git/blame - vendor/windows/src/Windows/Devices/Enumeration/Pnp/mod.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / vendor / windows / src / Windows / Devices / Enumeration / Pnp / mod.rs
CommitLineData
353b0b11
FG
1#[doc(hidden)]
2#[repr(transparent)]
3pub struct IPnpObject(::windows::core::IUnknown);
4unsafe impl ::windows::core::Interface for IPnpObject {
5 type Vtable = IPnpObject_Vtbl;
6}
7impl ::core::clone::Clone for IPnpObject {
8 fn clone(&self) -> Self {
9 Self(self.0.clone())
10 }
11}
12unsafe impl ::windows::core::ComInterface for IPnpObject {
13 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x95c66258_733b_4a8f_93a3_db078ac870c1);
14}
15#[repr(C)]
16#[doc(hidden)]
17pub struct IPnpObject_Vtbl {
18 pub base__: ::windows::core::IInspectable_Vtbl,
19 pub Type: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut PnpObjectType) -> ::windows::core::HRESULT,
20 pub Id: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows::core::HSTRING>) -> ::windows::core::HRESULT,
21 #[cfg(feature = "Foundation_Collections")]
22 pub Properties: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
23 #[cfg(not(feature = "Foundation_Collections"))]
24 Properties: usize,
25 pub Update: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, updateinfo: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
26}
27#[doc(hidden)]
28#[repr(transparent)]
29pub struct IPnpObjectStatics(::windows::core::IUnknown);
30unsafe impl ::windows::core::Interface for IPnpObjectStatics {
31 type Vtable = IPnpObjectStatics_Vtbl;
32}
33impl ::core::clone::Clone for IPnpObjectStatics {
34 fn clone(&self) -> Self {
35 Self(self.0.clone())
36 }
37}
38unsafe impl ::windows::core::ComInterface for IPnpObjectStatics {
39 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb3c32a3d_d168_4660_bbf3_a733b14b6e01);
40}
41#[repr(C)]
42#[doc(hidden)]
43pub struct IPnpObjectStatics_Vtbl {
44 pub base__: ::windows::core::IInspectable_Vtbl,
45 #[cfg(feature = "Foundation_Collections")]
46 pub CreateFromIdAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, r#type: PnpObjectType, id: ::std::mem::MaybeUninit<::windows::core::HSTRING>, requestedproperties: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
47 #[cfg(not(feature = "Foundation_Collections"))]
48 CreateFromIdAsync: usize,
49 #[cfg(feature = "Foundation_Collections")]
50 pub FindAllAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, r#type: PnpObjectType, requestedproperties: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
51 #[cfg(not(feature = "Foundation_Collections"))]
52 FindAllAsync: usize,
53 #[cfg(feature = "Foundation_Collections")]
54 pub FindAllAsyncAqsFilter: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, r#type: PnpObjectType, requestedproperties: *mut ::core::ffi::c_void, aqsfilter: ::std::mem::MaybeUninit<::windows::core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
55 #[cfg(not(feature = "Foundation_Collections"))]
56 FindAllAsyncAqsFilter: usize,
57 #[cfg(feature = "Foundation_Collections")]
58 pub CreateWatcher: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, r#type: PnpObjectType, requestedproperties: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
59 #[cfg(not(feature = "Foundation_Collections"))]
60 CreateWatcher: usize,
61 #[cfg(feature = "Foundation_Collections")]
62 pub CreateWatcherAqsFilter: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, r#type: PnpObjectType, requestedproperties: *mut ::core::ffi::c_void, aqsfilter: ::std::mem::MaybeUninit<::windows::core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
63 #[cfg(not(feature = "Foundation_Collections"))]
64 CreateWatcherAqsFilter: usize,
65}
66#[doc(hidden)]
67#[repr(transparent)]
68pub struct IPnpObjectUpdate(::windows::core::IUnknown);
69unsafe impl ::windows::core::Interface for IPnpObjectUpdate {
70 type Vtable = IPnpObjectUpdate_Vtbl;
71}
72impl ::core::clone::Clone for IPnpObjectUpdate {
73 fn clone(&self) -> Self {
74 Self(self.0.clone())
75 }
76}
77unsafe impl ::windows::core::ComInterface for IPnpObjectUpdate {
78 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6f59e812_001e_4844_bcc6_432886856a17);
79}
80#[repr(C)]
81#[doc(hidden)]
82pub struct IPnpObjectUpdate_Vtbl {
83 pub base__: ::windows::core::IInspectable_Vtbl,
84 pub Type: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut PnpObjectType) -> ::windows::core::HRESULT,
85 pub Id: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::std::mem::MaybeUninit<::windows::core::HSTRING>) -> ::windows::core::HRESULT,
86 #[cfg(feature = "Foundation_Collections")]
87 pub Properties: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
88 #[cfg(not(feature = "Foundation_Collections"))]
89 Properties: usize,
90}
91#[doc(hidden)]
92#[repr(transparent)]
93pub struct IPnpObjectWatcher(::windows::core::IUnknown);
94unsafe impl ::windows::core::Interface for IPnpObjectWatcher {
95 type Vtable = IPnpObjectWatcher_Vtbl;
96}
97impl ::core::clone::Clone for IPnpObjectWatcher {
98 fn clone(&self) -> Self {
99 Self(self.0.clone())
100 }
101}
102unsafe impl ::windows::core::ComInterface for IPnpObjectWatcher {
103 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x83c95ca8_4772_4a7a_aca8_e48c42a89c44);
104}
105#[repr(C)]
106#[doc(hidden)]
107pub struct IPnpObjectWatcher_Vtbl {
108 pub base__: ::windows::core::IInspectable_Vtbl,
109 #[cfg(feature = "Foundation")]
110 pub Added: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
111 #[cfg(not(feature = "Foundation"))]
112 Added: usize,
113 #[cfg(feature = "Foundation")]
114 pub RemoveAdded: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
115 #[cfg(not(feature = "Foundation"))]
116 RemoveAdded: usize,
117 #[cfg(feature = "Foundation")]
118 pub Updated: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
119 #[cfg(not(feature = "Foundation"))]
120 Updated: usize,
121 #[cfg(feature = "Foundation")]
122 pub RemoveUpdated: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
123 #[cfg(not(feature = "Foundation"))]
124 RemoveUpdated: usize,
125 #[cfg(feature = "Foundation")]
126 pub Removed: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
127 #[cfg(not(feature = "Foundation"))]
128 Removed: usize,
129 #[cfg(feature = "Foundation")]
130 pub RemoveRemoved: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
131 #[cfg(not(feature = "Foundation"))]
132 RemoveRemoved: usize,
133 #[cfg(feature = "Foundation")]
134 pub EnumerationCompleted: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
135 #[cfg(not(feature = "Foundation"))]
136 EnumerationCompleted: usize,
137 #[cfg(feature = "Foundation")]
138 pub RemoveEnumerationCompleted: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
139 #[cfg(not(feature = "Foundation"))]
140 RemoveEnumerationCompleted: usize,
141 #[cfg(feature = "Foundation")]
142 pub Stopped: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
143 #[cfg(not(feature = "Foundation"))]
144 Stopped: usize,
145 #[cfg(feature = "Foundation")]
146 pub RemoveStopped: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT,
147 #[cfg(not(feature = "Foundation"))]
148 RemoveStopped: usize,
149 pub Status: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::DeviceWatcherStatus) -> ::windows::core::HRESULT,
150 pub Start: unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
151 pub Stop: unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
152}
153#[doc = "*Required features: `\"Devices_Enumeration_Pnp\"`*"]
154#[repr(transparent)]
155pub struct PnpObject(::windows::core::IUnknown);
156impl PnpObject {
157 pub fn Type(&self) -> ::windows::core::Result<PnpObjectType> {
158 let this = self;
159 unsafe {
160 let mut result__ = ::windows::core::zeroed::<PnpObjectType>();
161 (::windows::core::Interface::vtable(this).Type)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
162 }
163 }
164 pub fn Id(&self) -> ::windows::core::Result<::windows::core::HSTRING> {
165 let this = self;
166 unsafe {
167 let mut result__ = ::windows::core::zeroed::<::windows::core::HSTRING>();
168 (::windows::core::Interface::vtable(this).Id)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
169 }
170 }
171 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
172 #[cfg(feature = "Foundation_Collections")]
173 pub fn Properties(&self) -> ::windows::core::Result<super::super::super::Foundation::Collections::IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>> {
174 let this = self;
175 unsafe {
176 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::Collections::IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>>();
177 (::windows::core::Interface::vtable(this).Properties)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
178 }
179 }
180 pub fn Update(&self, updateinfo: &PnpObjectUpdate) -> ::windows::core::Result<()> {
181 let this = self;
182 unsafe { (::windows::core::Interface::vtable(this).Update)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(updateinfo)).ok() }
183 }
184 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
185 #[cfg(feature = "Foundation_Collections")]
186 pub fn CreateFromIdAsync<P0>(r#type: PnpObjectType, id: &::windows::core::HSTRING, requestedproperties: P0) -> ::windows::core::Result<super::super::super::Foundation::IAsyncOperation<PnpObject>>
187 where
188 P0: ::windows::core::TryIntoParam<super::super::super::Foundation::Collections::IIterable<::windows::core::HSTRING>>,
189 {
190 Self::IPnpObjectStatics(|this| unsafe {
191 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::IAsyncOperation<PnpObject>>();
192 (::windows::core::Interface::vtable(this).CreateFromIdAsync)(::windows::core::Interface::as_raw(this), r#type, ::core::mem::transmute_copy(id), requestedproperties.try_into_param()?.abi(), &mut result__).from_abi(result__)
193 })
194 }
195 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
196 #[cfg(feature = "Foundation_Collections")]
197 pub fn FindAllAsync<P0>(r#type: PnpObjectType, requestedproperties: P0) -> ::windows::core::Result<super::super::super::Foundation::IAsyncOperation<PnpObjectCollection>>
198 where
199 P0: ::windows::core::TryIntoParam<super::super::super::Foundation::Collections::IIterable<::windows::core::HSTRING>>,
200 {
201 Self::IPnpObjectStatics(|this| unsafe {
202 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::IAsyncOperation<PnpObjectCollection>>();
203 (::windows::core::Interface::vtable(this).FindAllAsync)(::windows::core::Interface::as_raw(this), r#type, requestedproperties.try_into_param()?.abi(), &mut result__).from_abi(result__)
204 })
205 }
206 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
207 #[cfg(feature = "Foundation_Collections")]
208 pub fn FindAllAsyncAqsFilter<P0>(r#type: PnpObjectType, requestedproperties: P0, aqsfilter: &::windows::core::HSTRING) -> ::windows::core::Result<super::super::super::Foundation::IAsyncOperation<PnpObjectCollection>>
209 where
210 P0: ::windows::core::TryIntoParam<super::super::super::Foundation::Collections::IIterable<::windows::core::HSTRING>>,
211 {
212 Self::IPnpObjectStatics(|this| unsafe {
213 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::IAsyncOperation<PnpObjectCollection>>();
214 (::windows::core::Interface::vtable(this).FindAllAsyncAqsFilter)(::windows::core::Interface::as_raw(this), r#type, requestedproperties.try_into_param()?.abi(), ::core::mem::transmute_copy(aqsfilter), &mut result__).from_abi(result__)
215 })
216 }
217 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
218 #[cfg(feature = "Foundation_Collections")]
219 pub fn CreateWatcher<P0>(r#type: PnpObjectType, requestedproperties: P0) -> ::windows::core::Result<PnpObjectWatcher>
220 where
221 P0: ::windows::core::TryIntoParam<super::super::super::Foundation::Collections::IIterable<::windows::core::HSTRING>>,
222 {
223 Self::IPnpObjectStatics(|this| unsafe {
224 let mut result__ = ::windows::core::zeroed::<PnpObjectWatcher>();
225 (::windows::core::Interface::vtable(this).CreateWatcher)(::windows::core::Interface::as_raw(this), r#type, requestedproperties.try_into_param()?.abi(), &mut result__).from_abi(result__)
226 })
227 }
228 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
229 #[cfg(feature = "Foundation_Collections")]
230 pub fn CreateWatcherAqsFilter<P0>(r#type: PnpObjectType, requestedproperties: P0, aqsfilter: &::windows::core::HSTRING) -> ::windows::core::Result<PnpObjectWatcher>
231 where
232 P0: ::windows::core::TryIntoParam<super::super::super::Foundation::Collections::IIterable<::windows::core::HSTRING>>,
233 {
234 Self::IPnpObjectStatics(|this| unsafe {
235 let mut result__ = ::windows::core::zeroed::<PnpObjectWatcher>();
236 (::windows::core::Interface::vtable(this).CreateWatcherAqsFilter)(::windows::core::Interface::as_raw(this), r#type, requestedproperties.try_into_param()?.abi(), ::core::mem::transmute_copy(aqsfilter), &mut result__).from_abi(result__)
237 })
238 }
239 #[doc(hidden)]
240 pub fn IPnpObjectStatics<R, F: FnOnce(&IPnpObjectStatics) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> {
241 static SHARED: ::windows::imp::FactoryCache<PnpObject, IPnpObjectStatics> = ::windows::imp::FactoryCache::new();
242 SHARED.call(callback)
243 }
244}
245impl ::core::cmp::PartialEq for PnpObject {
246 fn eq(&self, other: &Self) -> bool {
247 self.0 == other.0
248 }
249}
250impl ::core::cmp::Eq for PnpObject {}
251impl ::core::fmt::Debug for PnpObject {
252 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
253 f.debug_tuple("PnpObject").field(&self.0).finish()
254 }
255}
256impl ::windows::core::RuntimeType for PnpObject {
257 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Enumeration.Pnp.PnpObject;{95c66258-733b-4a8f-93a3-db078ac870c1})");
258}
259impl ::core::clone::Clone for PnpObject {
260 fn clone(&self) -> Self {
261 Self(self.0.clone())
262 }
263}
264unsafe impl ::windows::core::Interface for PnpObject {
265 type Vtable = IPnpObject_Vtbl;
266}
267unsafe impl ::windows::core::ComInterface for PnpObject {
268 const IID: ::windows::core::GUID = <IPnpObject as ::windows::core::ComInterface>::IID;
269}
270impl ::windows::core::RuntimeName for PnpObject {
271 const NAME: &'static str = "Windows.Devices.Enumeration.Pnp.PnpObject";
272}
273::windows::imp::interface_hierarchy!(PnpObject, ::windows::core::IUnknown, ::windows::core::IInspectable);
274unsafe impl ::core::marker::Send for PnpObject {}
275unsafe impl ::core::marker::Sync for PnpObject {}
276#[doc = "*Required features: `\"Devices_Enumeration_Pnp\"`, `\"Foundation_Collections\"`*"]
277#[cfg(feature = "Foundation_Collections")]
278#[repr(transparent)]
279pub struct PnpObjectCollection(::windows::core::IUnknown);
280#[cfg(feature = "Foundation_Collections")]
281impl PnpObjectCollection {
282 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
283 #[cfg(feature = "Foundation_Collections")]
284 pub fn First(&self) -> ::windows::core::Result<super::super::super::Foundation::Collections::IIterator<PnpObject>> {
285 let this = &::windows::core::ComInterface::cast::<super::super::super::Foundation::Collections::IIterable<PnpObject>>(self)?;
286 unsafe {
287 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::Collections::IIterator<PnpObject>>();
288 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
289 }
290 }
291 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
292 #[cfg(feature = "Foundation_Collections")]
293 pub fn GetAt(&self, index: u32) -> ::windows::core::Result<PnpObject> {
294 let this = self;
295 unsafe {
296 let mut result__ = ::windows::core::zeroed::<PnpObject>();
297 (::windows::core::Interface::vtable(this).GetAt)(::windows::core::Interface::as_raw(this), index, &mut result__).from_abi(result__)
298 }
299 }
300 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
301 #[cfg(feature = "Foundation_Collections")]
302 pub fn Size(&self) -> ::windows::core::Result<u32> {
303 let this = self;
304 unsafe {
305 let mut result__ = ::windows::core::zeroed::<u32>();
306 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
307 }
308 }
309 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
310 #[cfg(feature = "Foundation_Collections")]
311 pub fn IndexOf(&self, value: &PnpObject, index: &mut u32) -> ::windows::core::Result<bool> {
312 let this = self;
313 unsafe {
314 let mut result__ = ::windows::core::zeroed::<bool>();
315 (::windows::core::Interface::vtable(this).IndexOf)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(value), index, &mut result__).from_abi(result__)
316 }
317 }
318 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
319 #[cfg(feature = "Foundation_Collections")]
320 pub fn GetMany(&self, startindex: u32, items: &mut [::core::option::Option<PnpObject>]) -> ::windows::core::Result<u32> {
321 let this = self;
322 unsafe {
323 let mut result__ = ::windows::core::zeroed::<u32>();
324 (::windows::core::Interface::vtable(this).GetMany)(::windows::core::Interface::as_raw(this), startindex, items.len() as u32, ::core::mem::transmute_copy(&items), &mut result__).from_abi(result__)
325 }
326 }
327}
328#[cfg(feature = "Foundation_Collections")]
329impl ::core::cmp::PartialEq for PnpObjectCollection {
330 fn eq(&self, other: &Self) -> bool {
331 self.0 == other.0
332 }
333}
334#[cfg(feature = "Foundation_Collections")]
335impl ::core::cmp::Eq for PnpObjectCollection {}
336#[cfg(feature = "Foundation_Collections")]
337impl ::core::fmt::Debug for PnpObjectCollection {
338 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
339 f.debug_tuple("PnpObjectCollection").field(&self.0).finish()
340 }
341}
342#[cfg(feature = "Foundation_Collections")]
343impl ::windows::core::RuntimeType for PnpObjectCollection {
344 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Enumeration.Pnp.PnpObjectCollection;pinterface({bbe1fa4c-b0e3-4583-baef-1f1b2e483e56};rc(Windows.Devices.Enumeration.Pnp.PnpObject;{95c66258-733b-4a8f-93a3-db078ac870c1})))");
345}
346#[cfg(feature = "Foundation_Collections")]
347impl ::core::clone::Clone for PnpObjectCollection {
348 fn clone(&self) -> Self {
349 Self(self.0.clone())
350 }
351}
352#[cfg(feature = "Foundation_Collections")]
353unsafe impl ::windows::core::Interface for PnpObjectCollection {
354 type Vtable = super::super::super::Foundation::Collections::IVectorView_Vtbl<PnpObject>;
355}
356#[cfg(feature = "Foundation_Collections")]
357unsafe impl ::windows::core::ComInterface for PnpObjectCollection {
358 const IID: ::windows::core::GUID = <super::super::super::Foundation::Collections::IVectorView<PnpObject> as ::windows::core::ComInterface>::IID;
359}
360#[cfg(feature = "Foundation_Collections")]
361impl ::windows::core::RuntimeName for PnpObjectCollection {
362 const NAME: &'static str = "Windows.Devices.Enumeration.Pnp.PnpObjectCollection";
363}
364#[cfg(feature = "Foundation_Collections")]
365impl ::core::iter::IntoIterator for PnpObjectCollection {
366 type Item = PnpObject;
367 type IntoIter = super::super::super::Foundation::Collections::VectorViewIterator<Self::Item>;
368 fn into_iter(self) -> Self::IntoIter {
369 ::core::iter::IntoIterator::into_iter(&self)
370 }
371}
372#[cfg(feature = "Foundation_Collections")]
373impl ::core::iter::IntoIterator for &PnpObjectCollection {
374 type Item = PnpObject;
375 type IntoIter = super::super::super::Foundation::Collections::VectorViewIterator<Self::Item>;
376 fn into_iter(self) -> Self::IntoIter {
377 super::super::super::Foundation::Collections::VectorViewIterator::new(::windows::core::ComInterface::cast(self).ok())
378 }
379}
380#[cfg(feature = "Foundation_Collections")]
381::windows::imp::interface_hierarchy!(PnpObjectCollection, ::windows::core::IUnknown, ::windows::core::IInspectable);
382#[cfg(feature = "Foundation_Collections")]
383impl ::windows::core::CanTryInto<super::super::super::Foundation::Collections::IIterable<PnpObject>> for PnpObjectCollection {}
384#[cfg(feature = "Foundation_Collections")]
385impl ::windows::core::CanTryInto<super::super::super::Foundation::Collections::IVectorView<PnpObject>> for PnpObjectCollection {}
386#[cfg(feature = "Foundation_Collections")]
387unsafe impl ::core::marker::Send for PnpObjectCollection {}
388#[cfg(feature = "Foundation_Collections")]
389unsafe impl ::core::marker::Sync for PnpObjectCollection {}
390#[doc = "*Required features: `\"Devices_Enumeration_Pnp\"`*"]
391#[repr(transparent)]
392pub struct PnpObjectUpdate(::windows::core::IUnknown);
393impl PnpObjectUpdate {
394 pub fn Type(&self) -> ::windows::core::Result<PnpObjectType> {
395 let this = self;
396 unsafe {
397 let mut result__ = ::windows::core::zeroed::<PnpObjectType>();
398 (::windows::core::Interface::vtable(this).Type)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
399 }
400 }
401 pub fn Id(&self) -> ::windows::core::Result<::windows::core::HSTRING> {
402 let this = self;
403 unsafe {
404 let mut result__ = ::windows::core::zeroed::<::windows::core::HSTRING>();
405 (::windows::core::Interface::vtable(this).Id)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
406 }
407 }
408 #[doc = "*Required features: `\"Foundation_Collections\"`*"]
409 #[cfg(feature = "Foundation_Collections")]
410 pub fn Properties(&self) -> ::windows::core::Result<super::super::super::Foundation::Collections::IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>> {
411 let this = self;
412 unsafe {
413 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::Collections::IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>>();
414 (::windows::core::Interface::vtable(this).Properties)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
415 }
416 }
417}
418impl ::core::cmp::PartialEq for PnpObjectUpdate {
419 fn eq(&self, other: &Self) -> bool {
420 self.0 == other.0
421 }
422}
423impl ::core::cmp::Eq for PnpObjectUpdate {}
424impl ::core::fmt::Debug for PnpObjectUpdate {
425 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
426 f.debug_tuple("PnpObjectUpdate").field(&self.0).finish()
427 }
428}
429impl ::windows::core::RuntimeType for PnpObjectUpdate {
430 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Enumeration.Pnp.PnpObjectUpdate;{6f59e812-001e-4844-bcc6-432886856a17})");
431}
432impl ::core::clone::Clone for PnpObjectUpdate {
433 fn clone(&self) -> Self {
434 Self(self.0.clone())
435 }
436}
437unsafe impl ::windows::core::Interface for PnpObjectUpdate {
438 type Vtable = IPnpObjectUpdate_Vtbl;
439}
440unsafe impl ::windows::core::ComInterface for PnpObjectUpdate {
441 const IID: ::windows::core::GUID = <IPnpObjectUpdate as ::windows::core::ComInterface>::IID;
442}
443impl ::windows::core::RuntimeName for PnpObjectUpdate {
444 const NAME: &'static str = "Windows.Devices.Enumeration.Pnp.PnpObjectUpdate";
445}
446::windows::imp::interface_hierarchy!(PnpObjectUpdate, ::windows::core::IUnknown, ::windows::core::IInspectable);
447unsafe impl ::core::marker::Send for PnpObjectUpdate {}
448unsafe impl ::core::marker::Sync for PnpObjectUpdate {}
449#[doc = "*Required features: `\"Devices_Enumeration_Pnp\"`*"]
450#[repr(transparent)]
451pub struct PnpObjectWatcher(::windows::core::IUnknown);
452impl PnpObjectWatcher {
453 #[doc = "*Required features: `\"Foundation\"`*"]
454 #[cfg(feature = "Foundation")]
455 pub fn Added(&self, handler: &super::super::super::Foundation::TypedEventHandler<PnpObjectWatcher, PnpObject>) -> ::windows::core::Result<super::super::super::Foundation::EventRegistrationToken> {
456 let this = self;
457 unsafe {
458 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::EventRegistrationToken>();
459 (::windows::core::Interface::vtable(this).Added)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(handler), &mut result__).from_abi(result__)
460 }
461 }
462 #[doc = "*Required features: `\"Foundation\"`*"]
463 #[cfg(feature = "Foundation")]
464 pub fn RemoveAdded(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::Result<()> {
465 let this = self;
466 unsafe { (::windows::core::Interface::vtable(this).RemoveAdded)(::windows::core::Interface::as_raw(this), token).ok() }
467 }
468 #[doc = "*Required features: `\"Foundation\"`*"]
469 #[cfg(feature = "Foundation")]
470 pub fn Updated(&self, handler: &super::super::super::Foundation::TypedEventHandler<PnpObjectWatcher, PnpObjectUpdate>) -> ::windows::core::Result<super::super::super::Foundation::EventRegistrationToken> {
471 let this = self;
472 unsafe {
473 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::EventRegistrationToken>();
474 (::windows::core::Interface::vtable(this).Updated)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(handler), &mut result__).from_abi(result__)
475 }
476 }
477 #[doc = "*Required features: `\"Foundation\"`*"]
478 #[cfg(feature = "Foundation")]
479 pub fn RemoveUpdated(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::Result<()> {
480 let this = self;
481 unsafe { (::windows::core::Interface::vtable(this).RemoveUpdated)(::windows::core::Interface::as_raw(this), token).ok() }
482 }
483 #[doc = "*Required features: `\"Foundation\"`*"]
484 #[cfg(feature = "Foundation")]
485 pub fn Removed(&self, handler: &super::super::super::Foundation::TypedEventHandler<PnpObjectWatcher, PnpObjectUpdate>) -> ::windows::core::Result<super::super::super::Foundation::EventRegistrationToken> {
486 let this = self;
487 unsafe {
488 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::EventRegistrationToken>();
489 (::windows::core::Interface::vtable(this).Removed)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(handler), &mut result__).from_abi(result__)
490 }
491 }
492 #[doc = "*Required features: `\"Foundation\"`*"]
493 #[cfg(feature = "Foundation")]
494 pub fn RemoveRemoved(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::Result<()> {
495 let this = self;
496 unsafe { (::windows::core::Interface::vtable(this).RemoveRemoved)(::windows::core::Interface::as_raw(this), token).ok() }
497 }
498 #[doc = "*Required features: `\"Foundation\"`*"]
499 #[cfg(feature = "Foundation")]
500 pub fn EnumerationCompleted(&self, handler: &super::super::super::Foundation::TypedEventHandler<PnpObjectWatcher, ::windows::core::IInspectable>) -> ::windows::core::Result<super::super::super::Foundation::EventRegistrationToken> {
501 let this = self;
502 unsafe {
503 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::EventRegistrationToken>();
504 (::windows::core::Interface::vtable(this).EnumerationCompleted)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(handler), &mut result__).from_abi(result__)
505 }
506 }
507 #[doc = "*Required features: `\"Foundation\"`*"]
508 #[cfg(feature = "Foundation")]
509 pub fn RemoveEnumerationCompleted(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::Result<()> {
510 let this = self;
511 unsafe { (::windows::core::Interface::vtable(this).RemoveEnumerationCompleted)(::windows::core::Interface::as_raw(this), token).ok() }
512 }
513 #[doc = "*Required features: `\"Foundation\"`*"]
514 #[cfg(feature = "Foundation")]
515 pub fn Stopped(&self, handler: &super::super::super::Foundation::TypedEventHandler<PnpObjectWatcher, ::windows::core::IInspectable>) -> ::windows::core::Result<super::super::super::Foundation::EventRegistrationToken> {
516 let this = self;
517 unsafe {
518 let mut result__ = ::windows::core::zeroed::<super::super::super::Foundation::EventRegistrationToken>();
519 (::windows::core::Interface::vtable(this).Stopped)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(handler), &mut result__).from_abi(result__)
520 }
521 }
522 #[doc = "*Required features: `\"Foundation\"`*"]
523 #[cfg(feature = "Foundation")]
524 pub fn RemoveStopped(&self, token: super::super::super::Foundation::EventRegistrationToken) -> ::windows::core::Result<()> {
525 let this = self;
526 unsafe { (::windows::core::Interface::vtable(this).RemoveStopped)(::windows::core::Interface::as_raw(this), token).ok() }
527 }
528 pub fn Status(&self) -> ::windows::core::Result<super::DeviceWatcherStatus> {
529 let this = self;
530 unsafe {
531 let mut result__ = ::windows::core::zeroed::<super::DeviceWatcherStatus>();
532 (::windows::core::Interface::vtable(this).Status)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
533 }
534 }
535 pub fn Start(&self) -> ::windows::core::Result<()> {
536 let this = self;
537 unsafe { (::windows::core::Interface::vtable(this).Start)(::windows::core::Interface::as_raw(this)).ok() }
538 }
539 pub fn Stop(&self) -> ::windows::core::Result<()> {
540 let this = self;
541 unsafe { (::windows::core::Interface::vtable(this).Stop)(::windows::core::Interface::as_raw(this)).ok() }
542 }
543}
544impl ::core::cmp::PartialEq for PnpObjectWatcher {
545 fn eq(&self, other: &Self) -> bool {
546 self.0 == other.0
547 }
548}
549impl ::core::cmp::Eq for PnpObjectWatcher {}
550impl ::core::fmt::Debug for PnpObjectWatcher {
551 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
552 f.debug_tuple("PnpObjectWatcher").field(&self.0).finish()
553 }
554}
555impl ::windows::core::RuntimeType for PnpObjectWatcher {
556 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Enumeration.Pnp.PnpObjectWatcher;{83c95ca8-4772-4a7a-aca8-e48c42a89c44})");
557}
558impl ::core::clone::Clone for PnpObjectWatcher {
559 fn clone(&self) -> Self {
560 Self(self.0.clone())
561 }
562}
563unsafe impl ::windows::core::Interface for PnpObjectWatcher {
564 type Vtable = IPnpObjectWatcher_Vtbl;
565}
566unsafe impl ::windows::core::ComInterface for PnpObjectWatcher {
567 const IID: ::windows::core::GUID = <IPnpObjectWatcher as ::windows::core::ComInterface>::IID;
568}
569impl ::windows::core::RuntimeName for PnpObjectWatcher {
570 const NAME: &'static str = "Windows.Devices.Enumeration.Pnp.PnpObjectWatcher";
571}
572::windows::imp::interface_hierarchy!(PnpObjectWatcher, ::windows::core::IUnknown, ::windows::core::IInspectable);
573unsafe impl ::core::marker::Send for PnpObjectWatcher {}
574unsafe impl ::core::marker::Sync for PnpObjectWatcher {}
575#[doc = "*Required features: `\"Devices_Enumeration_Pnp\"`*"]
576#[repr(transparent)]
577#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
578pub struct PnpObjectType(pub i32);
579impl PnpObjectType {
580 pub const Unknown: Self = Self(0i32);
581 pub const DeviceInterface: Self = Self(1i32);
582 pub const DeviceContainer: Self = Self(2i32);
583 pub const Device: Self = Self(3i32);
584 pub const DeviceInterfaceClass: Self = Self(4i32);
585 pub const AssociationEndpoint: Self = Self(5i32);
586 pub const AssociationEndpointContainer: Self = Self(6i32);
587 pub const AssociationEndpointService: Self = Self(7i32);
588 pub const DevicePanel: Self = Self(8i32);
589}
590impl ::core::marker::Copy for PnpObjectType {}
591impl ::core::clone::Clone for PnpObjectType {
592 fn clone(&self) -> Self {
593 *self
594 }
595}
596impl ::core::default::Default for PnpObjectType {
597 fn default() -> Self {
598 Self(0)
599 }
600}
601impl ::windows::core::TypeKind for PnpObjectType {
602 type TypeKind = ::windows::core::CopyType;
603}
604impl ::core::fmt::Debug for PnpObjectType {
605 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
606 f.debug_tuple("PnpObjectType").field(&self.0).finish()
607 }
608}
609impl ::windows::core::RuntimeType for PnpObjectType {
610 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"enum(Windows.Devices.Enumeration.Pnp.PnpObjectType;i4)");
611}
612#[cfg(feature = "implement")]
613::core::include!("impl.rs");