Author: mbosma
Date: Sat Jan 6 03:01:34 2007
New Revision: 25322
URL:
http://svn.reactos.org/svn/reactos?rev=25322&view=rev
Log:
Make difference between trunk and branch smaller by making use of the PVOID Variable in
ExeFmtpReadFile.
Modified:
branches/cache_manager_rewrite/headers.patch
branches/cache_manager_rewrite/mm/elf.inc.h
branches/cache_manager_rewrite/mm/pe.c
branches/cache_manager_rewrite/mm/section.c
Modified: branches/cache_manager_rewrite/headers.patch
URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/headers.p…
==============================================================================
--- branches/cache_manager_rewrite/headers.patch (original)
+++ branches/cache_manager_rewrite/headers.patch Sat Jan 6 03:01:34 2007
@@ -41,25 +41,14 @@
===================================================================
--- include/reactos/exeformat.h (revision 22988)
+++ include/reactos/exeformat.h (working copy)
-@@ -34,7 +34,8 @@
-
+@@ -35,6 +35,7 @@
typedef NTSTATUS (NTAPI * PEXEFMT_CB_READ_FILE)
(
-- IN PVOID File,
-+ IN PFILE_OBJECT FileObject,
+ IN PVOID File,
+ ULONG SectorSize,
IN PLARGE_INTEGER Offset,
IN ULONG Length,
OUT PVOID * Data,
-@@ -51,7 +52,7 @@
- (
- IN CONST VOID * FileHeader,
- IN SIZE_T FileHeaderSize,
-- IN PVOID File,
-+ IN PFILE_OBJECT FileObject,
- OUT PMM_IMAGE_SECTION_OBJECT ImageSectionObject,
- OUT PULONG Flags,
- IN PEXEFMT_CB_READ_FILE ReadFileCb,
Index: ntoskrnl/include/internal/cc.h
===================================================================
--- ntoskrnl/include/internal/cc.h (revision 22988)
Modified: branches/cache_manager_rewrite/mm/elf.inc.h
URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/elf.in…
==============================================================================
--- branches/cache_manager_rewrite/mm/elf.inc.h (original)
+++ branches/cache_manager_rewrite/mm/elf.inc.h Sat Jan 6 03:01:34 2007
@@ -448,6 +448,7 @@
nReadStatus = ReadFileCb
(
File,
+ ImageSectionObject->BytesPerSector,
&lnOffset,
cbPHdrSize,
&pData,
Modified: branches/cache_manager_rewrite/mm/pe.c
URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/pe.c?r…
==============================================================================
--- branches/cache_manager_rewrite/mm/pe.c (original)
+++ branches/cache_manager_rewrite/mm/pe.c Sat Jan 6 03:01:34 2007
@@ -144,7 +144,7 @@
*/
NTSTATUS NTAPI PeFmtCreateSection(IN CONST VOID * FileHeader,
IN SIZE_T FileHeaderSize,
- IN PFILE_OBJECT FileObject,
+ IN PVOID File,
OUT PMM_IMAGE_SECTION_OBJECT ImageSectionObject,
OUT PULONG Flags,
IN PEXEFMT_CB_READ_FILE ReadFileCb,
@@ -172,7 +172,7 @@
ASSERT(FileHeader);
ASSERT(FileHeaderSize > 0);
- ASSERT(FileObject);
+ ASSERT(File);
ASSERT(ImageSectionObject);
ASSERT(ReadFileCb);
ASSERT(AllocateSegmentsCb);
@@ -241,7 +241,7 @@
lnOffset.QuadPart = pidhDosHeader->e_lfanew;
/* read the header from the file */
- nStatus = ReadFileCb(FileObject, ImageSectionObject->BytesPerSector, &lnOffset,
sizeof(IMAGE_NT_HEADERS64), &pData, &pBuffer, &cbReadSize);
+ nStatus = ReadFileCb(File, ImageSectionObject->BytesPerSector, &lnOffset,
sizeof(IMAGE_NT_HEADERS64), &pData, &pBuffer, &cbReadSize);
if(!NT_SUCCESS(nStatus))
DIE(("ReadFile failed, status %08X\n", nStatus));
@@ -523,7 +523,7 @@
lnOffset.QuadPart = cbSectionHeadersOffset;
/* read the header from the file */
- nStatus = ReadFileCb(FileObject, ImageSectionObject->BytesPerSector, &lnOffset,
cbSectionHeadersSize, &pData, &pBuffer, &cbReadSize);
+ nStatus = ReadFileCb(File, ImageSectionObject->BytesPerSector, &lnOffset,
cbSectionHeadersSize, &pData, &pBuffer, &cbReadSize);
if(!NT_SUCCESS(nStatus))
DIE(("ReadFile failed with status %08X\n", nStatus));
Modified: branches/cache_manager_rewrite/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/branches/cache_manager_rewrite/mm/sectio…
==============================================================================
--- branches/cache_manager_rewrite/mm/section.c (original)
+++ branches/cache_manager_rewrite/mm/section.c Sat Jan 6 03:01:34 2007
@@ -3679,7 +3679,7 @@
(
IN CONST VOID * FileHeader,
IN SIZE_T FileHeaderSize,
- IN PFILE_OBJECT FileObject,
+ IN PVOID File,
OUT PMM_IMAGE_SECTION_OBJECT ImageSectionObject,
OUT PULONG Flags,
IN PEXEFMT_CB_READ_FILE ReadFileCb,
@@ -3690,7 +3690,7 @@
(
IN CONST VOID * FileHeader,
IN SIZE_T FileHeaderSize,
- IN PFILE_OBJECT FileObject,
+ IN PVOID File,
OUT PMM_IMAGE_SECTION_OBJECT ImageSectionObject,
OUT PULONG Flags,
IN PEXEFMT_CB_READ_FILE ReadFileCb,
@@ -3732,8 +3732,8 @@
static
NTSTATUS
NTAPI
-ExeFmtpReadFile(IN PFILE_OBJECT FileObject,
- ULONG SectorSize,
+ExeFmtpReadFile(IN PVOID File,
+ IN ULONG SectorSize,
IN PLARGE_INTEGER Offset,
IN ULONG Length,
OUT PVOID * Data,
@@ -3741,6 +3741,7 @@
OUT PULONG ReadSize)
{
NTSTATUS Status;
+ PFILE_OBJECT FileObject = (PFILE_OBJECT)File;
LARGE_INTEGER FileOffset;
ULONG AdjustOffset;
ULONG OffsetAdjustment;
@@ -4187,7 +4188,6 @@
*/
Offset.QuadPart = 0;
- /* FIXME: use FileObject instead of FileHandle */
Status = ExeFmtpReadFile (FileObject,
FileFsSize.BytesPerSector,
&Offset,
@@ -4214,7 +4214,6 @@
ImageSectionObject->BytesPerSector = FileFsSize.BytesPerSector;
Flags = 0;
- /* FIXME: use FileObject instead of FileHandle */
Status = ExeFmtpLoaders[i](FileHeader,
FileHeaderSize,
FileObject,