-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathUsbNcmFnSample.inf
114 lines (94 loc) · 8.79 KB
/
UsbNcmFnSample.inf
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
;
; UsbNcmFn.inf
;
[Version]
Signature="$WINDOWS NT$"
Class=Net
ClassGUID={4d36e972-e325-11ce-bfc1-08002be10318}
Provider=%Sample%
CatalogFile=UsbNcmFnSample.cat
DriverVer=; will be filled in at build time by StampInf
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
UsbNcmFnSample.sys = 1,,
;*****************************************
; Install Section
;*****************************************
[Manufacturer]
%Sample%=Standard,NT$ARCH$
[Standard.NT$ARCH$]
%UsbNcmFn.DeviceDesc%=UsbNcmFn_Device, USBFN\UsbNcm
[UsbNcmFn_Device.NT]
AddReg=UsbNcmFn_AddReg
CopyFiles=Drivers_Dir
BusType=15 ; PNPBus
Characteristics=0x84 ; NCF_PHYSICAL
*IfType=6 ; IF_TYPE_ETHERNET_CSMACD
*MediaType=0 ; NdisMedium802_3
*PhysicalMediaType=0 ; NdisPhysicalMediumUnspecified
*IfConnectorPresent = 1 ; true
*ConnectionType = 1 ; NET_IF_CONNECTION_DEDICATED
*DirectionType = 0 ; NET_IF_DIRECTION_SENDRECEIVE
*AccessType = 2 ; NET_IF_ACCESS_BROADCAST
*HardwareLoopback = 0 ; false
[Drivers_Dir]
UsbNcmFnSample.sys
[UsbNcmFn_AddReg]
;HKR,,FriendlyName,,%UsbNcmFn.DeviceDesc%
HKR, Ndi, Service, 0, "UsbNcmFn"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, Ndi\params\NetworkAddress, ParamDesc, 0, %NetworkAddress.Title%
HKR, Ndi\params\NetworkAddress, Type, 0, "edit"
HKR, Ndi\params\NetworkAddress, LimitText, 0, "12"
HKR, Ndi\params\NetworkAddress, UpperCase, 0, "1"
HKR, Ndi\params\NetworkAddress, Optional, 0, "1"
;UsbNcm Interface Descriptor
HKLM, "System\CurrentControlSet\Control\USBFN\Associations\UsbNcm", InterfaceList, %REG_MULTI_SZ%, "UsbNcmComm", "UsbNcmData"
HKLM, "System\CurrentControlSet\Control\USBFN\Associations\UsbNcm", bFunctionClass, %REG_DWORD%, 0x00000002
HKLM, "System\CurrentControlSet\Control\USBFN\Associations\UsbNcm", bFunctionSubclass, %REG_DWORD%, 0x0000000D
HKLM, "System\CurrentControlSet\Control\USBFN\Associations\UsbNcm", bFunctionProtocol, %REG_DWORD%, 0x00000000
;Control InterfaceDescriptor
;NCM Comm Interface: endpoints=1, class=02, subclass=0D, protocol=00
;CDC Header Descriptor: bcdCDC == 1.20
;NCM Union Descriptor: comm i/f 3, data i/f 4
;ECM Functional Descriptor: bmEthernetStatistics=00000000, wMaxSegmentSize=0x2336 (9014 decimal),
; wNumberMCFilters=0000, bNumberPowerFilters=00
;NCM Functional Descriptor: bcdNcmVersion=1.00, bmNetworkCapabilities=00
;Endpoint: 81 interrupt in
HKLM, "System\CurrentControlSet\Control\USBFN\Interfaces\UsbNcmComm", InterfaceDescriptor, %REG_BINARY%, 09,04,00,00,01,02,0D,00,00,05,24,00,20,01,05,24,06,03,04,0D,24,0F,10,00,00,00,00,36,23,00,00,00,06,24,1A,00,01,00,07,05,81,03,40,00,02
;Data InterfaceDescriptor
;NCM Data Alt 0 Interface: altsetting=0, endpoints=0, class=0A, subclass=00, protocol=01
;NCM Data Alt 1 Interface: altsetting=1, endpoints=2, class=0A, subclass=00, protocol=01
HKLM, "System\CurrentControlSet\Control\USBFN\Alternates\UsbNcmData", InterfaceList, %REG_MULTI_SZ%, "UsbNcmData0", "UsbNcmData1"
HKLM, "System\CurrentControlSet\Control\USBFN\Interfaces\UsbNcmData0", InterfaceDescriptor, %REG_BINARY%, 09,04,00,00,00,0A,00,01,00
HKLM, "System\CurrentControlSet\Control\USBFN\Interfaces\UsbNcmData1", InterfaceDescriptor, %REG_BINARY%, 09,04,00,01,02,0A,00,01,00,07,05,82,02,00,02,00,07,05,03,02,00,02,00
;-------------- Service installation
[UsbNcmFn_Device.NT.Services]
AddService = UsbNcmFn,%SPSVCINST_ASSOCSERVICE%, UsbNcmFn_Service_Inst
; -------------- UsbNcm driver install sections
[UsbNcmFn_Service_Inst]
DisplayName = %UsbNcmFn.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\UsbNcmFnSample.sys
[DestinationDirs]
DefaultDestDir = 12
[UsbNcmFn_Device.NT.Wdf]
KmdfService = UsbNcmFn, UsbNcmFn_wdfsect
[UsbNcmFn_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$
[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
Sample="NetAdpaterNcmSample"
ClassName="Universal Serial Bus devices"
DiskName = "UsbNcm Function Installation Disk"
UsbNcmFn.DeviceDesc = "UsbNcm Function Device"
UsbNcmFn.SVCDESC = "UsbNcm Function Service"
REG_SZ = 0x00000000
REG_MULTI_SZ = 0x00010000
REG_BINARY = 0x00000001
REG_DWORD = 0x00010001
NetworkAddress.Title="Network Address"