Hi all,
I am beginning to study the kernel driver but having an issue of debugging.
I am not sure my driver is getting run or not.
The WinDBG says that the driver is loaded but there is no debug message in the DriverEntry is print out.
The driver is built with WPP tracing option set to 'No'.
-
Here is result in WinDBG.
ModLoad: fffff805
88d90000 fffff80588d97000 HelloWorldDriver.sys
-
I install the driver by using below command.
devcon install HelloWorldDriver.sys Root\HelloWorldDriver
. -
The source code of DriverEntry:
NTSTATUS
DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPath
)
{
// NTSTATUS variable to record success or failure
NTSTATUS status = STATUS_SUCCESS;
// Allocate the driver configuration object
WDF_DRIVER_CONFIG config;
// Print "Hello World" for DriverEntry
KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "KmdfHelloWorld: DriverEntry\n"));
// Initialize the driver configuration object to register the
// entry point for the EvtDeviceAdd callback, KmdfHelloWorldEvtDeviceAdd
WDF_DRIVER_CONFIG_INIT(&config,
KmdfHelloWorldEvtDeviceAdd
);
// Finally, create the driver object
status = WdfDriverCreate(DriverObject,
RegistryPath,
WDF_NO_OBJECT_ATTRIBUTES,
&config,
WDF_NO_HANDLE
);
return status;
}
I am expecting that the message 'KmdfHelloWorld: DriverEntry' should be displayed on WinDBG.
Any idea will be appreciated.