Getting version info?

NTFSD Folk:

Has anyone been successful in getting a driver’s version information within
the driver? I’d just like to display it in diagnostic messages, but have
been beating my head against the wall trying to get it.

I’m looking for the VS_VERSION_INFO that is typically in the .rc file for a
driver. I’ve found it in the virtual address space of the driver, but can’t
find an API call that retrieves it.

It’s only for display purposes, but could be really handy for reporting
problems.

Thanks,
Ken Cross
FileKeeper, Inc.

PsGetVersion(PLONG Major,
PLONG Minor,
PLONG Build,
PUNICODE_STRING CSDVersion OPTIONAL);

L.

From the DDK Help:

"PsGetVersion

This function is obsolete in Windows XP and later versions of the
operating system. Use RtlGetVersion instead. PsGetVersion returns
caller-selected information about the current version of the NT-based
operating system. "

I don’t think it’s what the OP needs.

On 28-Mar-04, at 10:02 PM, Ladislav Zezula wrote:

PsGetVersion(PLONG Major,
PLONG Minor,
PLONG Build,
PUNICODE_STRING CSDVersion OPTIONAL);

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@telus.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Cliff Russell
Software Engineer

e-mail: xxxxx@atimi.com
ichat: xxxxx@mac.com
phone: 250 818 5711

Atimi Software: Software Development - On Time.
http://www.atimi.com

Thanks. I only note that the RtlGetVersion is not
available on NT4.

L.

Yes, I found lots of ways to get the version of the OS, but nothing about
getting the version of my driver.

What I’d really like is the equivalent of the library call
GetFileVersionInfo, or the Application.ProductVersion property in .NET. I
thought it’d be simple, but maybe it just doesn’t exist…

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Cliff Russell
Sent: Monday, March 29, 2004 1:57 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Getting version info?

From the DDK Help:

"PsGetVersion

This function is obsolete in Windows XP and later versions of the
operating system. Use RtlGetVersion instead. PsGetVersion returns
caller-selected information about the current version of the NT-based
operating system. "

I don’t think it’s what the OP needs.

On 28-Mar-04, at 10:02 PM, Ladislav Zezula wrote:

PsGetVersion(PLONG Major,
PLONG Minor,
PLONG Build,
PUNICODE_STRING CSDVersion OPTIONAL);

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@telus.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Cliff Russell
Software Engineer

e-mail: xxxxx@atimi.com
ichat: xxxxx@mac.com
phone: 250 818 5711

Atimi Software: Software Development - On Time.
http://www.atimi.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

----- Original Message -----
From: “Ken Cross”
To: “Windows File Systems Devs Interest List”
Sent: Monday, March 29, 2004 1:54 PM
Subject: RE: [ntfsd] Getting version info?

> Yes, I found lots of ways to get the version of the OS, but nothing about
> getting the version of my driver.
>
> What I’d really like is the equivalent of the library call
> GetFileVersionInfo, or the Application.ProductVersion property in .NET. I
> thought it’d be simple, but maybe it just doesn’t exist…
>
> Ken
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Cliff Russell
> Sent: Monday, March 29, 2004 1:57 AM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] Getting version info?
>
> From the DDK Help:
>
> "PsGetVersion
>
> This function is obsolete in Windows XP and later versions of the
> operating system. Use RtlGetVersion instead. PsGetVersion returns
> caller-selected information about the current version of the NT-based
> operating system. "
>
> I don’t think it’s what the OP needs.
>
>
> On 28-Mar-04, at 10:02 PM, Ladislav Zezula wrote:
>
> > PsGetVersion(PLONG Major,
> > PLONG Minor,
> > PLONG Build,
> > PUNICODE_STRING CSDVersion OPTIONAL);
> >
> > L.
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@telus.net
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> -----------------------------------------
> Cliff Russell
> Software Engineer
>
> e-mail: xxxxx@atimi.com
> ichat: xxxxx@mac.com
> phone: 250 818 5711
>
> Atimi Software: Software Development - On Time.
> http://www.atimi.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@comcast.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@volny.cz
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

> Yes, I found lots of ways to get the version of the OS, but nothing about

getting the version of my driver.

Eh, sorry for the previous reply. I sent it prematurely.

You may use the GetFileVersionInfo for the driver too.
If you want to do it *in the driver*, you will have to find the resource
manually in the driver image.

L.

GetFileVersionInfo only works if you know the path of the driver file. I
know of no way to get that from within the driver either, unless you make
assumptions about where the driver file is. I hate assumptions. :frowning:

Thanks anyhow.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Monday, March 29, 2004 7:17 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Getting version info?

Yes, I found lots of ways to get the version of the OS, but nothing about
getting the version of my driver.

Eh, sorry for the previous reply. I sent it prematurely.

You may use the GetFileVersionInfo for the driver too.
If you want to do it *in the driver*, you will have to find the resource
manually in the driver image.

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Umm, sounds simple but, what I do is have a header defining all the version
bits and bobs in my driver. I then use these defines in the .rc file. If I
need the version number in a source module I simply include the header and
use the define.

Simple but effective.

Ben Curley
Data Encryption Systems Ltd.

Tel: +44 (0)1823 352357 (Main)
Tel: +44 (0)1823 358320 (Direct Dial)

Web: http://www.deslock.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: 29 March 2004 13:37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

GetFileVersionInfo only works if you know the path of the driver file. I
know of no way to get that from within the driver either, unless you make
assumptions about where the driver file is. I hate assumptions. :frowning:

Thanks anyhow.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Monday, March 29, 2004 7:17 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Getting version info?

Yes, I found lots of ways to get the version of the OS, but nothing about
getting the version of my driver.

Eh, sorry for the previous reply. I sent it prematurely.

You may use the GetFileVersionInfo for the driver too.
If you want to do it *in the driver*, you will have to find the resource
manually in the driver image.

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to xxxxx@lists.osr.com

Yes, that’s effectively what I’ve had to do. I also have a little script
that increments the edit level in the header every time I modify a file.
Seems a bit of a kludge, though, and I was looking for a more “correct”
solution.

Thanks,
Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@des.co.uk
Sent: Monday, March 29, 2004 7:54 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

Umm, sounds simple but, what I do is have a header defining all the version
bits and bobs in my driver. I then use these defines in the .rc file. If I
need the version number in a source module I simply include the header and
use the define.

Simple but effective.

Ben Curley
Data Encryption Systems Ltd.

Tel: +44 (0)1823 352357 (Main)
Tel: +44 (0)1823 358320 (Direct Dial)

Web: http://www.deslock.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: 29 March 2004 13:37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

GetFileVersionInfo only works if you know the path of the driver file. I
know of no way to get that from within the driver either, unless you make
assumptions about where the driver file is. I hate assumptions. :frowning:

Thanks anyhow.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Monday, March 29, 2004 7:17 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Getting version info?

Yes, I found lots of ways to get the version of the OS, but nothing about
getting the version of my driver.

Eh, sorry for the previous reply. I sent it prematurely.

You may use the GetFileVersionInfo for the driver too.
If you want to do it *in the driver*, you will have to find the resource
manually in the driver image.

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Why do you have to make an assumption? The driver must be in registry
and if a imagepath is specified it will give its location. If not, you
know where it has to be. If the driver needs to know where it is, it is
available in DriverEntry. Getting the version info from the executing
driver is just a matter of writing the code.

“Ken Cross” wrote in message news:xxxxx@ntfsd…
> GetFileVersionInfo only works if you know the path of the driver file.
I
> know of no way to get that from within the driver either, unless you
make
> assumptions about where the driver file is. I hate assumptions. :frowning:
>
> Thanks anyhow.
>
> Ken
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav
Zezula
> Sent: Monday, March 29, 2004 7:17 AM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] Getting version info?
>
> > Yes, I found lots of ways to get the version of the OS, but nothing
about
> > getting the version of my driver.
>
> Eh, sorry for the previous reply. I sent it prematurely.
>
> You may use the GetFileVersionInfo for the driver too.
> If you want to do it in the driver, you will have to find the
resource
> manually in the driver image.
>
> L.
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@comcast.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

Good point, but the ImagePath entry is something like
“system32\drivers\something.sys”, so you’d have to prepend it with
%systemroot% - not sure how to do that from the kernel?

I have found the silly stuff in memory (from brute searching), but can’t
find a mechanism to retrieve it.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David J. Craig
Sent: Monday, March 29, 2004 10:49 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Getting version info?

Why do you have to make an assumption? The driver must be in registry
and if a imagepath is specified it will give its location. If not, you
know where it has to be. If the driver needs to know where it is, it is
available in DriverEntry. Getting the version info from the executing
driver is just a matter of writing the code.

“Ken Cross” wrote in message news:xxxxx@ntfsd…
> GetFileVersionInfo only works if you know the path of the driver file.
I
> know of no way to get that from within the driver either, unless you
make
> assumptions about where the driver file is. I hate assumptions. :frowning:
>
> Thanks anyhow.
>
> Ken
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav
Zezula
> Sent: Monday, March 29, 2004 7:17 AM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] Getting version info?
>
> > Yes, I found lots of ways to get the version of the OS, but nothing
about
> > getting the version of my driver.
>
> Eh, sorry for the previous reply. I sent it prematurely.
>
> You may use the GetFileVersionInfo for the driver too.
> If you want to do it in the driver, you will have to find the
resource
> manually in the driver image.
>
> L.
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@comcast.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

It is called code. Someone will write it for you if pay them.

“Ken Cross” wrote in message news:xxxxx@ntfsd…
> Good point, but the ImagePath entry is something like
> “system32\drivers\something.sys”, so you’d have to prepend it with
> %systemroot% - not sure how to do that from the kernel?
>
> I have found the silly stuff in memory (from brute searching), but
can’t
> find a mechanism to retrieve it.
>
> Ken
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of David J. Craig
> Sent: Monday, March 29, 2004 10:49 AM
> To: Windows File Systems Devs Interest List
> Subject: Re:[ntfsd] Getting version info?
>
> Why do you have to make an assumption? The driver must be in registry
> and if a imagepath is specified it will give its location. If not,
you
> know where it has to be. If the driver needs to know where it is, it
is
> available in DriverEntry. Getting the version info from the executing
> driver is just a matter of writing the code.
>
> “Ken Cross” wrote in message news:xxxxx@ntfsd…
> > GetFileVersionInfo only works if you know the path of the driver
file.
> I
> > know of no way to get that from within the driver either, unless you
> make
> > assumptions about where the driver file is. I hate assumptions.
:frowning:
> >
> > Thanks anyhow.
> >
> > Ken
> >
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav
> Zezula
> > Sent: Monday, March 29, 2004 7:17 AM
> > To: Windows File Systems Devs Interest List
> > Subject: Re: [ntfsd] Getting version info?
> >
> > > Yes, I found lots of ways to get the version of the OS, but
nothing
> about
> > > getting the version of my driver.
> >
> > Eh, sorry for the previous reply. I sent it prematurely.
> >
> > You may use the GetFileVersionInfo for the driver too.
> > If you want to do it in the driver, you will have to find the
> resource
> > manually in the driver image.
> >
> > L.
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@comcast.net
> > To unsubscribe send a blank email to
xxxxx@lists.osr.com
> >
> >
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@comcast.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

Here we use a build engine which increments build number for every build and
also generates version info. Build number is available as a preprocessor
symbol during build so it can be used in any source.

If you’re using any VCS software, script is unnecessary. You can use
keywords as $Revision: or $Header: or $Id: which are expanded by VCS and
contain file version number. For later two which are available for most VCS
some parsing is necessary.

BTW, you can use \SystemRoot\ symbolic link in kernel mode directly.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: Ken Cross[SMTP:xxxxx@comcast.net]
Reply To: Windows File Systems Devs Interest List
Sent: Monday, March 29, 2004 2:55 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

Yes, that’s effectively what I’ve had to do. I also have a little script
that increments the edit level in the header every time I modify a file.
Seems a bit of a kludge, though, and I was looking for a more “correct”
solution.

Thanks,
Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@des.co.uk
Sent: Monday, March 29, 2004 7:54 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

Umm, sounds simple but, what I do is have a header defining all the
version
bits and bobs in my driver. I then use these defines in the .rc file. If
I
need the version number in a source module I simply include the header and
use the define.

Simple but effective.

Ben Curley
Data Encryption Systems Ltd.

Tel: +44 (0)1823 352357 (Main)
Tel: +44 (0)1823 358320 (Direct Dial)

Web: http://www.deslock.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: 29 March 2004 13:37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

GetFileVersionInfo only works if you know the path of the driver file. I
know of no way to get that from within the driver either, unless you make
assumptions about where the driver file is. I hate assumptions. :frowning:

Thanks anyhow.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Monday, March 29, 2004 7:17 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Getting version info?

> Yes, I found lots of ways to get the version of the OS, but nothing
about
> getting the version of my driver.

Eh, sorry for the previous reply. I sent it prematurely.

You may use the GetFileVersionInfo for the driver too.
If you want to do it *in the driver*, you will have to find the resource
manually in the driver image.

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: michal.vodicka@st.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

That’s a good idea – specify the build/version info as a part of C_DEFINES,
right? (Since USER_C_FLAGS don’t get passed to the resource compiler.)

Yes, VCS/RCS/CVS/SCCS/whatever are good (I’ve used them on non-Windows
systems for years, and VSS on Windows), but I’m not aware of any that
produce version numbers like those needed in the .rc file. May be some
around, though…

Didn’t know about \SystemRoot\ – thanks!

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Vodicka, Michal
Sent: Monday, March 29, 2004 1:23 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

Here we use a build engine which increments build number for every build and
also generates version info. Build number is available as a preprocessor
symbol during build so it can be used in any source.

If you’re using any VCS software, script is unnecessary. You can use
keywords as $Revision: or $Header: or $Id: which are expanded by VCS and
contain file version number. For later two which are available for most VCS
some parsing is necessary.

BTW, you can use \SystemRoot\ symbolic link in kernel mode directly.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: Ken Cross[SMTP:xxxxx@comcast.net]
Reply To: Windows File Systems Devs Interest List
Sent: Monday, March 29, 2004 2:55 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

Yes, that’s effectively what I’ve had to do. I also have a little script
that increments the edit level in the header every time I modify a file.
Seems a bit of a kludge, though, and I was looking for a more “correct”
solution.

Thanks,
Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@des.co.uk
Sent: Monday, March 29, 2004 7:54 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

Umm, sounds simple but, what I do is have a header defining all the
version
bits and bobs in my driver. I then use these defines in the .rc file. If
I
need the version number in a source module I simply include the header and
use the define.

Simple but effective.

Ben Curley
Data Encryption Systems Ltd.

Tel: +44 (0)1823 352357 (Main)
Tel: +44 (0)1823 358320 (Direct Dial)

Web: http://www.deslock.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: 29 March 2004 13:37
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

GetFileVersionInfo only works if you know the path of the driver file. I
know of no way to get that from within the driver either, unless you make
assumptions about where the driver file is. I hate assumptions. :frowning:

Thanks anyhow.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Monday, March 29, 2004 7:17 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Getting version info?

> Yes, I found lots of ways to get the version of the OS, but nothing
about
> getting the version of my driver.

Eh, sorry for the previous reply. I sent it prematurely.

You may use the GetFileVersionInfo for the driver too.
If you want to do it *in the driver*, you will have to find the resource
manually in the driver image.

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: michal.vodicka@st.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

> ----------

From: Ken Cross[SMTP:xxxxx@comcast.net]
Reply To: Windows File Systems Devs Interest List
Sent: Monday, March 29, 2004 8:37 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

That’s a good idea – specify the build/version info as a part of
C_DEFINES,
right? (Since USER_C_FLAGS don’t get passed to the resource compiler.)

Yes, something like this:

!IF DEFINED(BUILD_NUMBER) && $(BUILD_NUMBER)
C_DEFINES=$(C_DEFINES) -DBUILD_NUMBER=$(BUILD_NUMBER)
!ENDIF

where BUILD_NUMBER is defined by build engine and passed to build by -nmake
parameter. I’m not sure about resource compiler because we generate whole
version info separatedly using m4 tool so it don’t need to be parametrised
more.

Yes, VCS/RCS/CVS/SCCS/whatever are good (I’ve used them on non-Windows
systems for years, and VSS on Windows), but I’m not aware of any that
produce version numbers like those needed in the .rc file. May be some
around, though…

The disadvantage is expanded keywords contain current file version number
which may not be what you need. If you have VSS, keywords are documented
somewhere. Also, using keywords for generating numbers usable in .rc file
would need some clever preprocessor tricks. I meant opposite case: ignore
version info and use numbers compiled in sources. For diagnostics it is
usually sufficient.

The best case is to have build engine integrated with VCS with automatic
labeling during build. Then, everything is reproducible and you can easily
get exact shapshot for every build, correct symbols etc. Build number is
everything you need. Invaluable when you have to solve problem with year old
binaries.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]

FWIW, here’s the a snippet from my version header file:

#define FK_VERSION_MAJOR 1 // Major version number
#define FK_VERSION_MINOR 2 // Minor version number
#define FK_VERSION_BUILD 1 // Build number
#define FK_VERSION_EDIT 663 // Edit number

#define FKVERSION
FK_VERSION_MAJOR,FK_VERSION_MINOR,FK_VERSION_BUILD,FK_VERSION_EDIT

Then a snippet from my .rc file:

//
// FKVERSION is defined in fkversion.h as a sequence of 4 digits: 1,2,3,4
// This is used as-is in FILEVERSION and PRODUCTVERSION.
// The macros below stringify the version for FileVersion and
ProductVersion.
//
#include “fkversion.h”

#define FK_VALUE2(Name,Value) VALUE #Name, #Value
#define FK_VALUE(Name,Value) FK_VALUE2(Name,Value)
#define FK_VALUE_STRING(Name) FK_VALUE(Name,FKVERSION)

VS_VERSION_INFO VERSIONINFO
FILEVERSION FKVERSION
PRODUCTVERSION FKVERSION
BEGIN
BLOCK “StringFileInfo”
BEGIN
BLOCK “040904b0”
BEGIN
// …
FK_VALUE_STRING(FileVersion)
FK_VALUE_STRING(ProductVersion)
END
END
BLOCK “VarFileInfo”
BEGIN
VALUE “Translation”, 0x409, 1200
END
END

I do similar nonsense with a timestamp string generated by TIMESTAMP in
the header file.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Vodicka, Michal
Sent: Monday, March 29, 2004 1:57 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?


From: Ken Cross[SMTP:xxxxx@comcast.net]
Reply To: Windows File Systems Devs Interest List
Sent: Monday, March 29, 2004 8:37 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Getting version info?

That’s a good idea – specify the build/version info as a part of
C_DEFINES,
right? (Since USER_C_FLAGS don’t get passed to the resource compiler.)

Yes, something like this:

!IF DEFINED(BUILD_NUMBER) && $(BUILD_NUMBER)
C_DEFINES=$(C_DEFINES) -DBUILD_NUMBER=$(BUILD_NUMBER)
!ENDIF

where BUILD_NUMBER is defined by build engine and passed to build by -nmake
parameter. I’m not sure about resource compiler because we generate whole
version info separatedly using m4 tool so it don’t need to be parametrised
more.

Yes, VCS/RCS/CVS/SCCS/whatever are good (I’ve used them on non-Windows
systems for years, and VSS on Windows), but I’m not aware of any that
produce version numbers like those needed in the .rc file. May be some
around, though…

The disadvantage is expanded keywords contain current file version number
which may not be what you need. If you have VSS, keywords are documented
somewhere. Also, using keywords for generating numbers usable in .rc file
would need some clever preprocessor tricks. I meant opposite case: ignore
version info and use numbers compiled in sources. For diagnostics it is
usually sufficient.

The best case is to have build engine integrated with VCS with automatic
labeling during build. Then, everything is reproducible and you can easily
get exact shapshot for every build, correct symbols etc. Build number is
everything you need. Invaluable when you have to solve problem with year old
binaries.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

> I have found the silly stuff in memory (from brute searching), but can’t

find a mechanism to retrieve it.

You have to find the image section containing “.rsrc”
There should be a resource of the type VS_VERSION_INFO.

L.