summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Subv2015-12-28 09:38:10 -0500
committerGravatar Subv2016-03-20 14:28:08 -0500
commit381a5c053f76a7d85d811ebf37a5943f6a57579e (patch)
tree61962f97006f902025012eda18c144dc3d06bea7 /src/core
parentMerge pull request #1538 from lioncash/dot (diff)
downloadyuzu-381a5c053f76a7d85d811ebf37a5943f6a57579e.tar.gz
yuzu-381a5c053f76a7d85d811ebf37a5943f6a57579e.tar.xz
yuzu-381a5c053f76a7d85d811ebf37a5943f6a57579e.zip
HLE/FS: FS::CreateFile takes an u64 for the file size.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/archive_backend.h2
-rw-r--r--src/core/file_sys/disk_archive.cpp2
-rw-r--r--src/core/file_sys/disk_archive.h2
-rw-r--r--src/core/file_sys/ivfc_archive.cpp2
-rw-r--r--src/core/file_sys/ivfc_archive.h2
-rw-r--r--src/core/hle/service/fs/archive.cpp2
-rw-r--r--src/core/hle/service/fs/archive.h2
-rw-r--r--src/core/hle/service/fs/fs_user.cpp6
8 files changed, 10 insertions, 10 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h
index 601e95d8c..152c8201c 100644
--- a/src/core/file_sys/archive_backend.h
+++ b/src/core/file_sys/archive_backend.h
@@ -108,7 +108,7 @@ public:
108 * @param size The size of the new file, filled with zeroes 108 * @param size The size of the new file, filled with zeroes
109 * @return File creation result code 109 * @return File creation result code
110 */ 110 */
111 virtual ResultCode CreateFile(const Path& path, u32 size) const = 0; 111 virtual ResultCode CreateFile(const Path& path, u64 size) const = 0;
112 112
113 /** 113 /**
114 * Create a directory specified by its path 114 * Create a directory specified by its path
diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp
index a51416774..614c2e2a0 100644
--- a/src/core/file_sys/disk_archive.cpp
+++ b/src/core/file_sys/disk_archive.cpp
@@ -37,7 +37,7 @@ bool DiskArchive::DeleteDirectory(const Path& path) const {
37 return FileUtil::DeleteDir(mount_point + path.AsString()); 37 return FileUtil::DeleteDir(mount_point + path.AsString());
38} 38}
39 39
40ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u32 size) const { 40ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const {
41 std::string full_path = mount_point + path.AsString(); 41 std::string full_path = mount_point + path.AsString();
42 42
43 if (FileUtil::Exists(full_path)) 43 if (FileUtil::Exists(full_path))
diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h
index ef9a98057..1bdbc2698 100644
--- a/src/core/file_sys/disk_archive.h
+++ b/src/core/file_sys/disk_archive.h
@@ -37,7 +37,7 @@ public:
37 bool DeleteFile(const Path& path) const override; 37 bool DeleteFile(const Path& path) const override;
38 bool RenameFile(const Path& src_path, const Path& dest_path) const override; 38 bool RenameFile(const Path& src_path, const Path& dest_path) const override;
39 bool DeleteDirectory(const Path& path) const override; 39 bool DeleteDirectory(const Path& path) const override;
40 ResultCode CreateFile(const Path& path, u32 size) const override; 40 ResultCode CreateFile(const Path& path, u64 size) const override;
41 bool CreateDirectory(const Path& path) const override; 41 bool CreateDirectory(const Path& path) const override;
42 bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; 42 bool RenameDirectory(const Path& src_path, const Path& dest_path) const override;
43 std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const override; 43 std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const override;
diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp
index 2efc31a8c..5325afb58 100644
--- a/src/core/file_sys/ivfc_archive.cpp
+++ b/src/core/file_sys/ivfc_archive.cpp
@@ -39,7 +39,7 @@ bool IVFCArchive::DeleteDirectory(const Path& path) const {
39 return false; 39 return false;
40} 40}
41 41
42ResultCode IVFCArchive::CreateFile(const Path& path, u32 size) const { 42ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const {
43 LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).", GetName().c_str()); 43 LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).", GetName().c_str());
44 // TODO: Verify error code 44 // TODO: Verify error code
45 return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, ErrorLevel::Permanent); 45 return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, ErrorLevel::Permanent);
diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h
index f3fd82de4..2a4e4def3 100644
--- a/src/core/file_sys/ivfc_archive.h
+++ b/src/core/file_sys/ivfc_archive.h
@@ -38,7 +38,7 @@ public:
38 bool DeleteFile(const Path& path) const override; 38 bool DeleteFile(const Path& path) const override;
39 bool RenameFile(const Path& src_path, const Path& dest_path) const override; 39 bool RenameFile(const Path& src_path, const Path& dest_path) const override;
40 bool DeleteDirectory(const Path& path) const override; 40 bool DeleteDirectory(const Path& path) const override;
41 ResultCode CreateFile(const Path& path, u32 size) const override; 41 ResultCode CreateFile(const Path& path, u64 size) const override;
42 bool CreateDirectory(const Path& path) const override; 42 bool CreateDirectory(const Path& path) const override;
43 bool RenameDirectory(const Path& src_path, const Path& dest_path) const override; 43 bool RenameDirectory(const Path& src_path, const Path& dest_path) const override;
44 std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const override; 44 std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const override;
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index d64b3656a..57fc2f44d 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -347,7 +347,7 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy
347 ErrorSummary::Canceled, ErrorLevel::Status); 347 ErrorSummary::Canceled, ErrorLevel::Status);
348} 348}
349 349
350ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u32 file_size) { 350ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u64 file_size) {
351 ArchiveBackend* archive = GetArchive(archive_handle); 351 ArchiveBackend* archive = GetArchive(archive_handle);
352 if (archive == nullptr) 352 if (archive == nullptr)
353 return ERR_INVALID_HANDLE; 353 return ERR_INVALID_HANDLE;
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h
index 952deb4d4..430dc2ef9 100644
--- a/src/core/hle/service/fs/archive.h
+++ b/src/core/hle/service/fs/archive.h
@@ -136,7 +136,7 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy
136 * @param file_size The size of the new file, filled with zeroes 136 * @param file_size The size of the new file, filled with zeroes
137 * @return File creation result code 137 * @return File creation result code
138 */ 138 */
139ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u32 file_size); 139ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u64 file_size);
140 140
141/** 141/**
142 * Create a Directory from an Archive 142 * Create a Directory from an Archive
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp
index e6c1f3616..12ed609e9 100644
--- a/src/core/hle/service/fs/fs_user.cpp
+++ b/src/core/hle/service/fs/fs_user.cpp
@@ -234,7 +234,7 @@ static void DeleteDirectory(Service::Interface* self) {
234 * 3 : Archive handle upper word 234 * 3 : Archive handle upper word
235 * 4 : File path string type 235 * 4 : File path string type
236 * 5 : File path string size 236 * 5 : File path string size
237 * 7 : File size (filled with zeroes) 237 * 7-8 : File size
238 * 10: File path string data 238 * 10: File path string data
239 * Outputs: 239 * Outputs:
240 * 1 : Result of function, 0 on success, otherwise error code 240 * 1 : Result of function, 0 on success, otherwise error code
@@ -245,12 +245,12 @@ static void CreateFile(Service::Interface* self) {
245 ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); 245 ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
246 auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]); 246 auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
247 u32 filename_size = cmd_buff[5]; 247 u32 filename_size = cmd_buff[5];
248 u32 file_size = cmd_buff[7]; 248 u64 file_size = ((u64)cmd_buff[8] << 32) | cmd_buff[7];
249 u32 filename_ptr = cmd_buff[10]; 249 u32 filename_ptr = cmd_buff[10];
250 250
251 FileSys::Path file_path(filename_type, filename_size, filename_ptr); 251 FileSys::Path file_path(filename_type, filename_size, filename_ptr);
252 252
253 LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", filename_type, filename_size, file_path.DebugStr().c_str()); 253 LOG_DEBUG(Service_FS, "type=%d size=%lld data=%s", filename_type, filename_size, file_path.DebugStr().c_str());
254 254
255 cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; 255 cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw;
256} 256}