Removed direct debug output.

Replaced direct calls to bios routines.

svn path=/trunk/; revision=2869
This commit is contained in:
Eric Kohl 2002-04-25 22:24:24 +00:00
parent 7111fc6bfa
commit 8ae62fd2db

View file

@ -41,8 +41,7 @@ BOOL IsoOpenVolume(ULONG DriveNumber)
{
PPVD Pvd;
// DbgPrint((DPRINT_FILESYSTEM, "IsoOpenVolume() DriveNumber = 0x%x VolumeStartSector = 16\n", DriveNumber));
printf("IsoOpenVolume() DriveNumber = 0x%x\n", DriveNumber);
DbgPrint((DPRINT_FILESYSTEM, "IsoOpenVolume() DriveNumber = 0x%x VolumeStartSector = 16\n", DriveNumber));
// Store the drive number
IsoDriveNumber = DriveNumber;
@ -52,7 +51,7 @@ BOOL IsoOpenVolume(ULONG DriveNumber)
Pvd = AllocateMemory(SECTORSIZE);
if (!BiosInt13ReadExtended(DriveNumber, 16, 1, Pvd))
if (!DiskReadLogicalSectors(DriveNumber, 16, 1, Pvd))
{
FileSystemError("Failed to read the PVD.");
FreeMemory(Pvd);
@ -64,8 +63,7 @@ BOOL IsoOpenVolume(ULONG DriveNumber)
FreeMemory(Pvd);
// DbgPrint((DPRINT_FILESYSTEM, "IsoRootSector = %u IsoRootLegth = %u\n", IsoRootSector, IsoRootLength));
printf("IsoRootSector = %u IsoRootLegth = %u\n", IsoRootSector, IsoRootLength);
DbgPrint((DPRINT_FILESYSTEM, "IsoRootSector = %u IsoRootLegth = %u\n", IsoRootSector, IsoRootLength));
return TRUE;
}
@ -78,8 +76,7 @@ static BOOL IsoSearchDirectoryBufferForFile(PVOID DirectoryBuffer, UINT32 Direct
ULONG i;
UCHAR Name[32];
// DbgPrint((DPRINT_FILESYSTEM, "IsoSearchDirectoryBufferForFile() DirectoryBuffer = 0x%x DirectoryLength = %d FileName = %s\n", DirectoryBuffer, DirectoryLength, FileName));
printf("IsoSearchDirectoryBufferForFile() DirectoryBuffer = 0x%x DirectoryLength = %d FileName = %s\n", DirectoryBuffer, DirectoryLength, FileName);
DbgPrint((DPRINT_FILESYSTEM, "IsoSearchDirectoryBufferForFile() DirectoryBuffer = 0x%x DirectoryLength = %d FileName = %s\n", DirectoryBuffer, DirectoryLength, FileName));
memset(Name, 0, 32 * sizeof(UCHAR));
@ -98,21 +95,18 @@ static BOOL IsoSearchDirectoryBufferForFile(PVOID DirectoryBuffer, UINT32 Direct
if (Record->FileIdLength == 1 && Record->FileId[0] == 0)
{
// DbgPrint((DPRINT_FILESYSTEM, "Name '.'\n"));
printf("Name '.'\n");
DbgPrint((DPRINT_FILESYSTEM, "Name '.'\n"));
}
else if (Record->FileIdLength == 1 && Record->FileId[0] == 1)
{
// DbgPrint((DPRINT_FILESYSTEM, "Name '..'\n"));
printf("Name '..'\n");
DbgPrint((DPRINT_FILESYSTEM, "Name '..'\n"));
}
else
{
for (i = 0; i < Record->FileIdLength && Record->FileId[i] != ';'; i++)
Name[i] = Record->FileId[i];
Name[i] = 0;
// DbgPrint((DPRINT_FILESYSTEM, "Name '%s'\n", Name));
printf("Name '%s'\n", Name);
DbgPrint((DPRINT_FILESYSTEM, "Name '%s'\n", Name));
if (strlen(FileName) == strlen(Name) && stricmp(FileName, Name) == 0)
{
@ -142,14 +136,12 @@ static PVOID IsoBufferDirectory(UINT32 DirectoryStartSector, UINT32 DirectoryLen
PVOID DirectoryBuffer;
UINT32 SectorCount;
// DbgPrint((DPRINT_FILESYSTEM, "IsoBufferDirectory() DirectoryStartSector = %d DirectoryLength = %d\n", DirectoryStartSector, DirectoryLength));
printf("IsoBufferDirectory() DirectoryStartSector = %d DirectoryLength = %d\n", DirectoryStartSector, DirectoryLength);
DbgPrint((DPRINT_FILESYSTEM, "IsoBufferDirectory() DirectoryStartSector = %d DirectoryLength = %d\n", DirectoryStartSector, DirectoryLength));
//
// Attempt to allocate memory for directory buffer
//
// DbgPrint((DPRINT_FILESYSTEM, "Trying to allocate (DirectoryLength) %d bytes.\n", DirectoryLength));
printf("Trying to allocate (DirectoryLength) %d bytes.\n", DirectoryLength);
DbgPrint((DPRINT_FILESYSTEM, "Trying to allocate (DirectoryLength) %d bytes.\n", DirectoryLength));
DirectoryBuffer = AllocateMemory(DirectoryLength);
if (DirectoryBuffer == NULL)
@ -158,13 +150,12 @@ static PVOID IsoBufferDirectory(UINT32 DirectoryStartSector, UINT32 DirectoryLen
}
SectorCount = ROUND_UP(DirectoryLength, SECTORSIZE) / SECTORSIZE;
// DbgPrint((DPRINT_FILESYSTEM, "Trying to read (DirectoryCount) %d sectors.\n", SectorCount));
printf("Trying to read (DirectoryCount) %d sectors.\n", SectorCount);
DbgPrint((DPRINT_FILESYSTEM, "Trying to read (DirectoryCount) %d sectors.\n", SectorCount));
//
// Now read directory contents into DirectoryBuffer
//
if (!BiosInt13ReadExtended(IsoDriveNumber, DirectoryStartSector, SectorCount, DirectoryBuffer))
if (!DiskReadLogicalSectors(IsoDriveNumber, DirectoryStartSector, SectorCount, DirectoryBuffer))
{
FreeMemory(DirectoryBuffer);
return NULL;
@ -193,8 +184,7 @@ static ULONG IsoGetNumPathParts(PUCHAR Path)
}
num++;
// DbgPrint((DPRINT_FILESYSTEM, "IsoGetNumPathParts() Path = %s NumPathParts = %d\n", Path, num));
printf("IsoGetNumPathParts() Path = %s NumPathParts = %d\n", Path, num);
DbgPrint((DPRINT_FILESYSTEM, "IsoGetNumPathParts() Path = %s NumPathParts = %d\n", Path, num));
return num;
}
@ -227,8 +217,7 @@ static VOID IsoGetFirstNameFromPath(PUCHAR Buffer, PUCHAR Path)
Buffer[i] = 0;
// DbgPrint((DPRINT_FILESYSTEM, "IsoGetFirstNameFromPath() Path = %s FirstName = %s\n", Path, Buffer));
printf("IsoGetFirstNameFromPath() Path = %s FirstName = %s\n", Path, Buffer);
DbgPrint((DPRINT_FILESYSTEM, "IsoGetFirstNameFromPath() Path = %s FirstName = %s\n", Path, Buffer));
}
@ -249,8 +238,7 @@ static BOOL IsoLookupFile(PUCHAR FileName, PISO_FILE_INFO IsoFileInfoPointer)
UINT32 DirectoryLength;
ISO_FILE_INFO IsoFileInfo;
// DbgPrint((DPRINT_FILESYSTEM, "IsoLookupFile() FileName = %s\n", FileName));
printf("IsoLookupFile() FileName = %s\n", FileName);
DbgPrint((DPRINT_FILESYSTEM, "IsoLookupFile() FileName = %s\n", FileName));
memset(IsoFileInfoPointer, 0, sizeof(ISO_FILE_INFO));
@ -336,8 +324,7 @@ FILE* IsoOpenFile(PUCHAR FileName)
ISO_FILE_INFO TempFileInfo;
PISO_FILE_INFO FileHandle;
// DbgPrint((DPRINT_FILESYSTEM, "IsoOpenFile() FileName = %s\n", FileName));
printf("IsoOpenFile() FileName = %s\n", FileName);
DbgPrint((DPRINT_FILESYSTEM, "IsoOpenFile() FileName = %s\n", FileName));
if (!IsoLookupFile(FileName, &TempFileInfo))
{
@ -365,8 +352,7 @@ static BOOL IsoReadPartialSector(ULONG SectorNumber, ULONG StartingOffset, ULONG
{
PUCHAR SectorBuffer;
// DbgPrint((DPRINT_FILESYSTEM, "IsoReadPartialSector() SectorNumber = %d StartingOffset = %d Length = %d Buffer = 0x%x\n", SectorNumber, StartingOffset, Length, Buffer));
printf("IsoReadPartialSector() SectorNumber = %d StartingOffset = %d Length = %d Buffer = 0x%x\n", SectorNumber, StartingOffset, Length, Buffer);
DbgPrint((DPRINT_FILESYSTEM, "IsoReadPartialSector() SectorNumber = %d StartingOffset = %d Length = %d Buffer = 0x%x\n", SectorNumber, StartingOffset, Length, Buffer));
SectorBuffer = AllocateMemory(SECTORSIZE);
if (SectorBuffer == NULL)
@ -374,7 +360,7 @@ static BOOL IsoReadPartialSector(ULONG SectorNumber, ULONG StartingOffset, ULONG
return FALSE;
}
if (!BiosInt13ReadExtended(IsoDriveNumber, SectorNumber, 1, SectorBuffer))
if (!DiskReadLogicalSectors(IsoDriveNumber, SectorNumber, 1, SectorBuffer))
{
FreeMemory(SectorBuffer);
return FALSE;
@ -401,8 +387,7 @@ BOOL IsoReadFile(FILE *FileHandle, ULONG BytesToRead, PULONG BytesRead, PVOID Bu
UINT32 LengthInSector;
UINT32 NumberOfSectors;
// DbgPrint((DPRINT_FILESYSTEM, "IsoReadFile() BytesToRead = %d Buffer = 0x%x\n", BytesToRead, Buffer));
printf("IsoReadFile() BytesToRead = %d Buffer = 0x%x\n", BytesToRead, Buffer);
DbgPrint((DPRINT_FILESYSTEM, "IsoReadFile() BytesToRead = %d Buffer = 0x%x\n", BytesToRead, Buffer));
if (BytesRead != NULL)
{
@ -503,7 +488,7 @@ BOOL IsoReadFile(FILE *FileHandle, ULONG BytesToRead, PULONG BytesRead, PVOID Bu
//
// Now do the read and update BytesRead, BytesToRead, FilePointer, & Buffer
//
if (!BiosInt13ReadExtended(IsoDriveNumber, SectorNumber, NumberOfSectors, Buffer))
if (!DiskReadLogicalSectors(IsoDriveNumber, SectorNumber, NumberOfSectors, Buffer))
{
return FALSE;
}
@ -550,8 +535,7 @@ ULONG IsoGetFileSize(FILE *FileHandle)
{
PISO_FILE_INFO IsoFileHandle = (PISO_FILE_INFO)FileHandle;
// DbgPrint((DPRINT_FILESYSTEM, "IsoGetFileSize() FileSize = %d\n", IsoFileHandle->FileSize));
printf("IsoGetFileSize() FileSize = %d\n", IsoFileHandle->FileSize);
DbgPrint((DPRINT_FILESYSTEM, "IsoGetFileSize() FileSize = %d\n", IsoFileHandle->FileSize));
return IsoFileHandle->FileSize;
}
@ -560,8 +544,7 @@ VOID IsoSetFilePointer(FILE *FileHandle, ULONG NewFilePointer)
{
PISO_FILE_INFO IsoFileHandle = (PISO_FILE_INFO)FileHandle;
// DbgPrint((DPRINT_FILESYSTEM, "IsoSetFilePointer() NewFilePointer = %d\n", NewFilePointer));
printf("IsoSetFilePointer() NewFilePointer = %d\n", NewFilePointer);
DbgPrint((DPRINT_FILESYSTEM, "IsoSetFilePointer() NewFilePointer = %d\n", NewFilePointer));
IsoFileHandle->FilePointer = NewFilePointer;
}
@ -570,8 +553,7 @@ ULONG IsoGetFilePointer(FILE *FileHandle)
{
PISO_FILE_INFO IsoFileHandle = (PISO_FILE_INFO)FileHandle;
// DbgPrint((DPRINT_FILESYSTEM, "IsoGetFilePointer() FilePointer = %d\n", IsoFileHandle->FilePointer));
printf("IsoGetFilePointer() FilePointer = %d\n", IsoFileHandle->FilePointer);
DbgPrint((DPRINT_FILESYSTEM, "IsoGetFilePointer() FilePointer = %d\n", IsoFileHandle->FilePointer));
return IsoFileHandle->FilePointer;
}