diff --git a/build/makeLegacyDVLs.bat b/build/makeLegacyDVLs.bat new file mode 100644 index 000000000..b4b449dfe --- /dev/null +++ b/build/makeLegacyDVLs.bat @@ -0,0 +1,84 @@ +@echo off +setlocal enabledelayedexpansion + +rem Add Legacy DVL folders here, seperated by a space, in the format +rem DVLbbbb, where bbbb is the Windows version, e.g. DVL1903. +rem If you do not wish to build any Legacy DVLs, leave the +rem _legacy_dvls_ variable equal to NULL. +set _legacy_dvls_=DVL1903 DVL1607 + +if "%_legacy_dvls_%"=="" ( + echo INFO : No Legacy DVLs were selected for building. + goto :eof +) +if "%DVL1607%"=="" set DVL1607=C:\DVL1607 +if "%DVL1903%"=="" set DVL1903=C:\DVL1903 +set "ProjDir=%~1" +set "IntDir_DVL=%~1%~2" +set "TargetName_DVL=%~3" +set "CONFIGURATION_DVL=%~4" +set "PLATFORM_DVL=%~5" +if exist "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" ( + del /f "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" +) +echo. +call :proc_legacy_dvls %_legacy_dvls_% +endlocal +goto :eof + +:proc_legacy_dvls +if "%~1"=="" goto :eof +call :do_dvl %1 +shift +goto :proc_legacy_dvls + +:do_dvl +set dvl_ver=%1 +set dvl_ver=%dvl_ver:~-4% +if exist !%~1! ( + echo Found !%~1!. Building Driver Verification Log for Windows 10 version !dvl_ver!... + !%~1!\dvl.exe + if "!errorlevel!" NEQ "0" ( + echo ERROR building Driver Verification Log for Windows 10 version !dvl_ver!. + echo The DVL file %ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML will NOT exist. + echo. + echo !dvl_ver!,fail >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" + goto :eof + ) + echo Copying DVL to %ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML. + copy /y "%ProjDir%%TargetName_DVL%.DVL.XML" "%ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML" + echo !dvl_ver!,!dvl_ver! >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" +) else ( + echo The !%~1! directory was not found. Unable to build Driver Verification Log. + if "%~1"=="DVL1607" ( + if exist "%ProjDir%%TargetName_DVL%.DVL-win10-1903.XML" ( + echo Creating Driver Verification Log for Windows 10 version !dvl_ver! from alternate DVL instead. + echo Alternate DVL : %TargetName_DVL%.DVL-win10-1903.XML + findstr /v /c:"General.Checksum" "%ProjDir%%TargetName_DVL%.DVL-win10-1903.XML" > "%ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML" + echo 1607,1903 >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" + ) else ( + if exist "%ProjDir%%TargetName_DVL%.DVL-win10-latest.XML" ( + echo Creating Driver Verification Log for Windows 10 version !dvl_ver! from alternate DVL instead. + echo Alternate DVL : %TargetName_DVL%.DVL-win10-latest.XML + findstr /v /c:"General.Checksum" "%ProjDir%%TargetName_DVL%.DVL-win10-latest.XML" | findstr /v /c:".Semmle." > "%ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML" + echo 1607,latest >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" + ) else ( + echo Unable to create Driver Verification Log from alternates as no suitable alternate exists. + echo. + echo 1607,fail >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" + goto :eof + ) + ) + echo Driver Verification Log Created. You can locate the Driver Verification Log file at: + echo %ProjDir%%TargetName_DVL%.DVL-win10-!dvl_ver!.XML + ) + if "%~1"=="DVL1903" ( + echo Unable to create Driver Verification Log from alternates as no suitable alternate exists. + echo. + echo 1903,fail >> "%ProjDir%%TargetName_DVL%.legacy_dvl_result.txt" + goto :eof + ) +) +echo Finished creating Driver Verification Log for Windows 10 version !dvl_ver!. +echo. +goto :eof diff --git a/vioscsi/buildAll.bat b/vioscsi/buildAll.bat old mode 100755 new mode 100644 index 483748476..01f137890 --- a/vioscsi/buildAll.bat +++ b/vioscsi/buildAll.bat @@ -3,4 +3,4 @@ if "%VIRTIO_WIN_NO_ARM%"=="" call ..\build\build.bat vioscsi.sln "Win10 Win11" A if errorlevel 1 goto :eof call ..\build\build.bat vioscsi.sln "Win10 Win11" %* if errorlevel 1 goto :eof -call ..\build\build.bat vioscsi.vcxproj "Win11_SDV" %* +call ..\build\build.bat vioscsi.vcxproj "Win10_SDV Win11_SDV" %* diff --git a/vioscsi/vioscsi.vcxproj b/vioscsi/vioscsi.vcxproj old mode 100755 new mode 100644 index 5de343edb..05534f04d --- a/vioscsi/vioscsi.vcxproj +++ b/vioscsi/vioscsi.vcxproj @@ -130,13 +130,39 @@ - copy /Y $(ProjectDir)vioscsi.DVL.XML $(ProjectDir)Install\$(TargetOS)\$(TargetArch) + echo Copying $(TargetName).DVL.XML to Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL.XML + copy /Y $(ProjectDir)$(TargetName).DVL.XML^ + $(ProjectDir)Install\$(TargetOS)\$(TargetArch) + echo Copying $(IntDir)vc.nativecodeanalysis.all.xml to $(ProjectDir) copy /Y $(IntDir)vc.nativecodeanalysis.all.xml $(ProjectDir) - call "..\build\dvl1903.bat" "$(ProjectDir)\$(IntDir)" "$(TargetName)" "$(Configuration)" "$(Platform)" - copy /Y $(ProjectDir)vioscsi.DVL.XML $(ProjectDir)Install\$(TargetOS)\$(TargetArch)\vioscsi.DVL-win10.XML + if "$(TargetOS)"=="Win10" ( + echo Copying $(TargetName).DVL.XML to $(ProjectDir)$(TargetName).DVL-win10-latest.XML + copy /Y $(ProjectDir)$(TargetName).DVL.XML^ + $(ProjectDir)$(TargetName).DVL-win10-latest.XML + ) + if "$(TargetOS)"=="Win11" ( + echo Copying $(TargetName).DVL.XML to $(ProjectDir)$(TargetName).DVL-win11-latest.XML + copy /Y $(ProjectDir)$(TargetName).DVL.XML^ + $(ProjectDir)$(TargetName).DVL-win11-latest.XML + ) + call "..\build\makeLegacyDVLs.bat" "$(ProjectDir)" "$(IntDir)" "$(TargetName)" "$(Configuration)" "$(Platform)" + if exist "$(ProjectDir)$(TargetName).DVL-win10-1903.XML" ( + echo Copying $(TargetName).DVL-win10-1903.XML to Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-win10.XML + copy /Y $(ProjectDir)$(TargetName).DVL-win10-1903.XML^ + $(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-win10.XML + ) else ( + echo Unable to copy Win10 DVL $(ProjectDir)$(TargetName).DVL-win10-1903.XML - it does not exist. + ) + if exist "$(ProjectDir)$(TargetName).DVL-win10-1607.XML" ( + echo Copying $(TargetName).DVL-win10-1607.XML to Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-compat.XML + copy /Y $(ProjectDir)$(TargetName).DVL-win10-1607.XML^ + $(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-compat.XML + ) else ( + echo Unable to copy COMPAT DVL $(ProjectDir)$(TargetName).DVL-win10-1607.XML - it does not exist. + ) - $(IntDir)vc.nativecodeanalysis.all.xml;$(ProjectDir)vioscsi.DVL.XML - $(ProjectDir)Install\$(TargetOS)\$(TargetArch)\vioscsi.DVL.XML;$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\vioscsi.DVL-win10.XML + $(IntDir)vc.nativecodeanalysis.all.xml;$(ProjectDir)$(TargetName).DVL.XML + $(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL.XML;$(ProjectDir)Install\$(TargetOS)\$(TargetArch)\$(TargetName).DVL-win10.XML true