* handle unknown reparse tags as non-symlinks

git-svn-id: trunk@46761 -
This commit is contained in:
svenbarth 2020-09-04 14:41:40 +00:00
parent f56539a7c9
commit 200e20fd71

View File

@ -476,6 +476,7 @@ begin
end; end;
end; end;
if SymLinkRec.TargetName <> '' then begin
Handle := FindFirstFileExW(PUnicodeChar(SymLinkRec.TargetName), FindExInfoDefaults , @SymLinkRec.FindData, Handle := FindFirstFileExW(PUnicodeChar(SymLinkRec.TargetName), FindExInfoDefaults , @SymLinkRec.FindData,
FindExSearchNameMatch, Nil, 0); FindExSearchNameMatch, Nil, 0);
if Handle <> INVALID_HANDLE_VALUE then begin if Handle <> INVALID_HANDLE_VALUE then begin
@ -488,6 +489,8 @@ begin
SymLinkRec.TargetName := ''; SymLinkRec.TargetName := '';
end else end else
SetLastError(ERROR_REPARSE_TAG_INVALID); SetLastError(ERROR_REPARSE_TAG_INVALID);
end else
SetLastError(ERROR_REPARSE_TAG_INVALID);
finally finally
FreeMem(PBuffer); FreeMem(PBuffer);
end; end;