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 rr Homepage E-mail, Berlin, Germany, 05.08.2008, 13:34

> I think Int21.71A0 should work well. Do "stc" before the "int" opcode,
> because DOSes without any Int21.71 functions will leave CF unchanged and
> set al to 0. If the flags are NC, test the returned bx's bit 14 (4000h).
> If it's 1, LFNs should be supported.

I found this code from the Free Pascal RTL (system.pp). And I think, it's buggy, because it assumes, that LFNs on other drives are available too, if drive C: already supports these?!

function CheckLFN:boolean;
var
  regs     : TRealRegs;
  RootName : pchar;
begin
{ Check LFN API on drive c:\ }
  RootName:='C:\';
  syscopytodos(longint(RootName),strlen(RootName)+1);
{ Call 'Get Volume Information' ($71A0) }
  regs.realeax:=$71a0;
  regs.reales:=tb_segment;
  regs.realedi:=tb_offset;
  regs.realecx:=32;
  regs.realds:=tb_segment;
  regs.realedx:=tb_offset;
  regs.realflags:=carryflag;
  sysrealintr($21,regs);
{ 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);
end;

---
Forum admin

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 271 users online (2 registered, 269 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum