fixed some prototypes
authorThomas Bluemel <thomas@reactsoft.com>
Mon, 28 Nov 2005 23:43:40 +0000 (23:43 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Mon, 28 Nov 2005 23:43:40 +0000 (23:43 +0000)
svn path=/trunk/; revision=19735

17 files changed:
reactos/apps/utils/ps/ps.c
reactos/include/ndk/mmfuncs.h
reactos/lib/kernel32/file/copy.c
reactos/lib/kernel32/mem/virtual.c
reactos/lib/kernel32/misc/toolhelp.c
reactos/lib/kernel32/process/create.c
reactos/lib/rtl/dbgbuffer.c
reactos/lib/rtl/heap.c
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/include/internal/ntoskrnl.h
reactos/ntoskrnl/mm/anonmem.c
reactos/ntoskrnl/mm/process.c
reactos/ntoskrnl/mm/region.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/ps/psmgr.c
reactos/w32api/include/winbase.h
reactos/w32api/include/windef.h

index 05b49d5..d72a03b 100644 (file)
@@ -269,12 +269,14 @@ int main()
                          statt->desc , waitt->desc);
                WriteFile(stdout, buf1, lstrlen(buf1), &r, NULL);
 
-               EnumThreadWindows((DWORD)CurrentProcess->Threads[ti].ClientId.UniqueThread,
+               EnumThreadWindows(PtrToUlong(CurrentProcess->Threads[ti].ClientId.UniqueThread),
                                  (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);
 }
index 9c087c8..b3b3201 100644 (file)
@@ -48,7 +48,7 @@ NtAllocateVirtualMemory(
     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 @@ NTAPI
 NtFreeVirtualMemory(
     IN HANDLE ProcessHandle,
     IN PVOID *BaseAddress,
-    IN PULONG RegionSize,
+    IN PSIZE_T RegionSize,
     IN ULONG FreeType
 );
 
@@ -119,7 +119,7 @@ NtMapViewOfSection(
     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 @@ ZwAllocateVirtualMemory(
     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 @@ NTAPI
 ZwFreeVirtualMemory(
     IN HANDLE ProcessHandle,
     IN PVOID *BaseAddress,
-    IN PULONG RegionSize,
+    IN PSIZE_T RegionSize,
     IN ULONG FreeType
 );
 
@@ -270,7 +270,7 @@ ZwMapViewOfSection(
     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
index 8f14c3e..82b547f 100644 (file)
@@ -35,7 +35,7 @@ CopyLoop (
    NTSTATUS errCode;
    IO_STATUS_BLOCK IoStatusBlock;
    UCHAR *lpBuffer = NULL;
-   ULONG RegionSize = 0x10000;
+   SIZE_T RegionSize = 0x10000;
    LARGE_INTEGER BytesCopied;
    DWORD CallbackReason;
    DWORD ProgressResult;
index d3b1794..6a85bb8 100644 (file)
@@ -22,7 +22,7 @@
 LPVOID STDCALL
 VirtualAllocEx(HANDLE hProcess,
               LPVOID lpAddress,
-              DWORD dwSize,
+              SIZE_T dwSize,
               DWORD flAllocationType,
               DWORD flProtect)
 {
@@ -31,7 +31,7 @@ VirtualAllocEx(HANDLE hProcess,
   Status = NtAllocateVirtualMemory(hProcess,
                                   (PVOID *)&lpAddress,
                                   0,
-                                  (PULONG)&dwSize,
+                                  &dwSize,
                                   flAllocationType,
                                   flProtect);
   if (!NT_SUCCESS(Status))
@@ -48,7 +48,7 @@ VirtualAllocEx(HANDLE hProcess,
  */
 LPVOID STDCALL
 VirtualAlloc(LPVOID lpAddress,
-            DWORD dwSize,
+            SIZE_T dwSize,
             DWORD flAllocationType,
             DWORD flProtect)
 {
@@ -66,7 +66,7 @@ VirtualAlloc(LPVOID lpAddress,
 BOOL STDCALL
 VirtualFreeEx(HANDLE hProcess,
              LPVOID lpAddress,
-             DWORD dwSize,
+             SIZE_T dwSize,
              DWORD dwFreeType)
 {
   NTSTATUS Status;
@@ -89,7 +89,7 @@ VirtualFreeEx(HANDLE hProcess,
  */
 BOOL STDCALL
 VirtualFree(LPVOID lpAddress,
-           DWORD dwSize,
+           SIZE_T dwSize,
            DWORD dwFreeType)
 {
   return(VirtualFreeEx(GetCurrentProcess(),
@@ -104,7 +104,7 @@ VirtualFree(LPVOID lpAddress,
  */
 BOOL STDCALL
 VirtualProtect(LPVOID lpAddress,
-              DWORD dwSize,
+              SIZE_T dwSize,
               DWORD flNewProtect,
               PDWORD lpflOldProtect)
 {
@@ -122,7 +122,7 @@ VirtualProtect(LPVOID lpAddress,
 BOOL STDCALL
 VirtualProtectEx(HANDLE hProcess,
                 LPVOID lpAddress,
-                DWORD dwSize,
+                SIZE_T dwSize,
                 DWORD flNewProtect,
                 PDWORD lpflOldProtect)
 {
@@ -147,7 +147,7 @@ VirtualProtectEx(HANDLE hProcess,
  */
 BOOL STDCALL
 VirtualLock(LPVOID lpAddress,
-           DWORD dwSize)
+           SIZE_T dwSize)
 {
   ULONG BytesLocked;
   NTSTATUS Status;
@@ -171,7 +171,7 @@ VirtualLock(LPVOID lpAddress,
 DWORD STDCALL
 VirtualQuery(LPCVOID lpAddress,
             PMEMORY_BASIC_INFORMATION lpBuffer,
-            DWORD dwLength)
+            SIZE_T dwLength)
 {
   return(VirtualQueryEx(NtCurrentProcess(),
                        lpAddress,
@@ -187,7 +187,7 @@ DWORD STDCALL
 VirtualQueryEx(HANDLE hProcess,
               LPCVOID lpAddress,
               PMEMORY_BASIC_INFORMATION lpBuffer,
-              DWORD dwLength)
+              SIZE_T dwLength)
 {
   NTSTATUS Status;
   ULONG ResultLength;
@@ -212,7 +212,7 @@ VirtualQueryEx(HANDLE hProcess,
  */
 BOOL STDCALL
 VirtualUnlock(LPVOID lpAddress,
-             DWORD dwSize)
+             SIZE_T dwSize)
 {
   ULONG BytesLocked;
   NTSTATUS Status;
index 520fc4c..9a064b2 100644 (file)
@@ -95,7 +95,7 @@ static VOID
 TH32FreeAllocatedResources(PRTL_DEBUG_BUFFER HeapDebug,
                            PRTL_DEBUG_BUFFER ModuleDebug,
                            PVOID ProcThrdInfo,
-                           ULONG ProcThrdInfoSize)
+                           SIZE_T ProcThrdInfoSize)
 {
   if(HeapDebug != NULL)
   {
@@ -121,7 +121,7 @@ TH32CreateSnapshot(DWORD dwFlags,
                    PRTL_DEBUG_BUFFER *HeapDebug,
                    PRTL_DEBUG_BUFFER *ModuleDebug,
                    PVOID *ProcThrdInfo,
-                   ULONG *ProcThrdInfoSize)
+                   SIZE_T *ProcThrdInfoSize)
 {
   NTSTATUS Status = STATUS_SUCCESS;
 
@@ -1115,7 +1115,7 @@ CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID)
 {
   PRTL_DEBUG_BUFFER HeapDebug, ModuleDebug;
   PVOID ProcThrdInfo;
-  ULONG ProcThrdInfoSize;
+  SIZE_T ProcThrdInfoSize;
   NTSTATUS Status;
   HANDLE hSnapShotSection = NULL;
 
index d2ca836..7527b15 100644 (file)
@@ -366,7 +366,7 @@ BasepInitializeEnvironment(HANDLE ProcessHandle,
     NTSTATUS Status;
     PWCHAR ScanChar;
     ULONG EnviroSize;
-    ULONG Size;
+    SIZE_T Size;
     UNICODE_STRING Desktop, Shell, Runtime, Title;
     PPEB OurPeb = NtCurrentPeb();
     LPVOID Environment = lpEnvironment;
index bc33809..e8ee5c8 100644 (file)
@@ -22,12 +22,12 @@ RtlCreateQueryDebugBuffer(IN ULONG Size,
 {
    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))
index e639dd2..f1c5bc5 100644 (file)
@@ -291,10 +291,10 @@ HEAP_Commit(SUBHEAP *subheap,
             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 @@ static void HEAP_ShrinkBlock(SUBHEAP *subheap, ARENA_INUSE *pArena, ULONG size)
  *           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 BOOLEAN HEAP_InitSubHeap( HEAP *heap, PVOID address, ULONG flags,
 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 @@ HEAP_CreateSubHeap(PVOID BaseAddress,
  * 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;
index 537a696..1df2335 100644 (file)
@@ -1277,9 +1277,9 @@ MmAlterRegion(
 
 VOID
 NTAPI
-MmInitialiseRegion(
+MmInitializeRegion(
     PLIST_ENTRY RegionListHead,
-    ULONG Length,
+    SIZE_T Length,
     ULONG Type,
     ULONG Protect
 );
index ce712ef..ada3859 100644 (file)
@@ -114,6 +114,7 @@ static const ULARGE_INTEGER __emptyULargeInteger = {{0, 0}};
 #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 @@ static const ULARGE_INTEGER __emptyULargeInteger = {{0, 0}};
 #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)
index d6d606a..98cc57a 100644 (file)
@@ -747,7 +747,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
    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) &&
index 3ce0029..45d2631 100644 (file)
@@ -61,7 +61,7 @@ MiCreatePebOrTeb(PEPROCESS Process,
     } 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 @@ MmCreatePeb(PEPROCESS Process)
 {
     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 @@ MmCreateProcessAddressSpace(IN PEPROCESS Process,
     PVOID BaseAddress;
     PMEMORY_AREA MemoryArea;
     PHYSICAL_ADDRESS BoundaryAddressMultiple;
-    ULONG ViewSize = 0;
+    SIZE_T ViewSize = 0;
     PVOID ImageBase = 0;
     BoundaryAddressMultiple.QuadPart = 0;
 
index fc553fb..5102cf3 100644 (file)
@@ -239,7 +239,7 @@ MmAlterRegion(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress,
 
 VOID
 NTAPI
-MmInitialiseRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type,
+MmInitializeRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type,
                    ULONG Protect)
 {
    PMM_REGION Region;
index db2b703..ac8895e 100644 (file)
@@ -3488,7 +3488,7 @@ MmMapViewOfSegment(PMADDRESS_SPACE AddressSpace,
                    PSECTION_OBJECT Section,
                    PMM_SECTION_SEGMENT Segment,
                    PVOID* BaseAddress,
-                   ULONG ViewSize,
+                   SIZE_T ViewSize,
                    ULONG Protect,
                    ULONG ViewOffset,
                    ULONG AllocationType)
@@ -3521,7 +3521,7 @@ MmMapViewOfSegment(PMADDRESS_SPACE AddressSpace,
    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 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
                    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 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
          ProbeForWriteLargeInteger(SectionOffset);
          SafeSectionOffset = *SectionOffset;
        }
-       ProbeForWriteUlong(ViewSize);
+       ProbeForWriteSize_t(ViewSize);
        SafeViewSize = *ViewSize;
      }
      _SEH_HANDLE
@@ -4404,7 +4404,7 @@ MmMapViewOfSection(IN PVOID SectionObject,
                    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)
index a9382b0..5f75325 100644 (file)
@@ -400,7 +400,7 @@ PspMapSystemDll(PEPROCESS Process,
                 PVOID *DllBase)
 {
     NTSTATUS Status;
-    ULONG ViewSize = 0;
+    SIZE_T ViewSize = 0;
     PVOID ImageBase = 0;
 
     /* Map the System DLL */
index 298b340..53e3ce8 100644 (file)
@@ -1898,16 +1898,16 @@ BOOL WINAPI UpdateResourceA(HANDLE,LPCSTR,LPCSTR,WORD,PVOID,DWORD);
 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);
index 1adf926..d4bcabe 100644 (file)
@@ -249,7 +249,9 @@ typedef CONST void *PCVOID,*LPCVOID;
 typedef int INT;
 typedef unsigned int UINT,*PUINT,*LPUINT;
 
+#ifndef NT_INCLUDED
 #include <winnt.h>
+#endif
 
 typedef UINT_PTR WPARAM;
 typedef LONG_PTR LPARAM;