Minor, make CreateFile compatible with the disabled writable flag
"writable" is not in use and probably we can go in the reverse direction and remove the flags that are useful for enabled writable, this is just for the sake of completeness however.
This commit is contained in:
parent
33eb1bd23b
commit
8eb53b853d
|
@ -556,8 +556,9 @@ hb_blob_create_from_file (const char *file_name)
|
||||||
if (unlikely (file->contents == MAP_FAILED)) goto fail;
|
if (unlikely (file->contents == MAP_FAILED)) goto fail;
|
||||||
|
|
||||||
#elif defined(_WIN32) || defined(__CYGWIN__)
|
#elif defined(_WIN32) || defined(__CYGWIN__)
|
||||||
HANDLE fd = CreateFile (file_name, GENERIC_READ, FILE_SHARE_READ, nullptr,
|
HANDLE fd = CreateFile (file_name,
|
||||||
OPEN_EXISTING,
|
writable ? GENERIC_READ|GENERIC_WRITE : GENERIC_READ,
|
||||||
|
FILE_SHARE_READ, nullptr, OPEN_EXISTING,
|
||||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, nullptr);
|
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, nullptr);
|
||||||
# define CLOSE CloseHandle
|
# define CLOSE CloseHandle
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue