- Simplify duplicated code by having one EnumFiles() function using
callbacks to perform actual action on enumerated files.
PrintAttribute() and ChangeAttribute() duplicate their functionality,
except for the actual difference of displaying the file attributes vs.
changing them.
Instead, move that per-file action into two callbacks, create a file
enumerator function that contains the common functionality, and make
it call the callback passed in parameter to it.
- Reparse points can be encountered during enumeration. In this case,
don't try to go into too many reparse-point levels (maximum two).
- Verify that paths/file names concatenation don't overflow (with the
StringCch* functions returning an error), as this could cause an
infinite loop in case of recursive-enumeration, and the position where
the new path part would be appended turns out to be just at the end
of the buffer.