[Gpg4win-devel] 64-bit gpgme looking for 32-bit gnupg
Andrej Kacian
andrej at kacian.sk
Fri Sep 23 23:11:31 CEST 2016
On Wed, 21 Sep 2016 21:36:49 +0200
Werner Koch <wk at gnupg.org> wrote:
> Well that is quite some time ago and fortunately we did a new release
> today. One point fixed in the new releases (1.7.0) is:
>
> * src/w32-util.c (find_program_at_standard_place): Fallback to
> CSIDL_PROGRAM_FILESX86.
Thanks, that is good news, but bad news is, the fallback doesn't work.
I have looked at find_program_at_standard_place() in w32-util.c, and
the code logic seems incorrect. The "path" buffer is always set to
contain path of the 64-bit Program Files, since the first call to
SHGetSpecialFolderPathA() will always succeed. The second call is never
used.
The correct way would be to make the first call, try access() on the
path constructed in "result", and if it fails, try the same thing with
CSIDL_PROGRAM_FILESX86.
Attached patch fixes the issue. With it, I am able to use GpgME in a
64-bit app.
By the way, SHGetSpecialFolderPath() seems to be unsupported[1], maybe
it's time to switch to ShGetFolderPath()?
1. https://msdn.microsoft.com/en-us/library/windows/desktop/bb762204%28v=vs.85%29.aspx
Regards,
--
Andrej
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.wald.intevation.org/pipermail/gpg4win-devel/attachments/20160923/737afba1/attachment.sig>
More information about the Gpg4win-devel
mailing list