memcpy(&pResultCB->VolumeCreationTime, &ft, sizeof(ft));
pResultCB->AvailableAllocationUnits.QuadPart = 0;
- pResultCB->Characteristics |= FILE_READ_ONLY_DEVICE;
+ pResultCB->FileSystemAttributes |= FILE_READ_ONLY_VOLUME;
pResultCB->VolumeLabelLength = cm_Utf8ToUtf16( "Freelance.Local.Root", -1, pResultCB->VolumeLabel,
(sizeof(pResultCB->VolumeLabel) / sizeof(WCHAR)) + 1);
}
volType = cm_VolumeType(volp, scp->fid.volume);
- pResultCB->Characteristics |= ((volType == ROVOL || volType == BACKVOL) ? FILE_READ_ONLY_DEVICE : 0);
+ if (volType == ROVOL || volType == BACKVOL)
+ pResultCB->FileSystemAttributes |= FILE_READ_ONLY_VOLUME;
code = cm_SyncOp(scp, NULL, userp, &req, PRSFS_READ,
CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
}
if (code == 0) {
- if (volStat.MaxQuota)
- {
- pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota;
- if (volType == ROVOL || volType == BACKVOL) {
- pResultCB->AvailableAllocationUnits.QuadPart = 0;
- }
- else
+ if (volType == ROVOL || volType == BACKVOL) {
+ pResultCB->TotalAllocationUnits.QuadPart = volStat.BlocksInUse;
+ pResultCB->AvailableAllocationUnits.QuadPart = 0;
+ } else {
+ if (volStat.MaxQuota)
{
+ pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota;
pResultCB->AvailableAllocationUnits.QuadPart =
min(volStat.MaxQuota - volStat.BlocksInUse, volStat.PartBlocksAvail);
}
- }
- else
- {
- pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks;
- if (volType == ROVOL || volType == BACKVOL) {
- pResultCB->AvailableAllocationUnits.QuadPart = 0;
- }
else
{
+ pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks;
pResultCB->AvailableAllocationUnits.QuadPart = volStat.PartBlocksAvail;
}
}
}
if (code == 0) {
- if (volStat.MaxQuota)
- {
- pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota;
- if (volType == ROVOL || volType == BACKVOL) {
- pResultCB->AvailableAllocationUnits.QuadPart = 0;
- }
- else
+ if (volType == ROVOL || volType == BACKVOL) {
+ pResultCB->TotalAllocationUnits.QuadPart = volStat.BlocksInUse;
+ pResultCB->AvailableAllocationUnits.QuadPart = 0;
+ } else {
+ if (volStat.MaxQuota)
{
+ pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota;
pResultCB->AvailableAllocationUnits.QuadPart =
min(volStat.MaxQuota - volStat.BlocksInUse, volStat.PartBlocksAvail);
}
- }
- else
- {
- pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks;
- if (volType == ROVOL || volType == BACKVOL) {
- pResultCB->AvailableAllocationUnits.QuadPart = 0;
- }
else
{
+ pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks;
pResultCB->AvailableAllocationUnits.QuadPart = volStat.PartBlocksAvail;
}
}