Changeset 100913 in vbox for trunk/src/VBox/Runtime/common/fs
- Timestamp:
- Aug 19, 2023 11:03:51 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/pdbvfs.cpp
r100912 r100913 798 798 RT_NOREF(pThis, pvInfo, cbInfo, pcbRet); 799 799 800 ssize_t cchRet; 800 801 switch (enmInfo) 801 802 { 803 /* This is the same as the symbol chache subdir name: */ 802 804 case RTVFSQIEX_VOL_LABEL: 803 /** @todo return the UUID + age. */ 804 return VERR_NOT_SUPPORTED; 805 805 if ( pThis->enmVersion == RTFSPDBVER_2 806 || RTUuidIsNull(&pThis->Uuid)) 807 cchRet = RTStrPrintf2((char *)pvInfo, cbInfo, "%08X%x", pThis->uTimestamp, pThis->uAge); 808 else 809 cchRet = RTStrPrintf2((char *)pvInfo, cbInfo, "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%x", 810 pThis->Uuid.Gen.u32TimeLow, 811 pThis->Uuid.Gen.u16TimeMid, 812 pThis->Uuid.Gen.u16TimeHiAndVersion, 813 pThis->Uuid.Gen.u8ClockSeqHiAndReserved, 814 pThis->Uuid.Gen.u8ClockSeqLow, 815 pThis->Uuid.Gen.au8Node[0], 816 pThis->Uuid.Gen.au8Node[1], 817 pThis->Uuid.Gen.au8Node[2], 818 pThis->Uuid.Gen.au8Node[3], 819 pThis->Uuid.Gen.au8Node[4], 820 pThis->Uuid.Gen.au8Node[5], 821 pThis->uAge); 822 break; 823 824 /* This exposes the PDB and VC versions: */ 806 825 case RTVFSQIEX_VOL_LABEL_ALT: 807 return RTStrCopy((char *)pvInfo, cbInfo, pThis->enmVersion == RTFSPDBVER_2 ? "pdb-v2" : "pdb-v7"); 826 cchRet = RTStrPrintf2((char *)pvInfo, cbInfo, 827 "pdb-v%u-%u", pThis->enmVersion == RTFSPDBVER_2 ? 2 : 7, pThis->uVcDate); 828 break; 808 829 809 830 case RTVFSQIEX_VOL_SERIAL: 810 /** @todo return the UUID. */ 811 return VERR_NOT_SUPPORTED; 831 if (cbInfo == sizeof(uint64_t) || cbInfo == sizeof(uint32_t)) 832 { 833 *pcbRet = cbInfo; 834 ((uint32_t *)pvInfo)[0] = pThis->uTimestamp; 835 if (cbInfo == sizeof(uint64_t)) 836 ((uint32_t *)pvInfo)[1] = pThis->uAge; 837 return VINF_SUCCESS; 838 } 839 if ( pThis->enmVersion != RTFSPDBVER_2 840 && !RTUuidIsNull(&pThis->Uuid)) 841 { 842 *pcbRet = sizeof(RTUUID); 843 if (cbInfo == sizeof(RTUUID)) 844 { 845 *(PRTUUID)pvInfo = pThis->Uuid; 846 return VINF_SUCCESS; 847 } 848 } 849 else 850 *pcbRet = sizeof(uint64_t); 851 return cbInfo < *pcbRet ? VERR_BUFFER_OVERFLOW : VERR_BUFFER_UNDERFLOW; 812 852 813 853 default: 814 854 return VERR_NOT_SUPPORTED; 815 816 } 855 } 856 857 if (cchRet > 0) 858 { 859 *pcbRet = (size_t)cchRet; 860 return VINF_SUCCESS; 861 } 862 *pcbRet = (size_t)-cchRet; 863 return VERR_BUFFER_OVERFLOW; 817 864 } 818 865
Note:
See TracChangeset
for help on using the changeset viewer.