title: How to create a basic, empty, WDM driver?
body: <p>I am trying to convince Visual Studio 2013 to build a driver. But never having seen Visual Studio 2013 successfully build a driver, i have no idea how to fix the problem.</p>
  
  <p>So it's time to go back to the beginning. Delete the entire solution and start adding things one-by-one until it fails to build. Except i cannot get an empty solution to build.</p>
  
  <h1>Let's create a <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/hh454833(v=vs.85).aspx" rel="nofollow noreferrer">new empty WDM driver project</a></h1>
  
  <p>In Visual Studio 2013, I select:</p>
  
  <ul>
  <li><strong>File</strong>, <strong>New</strong>, <strong>Project</strong></li>
  <li><strong>Templates</strong>, <strong>Visual C++</strong>, <strong>Windows Drivers</strong>, <strong>WDM</strong></li>
  <li><strong>Empty WDM Driver</strong></li>
  </ul>
  
  <p>And i now have a new, empty, driver solution:</p>
  
  <p><img src="https://i.stack.imgur.com/UNGiR.png" alt="enter image description here"></p>
  
  <p>Except when I attempt to build it, it fails:</p>
  
  <blockquote>
    <p>SIGNTASK : SignTool error : File not found: D:\Develop\TestDriver\MyDriver3\Win7Debug\MyDriver3.sys</p>
  </blockquote>
  
  <p>Now that error isn't unexpected, there isn't even any <strong>code</strong> in the solution to build into a <code>.sys</code> file!</p>
  
  <h1>So i'll add some code</h1>
  
  <p>Now let's create an empty WDM driver project, by adding an empty WDM driver file:</p>
  
  <p><strong>Source.c</strong></p>
  
  <pre><code>#include &lt;wdm.h&gt;
  
  NTSTATUS DriverEntry(PDRIVER_OBJECT object, PUNICODE_STRING registryPath)
  {
     return STATUS_SUCCESS;
  }
  </code></pre>
  
  <p>And this now also fails, but this time it fails with the exact same error message as last time:</p>
  
  <blockquote>
    <p>SIGNTASK : SignTool error : File not found: D:\Develop\TestDriver\MyDriver3\Win7Debug\MyDriver3.sys</p>
  </blockquote>
  
  <p>Which make sense, there is no <code>MyDriver3.sys</code> file. Not in that folder, not anywhere. There isn't a <code>.sys</code> file here, there isn't a <code>.sys</code> file there. There isn't a <code>.sys</code> file anywhere.</p>
  
  <h1>How to create a basic, empty, WDM driver?</h1>
  
  <p>So this leaves me with the question: </p>
  
  <blockquote>
    <p>How do i create a basic, empty, WDM driver?</p>
  </blockquote>
  
  <p>I'm concerned that even if Visual Studio does create a <code>.sys</code> file, it will just <a href="https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/8fdfa2ae-ea62-4c9d-86e0-eabff049fe90/driver-testing-an-error-occurred-deploying-the-drivers-in-the-solution-the-system?forum=wdk" rel="nofollow noreferrer">fail on the next error</a>. So what i'd like is a cononical example of an empty WDM solution - that builds.</p>
  
  <h1>Bonus Reading</h1>
  
  <ul>
  <li>MSDN: <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/hh454833(v=vs.85).aspx" rel="nofollow noreferrer">Creating a New Software Driver</a></li>
  <li><a href="https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/8fdfa2ae-ea62-4c9d-86e0-eabff049fe90/driver-testing-an-error-occurred-deploying-the-drivers-in-the-solution-the-system?forum=wdk" rel="nofollow noreferrer">Driver Testing an error occurred deploying the driver(s) in the solution : The system</a></li>
  </ul>