Author: fireball
Date: Wed May 21 11:10:00 2008
New Revision: 33623
URL:
http://svn.reactos.org/svn/reactos?rev=33623&view=rev
Log:
Stefan Ginsberg <stefan__100__(a)hotmail.com>
- Fix NtFlushVirtualMemory definition in PSDK.
- Fix NtFlushVirtualMemory's usage in kernel32.
- Fix FlushViewOfFile's prototype (DWORD -> SIZE_T, as it is in PlatformSDK).
- Add a C_ASSERT definition to winnt.h.
- Change a meaningless ASSERT to a C_ASSERT.
Modified:
trunk/reactos/dll/win32/kernel32/mem/local.c
trunk/reactos/dll/win32/kernel32/mem/section.c
trunk/reactos/include/psdk/winbase.h
trunk/reactos/include/psdk/winnt.h
trunk/reactos/include/psdk/winternl.h
Modified: trunk/reactos/dll/win32/kernel32/mem/local.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/loc…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/local.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/local.c [iso-8859-1] Wed May 21 11:10:00 2008
@@ -255,7 +255,7 @@
LocalLock(HLOCAL hMem)
{
/* This is the same as a GlobalLock, assuming these never change */
- ASSERT(LMEM_LOCKCOUNT == GMEM_LOCKCOUNT);
+ C_ASSERT(LMEM_LOCKCOUNT == GMEM_LOCKCOUNT);
return GlobalLock(hMem);
}
Modified: trunk/reactos/dll/win32/kernel32/mem/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/sec…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/section.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/section.c [iso-8859-1] Wed May 21 11:10:00 2008
@@ -353,16 +353,20 @@
BOOL
NTAPI
FlushViewOfFile(LPCVOID lpBaseAddress,
- DWORD dwNumberOfBytesToFlush)
-{
- NTSTATUS Status;
- ULONG NumberOfBytesFlushed;
+ SIZE_T dwNumberOfBytesToFlush)
+{
+ SIZE_T NumberOfBytesToFlush;
+ NTSTATUS Status;
+ IO_STATUS_BLOCK IoStatusBlock;
+
+ /* Save amount of bytes to flush to a local var */
+ NumberOfBytesToFlush = dwNumberOfBytesToFlush;
/* Flush the view */
Status = NtFlushVirtualMemory(NtCurrentProcess(),
(LPVOID)lpBaseAddress,
- dwNumberOfBytesToFlush,
- &NumberOfBytesFlushed);
+ &NumberOfBytesToFlush,
+ &IoStatusBlock);
if (!NT_SUCCESS(Status))
{
/* We failed */
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] Wed May 21 11:10:00 2008
@@ -1398,7 +1398,7 @@
#endif
BOOL WINAPI FlushFileBuffers(HANDLE);
BOOL WINAPI FlushInstructionCache(HANDLE,PCVOID,DWORD);
-BOOL WINAPI FlushViewOfFile(PCVOID,DWORD);
+BOOL WINAPI FlushViewOfFile(PCVOID,SIZE_T);
DWORD WINAPI FlsAlloc(PFLS_CALLBACK_FUNCTION);
PVOID WINAPI FlsGetValue(DWORD);
BOOL WINAPI FlsSetValue(DWORD,PVOID);
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=3…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Wed May 21 11:10:00 2008
@@ -237,6 +237,13 @@
typedef BYTE FCHAR;
typedef WORD FSHORT;
typedef DWORD FLONG;
+
+#define __C_ASSERT_JOIN(X, Y) __C_ASSERT_DO_JOIN(X, Y)
+#define __C_ASSERT_DO_JOIN(X, Y) __C_ASSERT_DO_JOIN2(X, Y)
+#define __C_ASSERT_DO_JOIN2(X, Y) X##Y
+
+#define C_ASSERT(e) typedef char __C_ASSERT_JOIN(__C_ASSERT__, __LINE__)[(e) ? 1 : -1]
+
#ifdef __GNUC__
#include "intrin.h"
Modified: trunk/reactos/include/psdk/winternl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winternl.h?re…
==============================================================================
--- trunk/reactos/include/psdk/winternl.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winternl.h [iso-8859-1] Wed May 21 11:10:00 2008
@@ -1739,7 +1739,7 @@
NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
NTSTATUS WINAPI NtFlushKey(HANDLE);
-NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
+NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,PIO_STATUS_BLOCK);
NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
NTSTATUS WINAPI
NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);