Log in

View Full Version : FIBMAP anyone ?


doomDVD
20th September 2003, 01:24
hi all i have been trying to figure out how to get the LBA of a specified file using ioctl functions, not aspi/udf(aspi). i came accross some source-code in an open source linux dvd program. but i have no idea how to reacreate the function in WINDOWS can any of you guys please help me.

here is the linux code i found:

---------------------------------------------

#ifndef FIBMAP
#define FIBMAP 1
#endif

int PathToLBA(char *filename)
{
int fd = open(argv[1], O_RDONLY);

if(fd < 0)
{
printf("unable to open file: %s\n", strerror(errno));
return(-1);
}

int lba = 0;
if(ioctl(fd, FIBMAP, &lba) < 0)
{
printf("ioctl failed: %s\n", strerror(errno));
return(-1);
}

return(0);
}

---------------------------------------------


if anyone has a windows version of this it would be a major help
thanx in advance, and thanx for all your previous help.

kind regards
doomDVD

doomDVD
21st September 2003, 19:16
i have been checking msdn for even the remotest idea
of windows implementation of this. But still no look.

hmmm

int 21h
22nd September 2003, 19:37
AFAIK, you can't unless you implement your own filesystem reader... why not use ASPI?

vStrip is a very, very good example on how to do it.

doomDVD
23rd September 2003, 19:44
thanx for the reply int21. i have an aspi and udf reader up and working but i though i would give ioctl/sptd a go. but im glad you cleared that up for me ive been searching around on the net for days :-) lol

regards
doomDVD :devil:

jfcarbel
25th September 2003, 08:42
Is ASPI installed on all systems? Is one always available in XP?

A strategy may be to resort to IOCTL if ASPI is not available on the machine.

doomDVD
25th September 2003, 11:53
i think ASPI is installed as standard on onlder versions of windows i.e. (Win95, Win98, WinME). but a third party driver is needed on the newer versions of windows (win2K, WinXP, Win2K3).

i have all of the ioctl functions working. the only thing that i can not dicover now is how to calculate the LBA for a file contained on the DISK, i dont want to use any aspi code as i want the ioctl code to function when aspi is not available.

kind regards
doomDVD:devil:

int 21h
25th September 2003, 16:16
You should use SPTI if there is no ASPI available.

doomDVD
25th September 2003, 16:37
int 21h: would you happen to know how to get the LBA for a file on disk using SPTI. i kinda thought that SPTI and IOCTL was the same thing :-) lol i guess not. :rolleyes:

i know there must be a way to do this without using aspi functions. the question that remains is how. if there is a veteran out there reading this please post a reply.

int21: i checked through the libdvdcss code but they do not supply any code to get the LBA for a file hmmm

regards
doomDVD. :devil: