Starting with the vista wdk, applications are marked as running on vista and forward in the PE header. The side effect of this is that on older platforms, this shows up as an invalid image format. You can control the versioning by adding the _NT_TARGET_VERSION directive to your sources file. For example
_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WIN2K)
This also controls what parts of the headers are exposed to your applications. Note that drivers use the directive to control what is exposed in the header, but the driver’s PE header is not changed like an app’s would be.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Matt
Sent: Sunday, May 25, 2008 4:03 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Binary compatible?
Maxim S. Shatskih wrote:
> I was under the impression that PE header formats changed between
> versions of the OS
>
Not so.
I had a .SYS binary which worked OK from NT4 to Vista.
So are the user-mode apps.
That sounds right on, but I recall having an unusual problem once. When
I built a particular
code base for Vista and tried to run it on w2k, an error of “Invalid
image format” or something to
that effect was produced. However, when I built the same code base for
w2k, all OS versions
at base and upwards were fine.
In reading threw MS’s PE Format specification document this morning, it
kinda appears there
might be two areas where an older machine might not understand the
format (just a quick scan
through finding “compatibility”). But for this to be the case,
linker/compiler options would of
had to been messed up seriously - and I don’t generally mess with those
a whole lot…
I figure it’s more likely that I had errors during the build that were
not caught causing the build
to stop… Thus garbage was generated…
I really can’t recall the specifics of what happened, I just jumped to
the conclusion that
modifications/updates to the PE format ‘might’ not be understood by
older systems.
Now that I think about it, ‘backwards compatibility’ actually has two
different meanings, never
really thought about that…
Matt
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