Here was the trick we discovered for UMDF:
-
Always do the needs/includes bit so that you get the right sections
from WINUSB.INF on Vista (specifically the CopyFiles directives). On XP
these won’t have any effect, which brings us to step 2
-
Always include the WinUSB co-installer. On Vista it won’t really do
anything (unfortunately … I was hoping they’d install the WinUSB
service on both platforms but no such luck). On XP it will install the
service entries which get installed on Vista through Needs/Includes
sections.
Also since you’re playing with this, you can try putting
Include=WINUSB.INF & Needs=WINUSB.NT.Services to your
DDInstall.NT.Services section instead of an AddService directive. The
device installer folks had a *theory* that this section would get parsed
after the WINUSB coinstaller had a chance to copy files onto the disk,
so WINUSB.INF would be in place at that point and the Include would be
able to bring the file in.
If not you’ll get an error because service is installed for the device
(probably saying the device isn’t configured properly).
Alternatively make sure you copy the contents of WINUSB.NT.Services &
WINUSB.AddService into your own INF.
Yes this is a mess. There are a lot of hoops we had to force everyone
through so that WINUSB could work with in-box Vista stuff, out-of-box
Vista stuff and out-of-box XP stuff.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel E. Germann
Sent: Friday, December 15, 2006 12:20 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Calling WinUSB from an application
Hi, Brian.
It’s nice to see someone else is giving it a try, too. I’m still
waiting
for hardware, so my INF is completely untested. I started with the .INX
file from the FX2 UMDF driver, and chopped out all the parts that looked
specific to the UMDF part of the driver. The main differences in mine
are:
- KmdfService entry for WinUSB (same as UMDF INX file; not sure if I
need
it or not):
[Dev_Install.NT.Wdf]
KmdfService=WINUSB,WinUsb_Install
[WinUSB_Install]
KmdfLibraryVersion=1.0
- Both WDF and WinUSB coinstallers (needs to work on XP systems; same
as
UMDF INX file; not sure if I need the WDF coinstaller or not):
[Dev_Install.NT.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles
[CoInstallers_AddReg]
HKR,CoInstallers32,0x00010000,“WdfCoInstaller01005.dll,WdfCoInstaller”,
“WinUSBCoInstaller.dll”
[CoInstallers_CopyFiles]
WdfCoInstaller01005.dll
WinUSBCoInstaller.dll
[DestinationDirs]
CoInstallers_CopyFiles=11
- Device interface GUID for WinUSB to register (so I can find my device
with SetupAPI):
[Dev_Install.NT.HW]
AddReg=Dev_AddReg
[Dev_AddReg]
HKR,DeviceInterfaceGUIDs,0x00010000,“{11111111-2222-3333-4444-555555555
555}”
- Service entry for WinUSB (might not be needed, per Doron’s post):
[Dev_Install.NT.Services]
AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
[WinUSB_ServiceInstall]
DisplayName = %WinUSB_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys
[Strings]
WinUSB_SvcDesc=“WinUSB Driver”
I did keep ClassGuid, DriverVer and CatalogFile. The ClassGuid
specifies
the device class your device will install under (which determines where
your
driver will show up in Device Manager (I used the USB GUID; same as UMDF
INX
file)). You’re right that DriverVer is kind of meaningless for an INF
like
this, but I think it’s required (as is CatalogFile) if you want to sign
the
driver package.
A related question: Can I use an I/O completion port with
WinUsb_ReadPipe?
The docs only talk about using an event in the OVERLAPPED structure, but
I’m
assuming it all goes through the standard I/O path with ReadFile at some
point, so it seems like that ought to work. I’m planning to do I/O like
the
UMDF FX2 driver’s .exe file did, by queuing a bunch of buffers and
looping
on GetQueuedCompletionStatus. When it’s time to finish, my app will
call
CancelIo on the device’s handle to cancel any pending WinUsb_ReadPipe
calls.
-Dan
wrote in message news:xxxxx@ntdev…
> Thanks a bunch Doron! That has reduced the size of my inf file
greatly.
> I’ve included your suggestions and made a few more edits, which are
the
> following:
>
> Under [Version], I got rid of ClassGuid, DriverVer, and CatalogFile
(as I
> don’t think I need them). I also got rid of the following
co-installer
> section:
>
> [USB_Install.CoInstallers]
> AddReg = WUDF_CoInstallers_AddReg
>
> Let me know if anyone sees a problem with the template inf file for a
> WinUSB-only install below (or if I actually need the items I deleted).
>
> Thanks,
> --Brian
>
> ;=================== Version section ====================
>
> [Version]
> Signature = “$Windows NT$”
> Provider = %MyProvider%
>
> ; =================== Manufacturer/Models sections ===================
>
> [Manufacturer]
> %MyProvider% = ,NTx86,NTia64,NTamd64
>
> [.NTx86]
> %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_xxxx&PID_xxxx
>
> [.NTia64]
> %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_xxxx&PID_xxxx
>
> [.NTamd64]
> %USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_xxxx&PID_xxxx
>
> ; =================== USB Install ===================
>
> [USB_Install]
> Include = winusb.inf
> Needs = WINUSB.NT
> AddProperty = DriverProperties
>
> [USB_Install.Services]
> Include = winusb.inf
> ;!!!AddService = WinUsb, 0x2, WINUSB.AddService
>
> ;
> ; =================== Strings ===================
> ;
>
> [Strings]
> Provider = “My Device Provider”
> MediaDescription = “My Device Installation Media”
> USB\MyDevice.DeviceDesc = “My Device Description”
>
> SERVICE_DEMAND_START = 0x3
> SERVICE_KERNEL_DRIVER = 0x1
> SERVICE_ERROR_NORMAL = 0x1
>
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer