aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PostBuild.bat34
-rw-r--r--StormLib_vs08.vcproj32
-rw-r--r--StormLib_vs19.vcxproj64
-rw-r--r--StormLib_vs19_dll.vcxproj4
-rw-r--r--StormLib_vs19_test.vcxproj4
-rw-r--r--make-msvc.bat28
-rw-r--r--make.bat8
-rw-r--r--test/StormTest.cpp129
-rw-r--r--test/TLogHelper.cpp81
9 files changed, 214 insertions, 170 deletions
diff --git a/PostBuild.bat b/PostBuild.bat
deleted file mode 100644
index c2d2534..0000000
--- a/PostBuild.bat
+++ /dev/null
@@ -1,34 +0,0 @@
-@echo off
-rem Post-build batch for StormLib project
-rem Called as PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) [vs2008]
-rem Example: PostBuild.bat StormLib_dll x64 Debug vs2008
-
-rem Select build type
-if "%1" == "StormLib_dll" goto PostBuild_DLL
-if "%1" == "StormLib" goto PostBuild_LIB
-goto:eof
-
-:PostBuild_DLL
-
-rem Build steps for the DLL. On 32-bit Release version, increment the build number
-if not "x%2" == "xWin32" goto:eof
-if not "x%3" == "xRelease" goto:eof
-PostBuild.exe .\src\DllMain.rc
-goto:eof
-
-:PostBuild_LIB
-
-rem Set target folders
-if "x%2" == "xWin32" set TARGET_DIR_LEVEL2=lib32
-if "x%2" == "xx64" set TARGET_DIR_LEVEL2=lib64
-if "x%4" == "xvs2008" set TARGET_DIR_LEVEL3=vs2008
-
-rem Check & create target folder structure
-if not exist ..\aaa goto:eof
-if not exist ..\aaa\%TARGET_DIR_LEVEL2% md ..\aaa\%TARGET_DIR_LEVEL2%
-if not exist ..\aaa\%TARGET_DIR_LEVEL2%\%TARGET_DIR_LEVEL3% md ..\aaa\%TARGET_DIR_LEVEL2%\%TARGET_DIR_LEVEL3%
-
-rem Copy include and LIB files to the target folder
-copy /Y .\src\StormLib.h ..\aaa\inc >nul
-copy /Y .\src\StormPort.h ..\aaa\inc >nul
-copy /Y .\bin\%1\%2\%3\StormLib???.lib ..\aaa\%TARGET_DIR_LEVEL2%\%TARGET_DIR_LEVEL3% >nul
diff --git a/StormLib_vs08.vcproj b/StormLib_vs08.vcproj
index 0c02e13..4f59a1b 100644
--- a/StormLib_vs08.vcproj
+++ b/StormLib_vs08.vcproj
@@ -80,7 +80,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -145,7 +145,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -209,7 +209,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -274,7 +274,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -336,7 +336,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -399,7 +399,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -461,7 +461,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -524,7 +524,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -588,7 +588,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -653,7 +653,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -717,7 +717,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -782,7 +782,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -844,7 +844,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -907,7 +907,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -969,7 +969,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
<Configuration
@@ -1032,7 +1032,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) vs2008"
+ CommandLine=""
/>
</Configuration>
</Configurations>
diff --git a/StormLib_vs19.vcxproj b/StormLib_vs19.vcxproj
index e0c83f9..eba3ea2 100644
--- a/StormLib_vs19.vcxproj
+++ b/StormLib_vs19.vcxproj
@@ -269,12 +269,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">
@@ -289,12 +291,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">
@@ -306,12 +310,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">
@@ -326,12 +332,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">
@@ -342,12 +350,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">
@@ -361,12 +371,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">
@@ -377,12 +389,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">
@@ -396,12 +410,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugUD|Win32'">
@@ -413,12 +429,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugUD|x64'">
@@ -433,12 +451,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugUS|Win32'">
@@ -450,12 +470,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugUS|x64'">
@@ -470,12 +492,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseUD|Win32'">
@@ -486,12 +510,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseUD|x64'">
@@ -505,12 +531,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseUS|Win32'">
@@ -521,12 +549,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseUS|x64'">
@@ -540,12 +570,14 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<OutputFile>./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib</OutputFile>
</Lib>
<PostBuildEvent>
- <Command>PostBuild.bat $(ProjectName) $(Platform) $(Configuration)</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/StormLib_vs19_dll.vcxproj b/StormLib_vs19_dll.vcxproj
index 1dbbce8..ba888e9 100644
--- a/StormLib_vs19_dll.vcxproj
+++ b/StormLib_vs19_dll.vcxproj
@@ -100,6 +100,7 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
@@ -123,6 +124,7 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
@@ -141,6 +143,7 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
@@ -164,6 +167,7 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<OutputFile>$(OutDir)StormLib.dll</OutputFile>
diff --git a/StormLib_vs19_test.vcxproj b/StormLib_vs19_test.vcxproj
index 9f91ade..d293549 100644
--- a/StormLib_vs19_test.vcxproj
+++ b/StormLib_vs19_test.vcxproj
@@ -98,6 +98,7 @@
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -121,6 +122,7 @@
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -138,6 +140,7 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -160,6 +163,7 @@
<PrecompiledHeader />
<WarningLevel>Level1</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
diff --git a/make-msvc.bat b/make-msvc.bat
index 8b9a559..007254e 100644
--- a/make-msvc.bat
+++ b/make-msvc.bat
@@ -21,8 +21,8 @@ if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2019\Professional\VC\Auxil
if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" set VCVARS_2019=%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
::Build all libraries using Visual Studio 2008 and 2017
-call :BuildLibs "%VCVARS_2008%" x86 %LIB_NAME%_vs08.sln
-call :BuildLibs "%VCVARS_2008%" x64 %LIB_NAME%_vs08.sln
+call :BuildLibs "%VCVARS_2008%" x86 %LIB_NAME%_vs08.sln \vs2008
+call :BuildLibs "%VCVARS_2008%" x64 %LIB_NAME%_vs08.sln \vs2008
call :BuildLibs "%VCVARS_2019%" x86 %LIB_NAME%_vs19.sln
call :BuildLibs "%VCVARS_2019%" x64 %LIB_NAME%_vs19.sln
goto:eof
@@ -35,13 +35,33 @@ goto:eof
:: %1 Full path to the VCVARS.BAT file
:: %2 Target build platform (x86 or x64)
:: %3 Plain name of the /sln solution file
+:: %4 Subdirectory for the target folder of the library ("\vs2008" or "")
::
:BuildLibs
-::set VSCMD_DEBUG=1
call %1 %2
if "%2" == "x86" set SLN_TRG=Win32
+if "%2" == "x86" set LIB_TRG=lib32
if "%2" == "x64" set SLN_TRG=x64
+<<<<<<< HEAD
+if "%2" == "x64" set LIB_TRG=lib64
+devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugAD|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugAD\*.lib ..\aaa\%LIB_TRG%%4
+devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugAS|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugAS\*.lib ..\aaa\%LIB_TRG%%4
+devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugUD|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugUD\*.lib ..\aaa\%LIB_TRG%%4
+devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugUS|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugUS\*.lib ..\aaa\%LIB_TRG%%4
+devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseAD|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseAD\*.lib ..\aaa\%LIB_TRG%%4
+devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseAS|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseAS\*.lib ..\aaa\%LIB_TRG%%4
+devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseUD|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseUD\*.lib ..\aaa\%LIB_TRG%%4
+devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseUS|%SLN_TRG%"
+xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseUS\*.lib ..\aaa\%LIB_TRG%%4
+=======
devenv.com %3 /project "%LIB_NAME%" /build "DebugAD|%SLN_TRG%"
devenv.com %3 /project "%LIB_NAME%" /build "DebugAS|%SLN_TRG%"
devenv.com %3 /project "%LIB_NAME%" /build "DebugUD|%SLN_TRG%"
@@ -50,6 +70,7 @@ devenv.com %3 /project "%LIB_NAME%" /build "ReleaseAD|%SLN_TRG%"
devenv.com %3 /project "%LIB_NAME%" /build "ReleaseAS|%SLN_TRG%"
devenv.com %3 /project "%LIB_NAME%" /build "ReleaseUD|%SLN_TRG%"
devenv.com %3 /project "%LIB_NAME%" /build "ReleaseUS|%SLN_TRG%"
+>>>>>>> 1a94f94b50f6d829b1e8fba08a3002a5db4f00d5
:: Restore environment variables to the old level
set INCLUDE=%SAVE_INCLUDE%
@@ -58,3 +79,4 @@ set PATH=%SAVE_PATH%
set VSINSTALLDIR=
set VCINSTALLDIR=
set DevEnvDir=
+goto:eof
diff --git a/make.bat b/make.bat
index 8765eb5..7b29207 100644
--- a/make.bat
+++ b/make.bat
@@ -35,10 +35,10 @@ del buildfre_wlh_amd64.log
echo.
:COPY_LIBS
-copy /Y .\objfre_wlh_amd64\amd64\%LIBRARY_NAME%.lib ..\aaa\lib64\%LIBRARY_NAME%.lib >nul
-copy /Y .\objfre_w2k_x86\i386\%LIBRARY_NAME%.lib ..\aaa\lib32\%LIBRARY_NAME%.lib >nul
-copy /Y .\src\StormPort.h ..\aaa\inc >nul
-copy /Y .\src\StormLib.h ..\aaa\inc >nul
+xcopy /Y /D .\src\StormLib.h ..\aaa\inc >nul
+xcopy /Y /D .\src\StormPort.h ..\aaa\inc >nul
+xcopy /Y /D .\objfre_w2k_x86\i386\%LIBRARY_NAME%.lib ..\aaa\lib32\%LIBRARY_NAME%.lib >nul
+xcopy /Y /D .\objfre_wlh_amd64\amd64\%LIBRARY_NAME%.lib ..\aaa\lib64\%LIBRARY_NAME%.lib >nul
:CLEANUP
if exist sources-cpp.cpp del sources-cpp.cpp
diff --git a/test/StormTest.cpp b/test/StormTest.cpp
index 123ec43..1f8a334 100644
--- a/test/StormTest.cpp
+++ b/test/StormTest.cpp
@@ -36,6 +36,7 @@
// Local structures
#define TFLG_COUNT_HASH 0x01000000 // There is file count in the lower 24-bits, then hash
+#define TFLG_WILL_FAIL 0x02000000 // The process is expected to fail
#define TFLG_COUNT_MASK 0x00FFFFFF // Mask for file count
#define TEST_DATA(hash, num) (num | TFLG_COUNT_HASH), hash
@@ -44,8 +45,8 @@ typedef struct _TEST_INFO
LPCTSTR szMpqName1;
LPCTSTR szMpqName2;
DWORD dwFlags;
- LPCSTR szFileName1;
- LPCSTR szFileName2;
+ const void * param1;
+ const void * param2;
} TEST_INFO, *PTEST_INFO;
typedef struct _LINE_INFO
@@ -929,23 +930,23 @@ static DWORD GetFilePatchCount(TLogHelper * pLogger, HANDLE hMpq, LPCSTR szFileN
return nPatchCount;
}
-static DWORD VerifyFilePatchCount(TLogHelper * pLogger, HANDLE hMpq, LPCSTR szFileName, int nExpectedPatchCount)
+static DWORD VerifyFilePatchCount(TLogHelper * pLogger, HANDLE hMpq, LPCSTR szFileName, DWORD dwExpectedPatchCount)
{
- int nPatchCount = 0;
+ DWORD dwPatchCount = 0;
// Retrieve the patch count
pLogger->PrintProgress(_T("Verifying patch count for %s ..."), szFileName);
- nPatchCount = GetFilePatchCount(pLogger, hMpq, szFileName);
+ dwPatchCount = GetFilePatchCount(pLogger, hMpq, szFileName);
// Check if there are any patches at all
- if(nExpectedPatchCount != 0 && nPatchCount == 0)
+ if(dwExpectedPatchCount != 0 && dwPatchCount == 0)
{
pLogger->PrintMessage("There are no patches for %s", szFileName);
return ERROR_FILE_CORRUPT;
}
// Check if the number of patches fits
- if(nPatchCount != nExpectedPatchCount)
+ if(dwPatchCount != dwExpectedPatchCount)
{
pLogger->PrintMessage("Unexpected number of patches for %s", szFileName);
return ERROR_FILE_CORRUPT;
@@ -2598,7 +2599,7 @@ static DWORD TestArchive(
STORM_FREE(FileDataList[0]);
if(hMpq != NULL)
SFileCloseArchive(hMpq);
- return dwErrCode;
+ return Logger.PrintVerdict(dwErrCode);
}
// Open an empty archive (found in WoW cache - it's just a header)
@@ -2643,15 +2644,17 @@ static DWORD TestOpenArchive_Corrupt(LPCTSTR szPlainName)
// Opens a patched MPQ archive
-static DWORD TestOpenArchive_Patched(LPCTSTR PatchList[], LPCSTR szPatchedFile, int nExpectedPatchCount, bool bExpectedToFail = false)
+static DWORD TestArchive_Patched(LPCTSTR PatchList[], LPCSTR szPatchedFile, DWORD dwFlags)
{
TLogHelper Logger("OpenPatchedMpqTest", PatchList[0]);
HANDLE hMpq;
HANDLE hFile;
BYTE Buffer[0x100];
+ DWORD dwExpectedPatchCount = (dwFlags & TFLG_COUNT_MASK);
DWORD dwFileCount = 0;
DWORD BytesRead = 0;
DWORD dwErrCode;
+ bool bExpectedToFail = (dwFlags & TFLG_WILL_FAIL) ? true : false;
// Open a patched MPQ archive
dwErrCode = OpenPatchedArchive(&Logger, &hMpq, PatchList);
@@ -2659,7 +2662,7 @@ static DWORD TestOpenArchive_Patched(LPCTSTR PatchList[], LPCSTR szPatchedFile,
{
// Check patch count
if(szPatchedFile != NULL)
- dwErrCode = VerifyFilePatchCount(&Logger, hMpq, szPatchedFile, nExpectedPatchCount);
+ dwErrCode = VerifyFilePatchCount(&Logger, hMpq, szPatchedFile, dwExpectedPatchCount);
// Try to open and read the file
if(dwErrCode == ERROR_SUCCESS)
@@ -4280,6 +4283,21 @@ static const TEST_INFO Test_Mpqs[] =
{_T("MPQ_2021_v1_CantExtractCHK.scx"), NULL, TEST_DATA("c9a7ded9f93d883b9419a52bec6087f7", 28)},
};
+static const TEST_INFO Patched_Mpqs[] =
+{
+ {NULL, NULL, 0, PatchList_StarCraft, "music\\terran1.wav"},
+ {NULL, NULL, 2, PatchList_WoW_OldWorld13286, "OldWorld\\World\\Model.blob"},
+ {NULL, NULL, 8, PatchList_WoW_15050, "World\\Model.blob"},
+ {NULL, NULL, 0, PatchList_WoW_16965, "DBFilesClient\\BattlePetNPCTeamMember.db2"},
+ {NULL, NULL, 6, PatchList_SC2_32283, "TriggerLibs\\natives.galaxy"},
+ {NULL, NULL, 2, PatchList_SC2_34644, "TriggerLibs\\GameData\\GameData.galaxy"},
+ {NULL, NULL, 3, PatchList_SC2_34644_Maps, "Maps\\Campaign\\THorner03.SC2Map\\BankList.xml"},
+ {NULL, NULL, TFLG_WILL_FAIL, PatchList_SC2_32283_enGB, "Assets\\Textures\\startupimage.dds"},
+ {NULL, NULL, 6, PatchList_SC2_36281_enGB, "LocalizedData\\GameHotkeys.txt"},
+ {NULL, NULL, 1, PatchList_HS_3604_enGB, "Hearthstone.exe"},
+ {NULL, NULL, 10, PatchList_HS_6898_enGB, "Hearthstone_Data\\Managed\\Assembly-Csharp.dll"}
+};
+
//-----------------------------------------------------------------------------
// Main
@@ -4298,21 +4316,21 @@ int _tmain(int argc, TCHAR * argv[])
//
// Tests on a local listfile
//
- /*
+
if(dwErrCode == ERROR_SUCCESS)
{
TestOnLocalListFile(_T("FLAT-MAP:ListFile_Blizzard.txt"));
dwErrCode = TestOnLocalListFile(_T("ListFile_Blizzard.txt"));
}
- */
+
//
// Open all files from the command line
//
- //for(int i = 1; i < argc; i++)
- //{
- // TestArchive(_T("MPQ_2021_v1_CantExtractCHK.scx"), _T("Listfile_Blizzard.txt"), TEST_FLAG_FILE_COUNT, NULL, NULL);
- //}
+ for(int i = 1; i < argc; i++)
+ {
+ TestArchive(_T("MPQ_2021_v1_CantExtractCHK.scx"), _T("Listfile_Blizzard.txt"), 0, NULL, NULL);
+ }
//
// Search all testing archives and verify their SHA1 hash
@@ -4361,13 +4379,34 @@ int _tmain(int argc, TCHAR * argv[])
{
for(size_t i = 0; i < _countof(Test_Mpqs); i++)
{
- dwErrCode = TestArchive(Test_Mpqs[i].szMpqName1, // Plain archive name
- Test_Mpqs[i].szMpqName2, // List file (NULL if none)
- Test_Mpqs[i].dwFlags, // What exactly to do
- Test_Mpqs[i].szFileName1, // The first name of the open file
- Test_Mpqs[i].szFileName2); // The second name of the open file
- if(dwErrCode != ERROR_SUCCESS)
- break;
+ dwErrCode = TestArchive(Test_Mpqs[i].szMpqName1, // Plain archive name
+ Test_Mpqs[i].szMpqName2, // List file (NULL if none)
+ Test_Mpqs[i].dwFlags, // What exactly to do
+ (LPCSTR)Test_Mpqs[i].param1, // The 1st parameter
+ (LPCSTR)Test_Mpqs[i].param2); // The 2nd parameter
+// if(dwErrCode != ERROR_SUCCESS)
+// break;
+ dwErrCode = ERROR_SUCCESS;
+ }
+ }
+
+ //
+ // Test opening patched archives - correct, damaged, protected
+ //
+
+ if(dwErrCode == ERROR_SUCCESS)
+ {
+ for(size_t i = 0; i < _countof(Patched_Mpqs); i++)
+ {
+ LPCTSTR * PatchList = (LPCTSTR *)Patched_Mpqs[i].param1;
+ LPCSTR szFileName = (LPCSTR)Patched_Mpqs[i].param2;
+
+ dwErrCode = TestArchive_Patched(PatchList, // List of patches
+ szFileName, // Name of a file
+ Patched_Mpqs[i].dwFlags);
+// if(dwErrCode != ERROR_SUCCESS)
+// break;
+ dwErrCode = ERROR_SUCCESS;
}
}
@@ -4383,50 +4422,6 @@ int _tmain(int argc, TCHAR * argv[])
if(dwErrCode == ERROR_SUCCESS)
dwErrCode = TestOpenArchive_Corrupt(_T("MPQ_2013_vX_Battle.net.MPQ"));
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_StarCraft, "music\\terran1.wav", 0);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_WoW_OldWorld13286, "OldWorld\\World\\Model.blob", 2);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_WoW_15050, "World\\Model.blob", 8);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_WoW_16965, "DBFilesClient\\BattlePetNPCTeamMember.db2", 0);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_SC2_32283, "TriggerLibs\\natives.galaxy", 6);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_SC2_34644, "TriggerLibs\\GameData\\GameData.galaxy", 2);
-
- // Open a patched archive with new format of BSDIFF patch
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_SC2_34644_Maps, "Maps\\Campaign\\THorner03.SC2Map\\BankList.xml", 3);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_SC2_32283_enGB, "Assets\\Textures\\startupimage.dds", 0, true);
-
- // Open a patched archive where the "StreamingBuckets.txt" in the patch doesn't contain MPQ_FILE_PATCH_FILE
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_SC2_36281_enGB, "LocalizedData\\GameHotkeys.txt", 6);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_HS_3604_enGB, "Hearthstone.exe", 1);
-
- // Open a patched archive
- if(dwErrCode == ERROR_SUCCESS)
- dwErrCode = TestOpenArchive_Patched(PatchList_HS_6898_enGB, "Hearthstone_Data\\Managed\\Assembly-Csharp.dll", 10);
-
// Check the opening archive for read-only
if(dwErrCode == ERROR_SUCCESS)
dwErrCode = TestOpenArchive_ReadOnly(_T("MPQ_1997_v1_Diablo1_DIABDAT.MPQ"), true);
diff --git a/test/TLogHelper.cpp b/test/TLogHelper.cpp
index 8a4fc41..7129b63 100644
--- a/test/TLogHelper.cpp
+++ b/test/TLogHelper.cpp
@@ -36,6 +36,9 @@ class TLogHelper
DWORD PrintErrorVa(const char * szFormat, ...);
DWORD PrintError(const char * szFormat, const char * szFileName = NULL);
+ // Print final verdict
+ DWORD PrintVerdict(DWORD dwErrCode = ERROR_SUCCESS);
+
const char * UserString;
unsigned int UserCount;
unsigned int UserTotal;
@@ -108,39 +111,16 @@ TLogHelper::TLogHelper(const char * szNewMainTitle, const TCHAR * szNewSubTitle1
TLogHelper::~TLogHelper()
{
- const TCHAR * szSaveSubTitle1 = szSubTitle1;
- const TCHAR * szSaveSubTitle2 = szSubTitle2;
- TCHAR szSaveMainTitle[0x80];
-
- // Set both to NULL so they won't be printed
- StringCopy(szSaveMainTitle, _countof(szSaveMainTitle), szMainTitle);
- szSubTitle1 = NULL;
- szSubTitle2 = NULL;
- szMainTitle = NULL;
-
- // Print the final information
- if(szSaveMainTitle != NULL && bMessagePrinted == false)
+ // Print a verdict, if no verdict was printed yet
+ if(bMessagePrinted == false)
{
- if(bDontPrintResult == false)
- {
- if(szSaveSubTitle1 != NULL && szSaveSubTitle2 != NULL)
- PrintMessage(_T("%s (%s+%s) succeeded."), szSaveMainTitle, szSaveSubTitle1, szSaveSubTitle2);
- else if(szSaveSubTitle1 != NULL)
- PrintMessage(_T("%s (%s) succeeded."), szSaveMainTitle, szSaveSubTitle1);
- else
- PrintMessage(_T("%s succeeded."), szSaveMainTitle);
- }
- else
- {
- PrintProgress(" ");
- printf("\r");
- }
+ PrintVerdict(ERROR_SUCCESS);
}
#if defined(_MSC_VER) && defined(_DEBUG)
if(_CrtDumpMemoryLeaks())
{
- PrintMessage(_T("Memory leak(s) detected after %s.\n"), szSaveMainTitle);
+ PrintMessage(_T("Memory leak(s) detected after.\n"));
}
#endif // _MSC_VER
}
@@ -361,18 +341,59 @@ DWORD TLogHelper::PrintError(const char * szFormat, const char * szFileName)
}
//-----------------------------------------------------------------------------
+// Print final verdict
+
+DWORD TLogHelper::PrintVerdict(DWORD dwErrCode)
+{
+ LPCTSTR szSaveSubTitle1 = szSubTitle1;
+ LPCTSTR szSaveSubTitle2 = szSubTitle2;
+ TCHAR szSaveMainTitle[0x80];
+
+ // Set both to NULL so they won't be printed
+ StringCopy(szSaveMainTitle, _countof(szSaveMainTitle), szMainTitle);
+ szSubTitle1 = NULL;
+ szSubTitle2 = NULL;
+ szMainTitle = NULL;
+
+ // Print the final information
+ if(szSaveMainTitle[0] != 0)
+ {
+ if(bDontPrintResult == false)
+ {
+ LPCTSTR szVerdict = (dwErrCode == ERROR_SUCCESS) ? _T("succeeded") : _T("failed");
+
+ if(szSaveSubTitle1 != NULL && szSaveSubTitle2 != NULL)
+ PrintMessage(_T("%s (%s+%s) %s."), szSaveMainTitle, szSaveSubTitle1, szSaveSubTitle2, szVerdict);
+ else if(szSaveSubTitle1 != NULL)
+ PrintMessage(_T("%s (%s) %s."), szSaveMainTitle, szSaveSubTitle1, szVerdict);
+ else
+ PrintMessage(_T("%s %s."), szSaveMainTitle, szVerdict);
+ }
+ else
+ {
+ PrintProgress(" ");
+ printf("\r");
+ }
+ }
+
+ // Return the error code so the caller can pass it fuhrter
+ return dwErrCode;
+}
+
+//-----------------------------------------------------------------------------
// Protected functions
#ifdef _UNICODE
TCHAR * TLogHelper::CopyFormatCharacter(TCHAR * szBuffer, const TCHAR *& szFormat)
{
- static const TCHAR * szStringFormat = _T("\"%s\"");
- static const TCHAR * szUint64Format = I64u_t;
+// static LPCTSTR szStringFormat = _T("\"%s\"");
+ static LPCTSTR szStringFormat = _T("%s");
+ static LPCTSTR szUint64Format = I64u_t;
// String format
if(szFormat[0] == '%')
{
- if(szFormat[1] == 's' && szFormat[2] != ')')
+ if(szFormat[1] == 's')
{
_tcscpy(szBuffer, szStringFormat);
szFormat += 2;