diff options
author | marha <marha@users.sourceforge.net> | 2010-11-19 13:13:51 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-11-19 13:13:51 +0000 |
commit | bd5413c3a7e500fa8c8ccd68a33d2fcc4c172e28 (patch) | |
tree | b77dfbc85a3ad280e488b7840ac42221785e0831 /tools/plink/winstore.c | |
parent | 87e3509a1a9724e6115385686d9121f6c4a0f473 (diff) | |
parent | 773752eab55047c33bad0d88006bb69f5c601502 (diff) | |
download | vcxsrv-bd5413c3a7e500fa8c8ccd68a33d2fcc4c172e28.tar.gz vcxsrv-bd5413c3a7e500fa8c8ccd68a33d2fcc4c172e28.tar.bz2 vcxsrv-bd5413c3a7e500fa8c8ccd68a33d2fcc4c172e28.zip |
svn merge ^/branches/released .
Diffstat (limited to 'tools/plink/winstore.c')
-rw-r--r-- | tools/plink/winstore.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/tools/plink/winstore.c b/tools/plink/winstore.c index b1b3d3a66..f7dd98965 100644 --- a/tools/plink/winstore.c +++ b/tools/plink/winstore.c @@ -23,9 +23,8 @@ static const char hex[16] = "0123456789ABCDEF"; static int tried_shgetfolderpath = FALSE;
static HMODULE shell32_module = NULL;
-typedef HRESULT (WINAPI *p_SHGetFolderPath_t)
- (HWND, int, HANDLE, DWORD, LPTSTR);
-static p_SHGetFolderPath_t p_SHGetFolderPath = NULL;
+DECL_WINDOWS_FUNCTION(static, HRESULT, SHGetFolderPathA,
+ (HWND, int, HANDLE, DWORD, LPSTR));
static void mungestr(const char *in, char *out)
{
@@ -498,22 +497,20 @@ static HANDLE access_random_seed(int action) * on older versions of Windows if we cared enough.
* However, the invocation below requires IE5+ anyway,
* so stuff that. */
- shell32_module = LoadLibrary("SHELL32.DLL");
- if (shell32_module) {
- p_SHGetFolderPath = (p_SHGetFolderPath_t)
- GetProcAddress(shell32_module, "SHGetFolderPathA");
- }
+ shell32_module = load_system32_dll("shell32.dll");
+ GET_WINDOWS_FUNCTION(shell32_module, SHGetFolderPathA);
+ tried_shgetfolderpath = TRUE;
}
- if (p_SHGetFolderPath) {
- if (SUCCEEDED(p_SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA,
- NULL, SHGFP_TYPE_CURRENT, seedpath))) {
+ if (p_SHGetFolderPathA) {
+ if (SUCCEEDED(p_SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA,
+ NULL, SHGFP_TYPE_CURRENT, seedpath))) {
strcat(seedpath, "\\PUTTY.RND");
if (try_random_seed(seedpath, action, &rethandle))
return rethandle;
}
- if (SUCCEEDED(p_SHGetFolderPath(NULL, CSIDL_APPDATA,
- NULL, SHGFP_TYPE_CURRENT, seedpath))) {
+ if (SUCCEEDED(p_SHGetFolderPathA(NULL, CSIDL_APPDATA,
+ NULL, SHGFP_TYPE_CURRENT, seedpath))) {
strcat(seedpath, "\\PUTTY.RND");
if (try_random_seed(seedpath, action, &rethandle))
return rethandle;
|