fixed some prototypes Modified: trunk/reactos/apps/utils/ps/ps.c Modified: trunk/reactos/include/ndk/mmfuncs.h Modified: trunk/reactos/lib/kernel32/file/copy.c Modified: trunk/reactos/lib/kernel32/mem/virtual.c Modified: trunk/reactos/lib/kernel32/misc/toolhelp.c Modified: trunk/reactos/lib/kernel32/process/create.c Modified: trunk/reactos/lib/rtl/dbgbuffer.c Modified: trunk/reactos/lib/rtl/heap.c Modified: trunk/reactos/ntoskrnl/include/internal/mm.h Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h Modified: trunk/reactos/ntoskrnl/mm/anonmem.c Modified: trunk/reactos/ntoskrnl/mm/process.c Modified: trunk/reactos/ntoskrnl/mm/region.c Modified: trunk/reactos/ntoskrnl/mm/section.c Modified: trunk/reactos/ntoskrnl/ps/psmgr.c Modified: trunk/reactos/w32api/include/winbase.h Modified: trunk/reactos/w32api/include/windef.h _____
Modified: trunk/reactos/apps/utils/ps/ps.c --- trunk/reactos/apps/utils/ps/ps.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/apps/utils/ps/ps.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -269,12 +269,14 @@
statt->desc , waitt->desc); WriteFile(stdout, buf1, lstrlen(buf1), &r, NULL);
- EnumThreadWindows((DWORD)CurrentProcess->Threads[ti].ClientId.UniqueThre ad, + EnumThreadWindows(PtrToUlong(CurrentProcess->Threads[ti].ClientId.Unique Thread), (WNDENUMPROC) EnumThreadProc, (LPARAM)(LPTSTR) szWindowName ); } +typedef __attribute__((mode (__pointer__))) unsigned long ULONG_PTRX; +CurrentProcess = (PSYSTEM_PROCESSES)((ULONG_PTRX)CurrentProcess + 1); CurrentProcess = (PSYSTEM_PROCESSES)((ULONG_PTR)CurrentProcess + - CurrentProcess->NextEntryOffset); + (ULONG_PTR)CurrentProcess->NextEntryOffset); } return (0); } _____
Modified: trunk/reactos/include/ndk/mmfuncs.h --- trunk/reactos/include/ndk/mmfuncs.h 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/include/ndk/mmfuncs.h 2005-11-28 23:43:40 UTC (rev 19735) @@ -48,7 +48,7 @@
IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG ZeroBits, - IN OUT PULONG RegionSize, + IN OUT PSIZE_T RegionSize, IN ULONG AllocationType, IN ULONG Protect ); @@ -97,7 +97,7 @@ NtFreeVirtualMemory( IN HANDLE ProcessHandle, IN PVOID *BaseAddress, - IN PULONG RegionSize, + IN PSIZE_T RegionSize, IN ULONG FreeType );
@@ -119,7 +119,7 @@ IN ULONG ZeroBits, IN ULONG CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, + IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG AccessProtection @@ -207,7 +207,7 @@ IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG ZeroBits, - IN OUT PULONG RegionSize, + IN OUT PSIZE_T RegionSize, IN ULONG AllocationType, IN ULONG Protect ); @@ -247,7 +247,7 @@ ZwFreeVirtualMemory( IN HANDLE ProcessHandle, IN PVOID *BaseAddress, - IN PULONG RegionSize, + IN PSIZE_T RegionSize, IN ULONG FreeType );
@@ -270,7 +270,7 @@ IN ULONG ZeroBits, IN ULONG CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, + IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG AccessProtection _____
Modified: trunk/reactos/lib/kernel32/file/copy.c --- trunk/reactos/lib/kernel32/file/copy.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/lib/kernel32/file/copy.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -35,7 +35,7 @@
NTSTATUS errCode; IO_STATUS_BLOCK IoStatusBlock; UCHAR *lpBuffer = NULL; - ULONG RegionSize = 0x10000; + SIZE_T RegionSize = 0x10000; LARGE_INTEGER BytesCopied; DWORD CallbackReason; DWORD ProgressResult; _____
Modified: trunk/reactos/lib/kernel32/mem/virtual.c --- trunk/reactos/lib/kernel32/mem/virtual.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/lib/kernel32/mem/virtual.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -22,7 +22,7 @@
LPVOID STDCALL VirtualAllocEx(HANDLE hProcess, LPVOID lpAddress, - DWORD dwSize, + SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { @@ -31,7 +31,7 @@ Status = NtAllocateVirtualMemory(hProcess, (PVOID *)&lpAddress, 0, - (PULONG)&dwSize, + &dwSize, flAllocationType, flProtect); if (!NT_SUCCESS(Status)) @@ -48,7 +48,7 @@ */ LPVOID STDCALL VirtualAlloc(LPVOID lpAddress, - DWORD dwSize, + SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { @@ -66,7 +66,7 @@ BOOL STDCALL VirtualFreeEx(HANDLE hProcess, LPVOID lpAddress, - DWORD dwSize, + SIZE_T dwSize, DWORD dwFreeType) { NTSTATUS Status; @@ -89,7 +89,7 @@ */ BOOL STDCALL VirtualFree(LPVOID lpAddress, - DWORD dwSize, + SIZE_T dwSize, DWORD dwFreeType) { return(VirtualFreeEx(GetCurrentProcess(), @@ -104,7 +104,7 @@ */ BOOL STDCALL VirtualProtect(LPVOID lpAddress, - DWORD dwSize, + SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect) { @@ -122,7 +122,7 @@ BOOL STDCALL VirtualProtectEx(HANDLE hProcess, LPVOID lpAddress, - DWORD dwSize, + SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect) { @@ -147,7 +147,7 @@ */ BOOL STDCALL VirtualLock(LPVOID lpAddress, - DWORD dwSize) + SIZE_T dwSize) { ULONG BytesLocked; NTSTATUS Status; @@ -171,7 +171,7 @@ DWORD STDCALL VirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, - DWORD dwLength) + SIZE_T dwLength) { return(VirtualQueryEx(NtCurrentProcess(), lpAddress, @@ -187,7 +187,7 @@ VirtualQueryEx(HANDLE hProcess, LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, - DWORD dwLength) + SIZE_T dwLength) { NTSTATUS Status; ULONG ResultLength; @@ -212,7 +212,7 @@ */ BOOL STDCALL VirtualUnlock(LPVOID lpAddress, - DWORD dwSize) + SIZE_T dwSize) { ULONG BytesLocked; NTSTATUS Status; _____
Modified: trunk/reactos/lib/kernel32/misc/toolhelp.c --- trunk/reactos/lib/kernel32/misc/toolhelp.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/lib/kernel32/misc/toolhelp.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -95,7 +95,7 @@
TH32FreeAllocatedResources(PRTL_DEBUG_BUFFER HeapDebug, PRTL_DEBUG_BUFFER ModuleDebug, PVOID ProcThrdInfo, - ULONG ProcThrdInfoSize) + SIZE_T ProcThrdInfoSize) { if(HeapDebug != NULL) { @@ -121,7 +121,7 @@ PRTL_DEBUG_BUFFER *HeapDebug, PRTL_DEBUG_BUFFER *ModuleDebug, PVOID *ProcThrdInfo, - ULONG *ProcThrdInfoSize) + SIZE_T *ProcThrdInfoSize) { NTSTATUS Status = STATUS_SUCCESS;
@@ -1115,7 +1115,7 @@ { PRTL_DEBUG_BUFFER HeapDebug, ModuleDebug; PVOID ProcThrdInfo; - ULONG ProcThrdInfoSize; + SIZE_T ProcThrdInfoSize; NTSTATUS Status; HANDLE hSnapShotSection = NULL;
_____
Modified: trunk/reactos/lib/kernel32/process/create.c --- trunk/reactos/lib/kernel32/process/create.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/lib/kernel32/process/create.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -366,7 +366,7 @@
NTSTATUS Status; PWCHAR ScanChar; ULONG EnviroSize; - ULONG Size; + SIZE_T Size; UNICODE_STRING Desktop, Shell, Runtime, Title; PPEB OurPeb = NtCurrentPeb(); LPVOID Environment = lpEnvironment; _____
Modified: trunk/reactos/lib/rtl/dbgbuffer.c --- trunk/reactos/lib/rtl/dbgbuffer.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/lib/rtl/dbgbuffer.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -22,12 +22,12 @@
{ NTSTATUS Status; PRTL_DEBUG_BUFFER Buf = NULL; - ULONG SectionSize = 100 * PAGE_SIZE; + SIZE_T SectionSize = 100 * PAGE_SIZE;
Status = NtAllocateVirtualMemory( NtCurrentProcess(), - (PVOID)&Buf, + (PVOID*)&Buf, 0, - &SectionSize, + &SectionSize, MEM_COMMIT, PAGE_READWRITE); if (!NT_SUCCESS(Status)) _____
Modified: trunk/reactos/lib/rtl/heap.c --- trunk/reactos/lib/rtl/heap.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/lib/rtl/heap.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -291,10 +291,10 @@
PVOID ptr, ULONG flags) { - ULONG size = (ULONG)((char *)ptr - (char *)subheap); + SIZE_T size = (SIZE_T)((char *)ptr - (char *)subheap); NTSTATUS Status; PVOID address; - ULONG commitsize; + SIZE_T commitsize;
size = (size + COMMIT_MASK) & ~COMMIT_MASK; if (size > subheap->size) @@ -516,7 +516,7 @@ * HEAP_InitSubHeap */ static BOOLEAN HEAP_InitSubHeap( HEAP *heap, PVOID address, ULONG flags, - ULONG commitSize, ULONG totalSize, + SIZE_T commitSize, ULONG totalSize, PRTL_HEAP_PARAMETERS Parameters ) { SUBHEAP *subheap = (SUBHEAP *)address; @@ -611,7 +611,7 @@ static PSUBHEAP HEAP_CreateSubHeap(PVOID BaseAddress, HEAP *heap, ULONG flags, - ULONG commitSize, ULONG totalSize, + SIZE_T commitSize, ULONG totalSize, PRTL_HEAP_PARAMETERS Parameters ) { PVOID address; @@ -671,7 +671,7 @@ * Find a free block at least as large as the requested size, and make sure * the requested size is committed. */ -static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, ULONG size, +static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T size, SUBHEAP **ppSubHeap ) { SUBHEAP *subheap; _____
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h --- trunk/reactos/ntoskrnl/include/internal/mm.h 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/ntoskrnl/include/internal/mm.h 2005-11-28 23:43:40 UTC (rev 19735) @@ -1277,9 +1277,9 @@
VOID NTAPI -MmInitialiseRegion( +MmInitializeRegion( PLIST_ENTRY RegionListHead, - ULONG Length, + SIZE_T Length, ULONG Type, ULONG Protect ); _____
Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h 2005-11-28 23:43:40 UTC (rev 19735) @@ -114,6 +114,7 @@
#define ProbeForWritePointer(Ptr) ProbeForWriteGenericType(Ptr, PVOID) #define ProbeForWriteHandle(Ptr) ProbeForWriteGenericType(Ptr, HANDLE) #define ProbeForWriteLangid(Ptr) ProbeForWriteGenericType(Ptr, LANGID) +#define ProbeForWriteSize_t(Ptr) ProbeForWriteGenericType(Ptr, SIZE_T) #define ProbeForWriteLargeInteger(Ptr) ProbeForWriteGenericType(&(Ptr)->QuadPart, LONGLONG) #define ProbeForWriteUlargeInteger(Ptr) ProbeForWriteGenericType(&(Ptr)->QuadPart, ULONGLONG) #define ProbeForWriteUnicodeString(Ptr) ProbeForWriteGenericType(Ptr, UNICODE_STRING) @@ -138,6 +139,7 @@ #define ProbeForReadPointer(Ptr) ProbeForReadGenericType(Ptr, PVOID, NULL) #define ProbeForReadHandle(Ptr) ProbeForReadGenericType(Ptr, HANDLE, NULL) #define ProbeForReadLangid(Ptr) ProbeForReadGenericType(Ptr, LANGID, 0) +#define ProbeForReadSize_t(Ptr) ProbeForReadGenericType(Ptr, SIZE_T, 0) #define ProbeForReadLargeInteger(Ptr) ProbeForReadGenericType(Ptr, LARGE_INTEGER, __emptyLargeInteger) #define ProbeForReadUlargeInteger(Ptr) ProbeForReadGenericType(Ptr, ULARGE_INTEGER, __emptyULargeInteger) #define ProbeForReadUnicodeString(Ptr) ProbeForReadGenericType(Ptr, UNICODE_STRING, __emptyUnicodeString) _____
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c --- trunk/reactos/ntoskrnl/mm/anonmem.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/ntoskrnl/mm/anonmem.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -747,7 +747,7 @@
MemoryAreaLength = (ULONG_PTR)MemoryArea->EndingAddress - (ULONG_PTR)MemoryArea->StartingAddress;
- MmInitialiseRegion(&MemoryArea->Data.VirtualMemoryData.RegionListHead, + MmInitializeRegion(&MemoryArea->Data.VirtualMemoryData.RegionListHead, MemoryAreaLength, Type, Protect);
if ((AllocationType & MEM_COMMIT) && _____
Modified: trunk/reactos/ntoskrnl/mm/process.c --- trunk/reactos/ntoskrnl/mm/process.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/ntoskrnl/mm/process.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -61,7 +61,7 @@
} while (Status != STATUS_SUCCESS);
/* Initialize the Region */ - MmInitialiseRegion(&MemoryArea->Data.VirtualMemoryData.RegionListHead, + MmInitializeRegion(&MemoryArea->Data.VirtualMemoryData.RegionListHead, PAGE_SIZE, MEM_COMMIT, PAGE_READWRITE); @@ -194,7 +194,7 @@ { PPEB Peb = NULL; LARGE_INTEGER SectionOffset; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; PVOID TableBase = NULL; PIMAGE_NT_HEADERS NtHeaders; PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigData; @@ -385,7 +385,7 @@ PVOID BaseAddress; PMEMORY_AREA MemoryArea; PHYSICAL_ADDRESS BoundaryAddressMultiple; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; PVOID ImageBase = 0; BoundaryAddressMultiple.QuadPart = 0;
_____
Modified: trunk/reactos/ntoskrnl/mm/region.c --- trunk/reactos/ntoskrnl/mm/region.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/ntoskrnl/mm/region.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -239,7 +239,7 @@
VOID NTAPI -MmInitialiseRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type, +MmInitializeRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type, ULONG Protect) { PMM_REGION Region; _____
Modified: trunk/reactos/ntoskrnl/mm/section.c --- trunk/reactos/ntoskrnl/mm/section.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/ntoskrnl/mm/section.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -3488,7 +3488,7 @@
PSECTION_OBJECT Section, PMM_SECTION_SEGMENT Segment, PVOID* BaseAddress, - ULONG ViewSize, + SIZE_T ViewSize, ULONG Protect, ULONG ViewOffset, ULONG AllocationType) @@ -3521,7 +3521,7 @@ MArea->Data.SectionData.Section = Section; MArea->Data.SectionData.ViewOffset = ViewOffset; MArea->Data.SectionData.WriteCopyView = FALSE; - MmInitialiseRegion(&MArea->Data.SectionData.RegionListHead, + MmInitializeRegion(&MArea->Data.SectionData.RegionListHead, ViewSize, 0, Protect);
return(STATUS_SUCCESS); @@ -3584,14 +3584,14 @@ IN ULONG ZeroBits OPTIONAL, IN ULONG CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, + IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType OPTIONAL, IN ULONG Protect) { PVOID SafeBaseAddress; LARGE_INTEGER SafeSectionOffset; - ULONG SafeViewSize; + SIZE_T SafeViewSize; PSECTION_OBJECT Section; PEPROCESS Process; KPROCESSOR_MODE PreviousMode; @@ -3642,7 +3642,7 @@ ProbeForWriteLargeInteger(SectionOffset); SafeSectionOffset = *SectionOffset; } - ProbeForWriteUlong(ViewSize); + ProbeForWriteSize_t(ViewSize); SafeViewSize = *ViewSize; } _SEH_HANDLE @@ -4404,7 +4404,7 @@ IN ULONG ZeroBits, IN ULONG CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, + IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect) _____
Modified: trunk/reactos/ntoskrnl/ps/psmgr.c --- trunk/reactos/ntoskrnl/ps/psmgr.c 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/ntoskrnl/ps/psmgr.c 2005-11-28 23:43:40 UTC (rev 19735) @@ -400,7 +400,7 @@
PVOID *DllBase) { NTSTATUS Status; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; PVOID ImageBase = 0;
/* Map the System DLL */ _____
Modified: trunk/reactos/w32api/include/winbase.h --- trunk/reactos/w32api/include/winbase.h 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/w32api/include/winbase.h 2005-11-28 23:43:40 UTC (rev 19735) @@ -1898,16 +1898,16 @@
BOOL WINAPI UpdateResourceW(HANDLE,LPCWSTR,LPCWSTR,WORD,PVOID,DWORD); BOOL WINAPI VerifyVersionInfoA(LPOSVERSIONINFOEXA,DWORD,DWORDLONG); BOOL WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW,DWORD,DWORDLONG); -PVOID WINAPI VirtualAlloc(PVOID,DWORD,DWORD,DWORD); -PVOID WINAPI VirtualAllocEx(HANDLE,PVOID,DWORD,DWORD,DWORD); -BOOL WINAPI VirtualFree(PVOID,DWORD,DWORD); -BOOL WINAPI VirtualFreeEx(HANDLE,PVOID,DWORD,DWORD); -BOOL WINAPI VirtualLock(PVOID,DWORD); -BOOL WINAPI VirtualProtect(PVOID,DWORD,DWORD,PDWORD); -BOOL WINAPI VirtualProtectEx(HANDLE,PVOID,DWORD,DWORD,PDWORD); -DWORD WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,DWORD); -DWORD WINAPI VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,DWORD); -BOOL WINAPI VirtualUnlock(PVOID,DWORD); +PVOID WINAPI VirtualAlloc(PVOID,SIZE_T,DWORD,DWORD); +PVOID WINAPI VirtualAllocEx(HANDLE,PVOID,SIZE_T,DWORD,DWORD); +BOOL WINAPI VirtualFree(PVOID,SIZE_T,DWORD); +BOOL WINAPI VirtualFreeEx(HANDLE,PVOID,SIZE_T,DWORD); +BOOL WINAPI VirtualLock(PVOID,SIZE_T); +BOOL WINAPI VirtualProtect(PVOID,SIZE_T,DWORD,PDWORD); +BOOL WINAPI VirtualProtectEx(HANDLE,PVOID,SIZE_T,DWORD,PDWORD); +DWORD WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T); +DWORD WINAPI VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T); +BOOL WINAPI VirtualUnlock(PVOID,SIZE_T); BOOL WINAPI WaitCommEvent(HANDLE,PDWORD,LPOVERLAPPED); BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD); DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,BOOL,DWORD); _____
Modified: trunk/reactos/w32api/include/windef.h --- trunk/reactos/w32api/include/windef.h 2005-11-28 23:35:35 UTC (rev 19734) +++ trunk/reactos/w32api/include/windef.h 2005-11-28 23:43:40 UTC (rev 19735) @@ -249,7 +249,9 @@
typedef int INT; typedef unsigned int UINT,*PUINT,*LPUINT;
+#ifndef NT_INCLUDED #include <winnt.h> +#endif
typedef UINT_PTR WPARAM; typedef LONG_PTR LPARAM;