aboutsummaryrefslogtreecommitdiff
path: root/launcher/FileSystem.cpp
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-02-10 19:06:49 -0800
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-03-20 14:56:32 -0700
commit7870cf28e55c090543591304b05a7ef5031e1157 (patch)
tree07b84a6489e5ab057397b6bc7336c73546551614 /launcher/FileSystem.cpp
parent9939367db7568249efd47701105323a4801a9413 (diff)
downloadPrismLauncher-7870cf28e55c090543591304b05a7ef5031e1157.tar.gz
PrismLauncher-7870cf28e55c090543591304b05a7ef5031e1157.tar.bz2
PrismLauncher-7870cf28e55c090543591304b05a7ef5031e1157.zip
fix: add missing mingw defs
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/FileSystem.cpp')
-rw-r--r--launcher/FileSystem.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp
index 948ec55e..a9461bb0 100644
--- a/launcher/FileSystem.cpp
+++ b/launcher/FileSystem.cpp
@@ -117,8 +117,45 @@ namespace fs = ghc::filesystem;
#include <fileapi.h>
// refs
#include <winioctl.h>
+# if defined(__MINGW32__)
+# include <crtdbg.h>
+# endif
#endif
+#if defined(Q_OS_WIN) && defined(__MINGW32__)
+
+typedef struct _DUPLICATE_EXTENTS_DATA {
+ HANDLE FileHandle;
+ LARGE_INTEGER SourceFileOffset;
+ LARGE_INTEGER TargetFileOffset;
+ LARGE_INTEGER ByteCount;
+} DUPLICATE_EXTENTS_DATA, *PDUPLICATE_EXTENTS_DATA;
+
+typedef struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER {
+ WORD ChecksumAlgorithm; // Checksum algorithm. e.g. CHECKSUM_TYPE_UNCHANGED, CHECKSUM_TYPE_NONE, CHECKSUM_TYPE_CRC32
+ WORD Reserved; // Must be 0
+ DWORD Flags; // FSCTL_INTEGRITY_FLAG_xxx
+ DWORD ChecksumChunkSizeInBytes;
+ DWORD ClusterSizeInBytes;
+} FSCTL_GET_INTEGRITY_INFORMATION_BUFFER, *PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER;
+
+typedef struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER {
+ WORD ChecksumAlgorithm; // Checksum algorithm. e.g. CHECKSUM_TYPE_UNCHANGED, CHECKSUM_TYPE_NONE, CHECKSUM_TYPE_CRC32
+ WORD Reserved; // Must be 0
+ DWORD Flags; // FSCTL_INTEGRITY_FLAG_xxx
+} FSCTL_SET_INTEGRITY_INFORMATION_BUFFER, *PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER;
+
+#define FSCTL_DUPLICATE_EXTENTS_TO_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 209, METHOD_BUFFERED, FILE_WRITE_DATA )
+#define FSCTL_GET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 159, METHOD_BUFFERED, FILE_ANY_ACCESS) // FSCTL_GET_INTEGRITY_INFORMATION_BUFFER
+#define FSCTL_SET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 160, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) // FSCTL_SET_INTEGRITY_INFORMATION_BUFFER
+
+
+#define ERROR_NOT_CAPABLE 775L
+#define ERROR_BLOCK_TOO_MANY_REFERENCES 347L
+
+#endif
+
+
namespace FS {
void ensureExists(const QDir& dir)
@@ -1279,7 +1316,7 @@ bool refs_clone(const std::wstring& src_path, const std::wstring& dst_path, std:
return false;
}
- long sourceFileLength = sourceFileLengthStruct.QuadPart;
+ DWORD sourceFileLength = sourceFileLengthStruct.QuadPart;
// Set the destination on-disk size the same as the source.
FILE_END_OF_FILE_INFO fileSizeInfo{sourceFileLength};