I wrote a driver in Visual Studio 2013. The creation process was successful. Then I prepared the trag computer and copied the driver files to it. Then I installed the driver:
C:\Windows\system32>pnputil -a "E:\driverZeug\KmdfHelloWorldPackage\KmdfHelloWorld.inf" Microsoft-PnP-Dienstprogramm Verarbeitungsinf.: KmdfHelloWorld.inf Das Treiberpaket wurde erfolgreich hinzugefΓΌgt. VerΓΆffentlichter Name: oem42.inf Versuche gesamt: 1 Anzahl erfolgreicher Importe: 1
It seems to have been successful. I launched DebugView on a PC, but now I do not know how to start the driver so that I can see the debug output. I have DbgPrintEx () - Statement in my source code.
Can someone tell me how to run this driver so that I can see the result.
This is the driver source code:
#include <ntddk.h> #include <wdf.h> DRIVER_INITIALIZE DriverEntry; EVT_WDF_DRIVER_DEVICE_ADD KmdfHelloWorldEvtDeviceAdd; NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath) { NTSTATUS status; WDF_DRIVER_CONFIG config; DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "KmdfHelloWorld: DriverEntry\n"); KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "KmdfHelloWorld: DriverEntry\n")); WDF_DRIVER_CONFIG_INIT(&config, KmdfHelloWorldEvtDeviceAdd); status = WdfDriverCreate(DriverObject, RegistryPath, WDF_NO_OBJECT_ATTRIBUTES, &config, WDF_NO_HANDLE); return status; } NTSTATUS KmdfHelloWorldEvtDeviceAdd(_In_ WDFDRIVER Driver, _Inout_ PWDFDEVICE_INIT DeviceInit) { NTSTATUS status; WDFDEVICE hDevice; UNREFERENCED_PARAMETER(Driver); KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "KmdfHelloWorld: KmdfHelloWorldEvtDeviceAdd\n")); status = WdfDeviceCreate(&DeviceInit, WDF_NO_OBJECT_ATTRIBUTES, &hDevice); return status; }
source share