]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-shell-ext-server-status-20051002
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 2 Oct 2005 10:08:18 +0000 (10:08 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 2 Oct 2005 10:08:18 +0000 (10:08 +0000)
Fix the server status dialog to properly call CheckServers and
fix CheckServers to properly construct the data structure for the
pioctl call.

(cherry picked from commit c0013b2513b206edded080f0a4cea6e7e96ab281)

src/WINNT/client_exp/gui2fs.cpp
src/WINNT/client_exp/server_status_dlg.cpp

index 6e261a7cc2eee443a30094c4ba65b4784c7b787c..350a3f6edf0e8f9aee3e8c2d530f0b1928c464d7 100644 (file)
@@ -1546,7 +1546,6 @@ BOOL RemoveMount(CStringArray& files)
     register LONG code = 0;
     struct ViceIoctl blob;
     char tbuffer[1024];
-    char lsbuffer[1024];
     register char *tp;
     char szCurItem[1024];
     BOOL error = FALSE;
@@ -1739,30 +1738,24 @@ BOOL CheckServers(const CString& strCellName, WHICH_CELLS nCellsToCheck, BOOL bF
 
     blob.out_size = MAXSIZE;
     blob.out = space;
-    memset(space, 0, sizeof(LONG));    /* so we assure zero when nothing is copied back */
-
-    /* prepare flags for checkservers command */
-    if (nCellsToCheck == LOCAL_CELL)
-        temp = 2;      /* default to checking local cell only */
-    else if (nCellsToCheck == ALL_CELLS)
-        temp &= ~2;    /* turn off local cell check */
-
-    if (bFast)
-        temp |= 1;     /* set fast flag */
-    
-    checkserv.magic = 0x12345678;      /* XXX */
-    checkserv.tflags = temp;
+    memset(space, 0, sizeof(afs_int32));       /* so we assure zero when nothing is copied back */
 
-    /* now copy in optional cell name, if specified */
     if (nCellsToCheck == SPECIFIC_CELL) {
+       temp = 2;
         GetCellName(PCCHAR(strCellName), &info);
         strcpy(checkserv.tbuffer,info.name);
         checkserv.tsize = strlen(info.name) + 1;
     } else {
+       if (nCellsToCheck != ALL_CELLS)
+           temp = 2;
         strcpy(checkserv.tbuffer, "\0");
         checkserv.tsize = 0;
     }
-
+    if (bFast)
+        temp |= 1;     /* set fast flag */
+    
+    checkserv.magic = 0x12345678;      /* XXX */
+    checkserv.tflags = temp;
     checkserv.tinterval = -1;  /* don't change current interval */
 
     code = pioctl(0, VIOCCKSERV, &blob, 1);
index 40b7069d26d79651031f9f8e25819303b50f1029..76fd50b3395c7bf85914f7dd385c23510766a311 100644 (file)
@@ -34,7 +34,7 @@ CServerStatusDlg::CServerStatusDlg() : CDialog()
 
        //{{AFX_DATA_INIT(CServerStatusDlg)
        m_bFast = FALSE;
-       m_nCell = -1;
+       m_nCell = LOCAL_CELL;
        //}}AFX_DATA_INIT
 }
 
@@ -76,7 +76,7 @@ BOOL CServerStatusDlg::OnInitDialog()
        CDialog::OnInitDialog();
 
        m_CellName.EnableWindow(FALSE);
-       m_nCell = 0;
+       m_nCell = LOCAL_CELL;
 
        UpdateData(FALSE);
 
@@ -93,19 +93,21 @@ void CServerStatusDlg::OnShowStatus()
 
 void CServerStatusDlg::OnSpecifiedCell() 
 {
-       m_CellName.EnableWindow(TRUE);  
-
+        m_nCell = SPECIFIC_CELL;
+        m_CellName.EnableWindow(TRUE); 
        CheckEnableShowStatus();
 }
 
 void CServerStatusDlg::OnLocalCell() 
 {
+        m_nCell = LOCAL_CELL;
        m_CellName.EnableWindow(FALSE);
        m_ShowStatus.EnableWindow(TRUE);
 }
 
 void CServerStatusDlg::OnAllCells() 
 {
+        m_nCell = ALL_CELLS;
        m_CellName.EnableWindow(FALSE);
        m_ShowStatus.EnableWindow(TRUE);
 }