Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Call for testers: UPXINFO version 04-AUG-2008 (Miscellaneous)

posted by marcov(R), 05.08.2008, 15:43

> Yes, and I'm already doing this for some parts of the source code.
> What's a safe way to detect, if LFNs are available?

FPC's way (system unit)

function CheckLFN:boolean;
regs : TRealRegs;
RootName : pchar;
{ Check LFN API on drive c:\ }
{ Call 'Get Volume Information' ($71A0) }
regs.reales:=tb_segment; //seg(rootname)
regs.realedi:=tb_offset; // ofs(rootname);
regs.realds:=tb_segment; //seg(rootname)
regs.realedx:=tb_offset; //ofs(rootname)
{ If carryflag=0 and LFN API bit in ebx is set then use Long file names }
CheckLFN:=(regs.realflags and carryflag=0) and (regs.realebx and $4000=$4000);

Note that there are 32-bitisms( copytodos, sysrealintr instead of dos() and real(e) prefixes of registers), but that should be easy to remedy.

Maybe this should be combined with a drive check first (in case C:\ is not valid? like iirc an IDE zipdisk and a shell command to another drive can have this?)


Complete thread:

Back to the forum
Board view  Mix view
15297 Postings in 1378 Threads, 254 registered users, 22 users online (0 registered, 22 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum