From 1725ddfd8f06bbff1b853c93be35f2b0ab672a01 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Tue, 12 Nov 2019 22:59:27 +0100 Subject: [PATCH] [SHELLBTRFS] Fix build when std::vector.data() is not implemented --- dll/shellext/shellbtrfs/mountmgr_local.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dll/shellext/shellbtrfs/mountmgr_local.cpp b/dll/shellext/shellbtrfs/mountmgr_local.cpp index 2f02984e5b6..ee7901e1f2a 100644 --- a/dll/shellext/shellbtrfs/mountmgr_local.cpp +++ b/dll/shellext/shellbtrfs/mountmgr_local.cpp @@ -33,7 +33,11 @@ void mountmgr::create_point(const wstring_view& symlink, const wstring_view& dev IO_STATUS_BLOCK iosb; vector buf(sizeof(MOUNTMGR_CREATE_POINT_INPUT) + ((symlink.length() + device.length()) * sizeof(WCHAR))); +#ifndef __REACTOS__ auto mcpi = reinterpret_cast(buf.data()); +#else + auto mcpi = reinterpret_cast(&buf[0]); +#endif mcpi->SymbolicLinkNameOffset = sizeof(MOUNTMGR_CREATE_POINT_INPUT); 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; vector buf(sizeof(MOUNTMGR_MOUNT_POINT) + ((symlink.length() + unique_id.length() + device_name.length()) * sizeof(WCHAR))); +#ifndef __REACTOS__ auto mmp = reinterpret_cast(buf.data()); +#else + auto mmp = reinterpret_cast(&buf[0]); +#endif memset(mmp, 0, sizeof(MOUNTMGR_MOUNT_POINT)); @@ -88,7 +96,11 @@ void mountmgr::delete_points(const wstring_view& symlink, const wstring_view& un } vector buf2(sizeof(MOUNTMGR_MOUNT_POINTS)); +#ifndef __REACTOS__ auto mmps = reinterpret_cast(buf2.data()); +#else + auto mmps = reinterpret_cast(&buf2[0]); +#endif Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_DELETE_POINTS, buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size()); @@ -110,7 +122,11 @@ vector mountmgr::query_points(const wstring_view& symlink, const vector v; vector buf(sizeof(MOUNTMGR_MOUNT_POINT) + ((symlink.length() + unique_id.length() + device_name.length()) * sizeof(WCHAR))); +#ifndef __REACTOS__ auto mmp = reinterpret_cast(buf.data()); +#else + auto mmp = reinterpret_cast(&buf[0]); +#endif memset(mmp, 0, sizeof(MOUNTMGR_MOUNT_POINT)); @@ -143,7 +159,11 @@ vector mountmgr::query_points(const wstring_view& symlink, const } vector buf2(sizeof(MOUNTMGR_MOUNT_POINTS)); +#ifndef __REACTOS__ auto mmps = reinterpret_cast(buf2.data()); +#else + auto mmps = reinterpret_cast(&buf2[0]); +#endif Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_QUERY_POINTS, buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size()); @@ -152,7 +172,11 @@ vector mountmgr::query_points(const wstring_view& symlink, const throw ntstatus_error(Status); buf2.resize(mmps->Size); +#ifndef __REACTOS__ mmps = reinterpret_cast(buf2.data()); +#else + mmps = reinterpret_cast(&buf2[0]); +#endif Status = NtDeviceIoControlFile(h, nullptr, nullptr, nullptr, &iosb, IOCTL_MOUNTMGR_QUERY_POINTS, buf.data(), (ULONG)buf.size(), buf2.data(), (ULONG)buf2.size());