Fix `win-randseed-location': use SHGetFolderPath() to find the
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 9 Jan 2007 18:05:17 +0000 (18:05 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 9 Jan 2007 18:05:17 +0000 (18:05 +0000)
commit7bccf0fe85dabc44d168fd2f42f458911e7c4d98
treee78731cf270d7dc09a8e87e1e6278c654cfecb70
parent9f7ebadc564a72c01e28dd895d88e171e7952fe7
Fix `win-randseed-location': use SHGetFolderPath() to find the
Application Data directory in preference to the old-fashioned
attempt to find the user's home directory, and use the _local-
machine_ Application Data directory in preference even to that.

SHGetFolderPath() is called via GetProcAddress, so this degrades
gracefully on old Windowses. (Tested myself on Win95.)

As part of this change, we now search for a location for the seed
file separately for reading and writing, so that installing the new
PuTTY should cause a seamless migration as the old seed file is read
from the old location and then a new one written to the new location.

`putty -cleanup' attempts to delete the seed file from _all_
affected locations.

Naturally, a user-specified seed file path in the Registry still
takes priority over all other means of finding the location.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7082 cda61777-01e9-0310-a592-d414129be87e
windows/winstore.c