@Wiimpathy @blackb0x so i found a bug in PartitionHandle.cpp in the unmount function. highlighted in red below. the problem is - is there is no such constant or variable named MountName. The name is supposed to be MountNameList[pos].c_str(). if left as MountName it means that those partitions were never unmounted because DeviceSyn should be garbage or empty with just a colon. but the strangest thing of all is that the compiler never caught the error. and never reported MountName as uninitialized.
void PartitionHandle::UnMount(int pos)
{
if(!interface || (pos >= (int)MountNameList.size()) || (MountNameList[pos].size() == 0))
return;
WBFS_Close();
char DeviceSyn[10];
memcpy(DeviceSyn, MountName(pos), 8);
strcat(DeviceSyn, ":");
DeviceSyn[9] = '\0';
if(strncmp(GetFSName(pos), "WBFS", 4) == 0)
{
wbfs_t *wbfshandle = GetWbfsHandle(pos);
if(wbfshandle) wbfs_close(wbfshandle);
gprintf("WBFS Partition at %s unmounted.\n", DeviceSyn);
}
else if(strncmp(GetFSName(pos), "FAT", 3) == 0)
{
fatUnmount(DeviceSyn);
gprintf("FAT Partition at %s unmounted.\n", DeviceSyn);
}
else if(strncmp(GetFSName(pos), "NTFS", 4) == 0)
{
ntfsUnmount(DeviceSyn, true);
gprintf("NTFS Partition at %s unmounted.\n", DeviceSyn);
}
else if(strncmp(GetFSName(pos), "LINUX", 5) == 0)
{
ext2Unmount(DeviceSyn);
gprintf("EXT Partition at %s unmounted.\n", DeviceSyn);
}
/* Remove name from list */
MountNameList[pos].clear();
SetWbfsHandle(pos, NULL);
}
void PartitionHandle::UnMount(int pos)
{
if(!interface || (pos >= (int)MountNameList.size()) || (MountNameList[pos].size() == 0))
return;
WBFS_Close();
char DeviceSyn[10];
memcpy(DeviceSyn, MountName(pos), 8);
strcat(DeviceSyn, ":");
DeviceSyn[9] = '\0';
if(strncmp(GetFSName(pos), "WBFS", 4) == 0)
{
wbfs_t *wbfshandle = GetWbfsHandle(pos);
if(wbfshandle) wbfs_close(wbfshandle);
gprintf("WBFS Partition at %s unmounted.\n", DeviceSyn);
}
else if(strncmp(GetFSName(pos), "FAT", 3) == 0)
{
fatUnmount(DeviceSyn);
gprintf("FAT Partition at %s unmounted.\n", DeviceSyn);
}
else if(strncmp(GetFSName(pos), "NTFS", 4) == 0)
{
ntfsUnmount(DeviceSyn, true);
gprintf("NTFS Partition at %s unmounted.\n", DeviceSyn);
}
else if(strncmp(GetFSName(pos), "LINUX", 5) == 0)
{
ext2Unmount(DeviceSyn);
gprintf("EXT Partition at %s unmounted.\n", DeviceSyn);
}
/* Remove name from list */
MountNameList[pos].clear();
SetWbfsHandle(pos, NULL);
}