I also tried something like:
function DirIsRoot(const PrmDir: String): Boolean;
var
dir: String;
begin
dir := ExpandFileName(ChompPathDelim(PrmDir)+'\..\');
Result := CompareText(dir, PrmDir) = 0;
end;
But that one failse on '\\server\share' and 'C:\..\' as well.
So, for now it remains a bit convoluted.
I refactored it a bit (the repeated copy()/pos() part)..
It also had a bug in the sense that it returned True on '\\?\C:/' (which is not the same as 'C:\' since in this naming scheme all characters are meant to be literal.
That's a bit contrived though.
Bart