aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascOpenFile.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-09-05 00:10:35 +0200
committerShauren <shauren.trinity@gmail.com>2023-09-05 00:10:35 +0200
commitd57b58849bda868f2463d38cc636f01af919316c (patch)
tree5beef62c041526d9468683e4388b6341f1530cc1 /dep/CascLib/src/CascOpenFile.cpp
parentba224f70ad81fa0e5d1f0c4daf197e143317cdaa (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@5c60050770767f2e606f6fec0c35beb8b9b00c60
Diffstat (limited to 'dep/CascLib/src/CascOpenFile.cpp')
-rw-r--r--dep/CascLib/src/CascOpenFile.cpp15
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);
}