windowsinf

Two INF files for the same driver solution?


We have a NDIS miniport driver. We have the same source code for WS2016 and WS2019 right now.

We want to make a separation between the two during build. What we want different is that, each of them should be built using a separate INF file.

Can I link 2 different INF files to the same solution file and change properties in the solution/vcxproj to use the INF file depending on what I am building for?


Solution

  • Yes, we are doing something similar. You can take a look at https://github.com/virtio-win/kvm-guest-drivers-windows/tree/master/NetKVM

    There are three inf files that are used based on the OS. You will see them as netkvm.inx, netkvm_no_RSC.inx, and netkvm_no_RSS.inx repository.

    The project file defines different inf depending on the build target: https://github.com/virtio-win/kvm-guest-drivers-windows/blob/26c5015550b0b0a5e8257634ebb415fb1790d64b/NetKVM/NetKVM-VS2015.vcxproj

    Look for following properties in the project file:

    <SourceInfFile></SourceInfFile>
    <TargetInfFile></TargetInfFile>