mirror of
https://github.com/thunderbrewhq/bc.git
synced 2025-12-12 18:12:29 +00:00
fix(system/file): reconstruct missing file share bits on Windows
This commit is contained in:
parent
5289a0369e
commit
cdc146f06e
1 changed files with 9 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ HANDLE Open(const char* systemPath, uint32_t flags, bool nocache) {
|
||||||
bool read = flags & BC_FILE_OPEN_READ;
|
bool read = flags & BC_FILE_OPEN_READ;
|
||||||
bool write = flags & BC_FILE_OPEN_WRITE;
|
bool write = flags & BC_FILE_OPEN_WRITE;
|
||||||
bool shareRead = flags & BC_FILE_OPEN_SHARE_READ;
|
bool shareRead = flags & BC_FILE_OPEN_SHARE_READ;
|
||||||
bool shareRead = flags & BC_FILE_OPEN_SHARE_WRITE;
|
bool shareWrite = flags & BC_FILE_OPEN_SHARE_WRITE;
|
||||||
bool write = flags & BC_FILE_OPEN_WRITE;
|
bool write = flags & BC_FILE_OPEN_WRITE;
|
||||||
bool mustNotExist = flags & BC_FILE_OPEN_MUST_NOT_EXIST;
|
bool mustNotExist = flags & BC_FILE_OPEN_MUST_NOT_EXIST;
|
||||||
bool mustExist = flags & BC_FILE_OPEN_MUST_EXIST;
|
bool mustExist = flags & BC_FILE_OPEN_MUST_EXIST;
|
||||||
|
|
@ -161,6 +161,14 @@ HANDLE Open(const char* systemPath, uint32_t flags, bool nocache) {
|
||||||
desiredAccess |= GENERIC_WRITE;
|
desiredAccess |= GENERIC_WRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Setup share policy
|
||||||
|
if (shareRead) {
|
||||||
|
shareMode |= FILE_SHARE_READ;
|
||||||
|
}
|
||||||
|
if (shareWrite) {
|
||||||
|
shareMode |= FILE_SHARE_WRITE;
|
||||||
|
}
|
||||||
|
|
||||||
// Setup create disposition
|
// Setup create disposition
|
||||||
if (create && mustNotExist) {
|
if (create && mustNotExist) {
|
||||||
createDisposition = CREATE_NEW;
|
createDisposition = CREATE_NEW;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue