From: Jeffrey Altman Date: Fri, 12 Feb 2010 02:45:40 +0000 (-0500) Subject: Windows: Prevent explorer shell extension from crashing if symbolic link add fails X-Git-Tag: openafs-devel-1_5_73~190 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=135c5668f9197aae6d29b1575e76323dd147f521 Windows: Prevent explorer shell extension from crashing if symbolic link add fails The explorer shell extension was passing the wrong parameters to the MessageBox API when a symbolic link add failed. The end result was stack corruption. FIXES 126406 Change-Id: I59b8b71d947525adccbd817cd5b6d4de5bf082b7 Reviewed-on: http://gerrit.openafs.org/1298 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/client_exp/make_symbolic_link_dlg.cpp b/src/WINNT/client_exp/make_symbolic_link_dlg.cpp index e35ac78..4816008 100644 --- a/src/WINNT/client_exp/make_symbolic_link_dlg.cpp +++ b/src/WINNT/client_exp/make_symbolic_link_dlg.cpp @@ -68,9 +68,7 @@ END_MESSAGE_MAP() void CMakeSymbolicLinkDlg::OnOK() { - char space[64]; UINT code; - int i; UpdateData(TRUE); CString strName; CString strTarget; @@ -79,23 +77,23 @@ void CMakeSymbolicLinkDlg::OnOK() if (!IsPathInAfs(m_sBase)) { MessageBeep((UINT)-1); strTarget+=" - Path is not in AFS directory"; - AfxMessageBox(strTarget,MB_OK); + AfxMessageBox(strTarget,MB_ICONERROR); return; } if (m_sBase.GetLength()>MAX_PATH-2) { MessageBeep((UINT)-1); - ShowMessageBox(IDS_CURRENT_DIRECTORY_PATH_TOO_LONG,MB_OK,IDS_CURRENT_DIRECTORY_PATH_TOO_LONG); + ShowMessageBox(IDS_CURRENT_DIRECTORY_PATH_TOO_LONG,MB_ICONERROR,IDS_CURRENT_DIRECTORY_PATH_TOO_LONG); } if (!SetCurrentDirectory(m_sBase)) { MessageBeep((UINT)-1); - ShowMessageBox(IDS_UNABLE_TO_SET_CURRENT_DIRECTORY,MB_OK,IDS_UNABLE_TO_SET_CURRENT_DIRECTORY); + ShowMessageBox(IDS_UNABLE_TO_SET_CURRENT_DIRECTORY,MB_ICONERROR,IDS_UNABLE_TO_SET_CURRENT_DIRECTORY); return; } if ((code=MakeSymbolicLink(strName,strTarget))!=0){ MessageBeep((UINT)-1); - ShowMessageBox(IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,MB_OK,IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,code); + ShowMessageBox(IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,MB_ICONERROR,IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,GetAfsError(code, strName)); return; } CDialog::OnOK();