diff --git a/CMakeLists.txt b/CMakeLists.txt index c76351e..df7ccd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,15 @@ set(CMAKE_CXX_FLAGS_FUZZERDEBUG "${CMAKE_CXX_FLAGS_DEBUG} /fsanitize-coverage=in # list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/FindWDK/cmake") # find_package(WDK REQUIRED) -set(NUGET_PACKAGE_VERSION "10.0.26100.4204") +# Select the Windows SDK/WDK NuGet package versions based on the platform toolset. +# VS 2026 (toolset v145) requires the 10.0.28000 packages; VS 2022 (v143) uses 10.0.26100. +if (MSVC_TOOLSET_VERSION GREATER_EQUAL 145) + set(NUGET_PACKAGE_VERSION "10.0.28000.1839") + set(WDK_VERSION "10.0.28000.0") +else () + set(NUGET_PACKAGE_VERSION "10.0.26100.4204") + set(WDK_VERSION "10.0.26100.0") +endif () set(NUGET_PACKAGES "Microsoft.Windows.SDK.CPP" @@ -48,10 +56,8 @@ endif() # Set WDK_ROOT based on the platform (arm64 or x64) if (TARGET_PLATFORM STREQUAL "arm64") set(WDK_ROOT "${PROJECT_BINARY_DIR}/packages/Microsoft.Windows.WDK.ARM64/c") - set(WDK_VERSION "10.0.26100.0") else () set(WDK_ROOT "${PROJECT_BINARY_DIR}/packages/Microsoft.Windows.WDK.x64/c") -set(WDK_VERSION "10.0.26100.0") endif () diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 550fd9f..cb3fff8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,7 +75,7 @@ To set up your development environment: git submodule update --init --recursive ``` -2. Open the solution in Visual Studio 2022 or use CMake to build: +2. Open the solution in Visual Studio 2022 or Visual Studio 2026, or use CMake to build: - Visual Studio: Open `usersim.sln` - CMake: Follow the CMake build instructions in the README diff --git a/README.md b/README.md index 95bab4d..f7009ac 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ To use this repository from another project: [KMDF sample driver](https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/writing-a-very-small-kmdf--driver) as a DLL (the sample project can be built either using Visual Studio or using cmake). 3. Set the following property on the project: Configuration Properties -> General -> Platform Toolset to - Visual Studio 2022 (v143). + Visual Studio 2022 (v143) or Visual Studio 2026 (v145). 4. Add a reference from your DLL project to the usersim project and the usersim_dll_skeleton project. 5. Define `_AMD64_;_WIN32_WINNT=0x0a00` in the project properties preprocessor defines. 6. Add to AdditionalIncludeDirectories: `$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\10.0.26100.0\km;;$(WindowsSdkDir)Include\wdf\kmdf\1.15` @@ -84,6 +84,7 @@ can be built and tested as follows. 1. As a one-time step, from a Visual Studio Developer Command Prompt, do: `cmake -G "Visual Studio 17 2022" -S external\catch2 -B external\catch2\build -DBUILD_TESTING=OFF` + (use `-G "Visual Studio 18 2026"` when building with Visual Studio 2026). 2. Build usersim.sln from the Visual Studio UI or using msbuild. 3. `cxplat_test.exe -d yes` and `usersim_tests.exe -d yes` can then be executed to run the standard tests. diff --git a/cxplat/cxplat_test/cxplat_test.vcxproj b/cxplat/cxplat_test/cxplat_test.vcxproj index 374e0f6..ab0251f 100644 --- a/cxplat/cxplat_test/cxplat_test.vcxproj +++ b/cxplat/cxplat_test/cxplat_test.vcxproj @@ -6,27 +6,27 @@ Win32Proj {e356324b-74bb-4123-9fbe-dd8b8ed8658a} cxplattest - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) Application true - v143 + $(UsersimPlatformToolset) Unicode Application false - v143 + $(UsersimPlatformToolset) true Unicode - v143 + $(UsersimPlatformToolset) - v143 + $(UsersimPlatformToolset) @@ -90,4 +90,4 @@ - \ No newline at end of file + diff --git a/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj b/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj index e3436e6..29b22db 100644 --- a/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj +++ b/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj @@ -39,7 +39,7 @@ cxplatwinkernel KMDF cxplat_winkernel - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) diff --git a/cxplat/src/cxplat_winkernel/packages.config b/cxplat/src/cxplat_winkernel/packages.config deleted file mode 100644 index 604e5de..0000000 --- a/cxplat/src/cxplat_winkernel/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cxplat/src/cxplat_winuser/CMakeLists.txt b/cxplat/src/cxplat_winuser/CMakeLists.txt index 749f2f7..94300d5 100644 --- a/cxplat/src/cxplat_winuser/CMakeLists.txt +++ b/cxplat/src/cxplat_winuser/CMakeLists.txt @@ -31,7 +31,7 @@ target_include_directories(cxplat_winuser PRIVATE "../../inc" "../../inc/winuser" "${WindowsSdkDir}include/10.0.22621.0" - "${WindowsSdkDir}include/10.0.26100.0" + "${WindowsSdkDir}include/${WDK_VERSION}" ) set(defs UNICODE _UNICODE CXPLAT_SOURCE) diff --git a/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj b/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj index 0bb61ba..d84169f 100644 --- a/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj +++ b/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj @@ -6,25 +6,25 @@ Win32Proj {f2ca70ab-af9a-47d1-9da9-94d5ab573ac2} cxplatwinuser - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) StaticLibrary true - v143 + $(UsersimPlatformToolset) Unicode StaticLibrary true - v143 + $(UsersimPlatformToolset) Unicode StaticLibrary false - v143 + $(UsersimPlatformToolset) true Unicode diff --git a/docs/DevelopmentGuide.md b/docs/DevelopmentGuide.md index 4ff8add..7ca6d94 100644 --- a/docs/DevelopmentGuide.md +++ b/docs/DevelopmentGuide.md @@ -98,14 +98,14 @@ Above all, if a file happens to differ in style from these guidelines (e.g., pri ### Prerequisites * Windows 10 version 1903 or later, or Windows Server 2019 or later -* Visual Studio 2022 with C++ development tools +* Visual Studio 2022 (v143) or Visual Studio 2026 (v145) with C++ development tools * Windows SDK version 10.0.22621.0 or later * Windows Driver Kit (WDK) version 10.0.22621.0 or later * CMake 3.16 or later (optional, for CMake builds) ### Building with Visual Studio -1. Open `usersim.sln` in Visual Studio 2022 +1. Open `usersim.sln` in Visual Studio 2022 or Visual Studio 2026 2. Select the desired configuration (Debug/Release) and platform (x64/ARM64) 3. Build the solution diff --git a/sample/sample.vcxproj b/sample/sample.vcxproj index b676978..d1ef7d4 100644 --- a/sample/sample.vcxproj +++ b/sample/sample.vcxproj @@ -8,13 +8,13 @@ 12.0 Debug sample - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) Windows10 true - v143 + $(UsersimPlatformToolset) DynamicLibrary KMDF Universal @@ -22,7 +22,7 @@ Windows10 false - v143 + $(UsersimPlatformToolset) DynamicLibrary KMDF Universal @@ -46,7 +46,7 @@ sha256 - $(WdkContentRoot)\Include\10.0.26100.0\km;$(WdkContentRoot)\Include\wdf\kmdf\1.15;%(AdditionalIncludeDirectories) + $(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km;$(WdkContentRoot)\Include\wdf\kmdf\1.15;%(AdditionalIncludeDirectories) Level3 true @@ -57,7 +57,7 @@ sha256 - $(WdkContentRoot)\Include\10.0.26100.0\km;$(WdkContentRoot)\Include\wdf\kmdf\1.15;%(AdditionalIncludeDirectories) + $(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km;$(WdkContentRoot)\Include\wdf\kmdf\1.15;%(AdditionalIncludeDirectories) diff --git a/setup_build/setup_build.vcxproj b/setup_build/setup_build.vcxproj index e21e976..c6259bb 100644 --- a/setup_build/setup_build.vcxproj +++ b/setup_build/setup_build.vcxproj @@ -10,19 +10,19 @@ Win32Proj {bfb0c59a-3f15-4d80-a65f-9a9a6dca3334} setupbuild - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) Application true - v143 + $(UsersimPlatformToolset) Unicode Application false - v143 + $(UsersimPlatformToolset) true Unicode diff --git a/src/usersim.vcxproj b/src/usersim.vcxproj index f23f088..b828daf 100644 --- a/src/usersim.vcxproj +++ b/src/usersim.vcxproj @@ -6,25 +6,25 @@ Win32Proj {030a7ac6-14dc-45cf-af34-891057ab1402} usersim - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) DynamicLibrary true - v143 + $(UsersimPlatformToolset) Unicode DynamicLibrary true - v143 + $(UsersimPlatformToolset) Unicode DynamicLibrary false - v143 + $(UsersimPlatformToolset) true Unicode @@ -49,7 +49,7 @@ true USERSIM_SOURCE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - $(ProjectDir);$(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\10.0.26100.0\km + $(ProjectDir);$(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km true @@ -64,7 +64,7 @@ true USERSIM_SOURCE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - $(ProjectDir);$(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\10.0.26100.0\km + $(ProjectDir);$(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km Console @@ -80,7 +80,7 @@ true USERSIM_SOURCE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true - $(ProjectDir);$(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\10.0.26100.0\km + $(ProjectDir);$(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km Console @@ -149,4 +149,4 @@ - \ No newline at end of file + diff --git a/tests/tests.vcxproj b/tests/tests.vcxproj index 484e835..8dfc5a9 100644 --- a/tests/tests.vcxproj +++ b/tests/tests.vcxproj @@ -6,19 +6,19 @@ Win32Proj {c7b63ca3-a0b8-4ee3-85c8-a17cb40440bf} tests - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) Application true - v143 + $(UsersimPlatformToolset) Unicode Application false - v143 + $(UsersimPlatformToolset) true Unicode @@ -43,7 +43,7 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - $(ProjectDir)..\external\catch2\src;$(ProjectDir)..\external\catch2\build\generated-includes;$(ProjectDir)..\inc;$(SolutionDir)cxplat\inc;$(SolutionDir)cxplat\inc\winuser;$(WdkContentRoot)\Include\10.0.26100.0\km;%(AdditionalIncludeDirectories) + $(ProjectDir)..\external\catch2\src;$(ProjectDir)..\external\catch2\build\generated-includes;$(ProjectDir)..\inc;$(SolutionDir)cxplat\inc;$(SolutionDir)cxplat\inc\winuser;$(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km;%(AdditionalIncludeDirectories) Console @@ -60,7 +60,7 @@ true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true - $(ProjectDir)..\external\catch2\src;$(ProjectDir)..\external\catch2\build\generated-includes;$(ProjectDir)..\inc;$(SolutionDir)cxplat\inc;$(SolutionDir)cxplat\inc\winuser;$(WdkContentRoot)\Include\10.0.26100.0\km;%(AdditionalIncludeDirectories) + $(ProjectDir)..\external\catch2\src;$(ProjectDir)..\external\catch2\build\generated-includes;$(ProjectDir)..\inc;$(SolutionDir)cxplat\inc;$(SolutionDir)cxplat\inc\winuser;$(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km;%(AdditionalIncludeDirectories) Console @@ -95,4 +95,4 @@ - \ No newline at end of file + diff --git a/usersim_dll_skeleton/usersim_dll_skeleton.vcxproj b/usersim_dll_skeleton/usersim_dll_skeleton.vcxproj index 9a15f10..20a96d7 100644 --- a/usersim_dll_skeleton/usersim_dll_skeleton.vcxproj +++ b/usersim_dll_skeleton/usersim_dll_skeleton.vcxproj @@ -9,19 +9,19 @@ Win32Proj {1937db41-f3eb-4955-a636-6386dcb394f6} usersimdllskeleton - 10.0.26100.0 + $(UsersimWindowsTargetPlatformVersion) StaticLibrary true - v143 + $(UsersimPlatformToolset) Unicode StaticLibrary false - v143 + $(UsersimPlatformToolset) true Unicode @@ -42,7 +42,7 @@ true _DEBUG;_LIB;%(PreprocessorDefinitions) true - $(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\10.0.26100.0\km + $(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km @@ -58,7 +58,7 @@ true NDEBUG;_LIB;%(PreprocessorDefinitions) true - $(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\10.0.26100.0\km + $(ProjectDir)..\inc;$(ProjectDir)..\cxplat\inc;$(ProjectDir)..\cxplat\inc\winuser;$(WdkContentRoot)\Include\$(WindowsTargetPlatformVersion)\km @@ -71,4 +71,4 @@ - \ No newline at end of file + diff --git a/wdk.props b/wdk.props index 508729d..3def8b7 100644 --- a/wdk.props +++ b/wdk.props @@ -9,22 +9,35 @@ native <_NuGetTargetFallbackMoniker>$(_NuGetTargetFallbackMoniker);native,Version=v0.0 true + + 10.0.28000.0 + 10.0.26100.0 + 10.0.26100.0 + + 10.0.28000.1839 + 10.0.26100.4204 + 10.0.26100.4204 + + v145 + v143 + v143 - 10.0.26100.4204 + $(UsersimWDKVersion) - 10.0.26100.4204 + $(UsersimWDKVersion) - 10.0.26100.4204 + $(UsersimWDKVersion) - 10.0.26100.4204 + $(UsersimWDKVersion) - 10.0.26100.4204 + $(UsersimWDKVersion) \ No newline at end of file