73 {
75
76 static const wstring dosdevices =
L"\\DosDevices\\";
77
79
83
85
87 return;
88
89 do {
93
95
97
100
102
114
117
118 if (
path.Length > 4 *
sizeof(
WCHAR) &&
path.Buffer[0] ==
'\\' &&
path.Buffer[1] ==
'\\' &&
path.Buffer[2] ==
'?' &&
path.Buffer[3] ==
'\\')
119 path.Buffer[1] =
'?';
120
122
124
128 continue;
129 }
130
132
137 continue;
138 }
139
141
144 dev.disk_num = 0xffffffff;
145 dev.part_num = 0xffffffff;
146 } else {
149 }
150
151 dev.friendly_name =
L"";
154 dev.has_parts =
false;
156 dev.multi_device =
false;
157
159
164 DRIVE_LAYOUT_INFORMATION_EX* dli;
165
169
172
175
179 string desc2;
180
181 desc2 = "";
182
183 if (sdd2->VendorIdOffset != 0) {
184 desc2 += (
char*)((
uint8_t*)sdd2 + sdd2->VendorIdOffset);
185
186 while (desc2.
length() > 0 && desc2[desc2.
length() - 1] ==
' ')
188 }
189
190 if (sdd2->ProductIdOffset != 0) {
191 if (sdd2->VendorIdOffset != 0 && desc2.
length() != 0 && desc2[desc2.
length() - 1] !=
' ')
192 desc2 += " ";
193
194 desc2 += (
char*)((
uint8_t*)sdd2 + sdd2->ProductIdOffset);
195
196 while (desc2.
length() > 0 && desc2[desc2.
length() - 1] ==
' ')
198 }
199
200 if (sdd2->VendorIdOffset != 0 || sdd2->ProductIdOffset != 0) {
202
204
207
209 dev.friendly_name = desc3;
210
212 }
213 }
214 }
215
217 }
218
219 dlisize = 0;
220 dli = nullptr;
221
222 do {
223 dlisize += 1024;
224
225 if (dli)
227
228 dli = (DRIVE_LAYOUT_INFORMATION_EX*)
malloc(dlisize);
229
231 nullptr, 0, dli, dlisize);
233
235 dev.has_parts =
true;
236
238 } else {
239 try {
241
242#ifndef __REACTOS__
243 for (
const auto&
p :
v) {
244 if (
p.symlink.length() == 14 &&
p.symlink.substr(0, dosdevices.length()) == dosdevices &&
p.symlink[13] ==
':') {
245#else
246 for(
auto p =
v.begin();
p !=
v.end(); ++
p) {
247 if ((*p).symlink.length() == 14 && (*p).symlink.substr(0, dosdevices.length()) == dosdevices && (*p).symlink[13] == ':') {
248#endif
250
251#ifndef __REACTOS__
252 dr[0] =
p.symlink[12];
253#else
254 dr[0] = (*p).symlink[12];
255#endif
256 dr[1] = ':';
257 dr[2] = 0;
258
260 break;
261 }
262 }
263 } catch (...) {
264 }
265 }
266
267 if (!
dev.is_disk || !
dev.has_parts) {
272
275 }
276
280
281 if (
dev.fstype ==
L"Btrfs") {
283
286 }
287
288 break;
289 }
290 }
291
293 }
294
297 wstring pref =
L"\\Device\\Btrfs{";
298
300
303 }
304 }
305
307 }
308
310
313
315 } else
317}
_Self substr(size_type __pos=0, size_type __n=npos) const
const _CharT * c_str() const
std::vector< mountmgr_point > query_points(const std::wstring_view &symlink=L"", const std::wstring_view &unique_id=L"", const std::wstring_view &device_name=L"") const
static wstring get_mountdev_name(const nt_handle &h)
#define NT_SUCCESS(StatCode)
static const fs_identifier fs_ident[]
#define INVALID_HANDLE_VALUE
#define MultiByteToWideChar
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO DeviceInfoSet, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData, DWORD DeviceInterfaceDetailDataSize, PDWORD RequiredSize, PSP_DEVINFO_DATA DeviceInfoData)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
#define RtlCompareMemory(s1, s2, l)
#define IOCTL_DISK_GET_DRIVE_LAYOUT_EX
#define FILE_SYNCHRONOUS_IO_ALERT
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define IOCTL_DISK_GET_LENGTH_INFO
static PIO_STATUS_BLOCK iosb
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FILE_SHARE_DELETE
#define FILE_GENERIC_READ
#define IOCTL_STORAGE_QUERY_PROPERTY
#define IOCTL_STORAGE_GET_DEVICE_NUMBER
STORAGE_DEVICE_DESCRIPTOR
#define DIGCF_DEVICEINTERFACE
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_DEVICE_INTERFACE_DETAIL_DATA_W
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
NTSTATUS NTAPI NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key)
WCHAR DevicePath[ANYSIZE_ARRAY]
STORAGE_QUERY_TYPE QueryType
UCHAR AdditionalParameters[1]
STORAGE_PROPERTY_ID PropertyId
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
#define RtlCopyMemory(Destination, Source, Length)