I don’t remember the initial post requiring this be done in KM. If
that’s a requirement, just delete this mail now. I also haven’t been
following this thread too closely, so I apologize if this has already
been suggested.
Checking the version resource should work for all Microsoft HALs and
most (if not all) 3rd party HALs. See GetFileVersionInfo() to load the
initial version resources and VerQueryValue() to load the specific
version info. In this case, I’d just look for VS_FF_DEBUG in
VS_FIXEDFILEINFO.dwFileFlags.
Omitting the error checking…
VS_FIXEDFILEINFO* vsFixedFileInfo;
UINT uiDataSize;
LPSTR lpszFileToCheck = argv[1];
DWORD dwSizeNeeded =
GetFileVersionInfoSize(lpszFileToCheck, NULL);
BYTE* pbData = (BYTE*)malloc(dwSizeNeeded+1);
GetFileVersionInfo(lpszFileToCheck, 0, dwSizeNeeded+1, pbData);
VerQueryValue(pbData, “\”, (LPVOID*)(&vsFixedFileInfo), &uiDataSize);
if (vsFixedFileInfo->dwFileFlags & VS_FF_DEBUG) {
printf(“%s is a checked build file\n”, argv[1]);
} else {
printf(“%s is a free build file\n”, argv[1]);
}
[You’ll need to add $(SDK_LIB_PATH)\version.lib to your TARGETLIBS.]
–Scott
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Monday, August 16, 2004 12:29 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] Re:Determing free or checked build
from the PE file
My general method to determine if a HAL is debug or release
is to compare the questionable file by date and file size to
known debug and release HALs. The debug HAL will almost
always be a little larger than the corresponding release HAL
when symbol stripped, and a whole lot larger if the symbols
haven’t been stripped.
Some OEM HALs (ours, for instance) will tell you the version
and if they are debug or release on a boot-time display line.
You can grep for that display text in the file to see what it says.
Loren
----- Original Message -----
From: “Don Burn”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Sunday, August 15, 2004 5:16 PM
> Subject: Re:[ntdev] Re:Determing free or checked build from
> the PE file
>
>
> > As I said, arbitrary files and that can include other than x86. I
> > started looking at this problem after a customer of mine had a
> > disaster with MIS running Windows Update on a bunch of
> checked build
> > machines (talk about flaky!).
> >
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >
> >
> > “Chuck Batson” wrote in message
> > news:xxxxx@ntdev…
> > > Jake O. said, “On x86, the HAL must match the kernel, so you can
> > > know by inference.” Are you not on x86? Or do you need to
> > > determine this for any arbitrary HAL that’s been
> separated from its
> > > kernel?
> > >
> > > Chuck
> > >
> > > ----- Original Message -----
> > > From: “Don Burn”
> > > Newsgroups: ntdev
> > > To: “Windows System Software Devs Interest List”
>
> > > Sent: Saturday, August 14, 2004 8:52 PM
> > > Subject: Re:[ntdev] Determing free or checked build from
> the PE file
> > >
> > >
> > > > I appreciate the suggestions so far, but they do not solve the
> > > > problem
> > > for
> > > > the HAL just the kernel.
> > > >
> > > >
> > > > –
> > > > Don Burn (MVP, Windows DDK)
> > > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > >
> > > >
> > > >
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as:
> > > > xxxxx@cbatson.com To unsubscribe send a blank
> email to
> > > > xxxxx@lists.osr.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@earthlink.net To
> > unsubscribe send a blank email to xxxxx@lists.osr.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@coffee-and-cigarettes.com To unsubscribe send a blank email to
xxxxx@lists.osr.com