请问:如何更改GetVolumeInformation()取得的驱动器标识?

LXFY 2003-07-17 04:32:21
请问:如何更改GetVolumeInformation()取得的驱动器标识?
...全文
120 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
IamReason 2003-07-22
  • 打赏
  • 举报
回复
GZ
zzw922 2003-07-21
  • 打赏
  • 举报
回复
读写引导区的
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName, // root directory
LPTSTR lpVolumeNameBuffer, // volume name buffer
DWORD nVolumeNameSize, // length of name buffer
LPDWORD lpVolumeSerialNumber, // volume serial number
LPDWORD lpMaximumComponentLength, // maximum file name length
LPDWORD lpFileSystemFlags, // file system options
LPTSTR lpFileSystemNameBuffer, // file system name buffer
DWORD nFileSystemNameSize // length of file system name buffer
);
你问驱动器标识,就是lpVolumeNameBuffer把,
在fat16中,BS_VolLab,在引导区中位于偏移43处,长度11。 Volume label. This field matches the 11-byte volume label
recorded in the root directory.
NOTE: FAT file system drivers should make sure that they update
this field when the volume label file in the root directory has its
name changed or created. The setting for this field when there is no
volume label is the string “NO NAME ”.
而在FAT32,BS_VolLab,在引导区中位于偏移71处,长度11。This field has the same definition as it does for FAT12 and FAT16
media. The only difference for FAT32 media is that the field is at a
different offset in the boot sector.

要修改信息,只有读写硬盘,修盘引导区的信息即可。
theone 2003-07-21
  • 打赏
  • 举报
回复
MBR->0x1C2: 0x1 (FAT12)
0x4 (FAT16 < 32M)
0x6 (FAT16 > 32M)
0xB (FAT32)
->0x1D2: 0x5 (FAT12 extended)
0xF (FAT16 / FAT32 extended)
PBR里面还有很多的地方需要修改,如0x24,0x25,0x26...
只是不知道这样修改能不能骗过OS,还是重新计算写分区表比较好
LXFY 2003-07-21
  • 打赏
  • 举报
回复
我就是问怎么改分区信息
theone 2003-07-17
  • 打赏
  • 举报
回复
磁盘卷标->SetVolumeLabel()
分区信息->不要改,除非你重新格式化磁盘
VolumeSerialNumber-> PBR 中offset 0x27~0x2A
theone 2003-07-17
  • 打赏
  • 举报
回复
你想修改那些信息?

2,641

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧