| 423 | } |
| 424 | |
| 425 | void CProperties::SetDisk(PEXT2_DISK disk) |
| 426 | { |
| 427 | CString s; |
| 428 | ULONGLONG size = 1; |
| 429 | |
| 430 | ResetPartGroup(); |
| 431 | cbPartBox->ResetContent(); |
| 432 | |
| 433 | if (!disk->bLoaded) { |
| 434 | ResetDiskGroup(); |
| 435 | return; |
| 436 | } else { |
| 437 | cbDiskBox->SetCurSel(disk->OrderNo); |
| 438 | } |
| 439 | |
| 440 | if (disk->Layout) { |
| 441 | for (UCHAR i=0; i < disk->NumParts; i++) { |
| 442 | s.Format("PARTITION %u", i+1); |
| 443 | cbPartBox->AddString(s.GetBuffer(s.GetLength())); |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | if (disk->SDD.VendorIdOffset) { |
| 448 | s = (PCHAR)&disk->SDD + disk->SDD.VendorIdOffset; |
| 449 | } else { |
| 450 | s.Empty(); |
| 451 | } |
| 452 | SET_TEXT(IDC_VENDOR_ID, s); |
| 453 | |
| 454 | if (disk->SDD.ProductIdOffset) { |
| 455 | s = (PCHAR)&disk->SDD + disk->SDD.ProductIdOffset; |
| 456 | } else { |
| 457 | s.Empty(); |
| 458 | } |
| 459 | SET_TEXT(IDC_PRODUCT_ID, s); |
| 460 | |
| 461 | if (disk->SDD.SerialNumberOffset) { |
| 462 | s = (PCHAR)&disk->SDD + disk->SDD.SerialNumberOffset; |
| 463 | } else { |
| 464 | s.Empty(); |
| 465 | } |
| 466 | SET_TEXT(IDC_SERIAL_NUMBER, s); |
| 467 | |
| 468 | s = BusTypeString(disk->SDD.BusType); |
| 469 | SET_TEXT(IDC_BUS_TYPE, s); |
| 470 | |
| 471 | if (disk->SDD.RemovableMedia) { |
| 472 | s = "Removable"; |
| 473 | } else { |
| 474 | s = "RAW"; |
| 475 | if (disk->Layout) { |
| 476 | if (disk->Layout->PartitionStyle == PARTITION_STYLE_MBR) { |
| 477 | if (disk->Layout->PartitionEntry->Mbr.PartitionType |
| 478 | == PARTITION_LDM) { |
| 479 | s.LoadString(IDS_DISK_TYPE_DYN); |
| 480 | } else { |
| 481 | s.LoadString(IDS_DISK_TYPE_BASIC); |
| 482 | } |
nothing calls this directly
no test coverage detected