git-svn-id: https://spexeah.com:8443/svn/Asuro@757 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
aaron
2019-01-25 14:17:09 +00:00
parent cdf2267a25
commit 476a189b21
3 changed files with 107 additions and 57 deletions
+2 -2
View File
@@ -363,7 +363,7 @@ begin
end; end;
end; end;
pop_trace(); //pop_trace();
end; end;
procedure readPIO28(drive : uint8; LBA : uint32; sectorCount : uint8; buffer : puint32); procedure readPIO28(drive : uint8; LBA : uint32; sectorCount : uint8; buffer : puint32);
@@ -425,7 +425,7 @@ begin
end; end;
end; end;
end; end;
pop_trace(); //pop_trace();
end; end;
procedure readPIOPI(drive : uint8; LBA : uint32; buffer : Puint32); procedure readPIOPI(drive : uint8; LBA : uint32; buffer : Puint32);
File diff suppressed because it is too large Load Diff
+21 -23
View File
@@ -461,7 +461,7 @@ begin
end; end;
end; end;
function readFile(fileName : pchar; extension : pchar; buffer : puint32; byteCount : puint32) : puint32; //TODO add length param function readFile(fileName : pchar; extension : pchar; buffer : puint32; byteCount : puint32) : puint32;
var var
error : puint32; error : puint32;
dirs : PLinkedListBase; dirs : PLinkedListBase;
@@ -471,38 +471,36 @@ var
otherCleanFileName : pchar; otherCleanFileName : pchar;
begin begin
push_trace('storagemanagement.readfile'); push_trace('storagemanagement.readfile');
bytecount := puint32(kalloc(4)); //bytecount := puint32(kalloc(4));
//memset(uint32(bytecount), 0, 4);
error := puint32(kalloc(4)); error := puint32(kalloc(4));
readfile:= error; readfile:= error;
cleanFileName := cleanString(filename); // cleanFileName := cleanString(filename);
dirs := rootVolume^.filesystem^.readdirCallback(rootVolume, getWorkingDirectory(), error); // dirs := rootVolume^.filesystem^.readdirCallback(rootVolume, getWorkingDirectory(), error);
for i:=0 to LL_Size(dirs) -1 do begin // for i:=0 to LL_Size(dirs) -1 do begin
otherCleanFileName := cleanString(PDirectory_Entry(LL_get(dirs, i))^.filename); //TODO clean extension // otherCleanFileName := cleanString(PDirectory_Entry(LL_get(dirs, i))^.filename); //TODO clean extension
writestringlnWND(otherCleanFileName, getTerminalHWND()); // writestringlnWND(otherCleanFileName, getTerminalHWND());
writestringlnWND(cleanFileName, getTerminalHWND()); // writestringlnWND(cleanFileName, getTerminalHWND());
if stringEquals(cleanFileName, otherCleanFileName) then begin // if stringEquals(cleanFileName, otherCleanFileName) then begin
writestringlnWND('match found!', getTerminalHWND()); // writestringlnWND('match found!', getTerminalHWND());
exists := true; // exists := true;
error^ := 0; // error^ := 0;
end; // end;
kfree(puint32(otherCleanFileName)); // kfree(puint32(otherCleanFileName));
end; // end;
kfree(puint32(cleanFileName)); // kfree(puint32(cleanFileName));
error^ := rootVolume^.filesystem^.readCallback(rootVolume, getWorkingDirectory(), fileName, extension, buffer, bytecount);
if exists = false then begin
// TODO error codes
error^ := 1;
exit;
end;
rootVolume^.filesystem^.readCallback(rootVolume, getWorkingDirectory(), fileName, extension, buffer, bytecount);
exit;
end; end;
end. end.