Author: tfaber
Date: Sat Nov 5 09:07:39 2011
New Revision: 54295
URL:
http://svn.reactos.org/svn/reactos?rev=54295&view=rev
Log:
[PSDK][KERNEL32]
- Fix some DWORD vs SIZE_T confusion for memory functions
Modified:
trunk/reactos/dll/win32/kernel32/client/heapmem.c
trunk/reactos/dll/win32/kernel32/client/virtmem.c
trunk/reactos/include/psdk/winbase.h
Modified: trunk/reactos/dll/win32/kernel32/client/heapmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/heapmem.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/heapmem.c [iso-8859-1] Sat Nov 5 09:07:39
2011
@@ -43,8 +43,8 @@
HANDLE
WINAPI
HeapCreate(DWORD flOptions,
- DWORD dwInitialSize,
- DWORD dwMaximumSize)
+ SIZE_T dwInitialSize,
+ SIZE_T dwMaximumSize)
{
HANDLE hRet;
ULONG Flags;
@@ -366,7 +366,7 @@
HGLOBAL
NTAPI
GlobalAlloc(UINT uFlags,
- DWORD dwBytes)
+ SIZE_T dwBytes)
{
ULONG Flags = 0;
PVOID Ptr = NULL;
@@ -823,7 +823,7 @@
HGLOBAL
NTAPI
GlobalReAlloc(HGLOBAL hMem,
- DWORD dwBytes,
+ SIZE_T dwBytes,
UINT uFlags)
{
PBASE_HEAP_HANDLE_ENTRY HandleEntry;
@@ -1085,7 +1085,7 @@
/*
* @implemented
*/
-DWORD
+SIZE_T
NTAPI
GlobalSize(HGLOBAL hMem)
{
Modified: trunk/reactos/dll/win32/kernel32/client/virtmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/virtmem.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/virtmem.c [iso-8859-1] Sat Nov 5 09:07:39
2011
@@ -27,7 +27,7 @@
IN DWORD flProtect)
{
NTSTATUS Status;
-
+
/* Make sure the address is within the granularity of the system (64K) */
if ((lpAddress) &&
(lpAddress < (PVOID)BaseStaticServerData->SysInfo.AllocationGranularity))
@@ -36,7 +36,7 @@
SetLastError(ERROR_INVALID_PARAMETER);
return NULL;
}
-
+
/* Handle any possible exceptions */
_SEH2_TRY
{
@@ -53,7 +53,7 @@
Status = _SEH2_GetExceptionCode();
}
_SEH2_END;
-
+
/* Check for status */
if (!NT_SUCCESS(Status))
{
@@ -193,7 +193,7 @@
IN SIZE_T dwSize)
{
NTSTATUS Status;
- ULONG RegionSize = dwSize;
+ SIZE_T RegionSize = dwSize;
PVOID BaseAddress = lpAddress;
/* Lock the memory */
@@ -215,7 +215,7 @@
/*
* @implemented
*/
-DWORD
+SIZE_T
NTAPI
VirtualQuery(IN LPCVOID lpAddress,
OUT PMEMORY_BASIC_INFORMATION lpBuffer,
@@ -231,7 +231,7 @@
/*
* @implemented
*/
-DWORD
+SIZE_T
NTAPI
VirtualQueryEx(IN HANDLE hProcess,
IN LPCVOID lpAddress,
@@ -239,7 +239,7 @@
IN SIZE_T dwLength)
{
NTSTATUS Status;
- ULONG ResultLength;
+ SIZE_T ResultLength;
/* Query basic information */
Status = NtQueryVirtualMemory(hProcess,
@@ -268,9 +268,9 @@
IN SIZE_T dwSize)
{
NTSTATUS Status;
- ULONG RegionSize = dwSize;
+ SIZE_T RegionSize = dwSize;
PVOID BaseAddress = lpAddress;
-
+
/* Lock the memory */
Status = NtUnlockVirtualMemory(NtCurrentProcess(),
&BaseAddress,
Modified: trunk/reactos/include/psdk/winbase.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Sat Nov 5 09:07:39 2011
@@ -998,12 +998,12 @@
typedef struct _MEMORYSTATUS {
DWORD dwLength;
DWORD dwMemoryLoad;
- DWORD dwTotalPhys;
- DWORD dwAvailPhys;
- DWORD dwTotalPageFile;
- DWORD dwAvailPageFile;
- DWORD dwTotalVirtual;
- DWORD dwAvailVirtual;
+ SIZE_T dwTotalPhys;
+ SIZE_T dwAvailPhys;
+ SIZE_T dwTotalPageFile;
+ SIZE_T dwAvailPageFile;
+ SIZE_T dwTotalVirtual;
+ SIZE_T dwAvailVirtual;
} MEMORYSTATUS,*LPMEMORYSTATUS;
#if (_WIN32_WINNT >= 0x0500)
@@ -1755,7 +1755,7 @@
UINT WINAPI GetWriteWatch(DWORD,PVOID,SIZE_T,PVOID*,PULONG_PTR,PULONG);
ATOM WINAPI GlobalAddAtomA(LPCSTR);
ATOM WINAPI GlobalAddAtomW( LPCWSTR);
-HGLOBAL WINAPI GlobalAlloc(UINT,DWORD);
+HGLOBAL WINAPI GlobalAlloc(UINT,SIZE_T);
SIZE_T WINAPI GlobalCompact(DWORD); /* Obsolete: Has no effect. */
ATOM WINAPI GlobalDeleteAtom(ATOM);
#define GlobalDiscard(m) GlobalReAlloc((m),0,GMEM_MOVEABLE)
@@ -1772,8 +1772,8 @@
#if (_WIN32_WINNT >= 0x0500)
BOOL WINAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX);
#endif
-HGLOBAL WINAPI GlobalReAlloc(HGLOBAL,DWORD,UINT);
-DWORD WINAPI GlobalSize(HGLOBAL);
+HGLOBAL WINAPI GlobalReAlloc(HGLOBAL,SIZE_T,UINT);
+SIZE_T WINAPI GlobalSize(HGLOBAL);
VOID WINAPI GlobalUnfix(HGLOBAL); /* Obsolete: Has no effect. */
BOOL WINAPI GlobalUnlock(HGLOBAL);
BOOL WINAPI GlobalUnWire(HGLOBAL); /* Obsolete: Has no effect. */
@@ -1781,14 +1781,14 @@
#define HasOverlappedIoCompleted(lpOverlapped) ((lpOverlapped)->Internal !=
STATUS_PENDING)
PVOID WINAPI HeapAlloc(HANDLE,DWORD,SIZE_T);
SIZE_T WINAPI HeapCompact(HANDLE,DWORD);
-HANDLE WINAPI HeapCreate(DWORD,DWORD,DWORD);
+HANDLE WINAPI HeapCreate(DWORD,SIZE_T,SIZE_T);
BOOL WINAPI HeapDestroy(HANDLE);
BOOL WINAPI HeapFree(HANDLE,DWORD,PVOID);
BOOL WINAPI HeapLock(HANDLE);
#if (_WIN32_WINNT >= 0x0501)
BOOL WINAPI HeapQueryInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
#endif
-PVOID WINAPI HeapReAlloc(HANDLE,DWORD,PVOID,DWORD);
+PVOID WINAPI HeapReAlloc(HANDLE,DWORD,PVOID,SIZE_T);
#if (_WIN32_WINNT >= 0x0501)
BOOL WINAPI HeapSetInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
#endif
@@ -2288,8 +2288,8 @@
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);
+SIZE_T WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T);
+SIZE_T 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);