mirror of
https://github.com/reactos/reactos.git
synced 2025-06-08 10:50:28 +00:00
[SHELLBTRFS] Fix build when std::vector.data() is not implemented
This commit is contained in:
parent
a837184300
commit
1725ddfd8f
1 changed files with 24 additions and 0 deletions
|
@ -33,7 +33,11 @@ void mountmgr::create_point(const wstring_view& symlink, const wstring_view& dev
|
||||||
IO_STATUS_BLOCK iosb;
|
IO_STATUS_BLOCK iosb;
|
||||||
|
|
||||||
vector<uint8_t> buf(sizeof(MOUNTMGR_CREATE_POINT_INPUT) + ((symlink.length() + device.length()) * sizeof(WCHAR)));
|
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());
|
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->SymbolicLinkNameOffset = sizeof(MOUNTMGR_CREATE_POINT_INPUT);
|
||||||
mcpi->SymbolicLinkNameLength = (USHORT)(symlink.length() * sizeof(WCHAR));
|
mcpi->SymbolicLinkNameLength = (USHORT)(symlink.length() * sizeof(WCHAR));
|
||||||
|
@ -55,7 +59,11 @@ void mountmgr::delete_points(const wstring_view& symlink, const wstring_view& un
|
||||||
IO_STATUS_BLOCK iosb;
|
IO_STATUS_BLOCK iosb;
|
||||||
|
|
||||||
vector<uint8_t> buf(sizeof(MOUNTMGR_MOUNT_POINT) + ((symlink.length() + unique_id.length() + device_name.length()) * sizeof(WCHAR)));
|
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());
|
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));
|
memset(mmp, 0, sizeof(MOUNTMGR_MOUNT_POINT));
|
||||||
|
|
||||||
|
@ -88,7 +96,11 @@ void mountmgr::delete_points(const wstring_view& symlink, const wstring_view& un
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<uint8_t> buf2(sizeof(MOUNTMGR_MOUNT_POINTS));
|
vector<uint8_t> buf2(sizeof(MOUNTMGR_MOUNT_POINTS));
|
||||||
|
#ifndef __REACTOS__
|
||||||
auto mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(buf2.data());
|
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,
|
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_DELETE_POINTS,
|
||||||
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
|
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
|
||||||
|
@ -110,7 +122,11 @@ vector<mountmgr_point> mountmgr::query_points(const wstring_view& symlink, const
|
||||||
vector<mountmgr_point> v;
|
vector<mountmgr_point> v;
|
||||||
|
|
||||||
vector<uint8_t> buf(sizeof(MOUNTMGR_MOUNT_POINT) + ((symlink.length() + unique_id.length() + device_name.length()) * sizeof(WCHAR)));
|
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());
|
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));
|
memset(mmp, 0, sizeof(MOUNTMGR_MOUNT_POINT));
|
||||||
|
|
||||||
|
@ -143,7 +159,11 @@ vector<mountmgr_point> mountmgr::query_points(const wstring_view& symlink, const
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<uint8_t> buf2(sizeof(MOUNTMGR_MOUNT_POINTS));
|
vector<uint8_t> buf2(sizeof(MOUNTMGR_MOUNT_POINTS));
|
||||||
|
#ifndef __REACTOS__
|
||||||
auto mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(buf2.data());
|
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,
|
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_QUERY_POINTS,
|
||||||
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
|
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
|
||||||
|
@ -152,7 +172,11 @@ vector<mountmgr_point> mountmgr::query_points(const wstring_view& symlink, const
|
||||||
throw ntstatus_error(Status);
|
throw ntstatus_error(Status);
|
||||||
|
|
||||||
buf2.resize(mmps->Size);
|
buf2.resize(mmps->Size);
|
||||||
|
#ifndef __REACTOS__
|
||||||
mmps = reinterpret_cast<MOUNTMGR_MOUNT_POINTS*>(buf2.data());
|
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,
|
Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_QUERY_POINTS,
|
||||||
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
|
buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());
|
||||||
|
|
Loading…
Reference in a new issue