GetVolumeNameForVolumeMountPoint() 是否返回卷的 GUID?

发布于 2024-08-30 10:03:00 字数 320 浏览 2 评论 0原文

GetVolumeNameForVolumeMountPoint() 是否返回 c++ 中卷的 GUID?

GetVolumeNameForVolumeMmountPoint()
{
LPCTSTR lpszvolumeMountPoint,
LPTSTR lpszVolumeName,
DWORDcchBufferLength,
}

我的意思是如果我使用可移动磁盘。 lpszVolumeName 在同一台计算机上会保持不变吗? 每次我将磁盘插入计算机的 USB 端口时,它是否会返回特定卷的特定 ID。 并确保不同的磁盘卷会得到不同的结果? 非常感谢!

Does GetVolumeNameForVolumeMountPoint() return the GUID of a volume in c++?

GetVolumeNameForVolumeMmountPoint()
{
LPCTSTR lpszvolumeMountPoint,
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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不美如何 2024-09-06 10:03:00

我找到了一些关于安装管理器的文档表明 GUID 与卷永久关联,并且在系统重新启动后仍保留。

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.

云柯 2024-09-06 10:03:00

MSDN 将volumename 称为GUID,但事实并非如此。
我通过以下步骤进行测试:

  1. 使用 ORICO USB HDD Dock 将 DiskA 克隆到 DiskB;
  2. 仅将 DiskA 连接到带有 HDD Dock 的 PC,WinXP 为其分配字母“G”,GUID 为 {ea044c37-816f-11e3-bea8-005056c00008},如寄存器所示

    "\\DosDevices\\G:"=十六进制:a7,5e,f9,19,00,7e,00,00,00,00,00,00
    "\\??\\卷{ea044c37-816f-11e3-bea8-005056c00008}"=十六进制:a7,5e,f9,19,00,7e,00,\
    
  3. 用 DiskB 替换 DiskA并连接到PC,驱动器盘符是相同的“G”,GUID是相同的{ea044c37-816f-11e3-bea8-005056c00008};

  4. 将DiskA和DiskB都连接到HDD Dock(2盘位),然后DiskB的GUID更改为{ea044c39-816f-11e3-bea8-005056c00008}

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}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文