G
George912
Guest
I use WDK 8.1 Update 1 (as I use Windows 7) and Visual Studio 2013.
I created an empty KMDF project and added the following source file:
#include <wdf.h>
#include <ntddk.h>
NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT driverObject, _In_ PUNICODE_STRING registryPath)
{
DbgPrint("Driver entry");
return STATUS_SUCCESS;
}
Once I try to build it, I get the following output:
1> Stamping Win7Release\HelloWorld.inf [Version] section with DriverVer=08/16/2018,14.2.5.34
1> cl wpp
1>wpp : error : (WppCreateFile)Cannot open file trace.h, error 2
2>------ Build started: Project: HelloWorld Package, Configuration: Win7 Release Win32 ------
2>C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets(1366,5): error MSB3030: Could not copy the file "C:\Users\Me\Desktop\HelloWorld\Win7Release\HelloWorld.sys" because it was not found.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
and about 100 syntax errors in files such as: wdfassert.h, wdfchildlist.h, wdmsec.h, wdf.h, wdfchildlist.h, wdm.h, most of them is "undefined identifier". (I'm not posting the errors as I think it's redundant, but let me know if you want to see them).
Have you any idea what caused them and what am I supposed to do in order to get rid of them?
After I saw someone recommended to disable Wpp Tracing in project properties, I did it and got rid of only the first error. I have 200 errors and 60 warnings now, though.
Screenshot of some of the errors (put "." instead of "<dot>", as I'm unable to post links/images):
imgur <dot> com/a/ATivHJV
After I removed #include <wdf.h>, I'm getting only one error:
error MSB3030: Could not copy the file "C:\Users\Me\Desktop\HelloWorld\Win7Release\HelloWorld.sys" because it was not found. C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets 1366 5 HelloWorld Package
Build output:
1>------ Rebuild All started: Project: HelloWorld, Configuration: Win7 Release Win32 ------
1> Stamping Win7Release\HelloWorld.inf [Version] section with DriverVer=08/16/2018,19.26.43.470
1> Driver.c
1>Driver.c(6): error C2220: warning treated as error - no 'object' file generated
1>Driver.c(6): warning C4100: 'registryPath' : unreferenced formal parameter
1>Driver.c(6): warning C4100: 'driverObject' : unreferenced formal parameter
2>------ Rebuild All started: Project: HelloWorld Package, Configuration: Win7 Release Win32 ------
2>C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets(1366,5): error MSB3030: Could not copy the file "C:\Users\Me\Desktop\HelloWorld\Win7Release\HelloWorld.sys" because it was not found.
========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========
EDIT: I got it working. I did a new project (as I thought it could change something) and had the same error, later added the following lines:
UNREFERENCED_PARAMETER(driverObject);
UNREFERENCED_PARAMETER(registryPath);
but had a linker error. A moment later, I noticed that I forgot to change the source file's extension from ".cpp" to ".c", changed that, built and got it working.
Continue reading...
I created an empty KMDF project and added the following source file:
#include <wdf.h>
#include <ntddk.h>
NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT driverObject, _In_ PUNICODE_STRING registryPath)
{
DbgPrint("Driver entry");
return STATUS_SUCCESS;
}
Once I try to build it, I get the following output:
1> Stamping Win7Release\HelloWorld.inf [Version] section with DriverVer=08/16/2018,14.2.5.34
1> cl wpp
1>wpp : error : (WppCreateFile)Cannot open file trace.h, error 2
2>------ Build started: Project: HelloWorld Package, Configuration: Win7 Release Win32 ------
2>C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets(1366,5): error MSB3030: Could not copy the file "C:\Users\Me\Desktop\HelloWorld\Win7Release\HelloWorld.sys" because it was not found.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
and about 100 syntax errors in files such as: wdfassert.h, wdfchildlist.h, wdmsec.h, wdf.h, wdfchildlist.h, wdm.h, most of them is "undefined identifier". (I'm not posting the errors as I think it's redundant, but let me know if you want to see them).
Have you any idea what caused them and what am I supposed to do in order to get rid of them?
After I saw someone recommended to disable Wpp Tracing in project properties, I did it and got rid of only the first error. I have 200 errors and 60 warnings now, though.
Screenshot of some of the errors (put "." instead of "<dot>", as I'm unable to post links/images):
imgur <dot> com/a/ATivHJV
After I removed #include <wdf.h>, I'm getting only one error:
error MSB3030: Could not copy the file "C:\Users\Me\Desktop\HelloWorld\Win7Release\HelloWorld.sys" because it was not found. C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets 1366 5 HelloWorld Package
Build output:
1>------ Rebuild All started: Project: HelloWorld, Configuration: Win7 Release Win32 ------
1> Stamping Win7Release\HelloWorld.inf [Version] section with DriverVer=08/16/2018,19.26.43.470
1> Driver.c
1>Driver.c(6): error C2220: warning treated as error - no 'object' file generated
1>Driver.c(6): warning C4100: 'registryPath' : unreferenced formal parameter
1>Driver.c(6): warning C4100: 'driverObject' : unreferenced formal parameter
2>------ Rebuild All started: Project: HelloWorld Package, Configuration: Win7 Release Win32 ------
2>C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets(1366,5): error MSB3030: Could not copy the file "C:\Users\Me\Desktop\HelloWorld\Win7Release\HelloWorld.sys" because it was not found.
========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========
EDIT: I got it working. I did a new project (as I thought it could change something) and had the same error, later added the following lines:
UNREFERENCED_PARAMETER(driverObject);
UNREFERENCED_PARAMETER(registryPath);
but had a linker error. A moment later, I noticed that I forgot to change the source file's extension from ".cpp" to ".c", changed that, built and got it working.
Continue reading...