Fixed a bug in libio (concerned file.find functions in particular)

Also, added a file to ease debugging in the future

git-svn-id: svn://kolibrios.org@2570 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-04-05 11:27:23 +00:00
parent 595e7179f6
commit 729f5e776a
3 changed files with 305 additions and 254 deletions

View File

@ -37,13 +37,14 @@
;;================================================================================================;; ;;================================================================================================;;
format MS COFF format MS COFF
public @EXPORT as 'EXPORTS' public @EXPORT as 'EXPORTS'
include '../../../../proc32.inc' include '../../../../proc32.inc'
include '../../../../macros.inc' include '../../../../macros.inc'
purge section;mov,add,sub purge section,mov,add,sub
include 'libio.inc' include 'libio.inc'
include 'libio_p.inc' include 'libio_p.inc'
@ -548,3 +549,4 @@ export \
file.seteof , 'file_seteof' , \ file.seteof , 'file_seteof' , \
file.truncate , 'file_truncate' , \ file.truncate , 'file_truncate' , \
file.close , 'file_close' file.close , 'file_close'

View File

@ -78,7 +78,7 @@ struct FileInfoA
FileSizeHigh dd ? FileSizeHigh dd ?
ends ends
ends ends
FileName rb 252 FileName rb 264
ends ends
struct FileInfoW struct FileInfoW

View File

@ -0,0 +1,49 @@
macro debug_FileInfoHeader ptr {
DEBUGF 1, "FileInfoHeader (0x%x)\n", ptr
DEBUGF 1, "Version: %u\n", [ptr + FileInfoHeader.Version]:4
DEBUGF 1, "FilesRead: %u\n", [ptr + FileInfoHeader.FilesRead]:4
DEBUGF 1, "FilesCount: %u\n\n", [ptr + FileInfoHeader.FilesCount]:4
}
macro debug_FileInfoA ptr {
DEBUGF 1, "FileInfoA (0x%x)\n", ptr
DEBUGF 1, "Attributes: 0x%x\n", [ptr + FileInfoA.Attributes]:8
DEBUGF 1, "Flags: 0x%x\n", [ptr + FileInfoA.Flags]:8
DEBUGF 1, "FileSizeLow: 0x%x\n", [ptr + FileInfoA.FileSize]:8
DEBUGF 1, "FileSizeHigh: 0x%x\n", [ptr + FileInfoA.FileSize+4]:8
push eax
lea eax, [ptr + FileInfoA.FileName]
DEBUGF 1, "FileName: %s\n\n", eax
pop eax
}
macro debug_FileInfoBlock ptr {
DEBUGF 1, "FileInfoBlock (0x%x)\n", ptr
DEBUGF 1, "Function: %u\n", [ptr + FileInfoBlock.Function]:4
DEBUGF 1, "Position: %u\n", [ptr + FileInfoBlock.Position]:4
DEBUGF 1, "Flags: 0x%x\n", [ptr + FileInfoBlock.Flags]:8
DEBUGF 1, "Count: %u\n", [ptr + FileInfoBlock.Count]:4
DEBUGF 1, "Buffer: 0x%x\n", [ptr + FileInfoBlock.Buffer]:8
DEBUGF 1, "FileName: %s\n\n", [ptr + FileInfoBlock.FileName]:8
}
macro debug_FindOptions ptr {
DEBUGF 1, "FindOptions (0x%x)\n", ptr
DEBUGF 1, "Attributes: 0x%x\n", [ptr + FindOptions.Attributes]:8
DEBUGF 1, "Mask: %s\n\n", [ptr + FindOptions.Mask]
}
macro debug_FindFileBlock ptr {
push eax
mov eax, ptr
DEBUGF 1, "FindFileBlock (0x%x)\n\n", eax
debug_FileInfoHeader eax
add eax, sizeof.FileInfoHeader
debug_FileInfoA eax
add eax, sizeof.FileInfoA
debug_FileInfoBlock eax
add eax, sizeof.FileInfoBlock
debug_FindOptions eax
pop eax
}