mirror of
https://github.com/Maschell/libntfs-wiiu.git
synced 2024-11-05 20:55:09 +01:00
Try to mount the first sector if no Partitiontable exists
This commit is contained in:
parent
8506269613
commit
a8d727ce17
@ -320,6 +320,27 @@ int ntfsMountAll (ntfs_md **mounts, u32 flags)
|
||||
|
||||
}
|
||||
ntfs_free(partitions);
|
||||
}else if(partition_count == 0){
|
||||
int k = 0;
|
||||
// Find the next unused mount name
|
||||
do {
|
||||
sprintf(name, "%s%i", NTFS_MOUNT_PREFIX, k++);
|
||||
if (k >= NTFS_MAX_MOUNTS) {
|
||||
ntfs_free(partitions);
|
||||
errno = EADDRNOTAVAIL;
|
||||
return -1;
|
||||
}
|
||||
} while (ntfsGetDevice(name, false));
|
||||
|
||||
// Mount the partition
|
||||
if (mount_count < NTFS_MAX_MOUNTS) {
|
||||
if (ntfsMount(name, disc->interface, 0, CACHE_DEFAULT_PAGE_SIZE, CACHE_DEFAULT_PAGE_COUNT, flags)) {
|
||||
strcpy(mount_points[mount_count].name, name);
|
||||
mount_points[mount_count].interface = disc->interface;
|
||||
mount_points[mount_count].startSector = 0;
|
||||
mount_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user