Usb driver installation

Hi all,

I am facing a strange condition while attempting to pre-install on Win2K my
new usb driver with fastinst.exe.
At the end of the installation process my driver is unexpectely loaded and
started.
StartDevice procedure of course fails with code 0xC0000010 when requesting
USB_DEVICE_SESCRIPTOR_TYPE
I presume because there is no real device attached.
As result I have in device manager an instance of my device with a great
yellow !
When I manually uninstall this instance everything works fine, driver is
loaded as soon any device is attached.
The problem seems to be related to UpdateDriverForPlugAndPlayDevices(), I
have the error
with both fastinst.exe and a custom setup program which uses
UpdateDriverForPlugAndPlayDevices().
Using SetupCopyOEMInf() everything works fine, but I would like to
understand why I am loaded without any
real device attached.

Any suggestion will be very appreciated
in the meanwhile an merry Christmas and happy new year to everybody in the
list,

PaoloC

Hereafter the INF file I am using:

[Version]
Signature="$CHICAGO$"
Class=UsbPrintGrabber
ClassGuid={E6496114-C970-499d-9730-CD0BC051D3D8}
provider=%MSFT%
DriverVer=14/Dec/2003,1.00.00.0005
LayoutFile=layout.inf

[SourceDisksNames]
1="UsbPrintGrab Installation Disk",,,

[SourceDisksFiles]
UpgLoad.sys = 1
UpgFirmware.hex = 1

[Manufacturer]
%MfgName%=DeviceList

[DeviceList]
;
; The following PIDs are for all of the devices in the EZ-USB family.
; These are the hardcoded PIDs that will be reported by an EZ-USB
; device with no external EEPROM. Bound to the general purpose driver.
;
%USB\VID_0547&PID_2131.DeviceDesc%=UPG.Load, USB\VID_0547&PID_2131

;---------------------------------------------------------------------------

; UPG CLASS Sections
;---------------------------------------------------------------------------

[ClassInstall32]
AddReg=UpgClassAddreg

[UpgClassAddreg]
HKR,,,,%UpgClassName%
HKR,,Icon,,"-23"

;[PreCopySection]
;HKR,,NoSetupUI,,1

[DestinationDirs]
UPG.Files.Sys = 10,System32\Drivers

;---------------------------------------------------------------------------

; UPG LOADER
;---------------------------------------------------------------------------

[UPG.Load]
CopyFiles=UPG.Files.Sys
AddReg=UPG.Load.AddReg

[UPG.Load.NT]
CopyFiles=UPG.Files.Sys
AddReg=UPG.Load.AddReg

[UPG.Load.NT.Services]
AddService = UpgLoad, 0x00000002, UPG.Load.AddService

[UPG.Load.AddService]
DisplayName = %UPG.Load.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\System32\Drivers\UpgLoad.sys

[UPG.Load.AddReg]
;HKR,,DevLoader,,*ntkern
;HKR,,NTMPDriver,,UpgLoad.sys
HKLM,"System\Currentcontrolset\Services\UpgLoad\Parameters","TriggerVid",0x1
0001,0x0547
HKLM,"System\Currentcontrolset\Services\UpgLoad\Parameters","TriggerPid",0x1
0001,0x2131
HKLM,"System\Currentcontrolset\Services\UpgLoad\Parameters","LoadFirmware",0
x10001,0x00
HKLM,"System\Currentcontrolset\Services\UpgLoad\Parameters","LoadDelaySec",0
x10001,5
HKLM,"System\Currentcontrolset\Services\UpgLoad\Parameters","Firmware",0x00,
"UpgFirmware.hex"

;destination-file-name[,source-file-name][,temporary-file-name][,flag]
[UPG.Files.Sys]
UpgLoad.sys
UpgFirmware.hex

;---------------------------------------------------------------------------

; UPG string
;---------------------------------------------------------------------------

[Strings]
MSFT="Omnilab srl"
MfgName="Omnilab"
USB\VID_0547&PID_2131.DeviceDesc="UPG loader 2131xx no f/w"
UPG.Load.SvcDesc="Usb Print Grabber f/w loader"
UpgClassName="Usb Printer Grabber"

PaoloC wrote:

I am facing a strange condition while attempting to pre-install on Win2K my
new usb driver with fastinst.exe.

FASTINST creates a root-enumerated device node, which is where the
yellow-bang instance comes from. You have the source code, so you can
make your own version of the utility that will just identify the device
ID by parsing the INF and then call UpdateDriversEtc.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com

I am still a bit confused.
You suggest to:

A) SetupDiCallClassInstaller(DIF_REGISTERDEVICE) +
UpdateDriverForPlugAndPlayDevices + SetupDiCallClassInstaller(DIF_REMOVE)

OR

B) Just invoke: UpdateDriverForPlugAndPlayDevices

Thanks a lot Walter,
PaoloC

----- Original Message -----
From: “Walter Oney”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Sunday, December 21, 2003 6:27 PM
Subject: [ntdev] Re: Usb driver installation

> PaoloC wrote:
> > I am facing a strange condition while attempting to pre-install on Win2K
my
> > new usb driver with fastinst.exe.
>
> FASTINST creates a root-enumerated device node, which is where the
> yellow-bang instance comes from. You have the source code, so you can
> make your own version of the utility that will just identify the device
> ID by parsing the INF and then call UpdateDriversEtc.
>
> –
> Walter Oney, Consulting and Training
> Basic and Advanced Driver Programming Seminars
> Check out our schedule at http://www.oneysoft.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@tin.it
> To unsubscribe send a blank email to xxxxx@lists.osr.com

PaoloC wrote:

You suggest to:

A) SetupDiCallClassInstaller(DIF_REGISTERDEVICE) +
UpdateDriverForPlugAndPlayDevices + SetupDiCallClassInstaller(DIF_REMOVE)

OR

B) Just invoke: UpdateDriverForPlugAndPlayDevices

Just B.

Look, FASTINST does three things: (1) parse the INF file to select a
device identifier, (2) create a root enumerated device with that
identifier, and (3) UpdateDriverEtc. You want (1) and (3), but not (2).

All FASTINST does that DEVCON doesn’t is to select a device id by
default. I designed it that way because most INF files used to test
legacy drivers have just one device id.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com