我在Visual Studio 2013中创建了驱动程序。 这个构建过程成功了。
然后,我们准备了traget-computer并复制了驱动程序文件。
然后我安装了驱动程序:
c :windowssystem32 PNP util-a ' e :driver zeugkmdfhelloworldpackagekmdfhelloworld.INF '
微软- PNP-dienst程序
vrarbeitungsinf. kmdfhelloworld.INF
dastreiberpaketwurdeerfolgreichinzugefgt。
verffentlichtername : OEM 42.INF
Versuche gesamt: 1
anzahlerfolgreicherimporte :1
好像很成功。
我在PC上运行DebugView,但现在不知道如何启动驱动程序以查看调试输出。 源代码中包含dbgprintex((-statement )。
有人会教你如何启动这个驱动程序,以便你能看到输出。
这是驱动程序的源代码:
#包含
#包含
驱动程序_初始化驱动程序条目;
evt _ wdf _ driver _ device _ addkmdfhelloworldevtdeviceadd;
ntstatus驱动程序条目(in _ pdriver _ objectdriverobject,_ in _ p unicode _ stringregistrypath ) )。
{
NTSTATUS status;
WDF_DRIVER_CONFIG config;
dgprintex (DP fltr _ ihv驱动程序_ id,DPFLTR_INFO_LEVEL,' kmdfhelloworld 3360驱动程序条目 n ' );
kprintex () DPfltr_ihvdriver_id,DPFLTR_INFO_LEVEL,' kmdfhelloworld 3360 driver entryn ' );
wdf_driver_config_init(config,KmdfHelloWorldEvtDeviceAdd;
satus=wdfdrivercreate (驱动程序对象,注册路径,WDF_NO_OBJECT_ATTRIBUTES,config,WDF_NO_HANDLE );
返回状态;
}
ntstatuskmdfhelloworldevtdeviceadd (in _ wdfdriverdriver,_ inout _ pwdfdevice _ initdeviceinit )。
{
NTSTATUS status;
wdf设备h设备;
统一参数(驱动程序;
kprintex () DPfltr_ihvdriver_id,DPFLTR_INFO_LEVEL,' kmdfhelloworld 3360 kmdfhelloworldevtdeviceaddn ' ) )
status=wdfdevicecreate (设备初始化,WDF_NO_OBJECT_ATTRIBUTES,h设备);
返回状态;
}