aboutsummaryrefslogtreecommitdiff
path: root/dep/CascLib/src/CascOpenStorage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dep/CascLib/src/CascOpenStorage.cpp')
-rw-r--r--dep/CascLib/src/CascOpenStorage.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/dep/CascLib/src/CascOpenStorage.cpp b/dep/CascLib/src/CascOpenStorage.cpp
index acbd14075e7..cfe42faaf16 100644
--- a/dep/CascLib/src/CascOpenStorage.cpp
+++ b/dep/CascLib/src/CascOpenStorage.cpp
@@ -442,7 +442,7 @@ static DWORD LoadEncodingManifest(TCascStorage * hs)
DWORD dwErrCode = ERROR_SUCCESS;
// Inform the user about what we are doing
- if(InvokeProgressCallback(hs, "Loading ENCODING manifest", NULL, 0, 0))
+ if(InvokeProgressCallback(hs, CascProgressLoadingManifest, "ENCODING", 0, 0))
return ERROR_CANCELLED;
// Fill-in the information from the index entry and insert it to the file tree
@@ -753,7 +753,7 @@ static int LoadDownloadManifest(TCascStorage * hs)
DWORD dwErrCode = ERROR_SUCCESS;
// Inform the user about what we are doing
- if(InvokeProgressCallback(hs, "Loading DOWNLOAD manifest", NULL, 0, 0))
+ if(InvokeProgressCallback(hs, CascProgressLoadingManifest, "DOWNLOAD", 0, 0))
return ERROR_CANCELLED;
// Load the entire DOWNLOAD file to memory
@@ -786,7 +786,7 @@ static int LoadInstallManifest(TCascStorage * hs)
DWORD dwErrCode = ERROR_SUCCESS;
// Inform the user about what we are doing
- if(InvokeProgressCallback(hs, "Loading INSTALL manifest", NULL, 0, 0))
+ if(InvokeProgressCallback(hs, CascProgressLoadingManifest, "INSTALL", 0, 0))
return ERROR_CANCELLED;
// Load the entire DOWNLOAD file to memory
@@ -854,7 +854,7 @@ static int LoadBuildManifest(TCascStorage * hs, DWORD dwLocaleMask)
assert(hs->pRootHandler == NULL);
// Inform the user about what we are doing
- if(InvokeProgressCallback(hs, "Loading ROOT manifest", NULL, 0, 0))
+ if(InvokeProgressCallback(hs, CascProgressLoadingManifest, "ROOT", 0, 0))
return ERROR_CANCELLED;
// Locale: The default parameter is 0 - in that case, we load all locales
@@ -913,6 +913,10 @@ __LoadRootFile:
break;
}
}
+ else
+ {
+ dwErrCode = ERROR_BAD_FORMAT;
+ }
}
else
{
@@ -922,7 +926,7 @@ __LoadRootFile:
// Handle reparsing of the root file
if(dwErrCode == ERROR_REPARSE_ROOT && pCKeyEntry != &hs->RootFile)
{
- if(InvokeProgressCallback(hs, "Loading ROOT manifest (reparsed)", NULL, 0, 0))
+ if(InvokeProgressCallback(hs, CascProgressLoadingManifest, "ROOT (reparsed)", 0, 0))
return ERROR_CANCELLED;
// Replace the root handler
@@ -1182,6 +1186,12 @@ static DWORD LoadCascStorage(TCascStorage * hs, PCASC_OPEN_STORAGE_ARGS pArgs, L
hs->dwBuildNumber = 21742 + hs->InstallCKey.ContentSize;
}
+ // Make sure we have a code name. Not a case of WoW build 22267
+ if(hs->szCodeName == NULL && hs->dwBuildNumber == 22267)
+ {
+ hs->SetProductCodeName("wow", 3);
+ }
+
// Create the array of CKey entries. Each entry represents a file in the storage
if(dwErrCode == ERROR_SUCCESS)
{
@@ -1337,6 +1347,13 @@ static DWORD ParseOpenParams(LPTSTR szParams, PCASC_OPEN_STORAGE_ARGS pArgs)
pArgs->szRegion = szParamsPtr;
}
+ // There could be region appended at the end
+ if((szParamsPtr = GetNextParam(szParamsPtr)) != NULL)
+ {
+ if(pArgs->szBuildKey && pArgs->szBuildKey[0])
+ return ERROR_INVALID_PARAMETER;
+ pArgs->szBuildKey = szParamsPtr;
+ }
return ERROR_SUCCESS;
}