global-mapping-20040325
[openafs.git] / src / WINNT / client_config / dlg_automap.cpp
index 831fd31..609f169 100644 (file)
@@ -15,6 +15,7 @@ extern "C" {
 
 #include "afs_config.h"
 #include <stdio.h>
+#include <lanahelper.h>
 
 /*
  * DEFINITIONS ________________________________________________________________
@@ -33,8 +34,6 @@ enum DDDACTION  { DDD_ADD, DDD_REMOVE };
  * PROTOTYPES _________________________________________________________________
  *
  */
-extern void GetNetbiosName(LPTSTR pszName, int type);
-
 void AutoMap_OnInitDialog (HWND hDlg);
 void AutoMap_OnAdd (HWND hDlg);
 void AutoMap_OnSelect (HWND hDlg);
@@ -219,7 +218,7 @@ BOOL UpdateRegistry(DRIVEMAP *pDrive, BOOL bRemove)
    if (!pDrive)
       return FALSE;
 
-   _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSConfigKeyName);
+   _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSDConfigKeyName);
 
    if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDispo) != ERROR_SUCCESS)
       return FALSE;
@@ -450,13 +449,7 @@ void AutoMapEdit_OnInitDialog (HWND hDlg)
    SendMessage (hCombo, CB_SETCURSEL, iItemSel, 0);
 
    TCHAR szMapping[ MAX_PATH ];
-#ifdef NOLANA
    AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : cm_slash_mount_root), TRUE, FALSE);
-#else
-    memset(szMapping, '\0', sizeof(szMapping));
-    szMapping[0] = '\\';
-    GetNetbiosName(&szMapping[1], 0);
-#endif
    SetDlgItemText (hDlg, IDC_PATH, szMapping);
    SetDlgItemText (hDlg, IDC_DESC, pMap->szSubmount);
 
@@ -484,25 +477,12 @@ void AutoMapEdit_OnOK (HWND hDlg)
       return;
       }
 
-#ifdef NOLANA
     if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) &&
          (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) )
     {
         Message (MB_ICONHAND, GetErrorTitle(), IDS_BADMAP_DESC);
         return;
     }
-#else
-   TCHAR szName[MAX_PATH];
-   memset(szName, '\0', sizeof(szName));
-   szName[0] = '\\';
-   GetNetbiosName(&szName[1], 0);
-
-   if ( lstrncmpi (pMap->szMapping, szName, lstrlen(szName) ))
-      {
-      Message (MB_ICONHAND, GetErrorTitle(), IDS_BADMAP_DESC);
-      return;
-      }
-#endif
 
    // First get a proper submount
    if (pMap->szSubmount[0]) {