MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / SetVolume

Method SetVolume

Ext2Mgr/Properties.cpp:237–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void CProperties::SetVolume(PEXT2_VOLUME vol)
238{
239 CString s;
240
241 if (vol->Extent->NumberOfDiskExtents == 1) {
242 m_disk = &gDisks[vol->Extent->Extents[0].DiskNumber];
243 m_part = NULL;
244 for (UCHAR i = 0; i < m_disk->NumParts; i++) {
245 if (m_disk->DataParts[i].Volume == vol) {
246 m_part = &m_disk->DataParts[i];
247 break;
248 }
249 }
250 } else {
251 m_disk = NULL;
252 m_part = NULL;
253 }
254
255 if (m_part) {
256 m_disk = NULL;
257 m_volume = NULL;
258 SetPartition(m_part);
259 if (0 == m_part->DrvLetters)
260 SET_WIN(IDC_SDEV_QUICK_MOUNT, TRUE);
261 else
262 SET_WIN(IDC_SDEV_QUICK_MOUNT, FALSE);
263 return;
264 } else {
265 m_disk = NULL;
266 ResetDiskGroup();
267 if (m_volume) {
268 if (0 == m_volume->DrvLetters)
269 SET_WIN(IDC_SDEV_QUICK_MOUNT, TRUE);
270 else
271 SET_WIN(IDC_SDEV_QUICK_MOUNT, FALSE);
272 }
273 }
274
275 cbDiskBox->SetCurSel(-1);
276 ResetDiskGroup();
277
278 cbPartBox->ResetContent();
279 cbPartBox->AddString("Volume");
280 cbPartBox->SetCurSel(0);
281
282 /* set mount points */
283 SET_TEXT(IDC_MOUNT_POINTS,
284 Ext2QueryVolumeLetterStrings(
285 vol->DrvLetters, NULL));
286
287 /* set volume status */
288 s = "Online";
289 if (vol->bRecognized && (vol->EVP.bExt2 || vol->EVP.bExt3)) {
290 s += ",codepage:";
291 s += vol->EVP.Codepage;
292 if (vol->EVP.bReadonly) {
293 s += ",Readonly";
294 }

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected