Make DDL directory allocated and copied (to support update DDLs in MapEdit)

This commit is contained in:
Ondrej Novak 2025-08-07 19:27:25 +02:00
parent b33fb43d78
commit 96e6435998
2 changed files with 10 additions and 4 deletions

View file

@ -20,7 +20,7 @@ const void* map_file_to_memory_cpp(const char *name, size_t *sz) {
std::filesystem::path p(reinterpret_cast<const char8_t *>(name));
HANDLE h = CreateFileW(p.c_str(), GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
HANDLE h = CreateFileW(p.c_str(), GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
if (h == INVALID_HANDLE_VALUE) throw std::runtime_error(std::string("Failed to open file for mapping: ")+p.string());
LARGE_INTEGER fsize;