So, now all security rules are applied to the searches again (including but not limited to keyword rules for instance).
Also, depending on the usage of Shareaza, the code causes up to 20% less file reads/writes (as the security.dat file is now only saved to disk if this is really necessary and not each time you do stuff even if that does not change anything within the security manager). Also, debug output ("TRACE") has been added to view loading and saving of the security.dat file on the debug output of visual studio.
Some more "ASSERT"s have been added to assure the validity of security rules inside the code.
The "ban file" command no also blocks a file's hashes instead of only the IPs of its hits.
The mechanisms of the security manager have been further protected by migrating even more of them into private space - external edits of the rule lists or the rules should not be necessary anyway... And while doing so, a row of locks became unnecessary as the methods in question now deal with copies of the data structures of the security manager instead of modifying these data structures directly. However some more protection of the security manager is possible - which I will do eventually to completely prevent external editing of the internal security manager objects...
Also, there has been a problem with up/downgrading my security code as the generated security.dat file was not compatible. This has been fixed now and should not cause problems any more. (A switch from BOOL (old code) to bool (new code) caused problems as the first one is treated as an int when reading/writing to the file while the second one is treated as a bool (obvious) - and both types don't have the same size within the file, which caused the file content to be messed up when writing the file with one version of the security code and reading it with the other version.) Of course, while downgrading, the security rules are lost (and I can't guarantee that there is not some strange behaviour every now and then - however this cannot be avoided as the way the rules are stored has been changed for better efficiency and improved code cleanness).
Here you go with the code:
mfg,
Old
PS.: @Ryo, while working with the code, I had to revert everything to a revision previous to your project/build changes to be able to do the necessary debugging. Could you plz see that debugging the Shareaza code with VS2010 will be possible again soon without having to relay on such a trickery...?
EDIT: PPS: Some more work is in progress.