Fix FILE_SHARE_* permissions for Windows in read_entire_file
This commit is contained in:
parent
d5232fd7ae
commit
d4af38ec9d
Notes:
git
2024-09-12 17:43:25 +00:00
@ -10558,7 +10558,7 @@ read_entire_file(pm_string_t *string, const char *filepath)
|
|||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Open the file for reading.
|
// Open the file for reading.
|
||||||
HANDLE file = CreateFile(filepath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
HANDLE file = CreateFile(filepath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
|
||||||
|
|
||||||
if (file == INVALID_HANDLE_VALUE) {
|
if (file == INVALID_HANDLE_VALUE) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user