Exemplo n.º 1
0
 internal MountPoint(SafeBufferGeneric buffer, MOUNTMGR_MOUNT_POINT mp)
 {
     SymbolicLinkName = buffer.ReadUnicodeString((ulong)mp.SymbolicLinkNameOffset, mp.SymbolicLinkNameLength / 2);
     if (SymbolicLinkName.StartsWith(@"\DosDevices", StringComparison.OrdinalIgnoreCase))
     {
         SymbolicLinkName = @"\??" + SymbolicLinkName.Substring(11);
     }
     UniqueId   = buffer.ReadBytes((ulong)mp.UniqueIdOffset, mp.UniqueIdLength);
     DeviceName = buffer.ReadUnicodeString((ulong)mp.DeviceNameOffset, mp.DeviceNameLength / 2);
 }
Exemplo n.º 2
0
        private static IReadOnlyList <MountPoint> ParseMountPoints(SafeStructureInOutBuffer <MOUNTMGR_MOUNT_POINTS> buffer, int length)
        {
            buffer.Initialize((uint)length);
            var result = buffer.Result;

            MOUNTMGR_MOUNT_POINT[] mount_point = new MOUNTMGR_MOUNT_POINT[result.NumberOfMountPoints];
            buffer.Data.ReadArray(0, mount_point, 0, mount_point.Length);

            return(mount_point.Select(m => new MountPoint(buffer, m)).ToList().AsReadOnly());
        }