Remove support for AppExeCLinks to retrieve target (#16044)
This commit is contained in:
parent
1704ca6885
commit
ed249d0fe6
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue