@ohos-ports/drivelist 12.0.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,108 @@
1
+ /*
2
+ * Copyright 2017 balena.io
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #ifndef SRC_WINDOWS_LIST_HPP_
18
+ #define SRC_WINDOWS_LIST_HPP_
19
+
20
+ #include <knownfolders.h>
21
+ #include <string>
22
+ #include <set>
23
+
24
+ namespace Drivelist {
25
+
26
+ // The <ntddstor.h>, and <usbiodef.h> headers include the following
27
+ // device interface GUIDs we're interested in;
28
+ // @see https://docs.microsoft.com/en-us/windows-hardware/drivers/install/install-reference
29
+ // @see https://msdn.microsoft.com/en-us/library/windows/hardware/ff541389(v=vs.85).aspx
30
+ // To avoid cluttering the global namespace,
31
+ // we'll just define here what we need:
32
+ //
33
+ // - GUID_DEVINTERFACE_DISK { 53F56307-B6BF-11D0-94F2-00A0C91EFB8B }
34
+ // - GUID_DEVINTERFACE_CDROM { 53F56308-B6BF-11D0-94F2-00A0C91EFB8B }
35
+ // - GUID_DEVINTERFACE_USB_HUB { F18A0E88-C30C-11D0-8815-00A0C906BED8 }
36
+ // - GUID_DEVINTERFACE_FLOPPY { 53F56311-B6BF-11D0-94F2-00A0C91EFB8B }
37
+ // - GUID_DEVINTERFACE_WRITEONCEDISK { 53F5630C-B6BF-11D0-94F2-00A0C91EFB8B }
38
+ // - GUID_DEVINTERFACE_TAPE { 53F5630B-B6BF-11D0-94F2-00A0C91EFB8B }
39
+ // - GUID_DEVINTERFACE_USB_DEVICE { A5DCBF10-6530-11D2-901F-00C04FB951ED }
40
+ // - GUID_DEVINTERFACE_VOLUME { 53F5630D-B6BF-11D0-94F2-00A0C91EFB8B }
41
+ // - GUID_DEVINTERFACE_STORAGEPORT { 2ACCFE60-C130-11D2-B082-00A0C91EFB8B }
42
+ //
43
+ const GUID GUID_DEVICE_INTERFACE_DISK = {
44
+ 0x53F56307L, 0xB6BF, 0x11D0, { 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B }
45
+ };
46
+
47
+ const GUID GUID_DEVICE_INTERFACE_CDROM = {
48
+ 0x53F56308L, 0xB6BF, 0x11D0, { 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B }
49
+ };
50
+
51
+ const GUID GUID_DEVICE_INTERFACE_USB_HUB = {
52
+ 0xF18A0E88L, 0xC30C, 0x11D0, { 0x88, 0x15, 0x00, 0xA0, 0xC9, 0x06, 0xBE, 0xD8 }
53
+ };
54
+
55
+ const GUID GUID_DEVICE_INTERFACE_FLOPPY = {
56
+ 0x53F56311L, 0xB6BF, 0x11D0, { 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B }
57
+ };
58
+
59
+ const GUID GUID_DEVICE_INTERFACE_WRITEONCEDISK = {
60
+ 0x53F5630CL, 0xB6BF, 0x11D0, { 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B }
61
+ };
62
+
63
+ const GUID GUID_DEVICE_INTERFACE_TAPE = {
64
+ 0x53F5630BL, 0xB6BF, 0x11D0, { 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B }
65
+ };
66
+
67
+ const GUID GUID_DEVICE_INTERFACE_USB_DEVICE = {
68
+ 0xA5DCBF10L, 0x6530, 0x11D2, { 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED }
69
+ };
70
+
71
+ const GUID GUID_DEVICE_INTERFACE_VOLUME = {
72
+ 0x53F5630DL, 0xB6BF, 0x11D0, { 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B }
73
+ };
74
+
75
+ const GUID GUID_DEVICE_INTERFACE_STORAGEPORT = {
76
+ 0x2ACCFE60L, 0xC130, 0x11D2, { 0xB0, 0x82, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B }
77
+ };
78
+
79
+ const std::set<std::string> USB_STORAGE_DRIVERS {
80
+ "USBSTOR", "UASPSTOR", "VUSBSTOR",
81
+ "RTUSER", "CMIUCR", "EUCR",
82
+ "ETRONSTOR", "ASUSSTPT"
83
+ };
84
+
85
+ const std::set<std::string> GENERIC_STORAGE_DRIVERS {
86
+ "SCSI", "SD", "PCISTOR",
87
+ "RTSOR", "JMCR", "JMCF", "RIMMPTSK", "RIMSPTSK", "RIXDPTSK",
88
+ "TI21SONY", "ESD7SK", "ESM7SK", "O2MD", "O2SD", "VIACR"
89
+ };
90
+
91
+ // List of known virtual disk hardware IDs
92
+ const std::set<std::string> VHD_HARDWARE_IDS {
93
+ "Arsenal_________Virtual_",
94
+ "KernSafeVirtual_________",
95
+ "Msft____Virtual_Disk____",
96
+ "VMware__VMware_Virtual_S"
97
+ };
98
+
99
+ const GUID KNOWN_FOLDER_IDS[] {
100
+ FOLDERID_Windows,
101
+ FOLDERID_Profile,
102
+ FOLDERID_ProgramFiles,
103
+ FOLDERID_ProgramFilesX86
104
+ };
105
+
106
+ } // namespace Drivelist
107
+
108
+ #endif // SRC_WINDOWS_LIST_HPP_