windowsvisual-studiokerneldriverwdk

Driver compilation successful but no .sys file generated


I'm attempting to compile a simple kernel driver in Visual Studio using the Windows Driver Kit. The compilation process completes without any errors, but I can't seem to find the expected .sys file in the output folder.

Here is the code snippet for the driver's entry point:


#include <ntddk.h>

NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
    UNREFERENCED_PARAMETER(DriverObject);
    UNREFERENCED_PARAMETER(RegistryPath);

    KdPrint("DriverEntry called\n");
    return STATUS_SUCCESS;
}

When I build the project, this is what the output log shows:


Build started...
1\>------ Build started: Project: fltdrv, Configuration: Debug x64 ------
1\>entry.c
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 10:56 AM and took 00.781 seconds ==========

My output path is set as $(SolutionDir)$(Platform)\$(Configuration)\ which resolves to C:\Users\myuser\source\vscode\myproject\driver\x64\Debug. However, no .sys file is generated in this directory.

I'm using the correct toolchain, and I have confirmed that my code is correct and there are no errors in the .inf file. I've also checked the project properties and they seem to be in order.

I'm using Visual Studio 2022 with administrator privileges enabled.

What I tried:

Despite all these steps, the .sys file is not being generated in the output directory.

Any help or insights on why the .sys file isn't being generated would be greatly appreciated. Thank you in advance!


Solution

  • Fixed it: apparently I forgot to install all the required Spectre mitigated libraries (ARM included, which I do not use).

    If you encounter the same issue, make sure that you have installed (via the Visual Studio Installer) the following libraries:

    MSVC v143 - VS 2022 C++ Arm build tools (Latest)
    MSVC v143 - VS 2022 C++ Arm Spectre-mitigated libs (Latest)
    MSVC v143 - VS 2022 C++ Arm64 build tools (Latest)
    MSVC v143 - VS 2022 C++ Arm64 Spectre-mitigated libs (Latest)
    MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
    MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)