[syslinux] find bug:syslinux.exe

Liu Yugang liuyug at yahoo.cn
Fri Sep 17 21:01:53 PDT 2010


hi

I am a syslinux user, but no developer, so I don't subscribe syslinux
mail list. I just report a bug, no more information.

bug file:
syslinux.exe
source:
win\syslinux.c
in function FixMBR:
==========================
BOOL FixMBR(int driveNum, int partitionNum, int write_mbr, int set_active)
{
BOOL result = TRUE;
HANDLE drive;

char driveName[128];

sprintf(driveName, "\\\\.\\PHYSICALDRIVE%d", driveNum);
==========================
It need a drive num!!! It get it from function :
==========================
STORAGE_DEVICE_NUMBER sdn;
if (GetStorageDeviceNumberByHandle(d_handle, &sdn)) {
if (!FixMBR(sdn.DeviceNumber, sdn.PartitionNumber, opt.install_mbr,
opt.activate_partition)) {
==========================
function:
==========================
BOOL GetStorageDeviceNumberByHandle(HANDLE handle,
const STORAGE_DEVICE_NUMBER * sdn)
{
BOOL result = FALSE;
DWORD count;

if (DeviceIoControl(handle, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL,
0, (LPVOID) sdn, sizeof(*sdn), &count, NULL)) {
result = TRUE;
} else {
error("GetDriveNumber: DeviceIoControl failed");
}

return (result);
}
==========================
DeviceNumber!!
On my Thinkpad T400 machine, it have Intel turbo memory. DeviceNumber is
error value!!!
in MSDN, it said " To obtain the physical drive for a volume, open a
handle to the volume and call the *DeviceIoControl* function with
*IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS*
<ioctl_volume_get_volume_disk_extents.htm>. This control code returns
the disk number of offset for each of the volume's extents; a volume can
span disks."

It is disknumber, no devicenumber.

Pls fix it. Thanks.



-- 
Best regards

Liu Yugang
liuyug at yahoo.cn

-----------------------------------------
Thunderbird + Gnupg + Enigmail = PGP/MIME

__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com




More information about the Syslinux mailing list