Commit graph

5 commits

Author SHA1 Message Date
Simon Tatham
0bc12e1c67 Fix WORD16 and WORD32 macros.
I made the mistake of using the same variable name _offset for the
temporary variable in WORD16 and WORD32, and for the one in BYTE which
the other two use as a subroutine - meaning that the declaration on
the first line of BYTE read 'size_t _offset = _offset+3' or similar,
in which the RHS _offset referred to the newly declared LHS one rather
than to the one in the outer scope.

WORD32 had the additional goof that I had declared its return-value
accumulator variable as a 16- rather than 32-bit integer due to
copy-and-paste error.

Between those two mistakes - surely introduced at the last minute when
I was doing code cleanup on this source base, because I know this
function was working OK before then - I had completely broken the
extraction of version strings from PE executables.
2017-05-28 10:00:03 +01:00
Simon Tatham
fe5eb01f9b Add a command-line test program.
At the moment it only tests MsiGetFileVersion, because that's the
piece I just found a problem in, but I could easily extend it to have
convenient command-line test rigs for other parts of this setup too.
2017-05-28 09:54:05 +01:00
Simon Tatham
39faf94ea2 Move the char16 functions into their own file.
This completes the removal of the monolithic fake-lib.[ch].
2017-05-18 07:16:21 +01:00
Simon Tatham
69d886c575 Redo the bounds checks in MsiGetFileVersion.
Now any failing bounds check causes the whole function to fail, rather
than returning a made-up value.
2017-05-18 06:57:29 +01:00
Simon Tatham
7e5c5d4232 Move MsiGetFileVersion out into its own file. 2017-05-18 06:57:18 +01:00