Remove support for AppExeCLinks to retrieve target (#16044)

This commit is contained in:
Steve Lee 2021-09-14 14:08:00 -07:00 committed by GitHub
parent 1704ca6885
commit ed249d0fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7993,18 +7993,6 @@ namespace Microsoft.PowerShell.Commands
public byte[] PathBuffer;
}
[StructLayout(LayoutKind.Sequential)]
private struct REPARSE_DATA_BUFFER_APPEXECLINK
{
public uint ReparseTag;
public ushort ReparseDataLength;
public ushort Reserved;
public uint StringCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3FF0)]
public byte[] StringList;
}
[StructLayout(LayoutKind.Sequential)]
private struct BY_HANDLE_FILE_INFORMATION
{
@ -8233,10 +8221,6 @@ namespace Microsoft.PowerShell.Commands
linkType = "Junction";
break;
case IO_REPARSE_TAG_APPEXECLINK:
linkType = "AppExeCLink";
break;
default:
linkType = null;
break;
@ -8515,16 +8499,6 @@ namespace Microsoft.PowerShell.Commands
targetDir = Encoding.Unicode.GetString(reparseMountPointDataBuffer.PathBuffer, reparseMountPointDataBuffer.SubstituteNameOffset, reparseMountPointDataBuffer.SubstituteNameLength);
break;
case IO_REPARSE_TAG_APPEXECLINK:
REPARSE_DATA_BUFFER_APPEXECLINK reparseAppExeDataBuffer = Marshal.PtrToStructure<REPARSE_DATA_BUFFER_APPEXECLINK>(outBuffer);
// The target file is at index 2
if (reparseAppExeDataBuffer.StringCount >= 3)
{
string temp = Encoding.Unicode.GetString(reparseAppExeDataBuffer.StringList);
targetDir = temp.Split('\0')[2];
}
break;
default:
return null;
}