diff --git a/src/drivers/general/queries/experimental/UnicodeStringFreed/driver_snippet.c b/src/drivers/general/queries/experimental/UnicodeStringFreed/driver_snippet.c index a13af3b2..9cca65ce 100644 --- a/src/drivers/general/queries/experimental/UnicodeStringFreed/driver_snippet.c +++ b/src/drivers/general/queries/experimental/UnicodeStringFreed/driver_snippet.c @@ -3,11 +3,12 @@ // // driver_snippet.c // -#include "ntifs.h" +#include "ntifs.h" #define SET_DISPATCH 1 // Template. Not called in this test. void top_level_call() {} + PUNICODE_STRING unicodeStringGlobal; void free_unicode_string(PUNICODE_STRING unicodeStr) { diff --git a/src/drivers/test/WDMTestTemplate/WDMTestTemplate.sln b/src/drivers/test/WDMTestTemplate/WDMTestTemplate.sln index 2738bb18..b204d010 100644 --- a/src/drivers/test/WDMTestTemplate/WDMTestTemplate.sln +++ b/src/drivers/test/WDMTestTemplate/WDMTestTemplate.sln @@ -1,28 +1,31 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0 -MinimumVisualStudioVersion = 12.0 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_driver1", "driver\fail_driver1.vcxproj", "{7F88D5C5-F05F-4817-89F5-C811053277A0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|Win32.Build.0 = Debug|Win32 - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|Win32.ActiveCfg = Release|Win32 - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|Win32.Build.0 = Release|Win32 - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|x64.ActiveCfg = Debug|x64 - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|x64.Build.0 = Debug|x64 - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|x64.ActiveCfg = Release|x64 - {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34302.85 +MinimumVisualStudioVersion = 12.0 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_driver1", "driver\fail_driver1.vcxproj", "{7F88D5C5-F05F-4817-89F5-C811053277A0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|Win32.Build.0 = Debug|Win32 + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|x64.ActiveCfg = Debug|x64 + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|x64.Build.0 = Debug|x64 + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|Win32.ActiveCfg = Release|Win32 + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|Win32.Build.0 = Release|Win32 + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|x64.ActiveCfg = Release|x64 + {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B5DD9EDC-06C8-4BC7-BEC8-179828286FF8} + EndGlobalSection +EndGlobal diff --git a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.c b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.c index e5feb084..6e606fed 100644 --- a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.c +++ b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.c @@ -21,8 +21,8 @@ Module Name: --*/ -#include "driver_snippet.c" #include "fail_driver1.h" +#include "driver_snippet.c" #define _DRIVER_NAME_ "fail_driver1" diff --git a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.h b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.h index 11b8f7ca..512bee92 100644 --- a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.h +++ b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.h @@ -15,7 +15,13 @@ Module Name: #ifdef __cplusplus extern "C" { #endif + +#if USE_NTIFS +#include "ntifs.h" +#else #include +#endif + #ifdef __cplusplus } #endif diff --git a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj index f28af681..1d6f2dce 100644 --- a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj +++ b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj @@ -1,167 +1,169 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {7F88D5C5-F05F-4817-89F5-C811053277A0} - $(MSBuildProjectName) - false - Debug - Win32 - {5B7623CB-C6FA-4BD9-B152-49D2AF3AFFF9} - - - - Windows10 - False - Desktop - WDM - WindowsKernelModeDriver10.0 - Driver - - - Windows10 - True - Desktop - WDM - WindowsKernelModeDriver10.0 - Driver - - - Windows10 - False - Desktop - WDM - WindowsKernelModeDriver10.0 - Driver - - - Windows10 - True - Desktop - WDM - WindowsKernelModeDriver10.0 - Driver - - - - $(IntDir) - - - - - - - - - - - - - - - - fail_driver1 - - - fail_driver1 - - - fail_driver1 - - - fail_driver1 - - - - false - Level4 - - - - - false - Level4 - - - - - false - Level4 - - - - - false - Level4 - - - - - - - - - - - - sha256 - - - - - - - - - sha256 - - - - - - - - - sha256 - - - - - - - - - sha256 - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {7F88D5C5-F05F-4817-89F5-C811053277A0} + $(MSBuildProjectName) + false + Debug + Win32 + {5B7623CB-C6FA-4BD9-B152-49D2AF3AFFF9} + + + + Windows10 + False + Desktop + WDM + WindowsKernelModeDriver10.0 + Driver + + + Windows10 + True + Desktop + WDM + WindowsKernelModeDriver10.0 + Driver + + + Windows10 + False + Desktop + WDM + WindowsKernelModeDriver10.0 + Driver + + + Windows10 + True + Desktop + WDM + WindowsKernelModeDriver10.0 + Driver + + + + $(IntDir) + + + + + + + + + + + + + + + + fail_driver1 + + + fail_driver1 + + + fail_driver1 + + + fail_driver1 + + + + false + Level4 + + + + + false + Level4 + + + + + false + Level4 + + + + + false + Level4 + + + + + + + + + + USE_NTIFS=$(UseNTIFS);%(PreprocessorDefinitions) + + + sha256 + + + + + + + USE_NTIFS=$(UseNTIFS);%(PreprocessorDefinitions) + + + sha256 + + + + + + + + + sha256 + + + + + + + + + sha256 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj.user b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj.user index 966b4ffb..429333de 100644 --- a/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj.user +++ b/src/drivers/test/WDMTestTemplate/driver/fail_driver1.vcxproj.user @@ -1,6 +1,6 @@ - - - - true - + + + + true + \ No newline at end of file diff --git a/src/drivers/test/build_create_analyze_test.cmd b/src/drivers/test/build_create_analyze_test.cmd index 88d368c1..5aad6c1b 100644 --- a/src/drivers/test/build_create_analyze_test.cmd +++ b/src/drivers/test/build_create_analyze_test.cmd @@ -2,38 +2,38 @@ rd /s /q working >NUL 2>&1 rd /s /q TestDB >NUL 2>&1 rd /s /q AnalysisFiles >NUL 2>&1 - -call :test PendingStatusError WDMTestTemplate wdm queries -call :test ExaminedValue WDMTestTemplate wdm queries -call :test StrSafe KMDFTestTemplate kmdf queries -call :test MultiplePagedCode WDMTestTemplate wdm queries -call :test NoPagedCode WDMTestTemplate wdm queries -call :test NoPagingSegment WDMTestTemplate wdm queries -call :test OpaqueMdlUse WDMTestTemplate wdm queries -call :test OpaqueMdlWrite WDMTestTemplate wdm queries -call :test KeWaitLocal WDMTestTemplate wdm queries -call :test IrqlTooHigh WDMTestTemplate general queries\experimental -call :test IrqlTooLow WDMTestTemplate general queries\experimental -call :test IrqlSetTooHigh WDMTestTemplate general queries\experimental -call :test IrqlSetTooLow WDMTestTemplate general queries\experimental -call :test WrongDispatchTableAssignment WDMTestTemplate wdm queries -call :test ExtendedDeprecatedApis WDMTestTemplate general queries -call :test WdkDeprecatedApis WDMTestTemplate general queries -call :test IllegalFieldAccess WDMTestTemplate wdm queries -call :test PoolTagIntegral WDMTestTemplate general queries -call :test ObReferenceMode WDMTestTemplate wdm queries -call :test DeviceInitApi KMDFTestTemplate kmdf queries\experimental -call :test DefaultPoolTag WDMTestTemplate general queries -call :test DefaultPoolTagExtended WDMTestTemplate general queries\experimental -call :test InitNotCleared WDMTestTemplate wdm queries -call :test IrqlNotUsed WDMTestTemplate general queries -call :test IrqlNotSaved WDMTestTemplate general queries -call :test IllegalFieldWrite WDMTestTemplate wdm queries -call :test IllegalFieldAccess2 WDMTestTemplate wdm queries -call :test RoutineFunctionTypeNotExpected WDMTestTemplate general queries -call :test KeSetEventIrql WDMTestTemplate general queries\experimental -call :test KeSetEventPageable WDMTestTemplate general queries -call :test UnicodeStringFreed WDMTestTemplate general queries\experimental +@REM call :test +call :test PendingStatusError WDMTestTemplate wdm queries 0 +call :test ExaminedValue WDMTestTemplate wdm queries 0 +call :test StrSafe KMDFTestTemplate kmdf queries 0 +call :test MultiplePagedCode WDMTestTemplate wdm queries 0 +call :test NoPagedCode WDMTestTemplate wdm queries 0 +call :test NoPagingSegment WDMTestTemplate wdm queries 0 +call :test OpaqueMdlUse WDMTestTemplate wdm queries 0 +call :test OpaqueMdlWrite WDMTestTemplate wdm queries 0 +call :test KeWaitLocal WDMTestTemplate wdm queries 0 +call :test IrqlTooHigh WDMTestTemplate general queries\experimental 0 +call :test IrqlTooLow WDMTestTemplate general queries\experimental 0 +call :test IrqlSetTooHigh WDMTestTemplate general queries\experimental 0 +call :test IrqlSetTooLow WDMTestTemplate general queries\experimental 0 +call :test WrongDispatchTableAssignment WDMTestTemplate wdm queries 0 +call :test ExtendedDeprecatedApis WDMTestTemplate general queries 0 +call :test WdkDeprecatedApis WDMTestTemplate general queries 0 +call :test IllegalFieldAccess WDMTestTemplate wdm queries 0 +call :test PoolTagIntegral WDMTestTemplate general queries 0 +call :test ObReferenceMode WDMTestTemplate wdm queries 0 +call :test DeviceInitApi KMDFTestTemplate kmdf queries\experimental 0 +call :test DefaultPoolTag WDMTestTemplate general queries 0 +call :test DefaultPoolTagExtended WDMTestTemplate general queries\experimental 0 +call :test InitNotCleared WDMTestTemplate wdm queries 0 +call :test IrqlNotUsed WDMTestTemplate general queries 0 +call :test IrqlNotSaved WDMTestTemplate general queries 0 +call :test IllegalFieldWrite WDMTestTemplate wdm queries 0 +call :test IllegalFieldAccess2 WDMTestTemplate wdm queries 0 +call :test RoutineFunctionTypeNotExpected WDMTestTemplate general queries 0 +call :test KeSetEventIrql WDMTestTemplate general queries\experimental 0 +call :test KeSetEventPageable WDMTestTemplate general queries 0 +call :test UnicodeStringFreed WDMTestTemplate general queries\experimental 1 exit /b 0 @@ -46,14 +46,14 @@ robocopy /e ..\%3\%4\%1\ working\%1\driver\ cd working\%1 echo building -msbuild /t:rebuild /p:platform=x64 +msbuild /t:rebuild /p:platform=x64 /p:UseNTIFS=%5 @REM the "..\..\TestDB\%1" in the command below specifies a location for the database we want to create. The %1 will correspond to the @REM first argument of the calls above, for example, PendingStatusError for the first call. echo creating_database mkdir ..\..\TestDB -codeql database create -l=cpp -c "msbuild /p:Platform=x64 /t:rebuild" "..\..\TestDB\%1" +codeql database create -l=cpp -c "msbuild /p:Platform=x64;UseNTIFS=%5 /t:rebuild" "..\..\TestDB\%1" @REM Similar to the case above, the %1 corresponds to PendingStatusError cd ..\.. diff --git a/src/drivers/test/diff/RoutineFunctionTypeNotExpected.sarif b/src/drivers/test/diff/RoutineFunctionTypeNotExpected.sarif index 8d5a80f9..dea8275e 100644 --- a/src/drivers/test/diff/RoutineFunctionTypeNotExpected.sarif +++ b/src/drivers/test/diff/RoutineFunctionTypeNotExpected.sarif @@ -1,21 +1,21 @@ -{ - "all": { - "+": 0, - "-": 0 - }, - "error": { - "+": 0, - "-": 0, - "codes": [] - }, - "warning": { - "+": 0, - "-": 0, - "codes": [] - }, - "note": { - "+": 0, - "-": 0, - "codes": [] - } +{ + "all": { + "+": 0, + "-": 0 + }, + "error": { + "+": 0, + "-": 0, + "codes": [] + }, + "warning": { + "+": 0, + "-": 0, + "codes": [] + }, + "note": { + "+": 0, + "-": 0, + "codes": [] + } } \ No newline at end of file