|
@@ -611,11 +611,11 @@ begin
|
|
if path[i]='/' then path[i]:='\';
|
|
if path[i]='/' then path[i]:='\';
|
|
dosregs.si:=1; { use ms-dos time }
|
|
dosregs.si:=1; { use ms-dos time }
|
|
dosregs.ecx:=attr;
|
|
dosregs.ecx:=attr;
|
|
- dosregs.edx:=(transfer_buffer and 15) + Sizeof(LFNSearchrec)+1;
|
|
|
|
- dosmemput(transfer_buffer shr 4,(transfer_buffer and 15)+Sizeof(LFNSearchrec)+1,path^,strlen(path)+1);
|
|
|
|
- dosregs.ds:=transfer_buffer shr 4;
|
|
|
|
- dosregs.edi:=transfer_buffer and 15;
|
|
|
|
- dosregs.es:=transfer_buffer shr 4;
|
|
|
|
|
|
+ dosregs.edx:=tb_offset+Sizeof(LFNSearchrec)+1;
|
|
|
|
+ dosmemput(tb_selector,tb_offset+Sizeof(LFNSearchrec)+1,path^,strlen(path)+1);
|
|
|
|
+ dosregs.ds:=tb_selector;
|
|
|
|
+ dosregs.edi:=tb_offset;
|
|
|
|
+ dosregs.es:=tb_selector;
|
|
dosregs.ax:=$714e;
|
|
dosregs.ax:=$714e;
|
|
msdos(dosregs);
|
|
msdos(dosregs);
|
|
LoadDosError;
|
|
LoadDosError;
|
|
@@ -631,8 +631,8 @@ var
|
|
begin
|
|
begin
|
|
Move(s.Fill,hdl,4);
|
|
Move(s.Fill,hdl,4);
|
|
dosregs.si:=1; { use ms-dos time }
|
|
dosregs.si:=1; { use ms-dos time }
|
|
- dosregs.edi:=transfer_buffer and 15;
|
|
|
|
- dosregs.es:=transfer_buffer shr 4;
|
|
|
|
|
|
+ dosregs.edi:=tb_offset;
|
|
|
|
+ dosregs.es:=tb_selector;
|
|
dosregs.ebx:=hdl;
|
|
dosregs.ebx:=hdl;
|
|
dosregs.ax:=$714f;
|
|
dosregs.ax:=$714f;
|
|
msdos(dosregs);
|
|
msdos(dosregs);
|
|
@@ -680,14 +680,14 @@ begin
|
|
for i:=0 to strlen(path) do
|
|
for i:=0 to strlen(path) do
|
|
if path[i]='/' then path[i]:='\';
|
|
if path[i]='/' then path[i]:='\';
|
|
copytodos(f,sizeof(searchrec));
|
|
copytodos(f,sizeof(searchrec));
|
|
- dosregs.edx:=transfer_buffer and 15;
|
|
|
|
- dosregs.ds:=transfer_buffer shr 4;
|
|
|
|
|
|
+ dosregs.edx:=tb_offset;
|
|
|
|
+ dosregs.ds:=tb_selector;
|
|
dosregs.ah:=$1a;
|
|
dosregs.ah:=$1a;
|
|
msdos(dosregs);
|
|
msdos(dosregs);
|
|
dosregs.ecx:=attr;
|
|
dosregs.ecx:=attr;
|
|
- dosregs.edx:=(transfer_buffer mod 16) + Sizeof(searchrec)+1;
|
|
|
|
- dosmemput(transfer_buffer div 16,(transfer_buffer mod 16) +Sizeof(searchrec)+1,path^,strlen(path)+1);
|
|
|
|
- dosregs.ds:=transfer_buffer div 16;
|
|
|
|
|
|
+ dosregs.edx:=tb_offset+Sizeof(searchrec)+1;
|
|
|
|
+ dosmemput(tb_selector,tb_offset+Sizeof(searchrec)+1,path^,strlen(path)+1);
|
|
|
|
+ dosregs.ds:=tb_selector;
|
|
dosregs.ah:=$4e;
|
|
dosregs.ah:=$4e;
|
|
msdos(dosregs);
|
|
msdos(dosregs);
|
|
copyfromdos(f,sizeof(searchrec));
|
|
copyfromdos(f,sizeof(searchrec));
|
|
@@ -699,8 +699,8 @@ end;
|
|
procedure Dosfindnext(var f : searchrec);
|
|
procedure Dosfindnext(var f : searchrec);
|
|
begin
|
|
begin
|
|
copytodos(f,sizeof(searchrec));
|
|
copytodos(f,sizeof(searchrec));
|
|
- dosregs.edx:=transfer_buffer mod 16;
|
|
|
|
- dosregs.ds:=transfer_buffer div 16;
|
|
|
|
|
|
+ dosregs.edx:=tb_offset;
|
|
|
|
+ dosregs.ds:=tb_selector;
|
|
dosregs.ah:=$1a;
|
|
dosregs.ah:=$1a;
|
|
msdos(dosregs);
|
|
msdos(dosregs);
|
|
dosregs.ah:=$4f;
|
|
dosregs.ah:=$4f;
|
|
@@ -764,7 +764,7 @@ begin
|
|
doserror:=0;
|
|
doserror:=0;
|
|
strpcopy(path0,path);
|
|
strpcopy(path0,path);
|
|
{$ifdef Go32V2}
|
|
{$ifdef Go32V2}
|
|
- if Win95 then
|
|
|
|
|
|
+ if LFNSupport then
|
|
LFNFindFirst(path0,attr,f)
|
|
LFNFindFirst(path0,attr,f)
|
|
else
|
|
else
|
|
Dosfindfirst(path0,attr,f);
|
|
Dosfindfirst(path0,attr,f);
|
|
@@ -778,7 +778,7 @@ procedure findnext(var f : searchRec);
|
|
begin
|
|
begin
|
|
doserror:=0;
|
|
doserror:=0;
|
|
{$ifdef Go32V2}
|
|
{$ifdef Go32V2}
|
|
- if Win95 then
|
|
|
|
|
|
+ if LFNSupport then
|
|
LFNFindnext(f)
|
|
LFNFindnext(f)
|
|
else
|
|
else
|
|
Dosfindnext(f);
|
|
Dosfindnext(f);
|
|
@@ -791,7 +791,7 @@ end;
|
|
Procedure FindClose(Var f: SearchRec);
|
|
Procedure FindClose(Var f: SearchRec);
|
|
begin
|
|
begin
|
|
{$ifdef Go32V2}
|
|
{$ifdef Go32V2}
|
|
- if Win95 then
|
|
|
|
|
|
+ if LFNSupport then
|
|
LFNFindClose(f);
|
|
LFNFindClose(f);
|
|
{$endif}
|
|
{$endif}
|
|
end;
|
|
end;
|
|
@@ -877,7 +877,7 @@ end;
|
|
for i:=1 to length(pa) do
|
|
for i:=1 to length(pa) do
|
|
if pa[i]='/' then
|
|
if pa[i]='/' then
|
|
pa[i]:='\';
|
|
pa[i]:='\';
|
|
-
|
|
|
|
|
|
+
|
|
if (length(pa)>1) and (pa[1] in ['A'..'Z']) and (pa[2]=':') then
|
|
if (length(pa)>1) and (pa[1] in ['A'..'Z']) and (pa[2]=':') then
|
|
begin
|
|
begin
|
|
{ we must get the right directory }
|
|
{ we must get the right directory }
|
|
@@ -895,14 +895,14 @@ end;
|
|
pa:=s+pa
|
|
pa:=s+pa
|
|
else
|
|
else
|
|
pa:=s+'\'+pa;
|
|
pa:=s+'\'+pa;
|
|
-
|
|
|
|
|
|
+
|
|
{ Turbo Pascal gives current dir on drive if only drive given as parameter! }
|
|
{ Turbo Pascal gives current dir on drive if only drive given as parameter! }
|
|
if length(pa) = 2 then
|
|
if length(pa) = 2 then
|
|
begin
|
|
begin
|
|
getdir(byte(pa[1])-64,s);
|
|
getdir(byte(pa[1])-64,s);
|
|
pa := s;
|
|
pa := s;
|
|
end;
|
|
end;
|
|
-
|
|
|
|
|
|
+
|
|
{First remove all references to '\.\'}
|
|
{First remove all references to '\.\'}
|
|
while pos ('\.\',pa)<>0 do
|
|
while pos ('\.\',pa)<>0 do
|
|
delete (pa,pos('\.\',pa),2);
|
|
delete (pa,pos('\.\',pa),2);
|
|
@@ -918,9 +918,9 @@ end;
|
|
delete (pa,j,i-j+3);
|
|
delete (pa,j,i-j+3);
|
|
end;
|
|
end;
|
|
until i=0;
|
|
until i=0;
|
|
-
|
|
|
|
|
|
+
|
|
{ Turbo Pascal gets rid of a \.. at the end of the path }
|
|
{ Turbo Pascal gets rid of a \.. at the end of the path }
|
|
- { Now remove also any reference to '\..' at end of line
|
|
|
|
|
|
+ { Now remove also any reference to '\..' at end of line
|
|
+ of course previous dir.. }
|
|
+ of course previous dir.. }
|
|
i:=pos('\..',pa);
|
|
i:=pos('\..',pa);
|
|
if i<>0 then
|
|
if i<>0 then
|
|
@@ -937,7 +937,7 @@ end;
|
|
{ Remove End . and \}
|
|
{ Remove End . and \}
|
|
if (length(pa)>0) and (pa[length(pa)]='.') then
|
|
if (length(pa)>0) and (pa[length(pa)]='.') then
|
|
dec(byte(pa[0]));
|
|
dec(byte(pa[0]));
|
|
- { if only the drive + a '\' is left then the '\' should be left to prevtn the program
|
|
|
|
|
|
+ { if only the drive + a '\' is left then the '\' should be left to prevtn the program
|
|
accessing the current directory on the drive rather than the root!}
|
|
accessing the current directory on the drive rather than the root!}
|
|
{ if the last char of path = '\' then leave it in as this is what TP does! }
|
|
{ if the last char of path = '\' then leave it in as this is what TP does! }
|
|
if ((length(pa)>3) and (pa[length(pa)]='\')) and (path[length(path)] <> '\') then
|
|
if ((length(pa)>3) and (pa[length(pa)]='\')) and (path[length(path)] <> '\') then
|
|
@@ -1021,13 +1021,13 @@ var
|
|
begin
|
|
begin
|
|
{$ifdef GO32V2}
|
|
{$ifdef GO32V2}
|
|
copytodos(filerec(f).name,strlen(filerec(f).name)+1);
|
|
copytodos(filerec(f).name,strlen(filerec(f).name)+1);
|
|
- dosregs.edx:=transfer_buffer and 15;
|
|
|
|
- dosregs.ds:=transfer_buffer shr 4;
|
|
|
|
|
|
+ dosregs.edx:=tb_offset;
|
|
|
|
+ dosregs.ds:=tb_selector;
|
|
{$else}
|
|
{$else}
|
|
strpcopy(n,filerec(f).name);
|
|
strpcopy(n,filerec(f).name);
|
|
dosregs.edx:=longint(@n);
|
|
dosregs.edx:=longint(@n);
|
|
{$endif}
|
|
{$endif}
|
|
- if Win95 then
|
|
|
|
|
|
+ if LFNSupport then
|
|
begin
|
|
begin
|
|
dosregs.ax:=$7143;
|
|
dosregs.ax:=$7143;
|
|
dosregs.bx:=0;
|
|
dosregs.bx:=0;
|
|
@@ -1048,13 +1048,13 @@ var
|
|
begin
|
|
begin
|
|
{$ifdef GO32V2}
|
|
{$ifdef GO32V2}
|
|
copytodos(filerec(f).name,strlen(filerec(f).name)+1);
|
|
copytodos(filerec(f).name,strlen(filerec(f).name)+1);
|
|
- dosregs.edx:=transfer_buffer mod 16;
|
|
|
|
- dosregs.ds:=transfer_buffer div 16;
|
|
|
|
|
|
+ dosregs.edx:=tb_offset;
|
|
|
|
+ dosregs.ds:=tb_selector;
|
|
{$else}
|
|
{$else}
|
|
strpcopy(n,filerec(f).name);
|
|
strpcopy(n,filerec(f).name);
|
|
dosregs.edx:=longint(@n);
|
|
dosregs.edx:=longint(@n);
|
|
{$endif}
|
|
{$endif}
|
|
- if Win95 then
|
|
|
|
|
|
+ if LFNSupport then
|
|
begin
|
|
begin
|
|
dosregs.ax:=$7143;
|
|
dosregs.ax:=$7143;
|
|
dosregs.bx:=1;
|
|
dosregs.bx:=1;
|
|
@@ -1139,7 +1139,12 @@ End;
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.8 1998-08-16 20:39:49 peter
|
|
|
|
|
|
+ Revision 1.9 1998-08-26 10:04:01 peter
|
|
|
|
+ * new lfn check from mailinglist
|
|
|
|
+ * renamed win95 -> LFNSupport
|
|
|
|
+ + tb_selector, tb_offset for easier access to transferbuffer
|
|
|
|
+
|
|
|
|
+ Revision 1.8 1998/08/16 20:39:49 peter
|
|
+ LFN Support
|
|
+ LFN Support
|
|
|
|
|
|
Revision 1.7 1998/08/16 09:12:13 michael
|
|
Revision 1.7 1998/08/16 09:12:13 michael
|