IO_STATUS_BLOCK iosb;
vector<uint8_t> buf(sizeof(MOUNTMGR_CREATE_POINT_INPUT) + ((symlink.length() + device.length()) * sizeof(WCHAR)));
-#ifndef __REACTOS__
auto mcpi = reinterpret_cast<MOUNTMGR_CREATE_POINT_INPUT*>(buf.data());
-#else
- auto mcpi = reinterpret_cast<MOUNTMGR_CREATE_POINT_INPUT*>(&buf[0]);
-#endif
mcpi->SymbolicLinkNameOffset = sizeof(MOUNTMGR_CREATE_POINT_INPUT);
mcpi->SymbolicLinkNameLength = (USHORT)(symlink.length() * sizeof(WCHAR));
memcpy((uint8_t*)mcpi + mcpi->DeviceNameOffset, device.data(), device.length() * sizeof(WCHAR));
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_CREATE_POINT,
-#ifndef __REACTOS__
buf.data(), (ULONG)buf.size(), nullptr, 0);
-#else
- &buf[0], (ULONG)buf.size(), nullptr, 0);
-#endif
if (!NT_SUCCESS(Status))
throw ntstatus_error(Status);
IO_STATUS_BLOCK iosb;
vector<uint8_t> buf(sizeof(MOUNTMGR_MOUNT_POINT) + ((symlink.length() + unique_id.length() + device_name.length()) * sizeof(WCHAR)));
-#ifndef __REACTOS__
auto mmp = reinterpret_cast<MOUNTMGR_MOUNT_POINT*>(buf.data());
-#else
- auto mmp = reinterpret_cast<MOUNTMGR_MOUNT_POINT*>(&buf[0]);
-#endif
memset(mmp, 0, sizeof(MOUNTMGR_MOUNT_POINT));
}
vector<uint8_t> buf2(sizeof(MOUNTMGR_MOUNT_POINTS));
-#ifndef __REACTOS__
auto mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(buf2.data());
-#else
- auto mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(&buf2[0]);
-#endif
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_DELETE_POINTS,
-#ifndef __REACTOS__
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
-#else
- &buf[0], (ULONG)buf.size(), &buf2[0], (ULONG)buf2.size());
-#endif
if (Status == STATUS_BUFFER_OVERFLOW) {
buf2.resize(mmps->Size);
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_DELETE_POINTS,
-#ifndef __REACTOS__
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
-#else
- &buf[0], (ULONG)buf.size(), &buf2[0], (ULONG)buf2.size());
-#endif
}
if (!NT_SUCCESS(Status))
vector<mountmgr_point> v;
vector<uint8_t> buf(sizeof(MOUNTMGR_MOUNT_POINT) + ((symlink.length() + unique_id.length() + device_name.length()) * sizeof(WCHAR)));
-#ifndef __REACTOS__
auto mmp = reinterpret_cast<MOUNTMGR_MOUNT_POINT*>(buf.data());
-#else
- auto mmp = reinterpret_cast<MOUNTMGR_MOUNT_POINT*>(&buf[0]);
-#endif
memset(mmp, 0, sizeof(MOUNTMGR_MOUNT_POINT));
}
vector<uint8_t> buf2(sizeof(MOUNTMGR_MOUNT_POINTS));
-#ifndef __REACTOS__
auto mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(buf2.data());
-#else
- auto mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(&buf2[0]);
-#endif
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_QUERY_POINTS,
-#ifndef __REACTOS__
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
-#else
- &buf[0], (ULONG)buf.size(), &buf2[0], (ULONG)buf2.size());
-#endif
if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_OVERFLOW)
throw ntstatus_error(Status);
buf2.resize(mmps->Size);
-#ifndef __REACTOS__
mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(buf2.data());
-#else
- mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(&buf2[0]);
-#endif
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_QUERY_POINTS,
-#ifndef __REACTOS__
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
-#else
- &buf[0], (ULONG)buf.size(), &buf2[0], (ULONG)buf2.size());
-#endif
if (!NT_SUCCESS(Status))
throw ntstatus_error(Status);
if (mmps->MountPoints[i].DeviceNameLength)
mpdn = wstring_view((WCHAR*)((uint8_t*)mmps + mmps->MountPoints[i].DeviceNameOffset), mmps->MountPoints[i].DeviceNameLength / sizeof(WCHAR));
+#ifndef __REACTOS__
v.emplace_back(mpsl, mpuid, mpdn);
+#else
+ v.push_back(mountmgr_point(mpsl, mpuid, mpdn));
+#endif
}
return v;