Kiyoshi-Tomomura / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

Super simple super useful change! #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
int DokanGetDiskFreeSpace(
    PULONGLONG          FreeBytesAvailable,
    PULONGLONG          TotalNumberOfBytes,
    PULONGLONG          TotalNumberOfFreeBytes,
    PDOKAN_FILE_INFO    DokanFileInfo)
{
    *FreeBytesAvailable = 512*1024*1024;
    *TotalNumberOfBytes = 1024*1024*1024;
    *TotalNumberOfFreeBytes = 512*1024*1024;

    return 0;
}

Why is the data hard coded??? Its fairly trivial to add a struct to the global 
context:

typedef struct {
     LPWSTR     VolumeNameBuffer;
     DWORD      VolumeNameSize;
     LPDWORD        VolumeSerialNumber;
     LPDWORD        MaximumComponentLength;
     LPDWORD        FileSystemFlags;
     LPWSTR     FileSystemNameBuffer;
     DWORD      FileSystemNameSize;
     LONGLONG       FreeBytesAvailable;
     LONGLONG       TotalNumberOfBytes;
     LONGLONG       TotalNumberOfFreeBytes;
} DokanDiskDriveInfo;

And then populate from that! (The same goes for DokanGetVolumeInformation)

Original issue reported on code.google.com by chacham1...@gmail.com on 28 Dec 2010 at 9:51

GoogleCodeExporter commented 9 years ago
DokanGetDiskFreeSpace is used only when DOKAN_OPERATIONS->GetDiskFreeSpace is 
not defined. You can add GetDiskFreeSpace as you like.

Original comment by asa...@gmail.com on 4 Jan 2011 at 12:36