MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / OpenFileByCKeyEntry

Function OpenFileByCKeyEntry

src/External/CascLib/src/CascOpenFile.cpp:191–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191bool OpenFileByCKeyEntry(TCascStorage * hs, PCASC_CKEY_ENTRY pCKeyEntry, DWORD dwOpenFlags, HANDLE * PtrFileHandle)
192{
193 TCascFile * hf = NULL;
194 DWORD dwErrCode = ERROR_FILE_NOT_FOUND;
195
196 // If the CKey entry is NULL, we consider the file non-existant
197 if(pCKeyEntry != NULL)
198 {
199 // Create the file handle structure
200 if((hf = new TCascFile(hs, pCKeyEntry)) != NULL)
201 {
202 hf->bVerifyIntegrity = (dwOpenFlags & CASC_STRICT_DATA_CHECK) ? true : false;
203 hf->bDownloadFileIf = (hs->dwFeatures & CASC_FEATURE_ONLINE) ? true : false;
204 hf->bOvercomeEncrypted = (dwOpenFlags & CASC_OVERCOME_ENCRYPTED) ? true : false;
205 dwErrCode = ERROR_SUCCESS;
206 }
207 else
208 {
209 dwErrCode = ERROR_NOT_ENOUGH_MEMORY;
210 }
211 }
212
213 // Give the output parameter, no matter what
214 PtrFileHandle[0] = (HANDLE)hf;
215
216 // Handle last error
217 if(dwErrCode != ERROR_SUCCESS)
218 SetCascError(dwErrCode);
219 return (dwErrCode == ERROR_SUCCESS);
220}
221
222bool OpenLocalFile(LPCTSTR szFileName, DWORD dwOpenFlags, HANDLE * PtrFileHandle)
223{

Callers 2

CascOpenFileFunction · 0.85
LoadInternalFileToMemoryFunction · 0.85

Calls 1

SetCascErrorFunction · 0.85

Tested by

no test coverage detected