开发者

Does GetVolumeNameForVolumeMountPoint() return the GUID of a volume?

开发者 https://www.devze.com 2022-12-27 23:38 出处:网络
Does GetVolumeNameForVolumeMountPoint() return the GUID of a volume in c++? GetVolumeNameForVolumeMmountPoint()

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:

  1. clone DiskA to DiskB with ORICO USB HDD Dock;
  2. 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,\
    
  3. 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};

  4. Connect both DiskA and DiskB with HDD Dock(2 Bays), then DiskB's GUID changed to {ea044c39-816f-11e3-bea8-005056c00008}
0

精彩评论

暂无评论...
验证码 换一张
取 消