From 1167dafbd320f4e8638463cc69aec81b6814125e Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 2 Oct 2005 10:08:18 +0000 Subject: [PATCH] STABLE14-windows-shell-ext-server-status-20051002 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 | 31 +++++++++------------- src/WINNT/client_exp/server_status_dlg.cpp | 10 ++++--- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/WINNT/client_exp/gui2fs.cpp b/src/WINNT/client_exp/gui2fs.cpp index 6e261a7cc2..350a3f6edf 100644 --- a/src/WINNT/client_exp/gui2fs.cpp +++ b/src/WINNT/client_exp/gui2fs.cpp @@ -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 */ + memset(space, 0, sizeof(afs_int32)); /* so we assure zero when nothing is copied back */ + 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; - - /* now copy in optional cell name, if specified */ - if (nCellsToCheck == SPECIFIC_CELL) { - GetCellName(PCCHAR(strCellName), &info); - strcpy(checkserv.tbuffer,info.name); - checkserv.tsize = strlen(info.name) + 1; - } else { - strcpy(checkserv.tbuffer, "\0"); - checkserv.tsize = 0; - } - checkserv.tinterval = -1; /* don't change current interval */ code = pioctl(0, VIOCCKSERV, &blob, 1); diff --git a/src/WINNT/client_exp/server_status_dlg.cpp b/src/WINNT/client_exp/server_status_dlg.cpp index 40b7069d26..76fd50b339 100644 --- a/src/WINNT/client_exp/server_status_dlg.cpp +++ b/src/WINNT/client_exp/server_status_dlg.cpp @@ -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); }