i was going through the code for some stuff for Skinner when i noticed
something strange. eMule set's it's dir mode in the current user's hkey:
void CPreferences::ChangeUserDirMode(int nNewMode){ ... // 0 = Multiuser, 1 = Publicuser, 2 = ExecuteableDir. CRegKey rkEMuleRegKey; if (rkEMuleRegKey.Create(HKEY_CURRENT_USER, _T("Software\\eMule")) == ERROR_SUCCESS){ if (rkEMuleRegKey.SetDWORDValue(_T("UsePublicUserDirectories"), nNewMode) != ERROR_SUCCESS) DebugLogError(_T("Failed to write registry key to switch UserDirMode")); else m_nCurrentUserDirMode = nNewMode; rkEMuleRegKey.Close(); }
shouldn't it be in the local machine key?
this is so the setting will be unified for all the users on the same computer.
second possible bug, i've started eMule 0.49b in debug (compiled myself without any changes),
when i tried to change the upload speed in the prefs, it crashed because of division by zero in
void COScopeCtrl::SetRange() at
m_PlotData[iTrend].dVerticalFactor = (double)m_nPlotHeight / m_PlotData[iTrend].dRange;
this was because the capacity was zero (from what i've seen).
there should be a check for .dRange to make sure it's not zero...
third possible bug, i've shared some files with 0.49b, including it's release files (bin & installer)
after sharing them, i tried to download them but eMule didn't notify me that i share them
because i've pasted the links, then i checked the code and saw that
void CDownloadQueue::AddFileLinkToDownload() doesn't check if the file is known/shared...:
void CDownloadQueue::AddFileLinkToDownload(CED2KFileLink* pLink, int cat) { if (IsFileExisting(pLink->GetHashKey(), true)) return; .... }
also, some code improvements:
in SafeFile.cpp, the CFileDataIO::Write[Long]String() function has 2 separate conditions
to write the string in multibyte, which can be merged... instead of:
if (eEncode == utf8strRaw) //utf8 else if (eEncode == utf8strOptBOM) { if (NeedUTF8String(rstr)) //bom-utf8 else //multibyte } else //multibyte
can be changed to:
if (eEncode == utf8strRaw) //utf8 else if (eEncode == utf8strOptBOM && NeedUTF8String(rstr)) //bom-utf8 else //multibyte
i'll update the thread soon, i forgot to write all the things i saw
and i may have forgotten something...

other improvements and fixes are in my sig, some are really old and should be taken care of
(like TitleMenu dll loading, the BtnSt and other unused classes, etc...)
Avi3k