mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 14:29:34 +02:00
+ zero seg regs prior to use in the win16 system unit dir functions as well
git-svn-id: trunk@31872 -
This commit is contained in:
parent
2f32a7b718
commit
2574c6304d
@ -31,6 +31,7 @@ begin
|
||||
if (len>0) and (s[len]='\') and
|
||||
Not ((len=1) or ((len=3) and (s[2]=':'))) then
|
||||
s[len]:=#0;
|
||||
ZeroSegRegs(regs);
|
||||
regs.DX:=Ofs(s[1]);
|
||||
regs.DS:=Seg(s[1]);
|
||||
if LFNSupport then
|
||||
@ -66,9 +67,11 @@ begin
|
||||
{ First handle Drive changes }
|
||||
if (len>=2) and (s[2]=':') then
|
||||
begin
|
||||
ZeroSegRegs(regs);
|
||||
regs.DX:=(ord(s[1]) and (not 32))-ord('A');
|
||||
regs.AX:=$0e00;
|
||||
MsDos(regs);
|
||||
ZeroSegRegs(regs);
|
||||
regs.AX:=$1900;
|
||||
MsDos(regs);
|
||||
if regs.AL<>regs.DL then
|
||||
@ -91,6 +94,7 @@ var
|
||||
i : integer;
|
||||
regs : Registers;
|
||||
begin
|
||||
ZeroSegRegs(regs);
|
||||
regs.DX:=drivenr;
|
||||
regs.SI:=Ofs(temp);
|
||||
regs.DS:=Seg(temp);
|
||||
@ -131,6 +135,7 @@ begin
|
||||
begin
|
||||
{ We need to get the current drive from DOS function 19H }
|
||||
{ because the drive was the default, which can be unknown }
|
||||
ZeroSegRegs(regs);
|
||||
regs.AX:=$1900;
|
||||
MsDos(regs);
|
||||
i:= (regs.AX and $ff) + ord('A');
|
||||
|
Loading…
Reference in New Issue
Block a user