Pepsi_1
Pepsi_1

Reputation: 121

Error Building Windows 7 Driver

I have this driver that will not compile. I've been searching the errors on the net and have came up with no solution. Any thoughts?

#include <wdm.h>

VOID Unload(IN PDRIVER_OBJECT pDriverObject)
{
    DbgPrint("Received signal to unload the driver");
    return;
}

NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING regPath)
{
    DbgPrint("Driver has been loaded");
    (*pDriverObject).DriverUnload = Unload;
    return(STATUS_SUCCESS);
}

Errors Below:

1>------ Build started: Project: KMDF Test, Configuration: Win7 Debug Win32 ------
1>  Stamping Win7Debug\KMDFTest.inf [Version] section with DriverVer=12/04/2012,10.12.25.726
1>  cl wpp
1>wpp : error : (WppCreateFile)Cannot open file trace.h, error 2
2>------ Build started: Project: KMDF Test Package, Configuration: Win7 Debug Win32 ------
2>C:\Program Files\Windows Kits\8.0\build\WindowsDriver8.0.common.targets(1347,5): error MSB3030: Could not copy the file "C:\Users\Administrator\documents\visual studio 2012\Projects\KMDF Test\Win7Debug\KMDFTest.sys" because it was not found.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Upvotes: 2

Views: 9324

Answers (5)

8bitcartridge
8bitcartridge

Reputation: 1721

Did you end up fixing this? It's very probable that your project is simply unable to find your trace.h file. If you're using Visual Studio, then check in the project settings under:

Configuration Properties -> Wpp Tracing -> File Options -> Scan Configuration Data

Make sure that the path to the file is correct. If it simply says trace.h, then make sure that trace.h is in the same folder as the project file.

If you don't need to do tracing, then Sami's answer is just as good.

Upvotes: 3

Vineel
Vineel

Reputation: 1440

open *.vcxproj file in notepad and comment the below lines.

<!--      <WppEnabled>true</WppEnabled>
      <WppScanConfigurationData Condition="'%(ClCompile. ScanConfigurationData)'  == ''">trace.h</WppScanConfigurationData>
      <WppKernelMode>true</WppKernelMode> -->

Then I did build. It worked.. Hope it helps you.

Upvotes: -1

Binary Exe LLC
Binary Exe LLC

Reputation: 1

Steps to resolve the problem:

  1. Search and get trace.h and put into folder of project file or provide the path.
  2. Replace KmdfSmallEvtDeviceAdd with KmdfHelloWorldEvtDeviceAdd

Upvotes: 0

Sami
Sami

Reputation: 131

Here is how I fixed this:

In the Solution Explorer window, right-click your driver project and choose Properties. In Wpp Tracing > All Options, set Run Wpp tracing to No. Click OK.

Sami

Upvotes: 13

gungun
gungun

Reputation: 1

Maybe you didn't choose the proper driver template?

While I was using both KDM and KDMF templates to create a Driver project, I met the same error as you....so...

You can create a new project, and choose the "Empty WDM Driver" template, then everything will be ok.

If you really want to use WPP, the following link can be helpful. Supporting WPP Tracing (Windows Drivers)

Upvotes: 0

Related Questions