1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Mappings for the contents of PortableDeviceApi.h
7 use shared::guiddef::REFGUID;
8 use shared::minwindef::{BYTE, DWORD, ULONG};
9 use um::objidlbase::IStream;
10 use um::portabledevicetypes::{
11     IPortableDeviceKeyCollection, IPortableDevicePropVariantCollection, IPortableDeviceValues,
12 };
13 use um::propkeydef::REFPROPERTYKEY;
14 use um::unknwnbase::{IUnknown, IUnknownVtbl};
15 use um::winnt::{HRESULT, LPCWSTR, LPWSTR, WCHAR};
16 // 328
17 RIDL!{#[uuid(0xa1567595, 0x4c2f, 0x4574, 0xa6, 0xfa, 0xec, 0xef, 0x91, 0x7b, 0x9a, 0x40)]
18 interface IPortableDeviceManager(IPortableDeviceManagerVtbl): IUnknown(IUnknownVtbl) {
19     fn GetDevices(
20         pPnPDeviceIDs: *mut LPWSTR,
21         pcPnPDeviceIDs: *mut DWORD,
22     ) -> HRESULT,
23     fn RefreshDeviceList() -> HRESULT,
24     fn GetDeviceFriendlyName(
25         pszPnPDeviceID: LPCWSTR,
26         pDeviceFriendlyName: *mut WCHAR,
27         pcchDeviceFriendlyName: *mut DWORD,
28     ) -> HRESULT,
29     fn GetDeviceDescription(
30         pszPnPDeviceID: LPCWSTR,
31         pDeviceDescription: *mut WCHAR,
32         pcchDeviceDescription: *mut DWORD,
33     ) -> HRESULT,
34     fn GetDeviceManufacturer(
35         pszPnPDeviceID: LPCWSTR,
36         pDeviceManufacturer: *mut WCHAR,
37         pcchDeviceManufacturer: *mut DWORD,
38     ) -> HRESULT,
39     fn GetDeviceProperty(
40         pszPnPDeviceID: LPCWSTR,
41         pszDevicePropertyName: LPCWSTR,
42         pData: *mut BYTE,
43         pcbData: *mut DWORD,
44         pdwType: *mut DWORD,
45     ) -> HRESULT,
46     fn GetPrivateDevices(
47         pPnPDeviceIDs: *mut LPWSTR,
48         pcPnPDeviceIDs: *mut DWORD,
49     ) -> HRESULT,
50 }}
51 RIDL!{#[uuid(0x625e2df8, 0x6392, 0x4cf0, 0x9a, 0xd1, 0x3c, 0xfa, 0x5f, 0x17, 0x77, 0x5c)]
52 interface IPortableDevice(IPortableDeviceVtbl): IUnknown(IUnknownVtbl) {
53     fn Open(
54         pszPnPDeviceID: LPCWSTR,
55         pClientInfo: *mut IPortableDeviceValues,
56     ) -> HRESULT,
57     fn SendCommand(
58         dwFlags: DWORD,
59         pParameters: *mut IPortableDeviceValues,
60         ppResults: *mut *mut IPortableDeviceValues,
61     ) -> HRESULT,
62     fn Content(
63         ppContent: *mut *mut IPortableDeviceContent,
64     ) -> HRESULT,
65     fn Capabilities(
66         ppCapabilities: *mut *mut IPortableDeviceCapabilities,
67     ) -> HRESULT,
68     fn Cancel() -> HRESULT,
69     fn Close() -> HRESULT,
70     fn Advise(
71         dwFlags: DWORD,
72         pCallback: *mut IPortableDeviceEventCallback,
73         pParameters: *mut IPortableDeviceValues,
74         ppszCookie: *mut LPWSTR,
75     ) -> HRESULT,
76     fn Unadvise(
77         pszCookie: LPCWSTR,
78     ) -> HRESULT,
79     fn GetPnPDeviceID(
80         ppszPnPDeviceID: *mut LPWSTR,
81     ) -> HRESULT,
82 }}
83 RIDL!{#[uuid(0x6a96ed84, 0x7c73, 0x4480, 0x99, 0x38, 0xbf, 0x5a, 0xf4, 0x77, 0xd4, 0x26)]
84 interface IPortableDeviceContent(IPortableDeviceContentVtbl): IUnknown(IUnknownVtbl) {
85     fn EnumObjects(
86         dwFlags: DWORD,
87         pszParentObjectID: LPCWSTR,
88         pFilter: *mut IPortableDeviceValues,
89         ppEnum: *mut *mut IEnumPortableDeviceObjectIDs,
90     ) -> HRESULT,
91     fn Properties(
92         ppProperties: *mut *mut IPortableDeviceProperties,
93     ) -> HRESULT,
94     fn Transfer(
95         ppResources: *mut *mut IPortableDeviceResources,
96     ) -> HRESULT,
97     fn CreateObjectWithPropertiesOnly(
98         pValues: *mut IPortableDeviceValues,
99         ppszObjectID: *mut LPWSTR,
100     ) -> HRESULT,
101     fn CreateObjectWithPropertiesAndData(
102         pValues: *mut IPortableDeviceValues,
103         ppData: *mut *mut IStream,
104         pdwOptimalWriteBufferSize: *mut DWORD,
105         ppszCookie: *mut LPWSTR,
106     ) -> HRESULT,
107     fn Delete(
108         dwOptions: DWORD,
109         pObjectIDs: *mut IPortableDevicePropVariantCollection,
110         ppResults: *mut *mut IPortableDevicePropVariantCollection,
111     ) -> HRESULT,
112     fn GetObjectIDsFromPersistentUniqueIDs(
113         pPersistentUniqueIDs: *mut IPortableDevicePropVariantCollection,
114         ppObjectIDs: *mut *mut IPortableDevicePropVariantCollection,
115     ) -> HRESULT,
116     fn Cancel() -> HRESULT,
117     fn Move(
118         pObjectIDs: *mut IPortableDevicePropVariantCollection,
119         pszDestinationFolderObjectID: LPCWSTR,
120         ppResults: *mut *mut IPortableDevicePropVariantCollection,
121     ) -> HRESULT,
122     fn Copy(
123         pObjectIDs: *mut IPortableDevicePropVariantCollection,
124         pszDestinationFolderObjectID: LPCWSTR,
125         ppResults: *mut *mut IPortableDevicePropVariantCollection,
126     ) -> HRESULT,
127 }}
128 RIDL!{#[uuid(0x9b4add96, 0xf6bf, 0x4034, 0x87, 0x08, 0xec, 0xa7, 0x2b, 0xf1, 0x05, 0x54)]
129 interface IPortableDeviceContent2(IPortableDeviceContent2Vtbl):
130     IPortableDeviceContent(IPortableDeviceContentVtbl) {
131     fn UpdateObjectWithPropertiesAndData(
132         pszObjectID: LPCWSTR,
133         pProperties: *mut IPortableDeviceValues,
134         ppData: *mut *mut IStream,
135         pdwOptimalWriteBufferSize: *mut DWORD,
136     ) -> HRESULT,
137 }}
138 RIDL!{#[uuid(0x10ece955, 0xcf41, 0x4728, 0xbf, 0xa0, 0x41, 0xee, 0xdf, 0x1b, 0xbf, 0x19)]
139 interface IEnumPortableDeviceObjectIDs(IEnumPortableDeviceObjectIDsVtbl): IUnknown(IUnknownVtbl) {
140     fn Next(
141         cObjects: ULONG,
142         pObjIDs: *mut LPWSTR,
143         pcFetched: *mut ULONG,
144     ) -> HRESULT,
145     fn Skip(
146         cObjects: ULONG,
147     ) -> HRESULT,
148     fn Reset() -> HRESULT,
149     fn Clone(
150         ppEnum: *mut *mut IEnumPortableDeviceObjectIDs,
151     ) -> HRESULT,
152     fn Cancel() -> HRESULT,
153 }}
154 RIDL!{#[uuid(0x7f6d695c, 0x03df, 0x4439, 0xa8, 0x09, 0x59, 0x26, 0x6b, 0xee, 0xe3, 0xa6)]
155 interface IPortableDeviceProperties(IPortableDevicePropertiesVtbl): IUnknown(IUnknownVtbl) {
156     fn GetSupportedProperties(
157         pszObjectID: LPCWSTR,
158         ppKeys: *mut *mut IPortableDeviceKeyCollection,
159     ) -> HRESULT,
160     fn GetPropertyAttributes(
161         pszObjectID: LPCWSTR,
162         Key: REFPROPERTYKEY,
163         ppAttributes: *mut *mut IPortableDeviceValues,
164     ) -> HRESULT,
165     fn GetValues(
166         pszObjectID: LPCWSTR,
167         pKeys: *mut IPortableDeviceKeyCollection,
168         ppValues: *mut *mut IPortableDeviceValues,
169     ) -> HRESULT,
170     fn SetValues(
171         pszObjectID: LPCWSTR,
172         pValues: *mut IPortableDeviceValues,
173         ppResults: *mut *mut IPortableDeviceValues,
174     ) -> HRESULT,
175     fn Delete(
176         pszObjectID: LPCWSTR,
177         pKeys: *mut IPortableDeviceKeyCollection,
178     ) -> HRESULT,
179     fn Cancel() -> HRESULT,
180 }}
181 RIDL!{#[uuid(0xfd8878ac, 0xd841, 0x4d17, 0x89, 0x1c, 0xe6, 0x82, 0x9c, 0xdb, 0x69, 0x34)]
182 interface IPortableDeviceResources(IPortableDeviceResourcesVtbl): IUnknown(IUnknownVtbl) {
183     fn GetSupportedResources(
184         pszObjectID: LPCWSTR,
185         ppKeys: *mut *mut IPortableDeviceKeyCollection,
186     ) -> HRESULT,
187     fn GetResourceAttributes(
188         pszObjectID: LPCWSTR,
189         Key: REFPROPERTYKEY,
190         ppResourceAttributes: *mut *mut IPortableDeviceValues,
191     ) -> HRESULT,
192     fn GetStream(
193         pszObjectID: LPCWSTR,
194         Key: REFPROPERTYKEY,
195         dwMode: DWORD,
196         pdwOptimalBufferSize: *mut DWORD,
197         ppStream: *mut *mut IStream,
198     ) -> HRESULT,
199     fn Delete(
200         pszObjectID: LPCWSTR,
201         pKeys: *mut IPortableDeviceKeyCollection,
202     ) -> HRESULT,
203     fn Cancel() -> HRESULT,
204     fn CreateResource(
205         pResourceAttributes: *mut IPortableDeviceValues,
206         ppData: *mut *mut IStream,
207         pdwOptimalWriteBufferSize: *mut DWORD,
208         ppszCookie: *mut LPWSTR,
209     ) -> HRESULT,
210 }}
211 RIDL!{#[uuid(0x2c8c6dbf, 0xe3dc, 0x4061, 0xbe, 0xcc, 0x85, 0x42, 0xe8, 0x10, 0xd1, 0x26)]
212 interface IPortableDeviceCapabilities(IPortableDeviceCapabilitiesVtbl): IUnknown(IUnknownVtbl) {
213     fn GetSupportedCommands(
214         ppCommands: *mut *mut IPortableDeviceKeyCollection,
215     ) -> HRESULT,
216     fn GetCommandOptions(
217         Command: REFPROPERTYKEY,
218         ppOptions: *mut *mut IPortableDeviceValues,
219     ) -> HRESULT,
220     fn GetFunctionalCategories(
221         ppCategories: *mut *mut IPortableDevicePropVariantCollection,
222     ) -> HRESULT,
223     fn GetFunctionalObjects(
224         Category: REFGUID,
225         ppObjectIDs: *mut *mut IPortableDevicePropVariantCollection,
226     ) -> HRESULT,
227     fn GetSupportedContentTypes(
228         Category: REFGUID,
229         ppContentTypes: *mut *mut IPortableDevicePropVariantCollection,
230     ) -> HRESULT,
231     fn GetSupportedFormats(
232         ContentType: REFGUID,
233         ppFormats: *mut *mut IPortableDevicePropVariantCollection,
234     ) -> HRESULT,
235     fn GetSupportedFormatProperties(
236         Format: REFGUID,
237         ppKeys: *mut *mut IPortableDeviceKeyCollection,
238     ) -> HRESULT,
239     fn GetFixedPropertyAttributes(
240         Format: REFGUID,
241         Key: REFPROPERTYKEY,
242         ppAttributes: *mut *mut IPortableDeviceValues,
243     ) -> HRESULT,
244     fn Cancel() -> HRESULT,
245     fn GetSupportedEvents(
246         ppEvents: *mut *mut IPortableDevicePropVariantCollection,
247     ) -> HRESULT,
248     fn GetEventOptions(
249         Event: REFGUID,
250         ppOptions: *mut *mut IPortableDeviceValues,
251     ) -> HRESULT,
252 }}
253 RIDL!{#[uuid(0xa8792a31, 0xf385, 0x493c, 0xa8, 0x93, 0x40, 0xf6, 0x4e, 0xb4, 0x5f, 0x6e)]
254 interface IPortableDeviceEventCallback(IPortableDeviceEventCallbackVtbl): IUnknown(IUnknownVtbl) {
255     fn OnEvent(
256         pEventParameters: *mut IPortableDeviceValues,
257     ) -> HRESULT,
258 }}
259 DEFINE_GUID!{LIBID_PortableDeviceApiLib,
260     0x1f001332, 0x1a57, 0x4934, 0xbe, 0x31, 0xaf, 0xfc, 0x99, 0xf4, 0xee, 0x0a}
261 DEFINE_GUID!{CLSID_PortableDevice,
262     0x728a21c5, 0x3d9e, 0x48d7, 0x98, 0x10, 0x86, 0x48, 0x48, 0xf0, 0xf4, 0x04}
263 RIDL!{#[uuid(0x728a21c5, 0x3d9e, 0x48d7, 0x98, 0x10, 0x86, 0x48, 0x48, 0xf0, 0xf4, 0x04)]
264 class PortableDevice;}
265 DEFINE_GUID!{CLSID_PortableDeviceManager,
266     0x0af10cec, 0x2ecd, 0x4b92, 0x95, 0x81, 0x34, 0xf6, 0xae, 0x06, 0x37, 0xf3}
267 RIDL!{#[uuid(0x0af10cec, 0x2ecd, 0x4b92, 0x95, 0x81, 0x34, 0xf6, 0xae, 0x06, 0x37, 0xf3)]
268 class PortableDeviceManager;}
269 DEFINE_GUID!{CLSID_PortableDeviceService,
270     0xef5db4c2, 0x9312, 0x422c, 0x91, 0x52, 0x41, 0x1c, 0xd9, 0xc4, 0xdd, 0x84}
271 RIDL!{#[uuid(0xef5db4c2, 0x9312, 0x422c, 0x91, 0x52, 0x41, 0x1c, 0xd9, 0xc4, 0xdd, 0x84)]
272 class PortableDeviceService;}
273 DEFINE_GUID!{CLSID_PortableDeviceDispatchFactory,
274     0x43232233, 0x8338, 0x4658, 0xae, 0x01, 0x0b, 0x4a, 0xe8, 0x30, 0xb6, 0xb0}
275 RIDL!{#[uuid(0x43232233, 0x8338, 0x4658, 0xae, 0x01, 0x0b, 0x4a, 0xe8, 0x30, 0xb6, 0xb0)]
276 class PortableDeviceDispatchFactory;}
277 DEFINE_GUID!{CLSID_PortableDeviceFTM,
278     0xf7c0039a, 0x4762, 0x488a, 0xb4, 0xb3, 0x76, 0x0e, 0xf9, 0xa1, 0xba, 0x9b}
279 RIDL!{#[uuid(0xf7c0039a, 0x4762, 0x488a, 0xb4, 0xb3, 0x76, 0x0e, 0xf9, 0xa1, 0xba, 0x9b)]
280 class PortableDeviceFTM;}
281 DEFINE_GUID!{CLSID_PortableDeviceServiceFTM,
282     0x1649b154, 0xc794, 0x497a, 0x9b, 0x03, 0xf3, 0xf0, 0x12, 0x13, 0x02, 0xf3}
283 RIDL!{#[uuid(0x1649b154, 0xc794, 0x497a, 0x9b, 0x03, 0xf3, 0xf0, 0x12, 0x13, 0x02, 0xf3)]
284 class PortableDeviceServiceFTM;}
285 DEFINE_GUID!{CLSID_PortableDeviceWebControl,
286     0x186dd02c, 0x2dec, 0x41b5, 0xa7, 0xd4, 0xb5, 0x90, 0x56, 0xfa, 0xde, 0x51}
287 RIDL!{#[uuid(0x186dd02c, 0x2dec, 0x41b5, 0xa7, 0xd4, 0xb5, 0x90, 0x56, 0xfa, 0xde, 0x51)]
288 class PortableDeviceWebControl;}
289