void FILESET::Invalidate (void) { if (!m_fStatusOutOfDate) { if (m_wGhost & GHOST_HAS_SERVER_ENTRY) m_fStatusOutOfDate = TRUE; LPAGGREGATE lpAggregate; if ((lpAggregate = m_lpiAggregate->OpenAggregate()) != NULL) { lpAggregate->InvalidateAllocation(); lpAggregate->Close(); } NOTIFYCALLBACK::SendNotificationToAll (evtInvalidate, GetIdentifier()); } }
FILESET::FILESET (LPAGGREGATE lpAggregateParent, LPVOLUMEID pvid, LPTSTR pszName) { m_lpiAggregate = lpAggregateParent->GetIdentifier(); m_lpiServer = lpAggregateParent->m_lpiServer; m_lpiCell = lpAggregateParent->m_lpiCell; m_lpiThis = NULL; m_lpiThisRW = NULL; m_lpiThisBK = NULL; m_idVolume = *pvid; lstrcpy (m_szName, pszName); m_wGhost = 0; m_fStatusOutOfDate = TRUE; memset (&m_fs, 0x00, sizeof(FILESETSTATUS)); m_fs.id = *pvid; lpAggregateParent->InvalidateAllocation(); }
BOOL FILESET::RefreshStatus (BOOL fNotify, ULONG *pStatus) { BOOL rc = TRUE; DWORD status = 0; if (m_fStatusOutOfDate && (m_wGhost & GHOST_HAS_SERVER_ENTRY)) { m_fStatusOutOfDate = FALSE; if (fNotify) NOTIFYCALLBACK::SendNotificationToAll (evtRefreshStatusBegin, GetIdentifier()); LPSERVER lpServer; if ((lpServer = OpenServer (&status)) == NULL) rc = FALSE; else { PVOID hCell; PVOID hVOS; if ((hVOS = lpServer->OpenVosObject (&hCell, &status)) == NULL) rc = FALSE; else { WORKERPACKET wp; wp.wpVosVolumeGet.hCell = hCell; wp.wpVosVolumeGet.hServer = hVOS; wp.wpVosVolumeGet.idPartition = NO_PARTITION; wp.wpVosVolumeGet.idVolume = m_idVolume; LPAGGREGATE lpAggregate; if ((lpAggregate = m_lpiAggregate->OpenAggregate()) != NULL) { wp.wpVosVolumeGet.idPartition = lpAggregate->GetID(); lpAggregate->Close(); } if (!Worker_DoTask (wtaskVosVolumeGet, &wp, &status)) rc = FALSE; else { SetStatusFromVOS (&wp.wpVosVolumeGet.Data); if ((lpAggregate = m_lpiAggregate->OpenAggregate()) != NULL) { lpAggregate->InvalidateAllocation(); lpAggregate->Close(); } } lpServer->CloseVosObject(); } lpServer->Close(); } if (fNotify) NOTIFYCALLBACK::SendNotificationToAll (evtRefreshStatusEnd, GetIdentifier(), ((rc) ? 0 : status)); } if (pStatus && !rc) *pStatus = status; return TRUE; }