I have an IOCTL to retrieve the driver version, but I am sick of changing
it in the resource file and my version.h include file (more like I keep
forgetting to change both). In user mode you can call
GetFileVersionInfo(). Is there some simple way to do this in kernel mode?
I tried making the .rc file include my version file, but then you can not
use the resource editor. It seems like there has got to be a simple way
to do this.
-Justin
Justin Frodsham wrote:
I have an IOCTL to retrieve the driver version, but I am sick of changing
it in the resource file and my version.h include file (more like I keep
forgetting to change both). In user mode you can call
GetFileVersionInfo(). Is there some simple way to do this in kernel mode?
I tried making the .rc file include my version file, but then you can not
use the resource editor. It seems like there has got to be a simple way
to do this.
If you really want to do this, you can install the samples for my WDM
book and then download the service pack from my web site. The RESOURCE
sample contains exactly the code you’re looking for.
This is very complex, however, because it involves doing file I/O
directly to the image file on disk. Even getting the name of the file is
a bit of a project. I prefer to *not* use the resource editor in my
drivers, since there are very few resources and it’s generally easier to
add them by hand. I therefore have a VERSION.H file that I update by
hand, which is exactly what you said you didn’t want to do. This is by
far the simpler approach, though.
–
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com
This may help.
In your version.h:
#define MY_VERSION_COMMA 1,2,3,4
#define MY_VERSION_DOTTED “5.6.7.8”
in your rc file:
#include “version.h”
…
FILEVERSION MY_VERSION_COMMA
…
VALUE “FileVersion”, MY_VERSION_DOTTED
Do the same for any other versions or whatever
Now at least all of your version changing can be in one place…so you won’t
forget to change them all 
Chris
“Justin Frodsham” wrote in message news:xxxxx@ntdev…
>
> I have an IOCTL to retrieve the driver version, but I am sick of changing
> it in the resource file and my version.h include file (more like I keep
> forgetting to change both). In user mode you can call
> GetFileVersionInfo(). Is there some simple way to do this in kernel mode?
> I tried making the .rc file include my version file, but then you can not
> use the resource editor. It seems like there has got to be a simple way
> to do this.
>
> -Justin
>
>