We have filter driver framework which is working fine while using it on hardware. We want to create the unit testing for our filter driver using the application programming. So as a first step we are calling the DriverEntry function from our application program and following is the configuration we used while compiling the source code.
Driver code configurations are:
- Platform Toolset : WindowsKernelModeDriver10.0
- Windows SDK is latest version from MSDN.(22000)
- Calling convention: __stdcall(/Gz)
- Compile As: Compile as C++ Module Code (/interface )
Application code configurations are:
5. Windows SDK version: 10.0 (latest installed version)
6. Platform Toolset: Visual Studio 2019 (v142)
7. Calling convension: __cdecl (/Gd)
8. Compile as : Compile as C++ Module Code (/interface )
Error detail:
unresolved external symbol "long __cdecl DriverEntry(struct _DRIVER_OBJECT *,struct _UNICODE_STRING *)" (?DriverEntry@@YAJPAU_DRIVER_OBJECT@@Pau _UNICODE_STRING@@@Z) referenced in function "void __cdecl DriverEntry(void)" (?DriverEntry@@YAXXZ)
Sample Code:
Application_code.cpp
include "driver.h"
NTSTATUS DriverEntry(In PDRIVER_OBJECT DriverObject, In PUNICODE_STRING RegistryPath);
void DriverEntry()
{
DriverEntry(&g_DriverObject, ®istryPath);
}
Driver code
driver.h
NTSTATUS DriverEntry(In PDRIVER_OBJECT DriverObject, In PUNICODE_STRING RegistryPath);
driver.c
include "driver.h"
NTSTATUS DriverEntry(In PDRIVER_OBJECT DriverObject, In PUNICODE_STRING RegistryPath)
{
// Print message
DoTrace(TRACE_LEVEL_VERBOSE, TFLAG_ENTRYEXIT, "%!FUNC! Entry");
}
Could some one help on this issue, anything missing?
Regards,
Vinoth P B