diff options
Diffstat (limited to 'dep/CascLib/src/CascOpenFile.cpp')
-rw-r--r-- | dep/CascLib/src/CascOpenFile.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/dep/CascLib/src/CascOpenFile.cpp b/dep/CascLib/src/CascOpenFile.cpp index eee4566db5d..ac1ddffc5f7 100644 --- a/dep/CascLib/src/CascOpenFile.cpp +++ b/dep/CascLib/src/CascOpenFile.cpp @@ -409,6 +409,21 @@ bool WINAPI CascOpenFile(HANDLE hStorage, const void * pvFileName, DWORD dwLocal break; } + // Check opening unique file + if(dwOpenFlags & CASC_OPEN_CKEY_ONCE) + { + // Was the file already open since CascOpenStorage? + if(pCKeyEntry->Flags & CASC_CE_OPEN_CKEY_ONCE) + { + SetCascError(ERROR_CKEY_ALREADY_OPENED); + return false; + } + else + { + pCKeyEntry->Flags |= CASC_CE_OPEN_CKEY_ONCE; + } + } + // Perform the open operation return OpenFileByCKeyEntry(hs, pCKeyEntry, dwOpenFlags, PtrFileHandle); } |