mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
Compare commits
2 Commits
0.4.15-rel
...
stlportcpp
Author | SHA1 | Date | |
---|---|---|---|
|
a1693a7ff5 | ||
|
f6728c78fa |
@@ -833,25 +833,15 @@ void BtrfsContextMenu::reflink_copy(HWND hwnd, const WCHAR* fn, const WCHAR* dir
|
||||
streambufsize += 0x1000;
|
||||
streambuf.resize(streambufsize);
|
||||
|
||||
#ifndef __REACTOS__
|
||||
memset(streambuf.data(), 0, streambufsize);
|
||||
|
||||
Status = NtQueryInformationFile(source, &iosb, streambuf.data(), streambufsize, FileStreamInformation);
|
||||
#else
|
||||
memset(&streambuf[0], 0, streambufsize);
|
||||
|
||||
Status = NtQueryInformationFile(source, &iosb, &streambuf[0], streambufsize, FileStreamInformation);
|
||||
#endif
|
||||
} while (Status == STATUS_BUFFER_OVERFLOW);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
throw ntstatus_error(Status);
|
||||
|
||||
#ifndef __REACTOS__
|
||||
auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(streambuf.data());
|
||||
#else
|
||||
auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(&streambuf[0]);
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
if (fsi->StreamNameLength > 0) {
|
||||
@@ -1535,25 +1525,15 @@ static void reflink_copy2(const wstring& srcfn, const wstring& destdir, const ws
|
||||
streambufsize += 0x1000;
|
||||
streambuf.resize(streambufsize);
|
||||
|
||||
#ifndef __REACTOS__
|
||||
memset(streambuf.data(), 0, streambufsize);
|
||||
|
||||
Status = NtQueryInformationFile(source, &iosb, streambuf.data(), streambufsize, FileStreamInformation);
|
||||
#else
|
||||
memset(&streambuf[0], 0, streambufsize);
|
||||
|
||||
Status = NtQueryInformationFile(source, &iosb, &streambuf[0], streambufsize, FileStreamInformation);
|
||||
#endif
|
||||
} while (Status == STATUS_BUFFER_OVERFLOW);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
throw ntstatus_error(Status);
|
||||
|
||||
#ifndef __REACTOS__
|
||||
auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(streambuf.data());
|
||||
#else
|
||||
auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(&streambuf[0]);
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
if (fsi->StreamNameLength > 0) {
|
||||
|
@@ -33,11 +33,7 @@ void mountmgr::create_point(const wstring_view& symlink, const wstring_view& dev
|
||||
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));
|
||||
@@ -48,11 +44,7 @@ void mountmgr::create_point(const wstring_view& symlink, const wstring_view& dev
|
||||
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);
|
||||
@@ -63,11 +55,7 @@ void mountmgr::delete_points(const wstring_view& symlink, const wstring_view& un
|
||||
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));
|
||||
|
||||
@@ -100,28 +88,16 @@ void mountmgr::delete_points(const wstring_view& symlink, const wstring_view& un
|
||||
}
|
||||
|
||||
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))
|
||||
@@ -134,11 +110,7 @@ vector<mountmgr_point> mountmgr::query_points(const wstring_view& symlink, const
|
||||
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));
|
||||
|
||||
@@ -171,35 +143,19 @@ vector<mountmgr_point> mountmgr::query_points(const wstring_view& symlink, const
|
||||
}
|
||||
|
||||
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);
|
||||
|
@@ -210,6 +210,9 @@ public:
|
||||
reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; }
|
||||
const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; }
|
||||
|
||||
_Tp* data() { return this->_M_start; }
|
||||
const _Tp* data() const { return this->_M_start; }
|
||||
|
||||
#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
|
||||
explicit vector(const allocator_type& __a = allocator_type())
|
||||
#else
|
||||
|
Reference in New Issue
Block a user