Fisheye: Tag ebabad67cdda34ed4e36ab794e10d0ade8124bf3 refers to a dead (removed) revision in file `src/ch/ConfigManager.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ebabad67cdda34ed4e36ab794e10d0ade8124bf3 refers to a dead (removed) revision in file `src/ch/ConfigManager.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -590,7 +590,7 @@ if (rFilter.m_bUseSize) { _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(static_cast<__int64>(rFilter.m_ullSize1), szData, true)); - + szLoaded[1023] = _T('\0'); if (rFilter.m_bUseSize2) { _tcscat(szLoaded, GetResManager()->LoadString(IDS_AND_STRING)); @@ -612,6 +612,7 @@ if (rFilter.m_bUseDate) { _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_DATECREATED_STRING+rFilter.m_iDateType), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iDateType1)); + szLoaded[1023] = _T('\0'); if (rFilter.m_bDate1) _tcscat(szLoaded, rFilter.m_tDate1.Format(_T(" %x"))); if (rFilter.m_bTime1) @@ -792,6 +793,10 @@ void CCustomCopyDlg::SetComboPath(LPCTSTR lpszText) { + _ASSERTE(lpszText); + if(!lpszText) + return; + // set current select to -1 m_ctlDstPath.SetCurSel(-1); @@ -815,6 +820,7 @@ // get text from combo COMBOBOXEXITEM cbi; TCHAR szPath[_MAX_PATH]; + memset(szPath, 0, _MAX_PATH); cbi.mask=CBEIF_TEXT; cbi.iItem=m_ctlDstPath.GetCurSel()/*-1*/; cbi.pszText=szPath; Index: src/ch/DataBuffer.cpp =================================================================== diff -u -r3493e9fc470285b0a0b417d50be281467a071eb7 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/DataBuffer.cpp (.../DataBuffer.cpp) (revision 3493e9fc470285b0a0b417d50be281467a071eb7) +++ src/ch/DataBuffer.cpp (.../DataBuffer.cpp) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -150,7 +150,7 @@ { if (m_pBuffer != NULL) { - VirtualFree(static_cast(m_pBuffer), m_uiRealSize, MEM_DECOMMIT); + VirtualFree(static_cast(m_pBuffer), 0, MEM_RELEASE); m_pBuffer=NULL; m_uiRealSize=0; m_bsSizes.m_uiDefaultSize=0; Index: src/ch/DirTreeCtrl.cpp =================================================================== diff -u -r5710fadbac5568e52aff80f31495c33577d431ce -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision 5710fadbac5568e52aff80f31495c33577d431ce) +++ src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -397,122 +397,130 @@ ///////////////////////////////////////////////////////////////////////////// // fills a hParent node with items starting with lpsf and lpdil for this item -bool CDirTreeCtrl::FillNode(HTREEITEM hParent, LPSHELLFOLDER lpsf, LPITEMIDLIST lpidl, bool bSilent) +HRESULT CDirTreeCtrl::FillNode(HTREEITEM hParent, LPSHELLFOLDER lpsf, LPITEMIDLIST lpidl, bool bSilent) { // get the global flag under consideration if (m_bIgnoreShellDialogs) bSilent=m_bIgnoreShellDialogs; // get the desktop interface and id's of list for net neigh. and my computer LPSHELLFOLDER lpsfDesktop=NULL; - LPITEMIDLIST lpiidlDrives=NULL, lpiidlNetwork=NULL; + LPITEMIDLIST lpiidlDrives=NULL; + LPITEMIDLIST lpiidlNetwork=NULL; + HRESULT hResult = S_OK; if (hParent == GetRootItem()) { - SHGetDesktopFolder(&lpsfDesktop); - SHGetSpecialFolderLocation(this->GetSafeHwnd(), CSIDL_DRIVES, &lpiidlDrives); - SHGetSpecialFolderLocation(this->GetSafeHwnd(), CSIDL_NETWORK, &lpiidlNetwork); + hResult = SHGetDesktopFolder(&lpsfDesktop); + if(SUCCEEDED(hResult)) + hResult = SHGetSpecialFolderLocation(this->GetSafeHwnd(), CSIDL_DRIVES, &lpiidlDrives); + if(SUCCEEDED(hResult)) + hResult = SHGetSpecialFolderLocation(this->GetSafeHwnd(), CSIDL_NETWORK, &lpiidlNetwork); } - LPITEMIDLIST lpiidl; - SHFILEINFO sfi; - ULONG ulAttrib; - TVITEM tvi; - TVINSERTSTRUCT tvis; - _SHELLITEMDATA *psid; - TCHAR szText[_MAX_PATH]; - LPENUMIDLIST lpeid=NULL; - HTREEITEM hCurrent=NULL; - bool bFound=false; - // shell allocator - LPMALLOC lpm; - if (SHGetMalloc(&lpm) != NOERROR) - return false; + LPMALLOC lpm = NULL; + if(SUCCEEDED(hResult)) + hResult = SHGetMalloc(&lpm); // enumerate child items for lpsf - if (lpsf->EnumObjects(bSilent ? NULL : GetParent()->GetSafeHwnd(), SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN, &lpeid) != NOERROR) - return false; + LPENUMIDLIST lpeid = NULL; + if(SUCCEEDED(hResult)) + hResult = lpsf->EnumObjects(bSilent ? NULL : GetParent()->GetSafeHwnd(), SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN, &lpeid); - while (lpeid->Next(1, &lpiidl, NULL) == NOERROR) + bool bFound=false; + if(SUCCEEDED(hResult)) { - // filer what has been found - ulAttrib=SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; - lpsf->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lpiidl, &ulAttrib); - if (ulAttrib & SFGAO_FOLDER && (ulAttrib & SFGAO_FILESYSANCESTOR || ulAttrib & SFGAO_FILESYSTEM) ) + LPITEMIDLIST lpiidl; + SHFILEINFO sfi; + ULONG ulAttrib; + TVITEM tvi; + TVINSERTSTRUCT tvis; + _SHELLITEMDATA *psid; + TCHAR szText[_MAX_PATH]; + HTREEITEM hCurrent=NULL; + while (lpeid->Next(1, &lpiidl, NULL) == NOERROR) { - // there's something to add so set bFound - bFound=true; + // filer what has been found + ulAttrib=SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; + lpsf->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lpiidl, &ulAttrib); + if (ulAttrib & SFGAO_FOLDER && (ulAttrib & SFGAO_FILESYSANCESTOR || ulAttrib & SFGAO_FILESYSTEM) ) + { + // there's something to add so set bFound + bFound=true; - // it's time to add everything - psid=new _SHELLITEMDATA; - lpsf->BindToObject(lpiidl, NULL, IID_IShellFolder, (void**)&psid->lpsf); - psid->lpiidl=ConcatPidls(lpidl, lpiidl); - psid->lpiidlRelative=CopyITEMID(lpm, lpiidl); - psid->lpsfParent=lpsf; - - tvi.mask=TVIF_CHILDREN | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM; - if (!GetName(lpsf, lpiidl, SHGDN_INFOLDER/* | SHGDN_INCLUDE_NONFILESYS*/, szText)) - lstrcpy(szText, _T("???")); - tvi.pszText=szText; - sfi.iIcon=-1; - SHGetFileInfo((LPCTSTR)psid->lpiidl, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON); - tvi.iImage=sfi.iIcon; - sfi.iIcon=-1; - SHGetFileInfo((LPCTSTR)psid->lpiidl, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON); - tvi.iSelectedImage=sfi.iIcon; - tvi.cChildren=(ulAttrib & SFGAO_HASSUBFOLDER); - tvi.lParam=reinterpret_cast(psid); - - tvis.hParent=hParent; - tvis.item=tvi; - hCurrent=InsertItem(&tvis); + // it's time to add everything + psid=new _SHELLITEMDATA; + lpsf->BindToObject(lpiidl, NULL, IID_IShellFolder, (void**)&psid->lpsf); + psid->lpiidl=ConcatPidls(lpidl, lpiidl); + psid->lpiidlRelative=CopyITEMID(lpm, lpiidl); + psid->lpsfParent=lpsf; - if (hParent == GetRootItem()) - { - // if this is My computer or net. neigh. - it's better to remember the handles - // compare psid->lpiidl and (lpiidlDrives & lpiidlNetwork) - if (SCODE_CODE(lpsfDesktop->CompareIDs(0, psid->lpiidl, lpiidlDrives)) == 0) - m_hDrives=hCurrent; - else if (SCODE_CODE(lpsfDesktop->CompareIDs(0, psid->lpiidl, lpiidlNetwork)) == 0) - m_hNetwork=hCurrent; - } + tvi.mask=TVIF_CHILDREN | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM; + if (!GetName(lpsf, lpiidl, SHGDN_INFOLDER/* | SHGDN_INCLUDE_NONFILESYS*/, szText)) + lstrcpy(szText, _T("???")); + tvi.pszText=szText; + sfi.iIcon=-1; + SHGetFileInfo((LPCTSTR)psid->lpiidl, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + tvi.iImage=sfi.iIcon; + sfi.iIcon=-1; + SHGetFileInfo((LPCTSTR)psid->lpiidl, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON); + tvi.iSelectedImage=sfi.iIcon; + tvi.cChildren=(ulAttrib & SFGAO_HASSUBFOLDER); + tvi.lParam=reinterpret_cast(psid); - FreePidl(lpiidl); // free found pidl - it was copied already + tvis.hParent=hParent; + tvis.item=tvi; + hCurrent=InsertItem(&tvis); + + if (hParent == GetRootItem()) + { + // if this is My computer or net. neigh. - it's better to remember the handles + // compare psid->lpiidl and (lpiidlDrives & lpiidlNetwork) + if (SCODE_CODE(lpsfDesktop->CompareIDs(0, psid->lpiidl, lpiidlDrives)) == 0) + m_hDrives=hCurrent; + else if (SCODE_CODE(lpsfDesktop->CompareIDs(0, psid->lpiidl, lpiidlNetwork)) == 0) + m_hNetwork=hCurrent; + } + + FreePidl(lpiidl); // free found pidl - it was copied already + } } } - if (lpeid) + if(lpeid) lpeid->Release(); - - if (lpsfDesktop) + if(lpsfDesktop) lpsfDesktop->Release(); + if(lpm) + lpm->Release(); - lpm->Release(); - // sortuj - if (bFound) + if(SUCCEEDED(hResult)) { - TVSORTCB tvscb; - tvscb.hParent=hParent; - tvscb.lpfnCompare=&CompareFunc; - tvscb.lParam=NULL; - if (!SortChildrenCB(&tvscb)) - TRACE("SortChildren failed\n"); - } - else - { - // some items has + and some not - correction - TVITEM tvi; - tvi.mask=TVIF_HANDLE | TVIF_CHILDREN; - tvi.hItem=hParent; - if (GetItem(&tvi) && tvi.cChildren == 1) + if(bFound) { - tvi.cChildren=0; - SetItem(&tvi); + TVSORTCB tvscb; + tvscb.hParent=hParent; + tvscb.lpfnCompare=&CompareFunc; + tvscb.lParam=NULL; + if (!SortChildrenCB(&tvscb)) + TRACE("SortChildren failed\n"); } + else + { + // some items has + and some not - correction + TVITEM tvi; + tvi.mask=TVIF_HANDLE | TVIF_CHILDREN; + tvi.hItem=hParent; + if (GetItem(&tvi) && tvi.cChildren == 1) + { + tvi.cChildren=0; + SetItem(&tvi); + } + } } - return bFound; + return hResult; } //////////////////////////////////////////////////////////////////////////// @@ -538,7 +546,7 @@ SHELLITEMDATA* psid; if (GetItemStruct(hItem, &psid)) { - if (!FillNode(hItem, psid->lpsf, psid->lpiidl, true)) + if(FAILED(FillNode(hItem, psid->lpsf, psid->lpiidl, true))) TRACE("FillNode in ExpandItem failed...\n"); // ignore fillnode in onitemexpanding @@ -570,7 +578,7 @@ if (!m_bIgnore) { // fill - if (!FillNode(pNMTreeView->itemNew.hItem, psid->lpsf, psid->lpiidl)) + if (FAILED(FillNode(pNMTreeView->itemNew.hItem, psid->lpsf, psid->lpiidl))) TRACE("FillNode failed...\n"); } else @@ -664,6 +672,8 @@ bool CDirTreeCtrl::SetPath(LPCTSTR lpszPath) { ASSERT(lpszPath); + if(!lpszPath) + return false; // if path is empty if (_tcscmp(lpszPath, _T("")) == 0) @@ -935,6 +945,8 @@ bool CDirTreeCtrl::GetItemStruct(HTREEITEM hItem, PSHELLITEMDATA *ppsid) { ASSERT(ppsid); + if(!ppsid) + return false; *ppsid=(PSHELLITEMDATA)GetItemData(hItem); return *ppsid != NULL; } @@ -1054,7 +1066,7 @@ SHELLITEMDATA* psid; if (GetItemStruct(hParent, &psid)) { - if (!FillNode(hParent, psid->lpsf, psid->lpiidl)) + if (FAILED(FillNode(hParent, psid->lpsf, psid->lpiidl))) TRACE("FillNode in EndEditLabel failed...\n"); } Index: src/ch/DirTreeCtrl.h =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/DirTreeCtrl.h (.../DirTreeCtrl.h) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/DirTreeCtrl.h (.../DirTreeCtrl.h) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -156,7 +156,7 @@ bool ComparePaths(LPCTSTR lpszFull, LPCTSTR lpszPartial); // bool SetRemotePath(LPCTSTR lpszPath); bool SetLocalPath(LPCTSTR lpszPath); - bool FillNode(HTREEITEM hParent, LPSHELLFOLDER lpsf, LPITEMIDLIST lpidl, bool bSilent=false); + HRESULT FillNode(HTREEITEM hParent, LPSHELLFOLDER lpsf, LPITEMIDLIST lpidl, bool bSilent=false); bool m_bIgnoreShellDialogs; // ignore dialogs of type 'insert floppy disk' HIMAGELIST m_hImageList; // system img list Index: src/ch/ExceptionEx.h =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/ExceptionEx.h (.../ExceptionEx.h) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/ExceptionEx.h (.../ExceptionEx.h) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -100,11 +100,15 @@ // helpers static TCHAR* FormatReason(PCTSTR pszReason, ...) { - TCHAR szBuf[1024]; + const size_t stMaxReason = 1024; + TCHAR szBuf[stMaxReason]; + va_list marker; va_start(marker, pszReason); - _vsntprintf(szBuf, 1024, pszReason, marker); + _vsntprintf(szBuf, stMaxReason - 1, pszReason, marker); + szBuf[stMaxReason - 1] = _T('\0'); va_end(marker); + TCHAR *pszData=new TCHAR[_tcslen(szBuf)+1]; _tcscpy(pszData, szBuf); return pszData; @@ -113,6 +117,8 @@ // formats max info about this exception virtual TCHAR* GetInfo(LPCTSTR pszDesc, TCHAR* pszStr, DWORD dwMaxLen) { + const size_t stMaxData = 1024; + // get the properties int iCount=RegisterInfo(NULL); __EXCPROPINFO *pepi=new __EXCPROPINFO[iCount]; @@ -130,7 +136,7 @@ size_t tIndex=_tcslen(pszStr); // format the info accordingly - TCHAR szData[1024]; + TCHAR szData[stMaxData]; for (int i=0;iUpdateTime(); // save progress before killed - TCHAR szPath[_MAX_PATH]; GetConfig()->get_string(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); GetApp()->ExpandPath(szPath); pTask->Store(szPath, false); @@ -1126,7 +1125,7 @@ PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); } - CTime tm=CTime::GetCurrentTime(); + tm=CTime::GetCurrentTime(); pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFTHREADFINISHED_STRING), tm.GetDay(), tm.GetMonth(), tm.GetYear(), tm.GetHour(), tm.GetMinute(), tm.GetSecond()); // we have been killed - the last operation @@ -1147,7 +1146,7 @@ if (e->m_iType == E_ERROR && GetConfig()->get_bool(PP_SNDPLAYSOUNDS)) { - TCHAR szPath[_MAX_PATH]; + szPath[_MAX_PATH]; GetConfig()->get_string(PP_SNDERRORSOUNDPATH, szPath, _MAX_PATH); GetApp()->ExpandPath(szPath); PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); Index: src/ch/MemDC.h =================================================================== diff -u -r3493e9fc470285b0a0b417d50be281467a071eb7 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/MemDC.h (.../MemDC.h) (revision 3493e9fc470285b0a0b417d50be281467a071eb7) +++ src/ch/MemDC.h (.../MemDC.h) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -55,7 +55,8 @@ CMemDC(CDC* pDC, LPCRECT lpSrcRect) : CDC() { ASSERT(pDC != NULL); - + if(!pDC) + return; m_rect.CopyRect(lpSrcRect); m_pDC = pDC; m_pOldBitmap = NULL; Index: src/ch/OptionsDlg.cpp =================================================================== diff -u -r37a273b73ad2ba80df122121bc36c7a11a5492bc -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision 37a273b73ad2ba80df122121bc36c7a11a5492bc) +++ src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -97,6 +97,8 @@ // copy shortcut and recent paths icpf::config* pConfig = GetConfig(); assert(pConfig); + if(!pConfig) + return FALSE; m_cvRecent.clear(true); size_t stSize = pConfig->get_value_count(PP_RECENTPATHS); @@ -497,6 +499,9 @@ CString COptionsDlg::MakeCompoundString(UINT uiBase, int iCount, LPCTSTR lpszSeparator) { + assert(lpszSeparator); + if(!lpszSeparator) + return _T(""); _tcscpy(m_szBuffer, GetResManager()->LoadString(uiBase+0)); for (int i=1;i @@ -181,6 +180,8 @@ CLangData* pLangData = (CLangData*)pData; assert(pLangData); assert(pszName); + if(!pLangData || !pszName) + return; if(bGroup && _tcsicmp(pszName, _t("Info")) == 0) return; @@ -399,6 +400,11 @@ // requires the param with ending '\\' void CResourceManager::Scan(LPCTSTR pszFolder, vector* pvData) { + assert(pszFolder); + assert(pvData); + if(!pszFolder || !pvData) + return; + TCHAR szPath[_MAX_PATH]; _tcscpy(szPath, pszFolder); _tcscat(szPath, _T("*.lng")); @@ -491,6 +497,7 @@ MENUITEMINFO mif; WORD wLoID; TCHAR szItem[1024]; + memset(szItem, 0, 1024); for (int i=0;iGetWindowRect(&rect); - // set point in which to set menu - CRect rect; - GetDlgItem(IDC_SET_PRIORITY_BUTTON)->GetWindowRect(&rect); - - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + } } BOOL CStatusDlg::OnCommand(WPARAM wParam, LPARAM lParam) @@ -816,12 +818,14 @@ CMenu* pPopup = menu.GetSubMenu(0); ASSERT(pPopup != NULL); + if(pPopup) + { + // get the point to show menu at + CRect rect; + GetDlgItem(IDC_ADVANCED_BUTTON)->GetWindowRect(&rect); - // get the point to show menu at - CRect rect; - GetDlgItem(IDC_ADVANCED_BUTTON)->GetWindowRect(&rect); - - pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); + } } void CStatusDlg::OnPopupReplacePaths() @@ -901,7 +905,7 @@ void CStatusDlg::SetBufferSizesString(UINT uiValue, int iIndex) { TCHAR szData[1024]; - switch (iIndex) + switch(iIndex) { case BI_DEFAULT: GetResManager()->LoadStringCopy(IDS_BSDEFAULT_STRING, szData, 256); @@ -918,6 +922,9 @@ case BI_LAN: GetResManager()->LoadStringCopy(IDS_BSLAN_STRING, szData, 256); break; + default: + _ASSERTE(false); + szData[0] = _T('\0'); } _tcscat(szData, GetSizeString((__int64)uiValue, m_szData, _MAX_PATH)); Index: src/ch/Stdafx.h =================================================================== diff -u -r76484f915550132d9fe6be7202fbe0c5dc8cdae7 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/Stdafx.h (.../Stdafx.h) (revision 76484f915550132d9fe6be7202fbe0c5dc8cdae7) +++ src/ch/Stdafx.h (.../Stdafx.h) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -30,9 +30,6 @@ #endif // _AFX_NO_AFXCMN_SUPPORT #include "afxmt.h" -#define DISABLE_CRYPT -#include "ConfigManager.h" - #pragma warning (disable: 4711) #include "HelpLngDialog.h" #include "htmlhelp.h" Index: src/ch/Theme Helpers.cpp =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/Theme Helpers.cpp (.../Theme Helpers.cpp) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -38,6 +38,8 @@ HTHEME CUxThemeSupport::OpenThemeData(HWND hwnd, LPCWSTR pszClassList) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return NULL; PFNOPENTHEMEDATA pfnProc=(PFNOPENTHEMEDATA)GetProcAddress(m_hThemesDll, "OpenThemeData"); @@ -50,6 +52,8 @@ HRESULT CUxThemeSupport::CloseThemeData(HTHEME hTheme) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNCLOSETHEMEDATA pfnProc=(PFNCLOSETHEMEDATA)GetProcAddress(m_hThemesDll, "CloseThemeData"); @@ -62,6 +66,8 @@ HRESULT CUxThemeSupport::DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNDRAWTHEMEEDGE pfnProc=(PFNDRAWTHEMEEDGE)GetProcAddress(m_hThemesDll, "DrawThemeEdge"); @@ -74,6 +80,8 @@ HRESULT CUxThemeSupport::DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNDRAWTHEMEBACKGROUND pfnProc=(PFNDRAWTHEMEBACKGROUND)GetProcAddress(m_hThemesDll, "DrawThemeBackground"); @@ -86,6 +94,8 @@ HRESULT CUxThemeSupport::DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc) { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return E_FAIL; PFNDRAWTHEMEPARENTBACKGROUND pfnProc=(PFNDRAWTHEMEPARENTBACKGROUND)GetProcAddress(m_hThemesDll, "DrawThemeParentBackground"); @@ -98,6 +108,8 @@ BOOL CUxThemeSupport::IsAppThemed() { ASSERT(m_hThemesDll); + if(!m_hThemesDll) + return FALSE; PFNISAPPTHEMED pfnProc=(PFNISAPPTHEMED)GetProcAddress(m_hThemesDll, "IsAppThemed"); Index: src/ch/ThemedButton.cpp =================================================================== diff -u -r3493e9fc470285b0a0b417d50be281467a071eb7 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/ThemedButton.cpp (.../ThemedButton.cpp) (revision 3493e9fc470285b0a0b417d50be281467a071eb7) +++ src/ch/ThemedButton.cpp (.../ThemedButton.cpp) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -86,13 +86,15 @@ DrawFrameControl(memdc.GetSafeHdc(), &rcItem, DFC_BUTTON, DFCS_ADJUSTRECT | DFCS_BUTTONPUSH | (bPushed ? DFCS_PUSHED : 0)); ASSERT(m_pilList); // make sure the image list exist + if(m_pilList) + { + int cx=16, cy=16; + ImageList_GetIconSize(m_pilList->m_hImageList, &cx, &cy); - int cx=16, cy=16; - ImageList_GetIconSize(m_pilList->m_hImageList, &cx, &cy); - - CRect rcBtn; - GetClientRect(&rcBtn); - m_pilList->Draw(&memdc, m_iIndex, CPoint( ((rcBtn.Width()-cx)/2)+(bPushed ? 1 : 0), (rcBtn.Height()-cy)/2+(bPushed ? 1 : 0)), ILD_TRANSPARENT); + CRect rcBtn; + GetClientRect(&rcBtn); + m_pilList->Draw(&memdc, m_iIndex, CPoint( ((rcBtn.Width()-cx)/2)+(bPushed ? 1 : 0), (rcBtn.Height()-cy)/2+(bPushed ? 1 : 0)), ILD_TRANSPARENT); + } } void CThemedButton::OnMouseMove(UINT nFlags, CPoint point) Index: src/ch/ch.h =================================================================== diff -u -rcdf6a22ddf857f56ce2e27e26d8cd6f0b8034b2e -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/ch.h (.../ch.h) (revision cdf6a22ddf857f56ce2e27e26d8cd6f0b8034b2e) +++ src/ch/ch.h (.../ch.h) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -28,15 +28,10 @@ #include "resource.h" // main symbols #include "AppHelper.h" #include "ResourceManager.h" - -#define DISABLE_CRYPT -#include "ConfigManager.h" - #include "CfgProperties.h" //#include "LogFile.h" #include "../libicpf/log.h" #include "../libicpf/cfg.h" -#include "../libicpf/cfg_ini.h" using namespace std; Index: src/ch/ch.vc90.vcproj =================================================================== diff -u -r06fedac840a38b4a69fc14f5057b8197b75cebe3 -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision 06fedac840a38b4a69fc14f5057b8197b75cebe3) +++ src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -864,10 +864,6 @@ - - @@ -900,10 +896,6 @@ > - - @@ -924,10 +916,6 @@ > - - @@ -1129,10 +1117,6 @@ > - - @@ -1173,10 +1157,6 @@ > - - @@ -1197,10 +1177,6 @@ > - - @@ -2203,7 +2179,7 @@ @@ -2213,7 +2189,7 @@ @@ -2223,7 +2199,7 @@ @@ -2233,7 +2209,7 @@ @@ -2243,7 +2219,7 @@ @@ -2253,7 +2229,7 @@ @@ -2263,7 +2239,7 @@ @@ -2273,7 +2249,7 @@ @@ -2287,7 +2263,7 @@ @@ -2297,7 +2273,7 @@ @@ -2307,7 +2283,7 @@ @@ -2317,7 +2293,7 @@ @@ -2327,7 +2303,7 @@ @@ -2337,7 +2313,7 @@ @@ -2347,7 +2323,7 @@ @@ -2357,7 +2333,7 @@ @@ -2371,7 +2347,7 @@ @@ -2381,7 +2357,7 @@ @@ -2391,7 +2367,7 @@ @@ -2401,7 +2377,7 @@ @@ -2411,7 +2387,7 @@ @@ -2421,7 +2397,7 @@ @@ -2431,7 +2407,7 @@ @@ -2441,7 +2417,7 @@ @@ -2455,7 +2431,7 @@ @@ -2465,7 +2441,7 @@ @@ -2475,7 +2451,7 @@ @@ -2485,7 +2461,7 @@ @@ -2495,7 +2471,7 @@ @@ -2505,7 +2481,7 @@ @@ -2515,7 +2491,7 @@ @@ -2525,7 +2501,7 @@ @@ -2539,7 +2515,7 @@ @@ -2549,7 +2525,7 @@ @@ -2559,7 +2535,7 @@ @@ -2569,7 +2545,7 @@ @@ -2579,7 +2555,7 @@ @@ -2589,7 +2565,7 @@ @@ -2599,7 +2575,7 @@ @@ -2609,7 +2585,7 @@ @@ -2623,7 +2599,7 @@ @@ -2633,7 +2609,7 @@ @@ -2643,7 +2619,7 @@ @@ -2653,7 +2629,7 @@ @@ -2663,7 +2639,7 @@ @@ -2673,7 +2649,7 @@ @@ -2683,7 +2659,7 @@ @@ -2693,7 +2669,7 @@ @@ -2707,7 +2683,7 @@ @@ -2717,7 +2693,7 @@ @@ -2727,7 +2703,7 @@ @@ -2737,7 +2713,7 @@ @@ -2747,7 +2723,7 @@ @@ -2757,7 +2733,7 @@ @@ -2767,7 +2743,7 @@ @@ -2777,7 +2753,7 @@ @@ -2791,7 +2767,7 @@ @@ -2801,7 +2777,7 @@ @@ -2811,7 +2787,7 @@ @@ -2821,7 +2797,7 @@ @@ -2831,7 +2807,7 @@ @@ -2841,7 +2817,7 @@ @@ -2851,7 +2827,7 @@ @@ -2861,7 +2837,7 @@ @@ -2875,7 +2851,7 @@ @@ -2885,7 +2861,7 @@ @@ -2895,7 +2871,7 @@ @@ -2905,7 +2881,7 @@ @@ -2915,7 +2891,7 @@ @@ -2925,7 +2901,7 @@ @@ -2935,7 +2911,7 @@ @@ -2945,7 +2921,7 @@ @@ -2959,7 +2935,7 @@ @@ -2969,7 +2945,7 @@ @@ -2979,7 +2955,7 @@ @@ -2989,7 +2965,7 @@ @@ -2999,7 +2975,7 @@ @@ -3009,7 +2985,7 @@ @@ -3019,7 +2995,7 @@ @@ -3029,7 +3005,7 @@ @@ -3043,7 +3019,7 @@ @@ -3053,7 +3029,7 @@ @@ -3063,7 +3039,7 @@ @@ -3073,7 +3049,7 @@ @@ -3083,7 +3059,7 @@ @@ -3093,7 +3069,7 @@ @@ -3103,7 +3079,7 @@ @@ -3113,7 +3089,7 @@ @@ -3127,7 +3103,7 @@ @@ -3137,7 +3113,7 @@ @@ -3147,7 +3123,7 @@ @@ -3157,7 +3133,7 @@ @@ -3167,7 +3143,7 @@ @@ -3177,7 +3153,7 @@ @@ -3187,7 +3163,7 @@ @@ -3197,7 +3173,7 @@ @@ -3211,7 +3187,7 @@ @@ -3221,7 +3197,7 @@ @@ -3231,7 +3207,7 @@ @@ -3241,7 +3217,7 @@ @@ -3251,7 +3227,7 @@ @@ -3261,7 +3237,7 @@ @@ -3271,7 +3247,7 @@ @@ -3281,7 +3257,7 @@ @@ -3295,7 +3271,7 @@ @@ -3305,7 +3281,7 @@ @@ -3315,7 +3291,7 @@ @@ -3325,7 +3301,7 @@ @@ -3335,7 +3311,7 @@ @@ -3345,7 +3321,7 @@ @@ -3355,7 +3331,7 @@ @@ -3365,7 +3341,7 @@ Index: src/ch/charvect.h =================================================================== diff -u -rcdf6a22ddf857f56ce2e27e26d8cd6f0b8034b2e -rebabad67cdda34ed4e36ab794e10d0ade8124bf3 --- src/ch/charvect.h (.../charvect.h) (revision cdf6a22ddf857f56ce2e27e26d8cd6f0b8034b2e) +++ src/ch/charvect.h (.../charvect.h) (revision ebabad67cdda34ed4e36ab794e10d0ade8124bf3) @@ -63,13 +63,21 @@ { size_type _Size=_tcslen(_Val)+1; PTSTR *ppsz=new PTSTR[_Count]; - for (size_type i=0;i<_Count;i++) + try { - ppsz[i]=new TCHAR[_Size]; - _tcscpy(ppsz[i], _Val); - } + for (size_type i=0;i<_Count;i++) + { + ppsz[i]=new TCHAR[_Size]; + _tcscpy(ppsz[i], _Val); + } - ((vector*)this)->insert(_Where, ppsz, ppsz+_Count); + ((vector*)this)->insert(_Where, ppsz, ppsz+_Count); + } + catch(...) + { + delete [] ppsz; + throw; + } delete [] ppsz; } else @@ -79,30 +87,44 @@ { size_type _Size=_tcslen(_Val)+1; PTSTR *ppsz=new PTSTR[_Count]; - for(size_type i=0;i<_Count;i++) + try { - ppsz[i]=new TCHAR[_Size]; - _tcscpy(ppsz[i], _Val); - } + for(size_type i=0;i<_Count;i++) + { + ppsz[i]=new TCHAR[_Size]; + _tcscpy(ppsz[i], _Val); + } - ((vector*)this)->insert(_Where, ppsz, ppsz+_Count); - delete [] ppsz; + ((vector*)this)->insert(_Where, ppsz, ppsz+_Count); + } + catch(...) + { + delete [] ppsz; + } }; template void insert(iterator _Where, _It _First, _It _Last, bool bCopy) { if (bCopy) { size_type _Cnt=_Last-_First; PTSTR *ppsz=new PTSTR[_Cnt]; - for (size_type i=0;i<_Cnt;i++) + try { - ppsz[i]=new TCHAR[_tcslen(*_First)+1]; - _tcscpy(ppsz[i], *_First); + for (size_type i=0;i<_Cnt;i++) + { + ppsz[i]=new TCHAR[_tcslen(*_First)+1]; + _tcscpy(ppsz[i], *_First); - _First++; - } + _First++; + } - ((vector*)this)->insert(_Where, ppsz, ppsz+_Cnt); + ((vector*)this)->insert(_Where, ppsz, ppsz+_Cnt); + } + catch(...) + { + delete [] ppsz; + throw; + } delete [] ppsz; } else