mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 07:09:23 +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
|
if (len>0) and (s[len]='\') and
|
||||||
Not ((len=1) or ((len=3) and (s[2]=':'))) then
|
Not ((len=1) or ((len=3) and (s[2]=':'))) then
|
||||||
s[len]:=#0;
|
s[len]:=#0;
|
||||||
|
ZeroSegRegs(regs);
|
||||||
regs.DX:=Ofs(s[1]);
|
regs.DX:=Ofs(s[1]);
|
||||||
regs.DS:=Seg(s[1]);
|
regs.DS:=Seg(s[1]);
|
||||||
if LFNSupport then
|
if LFNSupport then
|
||||||
@ -66,9 +67,11 @@ begin
|
|||||||
{ First handle Drive changes }
|
{ First handle Drive changes }
|
||||||
if (len>=2) and (s[2]=':') then
|
if (len>=2) and (s[2]=':') then
|
||||||
begin
|
begin
|
||||||
|
ZeroSegRegs(regs);
|
||||||
regs.DX:=(ord(s[1]) and (not 32))-ord('A');
|
regs.DX:=(ord(s[1]) and (not 32))-ord('A');
|
||||||
regs.AX:=$0e00;
|
regs.AX:=$0e00;
|
||||||
MsDos(regs);
|
MsDos(regs);
|
||||||
|
ZeroSegRegs(regs);
|
||||||
regs.AX:=$1900;
|
regs.AX:=$1900;
|
||||||
MsDos(regs);
|
MsDos(regs);
|
||||||
if regs.AL<>regs.DL then
|
if regs.AL<>regs.DL then
|
||||||
@ -91,6 +94,7 @@ var
|
|||||||
i : integer;
|
i : integer;
|
||||||
regs : Registers;
|
regs : Registers;
|
||||||
begin
|
begin
|
||||||
|
ZeroSegRegs(regs);
|
||||||
regs.DX:=drivenr;
|
regs.DX:=drivenr;
|
||||||
regs.SI:=Ofs(temp);
|
regs.SI:=Ofs(temp);
|
||||||
regs.DS:=Seg(temp);
|
regs.DS:=Seg(temp);
|
||||||
@ -131,6 +135,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
{ We need to get the current drive from DOS function 19H }
|
{ We need to get the current drive from DOS function 19H }
|
||||||
{ because the drive was the default, which can be unknown }
|
{ because the drive was the default, which can be unknown }
|
||||||
|
ZeroSegRegs(regs);
|
||||||
regs.AX:=$1900;
|
regs.AX:=$1900;
|
||||||
MsDos(regs);
|
MsDos(regs);
|
||||||
i:= (regs.AX and $ff) + ord('A');
|
i:= (regs.AX and $ff) + ord('A');
|
||||||
|
Loading…
Reference in New Issue
Block a user