Does GetVolumeNameForVolumeMountPoint() return the GUID of a volume?
Does GetVolumeNameForVolumeMountPoint() return the GUID of a volume in c++?
GetVolumeNameForVolumeMmountPoint()
{
LPCTSTR lpszvo开发者_Go百科lumeMountPoint,
LPTSTR lpszVolumeName,
DWORDcchBufferLength,
}
I mean if I am using a removeable disk. will the lpszVolumeName remained the same on the same computer? Does it return a certain ID for a certain volume everytime I insert the disk on my computer' USBport. And Make sure different disk's volumes will get different result? Many Thanks!
I found some documentation about the mount manager that states the GUID is permanently associated with the volume and it is persisted across system restarts.
MSDN call volumename as GUID, but it's not the case. I test it with following step:
- clone DiskA to DiskB with ORICO USB HDD Dock;
Connect only DiskA to PC with HDD Dock, WinXP assign letter 'G' to it and GUID is {ea044c37-816f-11e3-bea8-005056c00008}, as register shows
"\\DosDevices\\G:"=hex:a7,5e,f9,19,00,7e,00,00,00,00,00,00 "\\??\\Volume{ea044c37-816f-11e3-bea8-005056c00008}"=hex:a7,5e,f9,19,00,7e,00,\
Replace DiskA with DiskB and connect it to PC, driver letter is the same 'G', and GUID is the same {ea044c37-816f-11e3-bea8-005056c00008};
- Connect both DiskA and DiskB with HDD Dock(2 Bays), then DiskB's GUID changed to {ea044c39-816f-11e3-bea8-005056c00008}
精彩评论