Author: tkreuzer
Date: Tue Jul 29 19:25:15 2008
New Revision: 34939
URL:
http://svn.reactos.org/svn/reactos?rev=34939&view=rev
Log:
fix several ULONG / ULONG_PTR / SIZE_T issues.
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/cont.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/iospace.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mdlsup.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mm.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ncache.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pool.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/region.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rpoolmgr.h
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/sysldr.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/virtual.c
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/cont.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/cont.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/cont.c [iso-8859-1] Tue Jul 29 19:25:15
2008
@@ -225,7 +225,7 @@
*/
VOID STDCALL
MmFreeContiguousMemorySpecifyCache(IN PVOID BaseAddress,
- IN ULONG NumberOfBytes,
+ IN SIZE_T NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType)
{
MmLockAddressSpace(MmGetKernelAddressSpace());
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/iospace.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/iospace.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/iospace.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -137,7 +137,7 @@
*/
VOID STDCALL
MmUnmapIoSpace (IN PVOID BaseAddress,
- IN ULONG NumberOfBytes)
+ IN SIZE_T NumberOfBytes)
{
LONG Offset;
PVOID Address = BaseAddress;
@@ -163,7 +163,7 @@
*/
PVOID STDCALL
MmMapVideoDisplay (IN PHYSICAL_ADDRESS PhysicalAddress,
- IN ULONG NumberOfBytes,
+ IN SIZE_T NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType)
{
return MmMapIoSpace (PhysicalAddress, NumberOfBytes, (BOOLEAN)CacheType);
@@ -175,7 +175,7 @@
*/
VOID STDCALL
MmUnmapVideoDisplay (IN PVOID BaseAddress,
- IN ULONG NumberOfBytes)
+ IN SIZE_T NumberOfBytes)
{
MmUnmapIoSpace (BaseAddress, NumberOfBytes);
}
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mdlsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mdlsup.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mdlsup.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -81,7 +81,7 @@
NTAPI
MmCreateMdl(IN PMDL Mdl,
IN PVOID Base,
- IN ULONG Length)
+ IN SIZE_T Length)
{
ULONG Size;
@@ -107,7 +107,7 @@
ULONG
NTAPI
MmSizeOfMdl(IN PVOID Base,
- IN ULONG Length)
+ IN SIZE_T Length)
{
/* Return the MDL size */
return sizeof(MDL) + (ADDRESS_AND_SIZE_TO_SPAN_PAGES(Base, Length) *
sizeof(PFN_NUMBER));
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mm.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mm.c [iso-8859-1] Tue Jul 29 19:25:15
2008
@@ -14,7 +14,7 @@
/* GLOBALS *****************************************************************/
-ULONG MmUserProbeAddress = 0;
+ULONG_PTR MmUserProbeAddress = 0;
PVOID MmHighestUserAddress = NULL;
PBOOLEAN Mm64BitPhysicalAddress = FALSE;
PVOID MmSystemRangeStart = NULL;
@@ -394,7 +394,7 @@
NTAPI
NtResetWriteWatch(IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
- IN ULONG RegionSize)
+ IN SIZE_T RegionSize)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -374,7 +374,7 @@
if (MiDbgEnableMdDump) MiDbgDumpMemoryDescriptors();
/* Set the page directory */
- PsGetCurrentProcess()->Pcb.DirectoryTableBase.LowPart =
(ULONG)MmGetPageDirectory();
+ PsGetCurrentProcess()->Pcb.DirectoryTableBase.QuadPart =
(ULONG_PTR)MmGetPageDirectory();
/* Get the size of FreeLDR's image allocations */
MmBootImageSize = KeLoaderBlock->Extension->LoaderPagesSpanned;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ncache.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ncache.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ncache.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -115,7 +115,7 @@
* @implemented
*/
VOID STDCALL MmFreeNonCachedMemory (IN PVOID BaseAddress,
- IN ULONG NumberOfBytes)
+ IN SIZE_T NumberOfBytes)
{
MmLockAddressSpace(MmGetKernelAddressSpace());
MmFreeMemoryAreaByPtr(MmGetKernelAddressSpace(),
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pool.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pool.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/pool.c [iso-8859-1] Tue Jul 29 19:25:15
2008
@@ -50,7 +50,7 @@
* @implemented
*/
PVOID STDCALL
-ExAllocatePool (POOL_TYPE PoolType, ULONG NumberOfBytes)
+ExAllocatePool (POOL_TYPE PoolType, SIZE_T NumberOfBytes)
/*
* FUNCTION: Allocates pool memory of a specified type and returns a pointer
* to the allocated block. This routine is used for general purpose allocation
@@ -99,7 +99,7 @@
* @implemented
*/
PVOID STDCALL
-ExAllocatePoolWithTag (POOL_TYPE PoolType, ULONG NumberOfBytes, ULONG Tag)
+ExAllocatePoolWithTag (POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag)
{
PVOID Block;
@@ -127,7 +127,7 @@
* @implemented
*/
PVOID STDCALL
-ExAllocatePoolWithQuota (POOL_TYPE PoolType, ULONG NumberOfBytes)
+ExAllocatePoolWithQuota (POOL_TYPE PoolType, SIZE_T NumberOfBytes)
{
return(ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, TAG_NONE));
}
@@ -180,7 +180,7 @@
PVOID
NTAPI
ExAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType,
- IN ULONG NumberOfBytes,
+ IN SIZE_T NumberOfBytes,
IN ULONG Tag)
{
PEPROCESS Process;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -384,7 +384,7 @@
ImageConfigData = RtlImageDirectoryEntryToData(Peb->ImageBaseAddress,
TRUE,
IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG,
- &ViewSize);
+ (PULONG)&ViewSize);
ProbeForRead(ImageConfigData,
sizeof(IMAGE_LOAD_CONFIG_DIRECTORY),
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/region.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/region.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/region.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -238,7 +238,7 @@
VOID
NTAPI
-MmInitializeRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type,
+MmInitializeRegion(PLIST_ENTRY RegionListHead, SIZE_T Length, ULONG Type,
ULONG Protect)
{
PMM_REGION Region;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rpoolmgr.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rpoolmgr.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/rpoolmgr.h [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -12,7 +12,7 @@
typedef unsigned long rulong;
-#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase &&
(ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize)
+#define R_IS_POOL_PTR(pool,ptr) (((void*)(ULONG_PTR)(ptr) >= pool->UserBase)
&& ((ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize)))
#define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) )
#define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz
>= sizeof(R_FREE) && sz < pool->UserSize )
@@ -712,7 +712,7 @@
if ( R_IS_POOL_PTR(pool,NumberOfBytes) )
{
R_DEBUG("red zone verification requested for block 0x%X\n", NumberOfBytes
);
- RUsedRedZoneCheck(pool,RBodyToHdr((void*)NumberOfBytes), (char*)NumberOfBytes,
__FILE__, __LINE__ );
+ RUsedRedZoneCheck(pool,RBodyToHdr((void*)(ULONG_PTR)NumberOfBytes),
(char*)(ULONG_PTR)NumberOfBytes, __FILE__, __LINE__ );
R_RELEASE_MUTEX(pool);
return NULL;
}
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/section.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -2382,6 +2382,7 @@
LARGE_INTEGER Offset;
CHAR Buffer;
FILE_STANDARD_INFORMATION FileInfo;
+ ULONG Length;
/*
* Create the section
@@ -2444,7 +2445,8 @@
FileStandardInformation,
sizeof(FILE_STANDARD_INFORMATION),
&FileInfo,
- &Iosb.Information);
+ &Length);
+ Iosb.Information = Length;
if (!NT_SUCCESS(Status))
{
ObDereferenceObject(Section);
@@ -4188,8 +4190,8 @@
NtQuerySection(IN HANDLE SectionHandle,
IN SECTION_INFORMATION_CLASS SectionInformationClass,
OUT PVOID SectionInformation,
- IN ULONG SectionInformationLength,
- OUT PULONG ResultLength OPTIONAL)
+ IN SIZE_T SectionInformationLength,
+ OUT PSIZE_T ResultLength OPTIONAL)
{
PROS_SECTION_OBJECT Section;
KPROCESSOR_MODE PreviousMode;
@@ -4740,7 +4742,7 @@
NTSTATUS STDCALL
MmMapViewInSystemSpace (IN PVOID SectionObject,
OUT PVOID * MappedBase,
- IN OUT PULONG ViewSize)
+ IN OUT PSIZE_T ViewSize)
{
PROS_SECTION_OBJECT Section;
PMM_AVL_TABLE AddressSpace;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/sysldr.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -647,7 +647,7 @@
ForwardName->Hint = 0;
/* Set the new address */
- *(PULONG)&ForwardThunk.u1.AddressOfData = (ULONG)ForwardName;
+ ForwardThunk.u1.AddressOfData = (ULONG_PTR)ForwardName;
/* Snap the forwarder */
Status = MiSnapThunk(LdrEntry->DllBase,
@@ -1289,7 +1289,7 @@
LdrEntry = CONTAINING_RECORD(NextEntry,
LDR_DATA_TABLE_ENTRY,
InLoadOrderLinks);
- PsNtosImageBase = (ULONG)LdrEntry->DllBase;
+ PsNtosImageBase = (ULONG_PTR)LdrEntry->DllBase;
/* Loop the loader block */
while (NextEntry != ListHead)
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/virtual.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/virtual.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/virtual.c [iso-8859-1] Tue Jul 29
19:25:15 2008
@@ -678,8 +678,8 @@
NtReadVirtualMemory(IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
OUT PVOID Buffer,
- IN ULONG NumberOfBytesToRead,
- OUT PULONG NumberOfBytesRead OPTIONAL)
+ IN SIZE_T NumberOfBytesToRead,
+ OUT PSIZE_T NumberOfBytesRead OPTIONAL)
{
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
PEPROCESS Process;
@@ -765,8 +765,8 @@
NtWriteVirtualMemory(IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
IN PVOID Buffer,
- IN ULONG NumberOfBytesToWrite,
- OUT PULONG NumberOfBytesWritten OPTIONAL)
+ IN SIZE_T NumberOfBytesToWrite,
+ OUT PSIZE_T NumberOfBytesWritten OPTIONAL)
{
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
PEPROCESS Process;
@@ -950,8 +950,8 @@
IN PVOID Address,
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
OUT PVOID VirtualMemoryInformation,
- IN ULONG Length,
- OUT PULONG UnsafeResultLength)
+ IN SIZE_T Length,
+ OUT PSIZE_T UnsafeResultLength)
{
NTSTATUS Status = STATUS_SUCCESS;
ULONG ResultLength = 0;
@@ -1062,8 +1062,8 @@
NTAPI
NtUnlockVirtualMemory(IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
- IN ULONG NumberOfBytesToUnlock,
- OUT PULONG NumberOfBytesUnlocked OPTIONAL)
+ IN SIZE_T NumberOfBytesToUnlock,
+ OUT PSIZE_T NumberOfBytesUnlocked OPTIONAL)
{
UNIMPLEMENTED;
if (NumberOfBytesUnlocked) *NumberOfBytesUnlocked = 0;