chevah/compat — pull request #23 by adiroiban (2014-03-04 13:51:27+00:00)
Title: [#2018] Detect symlink support on Windows.

Problem description
===================

Not all Windows version and running mode support symlink creation.

We need to check symlink support in process in order to implement symlink functionality.

Changes description
===================
This also includes a refactoring of this code.

All Unix system should support symlinks.

elevatePrivileges was made public as it was used from nt_filesystem... is public but not part of standard IProcessCapabilities interface.

I did not liked how CompatException was bubbled outside of the class where it was raised as _elevatePrivileges was not documented and I prefer to have a single AdjustPrivilegeException exception.

I have refactored _getAvailablePrivileges to have GetTokenInformation call
in a single place.

There is also a new _getPrivilegeState

I have refactored _hasPrivilege to use the new methods. It was renamed to
_isPrivilegeEnabled to better describe what it does.

I have moved all Windows capabilities tests in a single test since on Windows
elevate things are a big different and many of those tests were also valid
for XP, DC and 2003.

How to try and test the changes
===============================

reviewers @alibotean

Check that changes make sense.