INF Driver Versioning

I have a WDF driver and I’m trying to improve the INF file.
Particularly, I’d like for the version number to be displayed in the
Device Manager’s driver information. In my INF file I have the following:

[Version]
DriverVer=05/15/2009,1.1.0

I noticed in Device Manager, the driver version is 6.0.6001.18000, which
is the version system for WDK I believe. No further version info is
provided in the DDInstall section or any of the other sections.

Is the WDF coinstaller overriding my version information, or is there
another field I have to define in my INF file?

Have you specified the driver version in .rc file of you driver ?

2009/5/15 Bryan R

> I have a WDF driver and I’m trying to improve the INF file.
> Particularly, I’d like for the version number to be displayed in the
> Device Manager’s driver information. In my INF file I have the following:
>
> [Version]
> DriverVer=05/15/2009,1.1.0
>
> I noticed in Device Manager, the driver version is 6.0.6001.18000, which
> is the version system for WDK I believe. No further version info is
> provided in the DDInstall section or any of the other sections.
>
> Is the WDF coinstaller overriding my version information, or is there
> another field I have to define in my INF file?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


…Swapnil

|| Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
|| Hare Rama Hare Rama Rama Rama Hare Hare ||

Thanks for the pointer, I will try to find out more about RC files.
In fact, at this time, this driver doesn’t have an RC file. You don’t
happen to know of a good resource for learning more about the RC files
and versioning, do you? I looked at the PciDrv sample and its RC file,
and I tried to make the same changes to my driver’s RC file, but Device
Manager still reports the WDK version.

> You don’t happen to know of a good resource for learning more about

the RC files and versioning, do you?

http://msdn.microsoft.com/en-us/library/aa380599(VS.85).aspx

(MSDN > MSDN Library > Win32 and COM Development > User Interface >
resource Compiler > About Resource Files)

http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx

(MSDN > MSDN Library > Win32 and COM Development > User Interface >
resource Compiler > About Resource Files -> Resource-Definition
Statements > VERSIONINFO Resource)

2009/5/15 Bryan R :
> Thanks for the pointer, I will try to find out more about RC files.
> In fact, at this time, this driver doesn’t have an RC file. ?You don’t
> happen to know of a good resource for learning more about the RC files
> and versioning, do you? ?I looked at the PciDrv sample and its RC file,
> and I tried to make the same changes to my driver’s RC file, but Device
> Manager still reports the WDK version.

Hello Bryan,

Have you checked the version number of the driver binary?
I’m interested to know what’s the version of your driver binary, if
you check its file properties from Windows Explorer.

I ran into the senario where I need to research what is the best
versioning scheme and method for a driver, though I was working with a
WDM driver. I’m in the process to port it to use WDF framework, and
have yet to check the versioning scheme when a WDF coinstallers are
involved. I’ll be interested to know what’s the outcome of your
findings.

Best regards,


WH Tan

“swapnil kamble” wrote in message
news:xxxxx@ntdev…
> Have you specified the driver version in .rc file of you driver ?

Normally the driver version is defined in the INF.
This is because a driver may consist of several sys, dll and other files,
and
there may not be a single PE file to pick the version from.
AFAIK all this .rc stuff is optional (unless needed for something
functional, like event log message resources, MOFs etc.)

— pa

> 2009/5/15 Bryan R
>
>> I have a WDF driver and I’m trying to improve the INF file.
>> Particularly, I’d like for the version number to be displayed in the
>> Device Manager’s driver information. In my INF file I have the
>> following:
>>
>> [Version]
>> DriverVer=05/15/2009,1.1.0
>>
>> I noticed in Device Manager, the driver version is 6.0.6001.18000, which
>> is the version system for WDK I believe. No further version info is
>> provided in the DDInstall section or any of the other sections.
>>
>> Is the WDF coinstaller overriding my version information, or is there
>> another field I have to define in my INF file?
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>
>
> –
> …Swapnil
>
> || Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
> || Hare Rama Hare Rama Rama Rama Hare Hare ||
>

Hi,

Did you try running chkinf? If I recall, chkinf is picky about the format and may help. Perhaps it requires the format to be major.minor.build.qfe and if you leave one off it doesn’t take it?

AFAIK, RC file is necessary for NDIS miniport driver. Without that
driver cannot pass WHQL test.

Thanks
Wayne

Pavel A. wrote:

“swapnil kamble” wrote in message
> news:xxxxx@ntdev…
>> Have you specified the driver version in .rc file of you driver ?
>
> Normally the driver version is defined in the INF.
> This is because a driver may consist of several sys, dll and other
> files, and
> there may not be a single PE file to pick the version from.
> AFAIK all this .rc stuff is optional (unless needed for something
> functional, like event log message resources, MOFs etc.)
>
> — pa
>
>> 2009/5/15 Bryan R
>>
>>> I have a WDF driver and I’m trying to improve the INF file.
>>> Particularly, I’d like for the version number to be displayed in the
>>> Device Manager’s driver information. In my INF file I have the
>>> following:
>>>
>>> [Version]
>>> DriverVer=05/15/2009,1.1.0
>>>
>>> I noticed in Device Manager, the driver version is 6.0.6001.18000, which
>>> is the version system for WDK I believe. No further version info is
>>> provided in the DDInstall section or any of the other sections.
>>>
>>> Is the WDF coinstaller overriding my version information, or is there
>>> another field I have to define in my INF file?
>>>
>>> —
>>> NTDEV is sponsored by OSR
>>>
>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>> http://www.osr.com/seminars
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>
>>
>>
>> –
>> …Swapnil
>>
>> || Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
>> || Hare Rama Hare Rama Rama Rama Hare Hare ||
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Yes, I did run ChkInf and the only warnings relate to an unknown devie
class, but I am defining a new one, and also WDF related parts that
ChkInf doesn’t check.

Also, according to the WDK documentation, the “DriverVer” format is
mm/dd/yyyy[,w.x.y.z], and I believe x, y, and z are optional. I tried
changing the version from 1.1.0 to 1.1.0.0, but still I ended up with
the WDK version in Device Manager.

Thank you! I"ll look into those and see if I can get the versioning
resolved. I was looking all over the WDK docs and couldn’t find anything.

> Have you checked the version number of the driver binary?

I’m interested to know what’s the version of your driver binary, if
you check its file properties from Windows Explorer.

The version reported at the top of the tab is 1.0.0.0. Looking more
closely at the fields, I get the following:

File Version: “1.00.00.0000 built by: WinDDK”
Product Version: “1.00.00.0000”

However the INF is specifying 1.1.0.0, so now I am a bit confused as to
where all of the numbers are coming from. Device Manager gives 6.x.x.x
which is my WDK version, and now Explorer reports 1.0.0.0. Very
interesting, I’m going to have to research the version system with the
RC files in more depth.

2009/5/18 Bryan R wrote:

The version reported at the top of the tab is 1.0.0.0. ?Looking more
closely at the fields, I get the following:

File Version: “1.00.00.0000 built by: WinDDK”
Product Version: “1.00.00.0000”

However the INF is specifying 1.1.0.0, so now I am a bit confused as to
where all of the numbers are coming from. ?Device Manager gives 6.x.x.x
which is my WDK version, and now Explorer reports 1.0.0.0. ?Very
interesting, I’m going to have to research the version system with the
RC files in more depth.

Hello Bryan,

I run some test myself. But my results are very different from what
other (myself included) have suggested in this thread. It appears
that the device manager will always report whatever the version number
specified in my INF file, regardless of the actual driver binary
version number.

My testing is done with the following set-up:

OS: Windows XP SP3
Hardware: OSR USB FX2 Learning Kit

I’m using the KMDF sample from WDK 6001.18002. I modify the generated
INF file manually, as the sample will use StampInf to stamp the
co-installer version instead on the driver version.

Bryan, are you sure that you’re using the correct INF file? I usually
will clean up any previous backup version of INF file with the file
name oem?.inf in my C:\windows\inf folder (might be different if
you’re uisng Vista or other version of Windows than mine), where ?
represent 2-digit decimal number.

Best regards,


WH Tan

This is what I remember from my WinXP and Vista USB install tests:

The “Driver” entry in Device Manager will not be updated - nor will the
device name as displayed in device manager - if you don’t remove a
device class completely from the Windows installation (*) but just
update the driver (using a newer INF file).

The version number of the driver binary can be inspected via
“Driver”->“Details”, this actually looks into the VERSIONINFO resource
of the SYS file (which by default will be set to the WDK version if you
don’t change the templates).

The version from the INF file therefore gets not displayed after the
initial (first) installation on your system.

(*)which AFAIK only from Vista you can do with a standard dialog
(checkbox “delete driver from drive” or something), otherwise you have
to do it manually

[Note: my Windows installation is not in English, so prompt names in
English are translated or from memory.]

2009/5/19 Hagen Patzke wrote>:

(*)which AFAIK only from Vista you can do with a standard dialog
(checkbox “delete driver from drive” or something), otherwise you have
to do it manually

Hello Hagen,

I forgot to mention in my previous message that I actually did
something manually - right-clicked on the device in device manager
device list and chose uninstall. I’m not sure what happens behind the
scene after that, but probably what happens is what you referred as
remove-device-class?

I make such guess because if I make sure that after uninstall the
device from device manger and my c:\windows\inf is clean from any old
version of INF file, I almost certain that I can tinker around with
device name, version number etc. Though I have never tried changing
the device class. I’ll try that when I have the chance.

Best regards,


WH Tan

> -----Original Message-----

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Hagen Patzke
Sent: Tuesday, May 19, 2009 9:30 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] INF Driver Versioning

This is what I remember from my WinXP and Vista USB install tests:

The “Driver” entry in Device Manager will not be updated -
nor will the
device name as displayed in device manager - if you don’t remove a
device class completely from the Windows installation (*) but just
update the driver (using a newer INF file).

Sorry, that’s not right. This entry is updated after successful driver
update. Nothing needs to be removed. You’re right it may not be the same
version as the current binary (which can be changed) but it is the
version from INF from the last driver installed correct way via DM or
Setup API. I just have a pleasure to work with this API from the hell
and this part seems to work correctly (at least at XP SP3 and Win7).

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

I added the following to the RC file which is referenced in the SOURCES
file:


define VER_FILEVERSION 1,1,0
#define VER_FILEVERSION_STR “1.1.0”

#undef VER_PRODUCTVERSION
#define VER_PRODUCTVERSION VER_FILEVERSION

#undef VER_PRODUCTVERSION_STR
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR

This is what the PCIDRV example in the WDK does as well. I have also
made sure to delete all of the oem*.inf files in C:\Windows\inf, I
uninstall the driver each time as opposed to updating the driver, and in
my INF I also have the version information set to “05/20/2009,1.1.0”

The result is that when I look at the .sys binary version, it is still
1.0.0, and in Device Manager the version is the WDK version number. I
suspect there is something else I’m missing.

Bryan, as mentioned in some of the replies before the version number shown
in driver tab of driver properties window in Device manager is the number
present in INF. It should also show your date and provider information if
you had given those information in INF file. Are you able to see the
Provider name and date as mentioned in your INF ?

rtshiva

2009/5/20 Bryan R

> I added the following to the RC file which is referenced in the SOURCES
> file:
>
> -----------------------------------------------------------
> define VER_FILEVERSION 1,1,0
> #define VER_FILEVERSION_STR “1.1.0”
>
>
> #undef VER_PRODUCTVERSION
> #define VER_PRODUCTVERSION VER_FILEVERSION
>
> #undef VER_PRODUCTVERSION_STR
> #define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR
> -----------------------------------------------------------
>
> This is what the PCIDRV example in the WDK does as well. I have also
> made sure to delete all of the oem*.inf files in C:\Windows\inf, I
> uninstall the driver each time as opposed to updating the driver, and in
> my INF I also have the version information set to “05/20/2009,1.1.0”
>
> The result is that when I look at the .sys binary version, it is still
> 1.0.0, and in Device Manager the version is the WDK version number. I
> suspect there is something else I’m missing.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Thank you for the information, you have given me some new clues and the
issue is now resolved.

I’m using the KMDF sample from WDK 6001.18002. I modify the generated
INF file manually, as the sample will use StampInf to stamp the
co-installer version instead on the driver version.

This was the big hint, StampInf! I noticed that when I use an INX
template and let the WDK generate the INF from the template, the
DriverVer field is clobbered and replaced with the WDK version. I
should have noticed this sooner!

makefile.inc:

_LNG=$(LANGUAGE)
_INX=.
STAMP=stampinf -f $@ -a $(_BUILDARCH) -k
$(KMDF_VERSION_MAJOR).$(KMDF_VERSION_MINOR)

$(OBJ_PATH)$(O)$(INF_NAME).inf: $(_INX)$(INF_NAME).inx
copy $(_INX)$(@B).inx $@
$(STAMP)

I’m removed $(STAMP) from the end of the file, but it has broken the
installation process and the co-installers are not being located
properly (same folder is INF and SYS). Specifically, the
$KMDFCOINSTALLERVERSION$ variable seems to be left unprocessed, which
leads me to believe that StampInf processes this variable.
Unfortunately, StampInf also clobbers version info. I would love to know
how Microsoft handle this issue. Do Microsoft really write scripts to
go back and repair that info? I would hope not.

Original INF WDF sections:

; ================= WDF Coninstaller =====================
[CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll

[SourceDisksFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll = 1

[CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000,
“WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller”

[DspPci_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$

Updated INF WDF sections:

; ================= WDF Coninstaller =====================
[CoInstaller_CopyFiles]
WdfCoInstaller01007.dll

[SourceDisksFiles]
WdfCoInstaller01007.dll = 1

[CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “WdfCoInstaller01007.dll,WdfCoInstaller”

[DspPci_wdfsect]
KmdfLibraryVersion = 1.7

So if anyone else runes into this issue, disable StampInf and manually
manage the KMDF version information yourself. There is probably a
better way, but for now this works as a fix for my driver.

Thanks to everyone for the ideas and help, I really appreciate it.

Thanks for your reply.

Bryan, as mentioned in some of the replies before the version number
shown in driver tab of driver properties window in Device manager is the
number present in INF. It should also show your date and provider
information if you had given those information in INF file. Are you able
to see the Provider name and date as mentioned in your INF ?

I found out that StampInf was clobbering the data from my INX template
file. I have disabled StampInf and I manually manage the KMDF version
information (i.e. inserting “1.7”) along with my driver version information.

2009/5/20 Bryan R wrote>:

I found out that StampInf was clobbering the data from my INX template
file. ?I have disabled StampInf and I manually manage the KMDF version
information (i.e. inserting “1.7”) along with my driver version information.

Bryan,

No need to disable the StampInf. Leave the -k option switch as it is.
You can make use of addtional -v switch to specify the version number
for your driver’s INF. I just don’t know why -k parameters will make
its way to DriverVer if you didn’t specify one with -v.

Best regards,


WH Tan