简体   繁体   中英

How do I get the upper half of the Volume id in Windows?

This link at Ubuntu says "The option --new-half-serial only changes the upper part of the serial number, keeping the lower part which is used by Windows unchanged."

That suggests that the upper half of the Volume Id exists on the disk, is there any way to get at this in Windows? (GetVolumeInformation only returns the lower half). Ubuntu shows the entire 64-bit value with blkid .

Notes:

"This is not the volume UUID used by Windows to locate files which have been moved to another volume."

This refers to the Volume UUID, not the Volume Id I am talking about here. The Volume UUID is of the form: \\\\.\\Volume{7E899CB7-0079-11E1-BC4E-002219F6E9D9}

I think you want to have a look at the

NTFS_VOLUME_DATA_BUFFER

structure, and the DeviceIO Command:

FSCTL_GET_NTFS_VOLUME_DATA

And the function DeviceIoControl() . I think you will find what you are looking for in there. The first member of the NFTS_VOLUME_DATA_BUFFER is defined as a LARGE_INTEGER, which is just a typedef to:

typedef union _LARGE_INTEGER {
    struct {
        DWORD LowPart;
        LONG HighPart;
    };
    struct {
        DWORD LowPart;
        LONG HighPart;
    } u;
    LONGLONG QuadPart;
} LARGE_INTEGER;

Let me know if that helps at all...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM