Microsoft 提供了一个 NDIS 微型端口驱动程序,Rndismp.sys,该驱动程序实现远程 NDIS 消息集并与通用总线传输驱动程序通信,后者又与相应的总线驱动程序通信。 此 NDIS 微型端口驱动程序由 Microsoft 实现和维护,并作为所有受支持的 Windows 版本的一部分来分发。 可以在 %SystemRoot%\System32\drivers 目录中找到它。
若要将远程 NDIS 驱动程序与 USB 设备配合使用,IHV 必须根据以下模板之一提供 INF 文件:
适用于 NDIS 5.1 (Windows XP 及更高版本的 RNDIS INF 模板)
; Remote NDIS template device setup file
; Copyright (c) Microsoft Corporation
;
; 这是INF安装脚本的模板,用于USB主机驱动程序上的RNDIS。
; 此INF适用于Windows XP SP2、Windows XP x64、
; Windows Server 2003 SP1 x86、x64和ia64,以及
; Windows Vista x86和x64。
; 此INF将与Windows XP、Windows XP SP1、Windows 2003一起发布
[Version]
Signature = "$Windows NT$"
Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Microsoft%
DriverVer = 06/21/2006,6.0.6000.16384
;CatalogFile = device.cat
PnpLockdown = 1
[Manufacturer]
%Microsoft% = RndisDevices,NTx86,NTamd64,NTia64
;===================
; USB\VID_xxxx&PID_yyyy 对应USB设备的PID和VID
; Decoration for x86 architecture
[RndisDevices.NTx86]
%RndisDevice% = RNDIS.NT.5.1, USB\VID_xxxx&PID_yyyy
; Decoration for x64 architecture
[RndisDevices.NTamd64]
%RndisDevice% = RNDIS.NT.5.1, USB\VID_xxxx&PID_yyyy
; Decoration for ia64 architecture
[RndisDevices.NTia64]
%RndisDevice% = RNDIS.NT.5.1, USB\VID_xxxx&PID_yyyy
;===================
;@@@ This is the common setting for setup
[ControlFlags]
ExcludeFromSelect=*
; DDInstall section
; References the in-build Netrndis.inf
[RNDIS.NT.5.1]
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15
; NEVER REMOVE THE FOLLOWING REFERENCE FOR NETRNDIS.INF
include = netrndis.inf
needs = Usb_Rndis.ndi
AddReg = Rndis_AddReg_Vista
; DDInstal.Services section
[RNDIS.NT.5.1.Services]
include = netrndis.inf
needs = Usb_Rndis.ndi.Services
; Optional registry settings. You can modify as needed.
[RNDIS_AddReg_Vista]
HKR, NDI\params\VistaProperty, ParamDesc, 0, %Vista_Property%
HKR, NDI\params\VistaProperty, type, 0, "edit"
HKR, NDI\params\VistaProperty, LimitText, 0, "12"
HKR, NDI\params\VistaProperty, UpperCase, 0, "1"
HKR, NDI\params\VistaProperty, default, 0, " "
HKR, NDI\params\VistaProperty, optional, 0, "1"
; 没有系统复制文件-系统文件已在构建为操作系统的一部分。
; Modify these strings for your device as needed.
[Strings]
Microsoft = "Microsoft Corporation"
RndisDevice = "Remote NDIS based Device"
Vista_Property = "Optional Vista Property"
适用于 NDIS 6.0 (Windows 7 及更高版本的 RNDIS INF 模板)
; Remote NDIS template device setup file
; Copyright (c) Microsoft Corporation
;
; 这是通过USB的RNDIS的INF安装脚本的模板
; 利用较新的NDIS 6.x微型端口(rndismp6.sys)的主机驱动程序
; 提高了性能。此INF适用于Windows 7、Windows Server 2008 R2,
; 以及x86、amd64和ia64平台上的后续操作系统。
[Version]
Signature = "$Windows NT$"
Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Microsoft%
DriverVer = 07/21/2008,6.0.6000.16384
;CatalogFile = device.cat
PnpLockdown = 1
[Manufacturer]
%Microsoft% = RndisDevices,NTx86,NTamd64,NTia64
; Decoration for x86 architecture
[RndisDevices.NTx86]
%RndisDevice% = RNDIS.NT.6.0, USB\VID_xxxx&PID_yyyy
; Decoration for x64 architecture
[RndisDevices.NTamd64]
%RndisDevice% = RNDIS.NT.6.0, USB\VID_xxxx&PID_yyyy
; Decoration for ia64 architecture
[RndisDevices.NTia64]
%RndisDevice% = RNDIS.NT.6.0, USB\VID_xxxx&PID_yyyy
;@@@ This is the common setting for setup
[ControlFlags]
ExcludeFromSelect=*
; DDInstall section
; References the in-build Netrndis.inf
[RNDIS.NT.6.0]
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15
; NEVER REMOVE THE FOLLOWING REFERENCE FOR NETRNDIS.INF
include = netrndis.inf
needs = usbrndis6.ndi
AddReg = Rndis_AddReg
*IfType = 6 ; IF_TYPE_ETHERNET_CSMACD.
*MediaType = 16 ; NdisMediumNative802_11
*PhysicalMediaType = 14 ; NdisPhysicalMedium802_3
; DDInstal.Services section
[RNDIS.NT.6.0.Services]
include = netrndis.inf
needs = usbrndis6.ndi.Services
; Optional registry settings. You can modify as needed.
[RNDIS_AddReg]
HKR, NDI\params\RndisProperty, ParamDesc, 0, %Rndis_Property%
HKR, NDI\params\RndisProperty, type, 0, "edit"
HKR, NDI\params\RndisProperty, LimitText, 0, "12"
HKR, NDI\params\RndisProperty, UpperCase, 0, "1"
HKR, NDI\params\RndisProperty, default, 0, " "
HKR, NDI\params\RndisProperty, optional, 0, "1"
; No sys copyfiles - the sys files are already in-build
; (part of the operating system).
; Modify these strings for your device as needed.
[Strings]
Microsoft = "Microsoft Corporation"
RndisDevice = "Remote NDIS6 based Device"
Rndis_Property = "Optional RNDIS Property"
和其他的驱动不一样,RNDIS是INF和硬件直接匹配的,换言之,只要硬件符合协议,是不需要再额外编写驱动程序的,这对于设备厂商来说,免去了开发驱动的困难,只需要搭建好硬件之后,直接跑一下HLK就可以了,但是相对的,这种硬件对于协议的容忍度非常低,同时也增加了硬件设备的开发难度。