Author: hpoussin
Date: Sat Aug 8 23:11:40 2009
New Revision: 42538
URL:
http://svn.reactos.org/svn/reactos?rev=42538&view=rev
Log:
Fix some typos and make PFILE a ULONG
Modified:
trunk/reactos/boot/freeldr/freeldr/fs/ext2.c
trunk/reactos/boot/freeldr/freeldr/fs/fat.c
trunk/reactos/boot/freeldr/freeldr/fs/fs.c
trunk/reactos/boot/freeldr/freeldr/include/fs.h
trunk/reactos/boot/freeldr/freeldr/include/reactos.h
trunk/reactos/boot/freeldr/freeldr/linuxboot.c
trunk/reactos/boot/freeldr/freeldr/miscboot.c
trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
Modified: trunk/reactos/boot/freeldr/freeldr/fs/ext2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/ex…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] Sat Aug 8 23:11:40 2009
@@ -21,12 +21,12 @@
#include <debug.h>
BOOLEAN Ext2OpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector, ULONGLONG
PartitionSectorCount);
-FILE* Ext2OpenFile(PCSTR FileName);
+PEXT2_FILE_INFO Ext2OpenFile(PCSTR FileName);
BOOLEAN Ext2LookupFile(PCSTR FileName, PEXT2_FILE_INFO Ext2FileInfoPointer);
BOOLEAN Ext2SearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize,
PCHAR FileName, PEXT2_DIR_ENTRY DirectoryEntry);
BOOLEAN Ext2ReadVolumeSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONGLONG
SectorCount, PVOID Buffer);
-BOOLEAN Ext2ReadFileBig(FILE *FileHandle, ULONGLONG BytesToRead, ULONGLONG* BytesRead,
PVOID Buffer);
+BOOLEAN Ext2ReadFileBig(PEXT2_FILE_INFO Ext2FileInfo, ULONGLONG BytesToRead, ULONGLONG*
BytesRead, PVOID Buffer);
BOOLEAN Ext2ReadSuperBlock(VOID);
BOOLEAN Ext2ReadGroupDescriptors(VOID);
BOOLEAN Ext2ReadDirectory(ULONG Inode, PVOID* DirectoryBuffer, PEXT2_INODE
InodePointer);
@@ -102,7 +102,7 @@
* Tries to open the file 'name' and returns true or false
* for success and failure respectively
*/
-FILE* Ext2OpenFile(PCSTR FileName)
+PEXT2_FILE_INFO Ext2OpenFile(PCSTR FileName)
{
EXT2_FILE_INFO TempExt2FileInfo;
PEXT2_FILE_INFO FileHandle;
@@ -194,7 +194,7 @@
RtlCopyMemory(FileHandle, &TempExt2FileInfo, sizeof(EXT2_FILE_INFO));
- return (FILE*)FileHandle;
+ return FileHandle;
}
}
@@ -360,9 +360,8 @@
* Reads BytesToRead from open file and
* returns the number of bytes read in BytesRead
*/
-BOOLEAN Ext2ReadFileBig(FILE *FileHandle, ULONGLONG BytesToRead, ULONGLONG* BytesRead,
PVOID Buffer)
-{
- PEXT2_FILE_INFO Ext2FileInfo = (PEXT2_FILE_INFO)FileHandle;
+BOOLEAN Ext2ReadFileBig(PEXT2_FILE_INFO Ext2FileInfo, ULONGLONG BytesToRead, ULONGLONG*
BytesRead, PVOID Buffer)
+{
ULONG BlockNumber;
ULONG BlockNumberIndex;
ULONG OffsetInBlock;
@@ -1223,7 +1222,7 @@
LONG Ext2Read(ULONG FileId, VOID* Buffer, ULONG N, ULONG* Count)
{
- PFAT_FILE_INFO FileHandle = FsGetDeviceSpecific(FileId);
+ PEXT2_FILE_INFO FileHandle = FsGetDeviceSpecific(FileId);
ULONGLONG BytesReadBig;
BOOLEAN ret;
Modified: trunk/reactos/boot/freeldr/freeldr/fs/fat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fa…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/fat.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/fat.c [iso-8859-1] Sat Aug 8 23:11:40 2009
@@ -33,7 +33,7 @@
BOOLEAN FatReadCluster(ULONG ClusterNumber, PVOID Buffer);
BOOLEAN FatReadClusterChain(ULONG StartClusterNumber, ULONG NumberOfClusters, PVOID
Buffer);
BOOLEAN FatReadPartialCluster(ULONG ClusterNumber, ULONG StartingOffset, ULONG Length,
PVOID Buffer);
-BOOLEAN FatReadFile(FILE *FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID
Buffer);
+BOOLEAN FatReadFile(PFAT_FILE_INFO FatFileInfo, ULONG BytesToRead, ULONG* BytesRead,
PVOID Buffer);
BOOLEAN FatReadVolumeSectors(ULONG DriveNumber, ULONG SectorNumber, ULONG SectorCount,
PVOID Buffer);
BOOLEAN gCacheEnabled = FALSE;
@@ -1224,9 +1224,8 @@
* Reads BytesToRead from open file and
* returns the number of bytes read in BytesRead
*/
-BOOLEAN FatReadFile(FILE *FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer)
-{
- PFAT_FILE_INFO FatFileInfo = (PFAT_FILE_INFO)FileHandle;
+BOOLEAN FatReadFile(PFAT_FILE_INFO FatFileInfo, ULONG BytesToRead, ULONG* BytesRead,
PVOID Buffer)
+{
ULONG ClusterNumber;
ULONG OffsetInCluster;
ULONG LengthInCluster;
Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fs…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] Sat Aug 8 23:11:40 2009
@@ -62,7 +62,7 @@
if (ret == ESUCCESS)
return (PFILE)FileId;
else
- return NULL;
+ return (PFILE)0;
}
VOID FsCloseFile(PFILE FileHandle)
Modified: trunk/reactos/boot/freeldr/freeldr/include/fs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/fs.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/fs.h [iso-8859-1] Sat Aug 8 23:11:40 2009
@@ -34,8 +34,7 @@
#define FS_EXT2 3
#define FS_ISO9660 5
-#define FILE VOID
-#define PFILE FILE *
+#define PFILE ULONG
VOID FsRegisterDevice(CHAR* Prefix, const DEVVTBL* FuncTable);
VOID FsSetDeviceSpecific(ULONG FileId, VOID* Specific);
Modified: trunk/reactos/boot/freeldr/freeldr/include/reactos.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/reactos.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/reactos.h [iso-8859-1] Sat Aug 8 23:11:40
2009
@@ -98,9 +98,9 @@
VOID FASTCALL FrLdrSetupPae(ULONG Magic);
VOID FASTCALL FrLdrSetupPageDirectory(VOID);
VOID FASTCALL FrLdrGetPaeMode(VOID);
-BOOLEAN NTAPI FrLdrMapKernel(FILE *KernelImage);
+BOOLEAN NTAPI FrLdrMapKernel(PFILE KernelImage);
ULONG_PTR NTAPI FrLdrCreateModule(LPCSTR ModuleName);
-ULONG_PTR NTAPI FrLdrLoadModule(FILE *ModuleImage, LPCSTR ModuleName, PULONG
ModuleSize);
+ULONG_PTR NTAPI FrLdrLoadModule(PFILE ModuleImage, LPCSTR ModuleName, PULONG
ModuleSize);
BOOLEAN NTAPI FrLdrCloseModule(ULONG_PTR ModuleBase, ULONG dwModuleSize);
VOID NTAPI FrLdrStartup(ULONG Magic);
typedef VOID (FASTCALL *ROS_KERNEL_ENTRY_POINT)(ULONG Magic, PROS_LOADER_PARAMETER_BLOCK
LoaderBlock);
@@ -108,7 +108,7 @@
PVOID
NTAPI
FrLdrMapImage(
- IN FILE *Image,
+ IN PFILE Image,
IN PCHAR ShortName,
IN ULONG ImageType
);
@@ -116,7 +116,7 @@
PVOID
NTAPI
FrLdrReadAndMapImage(
- IN FILE *Image,
+ IN PFILE Image,
IN PCHAR ShortName,
IN ULONG ImageType
);
Modified: trunk/reactos/boot/freeldr/freeldr/linuxboot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/linux…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/linuxboot.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/linuxboot.c [iso-8859-1] Sat Aug 8 23:11:40 2009
@@ -43,8 +43,8 @@
VOID LoadAndBootLinux(PCSTR OperatingSystemName, PCSTR Description)
{
- PFILE LinuxKernel = NULL;
- PFILE LinuxInitrdFile = NULL;
+ PFILE LinuxKernel = 0;
+ PFILE LinuxInitrdFile = 0;
CHAR TempString[260];
UiDrawBackdrop();
@@ -81,7 +81,7 @@
// Open the kernel
LinuxKernel = FsOpenFile(LinuxKernelName);
- if (LinuxKernel == NULL)
+ if (!LinuxKernel)
{
sprintf(TempString, "Linux kernel \'%s\' not found.",
LinuxKernelName);
UiMessageBox(TempString);
@@ -92,7 +92,7 @@
if (LinuxHasInitrd)
{
LinuxInitrdFile = FsOpenFile(LinuxInitrdName);
- if (LinuxInitrdFile == NULL)
+ if (!LinuxInitrdFile)
{
sprintf(TempString, "Linux initrd image \'%s\' not found.",
LinuxInitrdName);
UiMessageBox(TempString);
@@ -178,11 +178,11 @@
LinuxBootFailed:
- if (LinuxKernel != NULL)
+ if (LinuxKernel)
{
FsCloseFile(LinuxKernel);
}
- if (LinuxInitrdFile != NULL)
+ if (LinuxInitrdFile)
{
FsCloseFile(LinuxInitrdFile);
}
Modified: trunk/reactos/boot/freeldr/freeldr/miscboot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/miscb…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/miscboot.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/miscboot.c [iso-8859-1] Sat Aug 8 23:11:40 2009
@@ -58,7 +58,7 @@
}
FilePointer = FsOpenFile(FileName);
- if (FilePointer == NULL)
+ if (!FilePointer)
{
strcat(FileName, " not found.");
UiMessageBox(FileName);
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c [iso-8859-1] Sat Aug 8 23:11:40
2009
@@ -65,7 +65,7 @@
ULONG_PTR
NTAPI
-FrLdrLoadModule(FILE *ModuleImage,
+FrLdrLoadModule(PFILE ModuleImage,
LPCSTR ModuleName,
PULONG ModuleSize)
{
@@ -435,7 +435,7 @@
PVOID
NTAPI
-FrLdrReadAndMapImage(IN FILE *Image,
+FrLdrReadAndMapImage(IN PFILE Image,
IN PCHAR Name,
IN ULONG ImageType)
{
@@ -674,7 +674,7 @@
PVOID
NTAPI
-FrLdrMapImage(IN FILE *Image,
+FrLdrMapImage(IN PFILE Image,
IN PCHAR Name,
IN ULONG ImageType)
{
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] Sat Aug 8 23:11:40
2009
@@ -67,7 +67,7 @@
FilePointer = FsOpenFile(szFileName);
/* Try under the system root in the main dir and drivers */
- if (FilePointer == NULL)
+ if (!FilePointer)
{
strcpy(value, SystemRoot);
if(value[strlen(value)-1] != '\\')
@@ -76,7 +76,7 @@
FilePointer = FsOpenFile(value);
}
- if (FilePointer == NULL)
+ if (!FilePointer)
{
strcpy(value, SystemRoot);
if(value[strlen(value)-1] != '\\')
@@ -86,7 +86,7 @@
FilePointer = FsOpenFile(value);
}
- if (FilePointer == NULL)
+ if (!FilePointer)
{
strcpy(value, SystemRoot);
if(value[strlen(value)-1] != '\\')
@@ -97,7 +97,7 @@
}
/* Make sure we did */
- if (FilePointer == NULL) {
+ if (!FilePointer) {
/* Fail if file wasn't opened */
strcpy(value, szFileName);
@@ -201,7 +201,7 @@
FilePointer = FsOpenFile(szFileName);
/* Make sure we did */
- if (FilePointer == NULL) {
+ if (!FilePointer) {
/* Fail if file wasn't opened */
strcpy(value, szFileName);
@@ -847,7 +847,7 @@
DPRINTM(DPRINT_REACTOS, "SystemHive: '%s'", szFileName);
FilePointer = FsOpenFile(szFileName);
- if (FilePointer == NULL)
+ if (!FilePointer)
{
UiMessageBox("Could not find the System hive!");
return;