当前位置:   article > 正文

WDM驱动实操No.1_ven8086网卡驱动

ven8086网卡驱动

一、虚拟驱动如何绑定一个实际硬件安装该驱动?

1、实际硬件:网卡

网卡
硬件ID:PCI\VEN_8086&DEV_10D3
对应于虚拟驱动INF文件中的:
%wdk_s2_c13_test1_driver.DeviceDesc%=Root\wdk_s2_c13_test1_driver ; TODO: edit hw-id
修改:只要将Root\wdk_s2_c13_test1_driver 变更为 PCI\VEN_8086&DEV_10D3即可
%wdk_s2_c13_test1_driver.DeviceDesc%=wdk_s2_c13_test1_driver_Device, PCI\VEN_8086&DEV_10D3
;Root\wdk_s2_c13_test1_driver ; TODO: edit hw-id
拓展:也就是改变驱动中对应的硬件ID就可以绑定对应的实际硬件;在项目中,一个驱动可能需要适配不用的设备,就是通过设备的硬件ID进行识别区分的。

2、安装驱动

2.1 log

00000020	8.29713917	Enter HelloWDMPnp	
00000021	8.29730415	PNP Request (IRP_MN_QUERY_DEVICE_RELATIONS)	
00000022	8.29730892	Enter DefaultPnpHandler	
00000023	8.29731083	Leave DefaultPnpHandler	
00000024	8.29731369	Leave HelloWDMPnp	
00000025	8.31659031	Enter HelloWDMPnp	
00000026	8.31659794	PNP Request (IRP_MN_QUERY_REMOVE_DEVICE)	
00000027	8.31660080	Enter DefaultPnpHandler	
00000028	8.31660366	Leave DefaultPnpHandler	
00000029	8.31660557	Leave HelloWDMPnp	
00000030	8.34850597	Enter HelloWDMPnp	
00000031	8.34851360	PNP Request (IRP_MN_REMOVE_DEVICE)	
00000032	8.34851646	Enter HandleRemoveDevice	
00000033	8.34851837	Enter DefaultPnpHandler	
00000034	8.34851933	Leave DefaultPnpHandler	
00000035	8.34856892	Leave HandleRemoveDevice	
00000036	8.34857082	Leave HelloWDMPnp	
00000037	8.34865093	Enter HelloWDMUnload	
00000038	8.34865284	Leave HelloWDMUnload	
00000039	8.52089310	Enter DriverEntry	
00000040	8.52089691	Leave DriverEntry	
00000041	8.52099895	Enter HelloWDMAddDevice	
00000042	8.52149391	\??\ROOT#UNKNOWN#0002#{0e57c50f-0ccc-4ad2-a895-93c5ed221301}	
00000043	8.52150917	Leave HelloWDMAddDevice	
00000044	8.52157593	Enter HelloWDMPnp	
00000045	8.52157879	Enter DefaultPnpHandler	
00000046	8.52158070	Leave DefaultPnpHandler	
00000047	8.52165890	Enter HelloWDMPnp	
00000048	8.52166271	PNP Request (IRP_MN_FILTER_RESOURCE_REQUIREMENTS)	
00000049	8.52166462	Enter DefaultPnpHandler	
00000050	8.52166557	Leave DefaultPnpHandler	
00000051	8.52166843	Leave HelloWDMPnp	
00000052	8.52198410	Enter HelloWDMPnp	
00000053	8.52198792	PNP Request (IRP_MN_START_DEVICE)	
00000054	8.52199078	Enter HandleStartDevice	
00000055	8.52199268	Enter DefaultPnpHandler	
00000056	8.52199554	Leave DefaultPnpHandler	
00000057	8.52200031	Leave HandleStartDevice	
00000058	8.52200127	Leave HelloWDMPnp	
00000059	8.52213955	Enter HelloWDMPnp	
00000060	8.52214336	PNP Request (IRP_MN_QUERY_CAPABILITIES)	
00000061	8.52214527	Enter DefaultPnpHandler	
00000062	8.52214718	Leave DefaultPnpHandler	
00000063	8.52216434	Leave HelloWDMPnp	
00000064	8.52219105	Enter HelloWDMPnp	
00000065	8.52219391	PNP Request (IRP_MN_QUERY_PNP_DEVICE_STATE)	
00000066	8.52219486	Enter DefaultPnpHandler	
00000067	8.52219677	Leave DefaultPnpHandler	
00000068	8.52219868	Leave HelloWDMPnp	
00000069	8.52226353	Enter HelloWDMPnp	
00000070	8.52226734	PNP Request (IRP_MN_QUERY_DEVICE_RELATIONS)	
00000071	8.52226925	Enter DefaultPnpHandler	
00000072	8.52227020	Leave DefaultPnpHandler	
00000073	8.52227306	Leave HelloWDMPnp	
00000074	8.57192612	Enter HelloWDMAddDevice	
00000075	8.57197285	\??\ROOT#UNKNOWN#0001#{0e57c50f-0ccc-4ad2-a895-93c5ed221301}	
00000076	8.57197952	Leave HelloWDMAddDevice	
00000077	8.57201672	Enter HelloWDMPnp	
00000078	8.57201862	Enter DefaultPnpHandler	
00000079	8.57201958	Leave DefaultPnpHandler	
00000080	8.57206440	Enter HelloWDMPnp	
00000081	8.57206535	PNP Request (IRP_MN_FILTER_RESOURCE_REQUIREMENTS)	
00000082	8.57206726	Enter DefaultPnpHandler	
00000083	8.57206821	Leave DefaultPnpHandler	
00000084	8.57206917	Leave HelloWDMPnp	
00000085	8.57210255	Enter HelloWDMPnp	
00000086	8.57210827	PNP Request (IRP_MN_START_DEVICE)	
00000087	8.57210922	Enter HandleStartDevice	
00000088	8.57211018	Enter DefaultPnpHandler	
00000089	8.57211113	Leave DefaultPnpHandler	
00000090	8.57211399	Leave HandleStartDevice	
00000091	8.57211494	Leave HelloWDMPnp	
00000092	8.57217312	Enter HelloWDMPnp	
00000093	8.57217407	PNP Request (IRP_MN_QUERY_CAPABILITIES)	
00000094	8.57217503	Enter DefaultPnpHandler	
00000095	8.57217598	Leave DefaultPnpHandler	
00000096	8.57218552	Leave HelloWDMPnp	
00000097	8.57219982	Enter HelloWDMPnp	
00000098	8.57220173	PNP Request (IRP_MN_QUERY_PNP_DEVICE_STATE)	
00000099	8.57220364	Enter DefaultPnpHandler	
00000100	8.57220364	Leave DefaultPnpHandler	
00000101	8.57220459	Leave HelloWDMPnp	
00000102	8.57225800	Enter HelloWDMPnp	
00000103	8.57225895	PNP Request (IRP_MN_QUERY_DEVICE_RELATIONS)	
00000104	8.57225990	Enter DefaultPnpHandler	
00000105	8.57226181	Leave DefaultPnpHandler	
00000106	8.57226276	Leave HelloWDMPnp	
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87

为具体网卡安装的驱动
然后将网卡驱动更新之后:
在这里插入图片描述
就会将设备与微软的驱动绑定;

2.2 理解启动设备和禁用设备

因为是即插即用,我们首先得将驱动和设备区分开;驱动是一种程序,躺在内存中。当有一个设备插入(也相当于我们启用一个设备),那么就会去找驱动程序,找到后,驱动就开始为设备服务了。也就是,一个驱动可以为很多不同时段插入的设备服务,也就是加载驱动。加载驱动中就有创建设备,其实就是为实际的硬件创建一个软件的形式,使得能与设备进行交互,所以启用设备都会创建一个设备对象。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/246878
推荐阅读
相关标签
  

闽ICP备14008679号