EldoS | Feel safer!

Software components for data protection, secure storage and transfer

GetVolumeSize => Enlarge maximum size?

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
Posted: 11/23/2012 07:10:46
by Julian  (Basic support level)
Joined: 11/23/2012
Posts: 1

Hello :-)

i'm actually trying to configure an Mounter-example by editing the GetVolumeSize-callback-method. The original code looks like the following:

void CbFsGetVolumeSize(
   CallbackFileSystem* Sender,
   __int64* TotalNumberOfSectors,
   __int64* NumberOfFreeSectors
    MEMORYSTATUS status;

    *TotalNumberOfSectors = status.dwTotalVirtual / g_CbFs.GetSectorSize();
    *NumberOfFreeSectors  = (status.dwTotalVirtual - CalculateFolderSize(g_DiskContext) + g_CbFs.GetSectorSize()/2) / g_CbFs.GetSectorSize();

Now i'm trying to implement a functionality so that the size of the mounted volume does never end. E.g.:

if (*NumberOfFreeSectors < *TotalNumberOfSectors/2){//enlarge maximum size}

Could there be any problems? What would be the best way for implementation?

Thanks for your support! :-)

Posted: 11/23/2012 10:59:45
by Volodymyr Zinin (EldoS Corp.)

You idea should work. But it's better to check it. CallbackFS does nothing extra with the storage size. It just passes the result returned from the GetVolumeSize callback to the system.



Topic viewed 994 times



Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!