From fc128997e7d9b4bd4555731da60bd6a425179596 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 4 Aug 2004 16:54:42 +0000 Subject: [PATCH 1/1] shortcut-params-20040804 Fix the retrieval of the shortcut params from the registry when the HKCU\Software\Openafs\Client key exists but the AfscredsShortcutParams is missing. --- src/WINNT/client_creds/shortcut.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/WINNT/client_creds/shortcut.cpp b/src/WINNT/client_creds/shortcut.cpp index 6bce0c7..da0f392 100644 --- a/src/WINNT/client_creds/shortcut.cpp +++ b/src/WINNT/client_creds/shortcut.cpp @@ -115,9 +115,6 @@ void Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart) code = RegOpenKeyEx(HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT, 0, KEY_QUERY_VALUE, &hk); - if (code != ERROR_SUCCESS) - code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_OPENAFS_CLIENT, - 0, KEY_QUERY_VALUE, &hk); if (code == ERROR_SUCCESS) { len = sizeof(szParams); type = REG_SZ; @@ -125,6 +122,17 @@ void Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart) (BYTE *) &szParams, &len); RegCloseKey (hk); } + if (code != ERROR_SUCCESS) { + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_OPENAFS_CLIENT, + 0, KEY_QUERY_VALUE, &hk); + if (code == ERROR_SUCCESS) { + len = sizeof(szParams); + type = REG_SZ; + code = RegQueryValueEx(hk, "AfscredsShortcutParams", NULL, &type, + (BYTE *) &szParams, &len); + RegCloseKey (hk); + } + } Shortcut_Create (szShortcut, szSource, "Autostart Authentication Agent", szParams); } else // (!g.fAutoStart) -- 1.9.4