winnt-create-globalautomapper-registry-key-20010404
authorVolker Holfeld <volker.holfeld@e-technik.tu-chemnitz.de>
Wed, 4 Apr 2001 13:43:45 +0000 (13:43 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 4 Apr 2001 13:43:45 +0000 (13:43 +0000)
if GlobalAutoMapper key is missing when a global drive is defined with the
gui it will be created

src/WINNT/client_config/dlg_automap.cpp

index 0bc2869..d179543 100644 (file)
@@ -212,13 +212,14 @@ BOOL UpdateRegistry(DRIVEMAP *pDrive, BOOL bRemove)
    TCHAR szValueName[128];
    HKEY hKey;
    LONG result;
+   DWORD dwDispo;
 
    if (!pDrive)
       return FALSE;
 
    _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSConfigKeyName);
 
-   if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_SET_VALUE, &hKey) != ERROR_SUCCESS)
+   if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDispo) != ERROR_SUCCESS)
       return FALSE;
 
    _stprintf(szValueName, TEXT("%c:"), pDrive->chDrive);