Author: sginsberg
Date: Sun Jan 25 10:13:16 2009
New Revision: 39092
URL:
http://svn.reactos.org/svn/reactos?rev=39092&view=rev
Log:
- Deprecate global helper.h -- define the various 'helpful macros' per module
Removed:
trunk/reactos/include/reactos/helper.h
Modified:
trunk/reactos/base/setup/usetup/usetup.h
trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
trunk/reactos/dll/directx/ksuser/ksuser.h
trunk/reactos/dll/ntdll/include/ntdll.h
trunk/reactos/dll/ntdll/ldr/utils.c
trunk/reactos/dll/win32/kernel32/file/iocompl.c
trunk/reactos/dll/win32/kernel32/include/kernel32.h
trunk/reactos/dll/win32/kernel32/k32.h
trunk/reactos/dll/win32/kernel32/misc/version.c
trunk/reactos/drivers/filesystems/fastfat/vfat.h
trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h
trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c
trunk/reactos/drivers/video/videoprt/videoprt.h
trunk/reactos/hal/halarm/include/hal.h
trunk/reactos/hal/halppc/include/hal.h
trunk/reactos/hal/halx86/include/hal.h
trunk/reactos/lib/fslib/vfatlib/check/vfat.h
trunk/reactos/lib/ppcmmu/mmuobject.c
trunk/reactos/lib/rtl/env.c
trunk/reactos/lib/rtl/image.c
trunk/reactos/lib/rtl/ppb.c
trunk/reactos/lib/rtl/rtl.h
trunk/reactos/lib/rtl/rtlp.h
trunk/reactos/lib/sdk/crt/precomp.h
trunk/reactos/lib/sdk/crt/stdlib/malloc.c
trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
trunk/reactos/ntoskrnl/include/precomp.h
trunk/reactos/subsystems/win32/win32k/pch.h
Modified: trunk/reactos/base/setup/usetup/usetup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -44,9 +44,6 @@
/* DDK Disk Headers */
#include <ntddscsi.h>
-
-/* Helper Header */
-#include <reactos/helper.h>
/* ReactOS Version */
#include <reactos/buildno.h>
@@ -125,6 +122,34 @@
#define POPUP_WAIT_ANY_KEY 1
#define POPUP_WAIT_ENTER 2
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
+
+#define LIST_FOR_EACH(elem, list, type, field) \
+ for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
+ &(elem)->field != (list) || (elem == NULL); \
+ (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
+
+#define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\
+{\
+ PLIST_ENTRY current;\
+\
+ current = (ListHead)->Flink;\
+ while (current != (ListHead))\
+ {\
+ if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
+ (NewEntry)->SortField)\
+ {\
+ break;\
+ }\
+ current = current->Flink;\
+ }\
+\
+ InsertTailList(current, &((NewEntry)->ListEntryField));\
+}
#endif /* __USETUP_H__*/
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Sun Jan 25 10:13:16
2009
@@ -21,6 +21,13 @@
#define __FREELDR_H
#define UINT64_C(val) val##ULL
+#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
+
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
#define NTOSAPI
#define printf TuiPrintf
@@ -94,7 +101,6 @@
/* Externals */
#include <reactos/rossym.h>
#include <reactos/buildno.h>
-#include <reactos/helper.h>
/* Needed if debuging is enabled */
#include <comm.h>
/* Swap */
Modified: trunk/reactos/dll/directx/ksuser/ksuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksuser/ksuser.…
==============================================================================
--- trunk/reactos/dll/directx/ksuser/ksuser.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksuser/ksuser.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -9,7 +9,6 @@
#include <ks.h>
-#include <reactos/helper.h>
LPVOID
__stdcall
@@ -19,4 +18,10 @@
DWORD dwBytes
);
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
+
#endif
Modified: trunk/reactos/dll/ntdll/include/ntdll.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/include/ntdll.h?…
==============================================================================
--- trunk/reactos/dll/ntdll/include/ntdll.h [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/include/ntdll.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -32,7 +32,4 @@
/* CSRSS Header */
#include <csrss/csrss.h>
-/* Helper Macros */
-#include <reactos/helper.h>
-
/* EOF */
Modified: trunk/reactos/dll/ntdll/ldr/utils.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/utils.c?rev=…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -22,6 +22,7 @@
#include <debug.h>
#define LDRP_PROCESS_CREATION_TIME 0x8000000
+#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
/* GLOBALS *******************************************************************/
Modified: trunk/reactos/dll/win32/kernel32/file/iocompl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/io…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/iocompl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/iocompl.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -12,6 +12,10 @@
#include <k32.h>
#include <wine/debug.h>
+#define NANOS_TO_100NS(nanos) (((LONGLONG)(nanos)) / 100)
+#define MICROS_TO_100NS(micros) (((LONGLONG)(micros)) * NANOS_TO_100NS(1000))
+#define MILLIS_TO_100NS(milli) (((LONGLONG)(milli)) * MICROS_TO_100NS(1000))
+
WINE_DEFAULT_DEBUG_CHANNEL(kernel32file);
/*
@@ -110,7 +114,7 @@
if (dwMilliseconds != INFINITE)
{
- Interval.QuadPart = RELATIVE_TIME(MILLIS_TO_100NS(dwMilliseconds));
+ Interval.QuadPart = (-(MILLIS_TO_100NS(dwMilliseconds)));
}
errCode = NtRemoveIoCompletion(CompletionHandle,
Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sun Jan 25 10:13:16
2009
@@ -20,6 +20,12 @@
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
+
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
#ifndef FIELD_OFFSET
#define FIELD_OFFSET(type,fld) ((LONG)&(((type *)0)->fld))
Modified: trunk/reactos/dll/win32/kernel32/k32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/k32.h?r…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/k32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/k32.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -41,7 +41,4 @@
/* PSEH for SEH Support */
#include <pseh/pseh2.h>
-/* Helper Header */
-#include <reactos/helper.h>
-
#endif
Modified: trunk/reactos/dll/win32/kernel32/misc/version.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ve…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/version.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/version.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -15,6 +15,8 @@
#define NDEBUG
#include <debug.h>
+#define UNICODIZE1(x) L##x
+#define UNICODIZE(x) UNICODIZE1(x)
/* FUNCTIONS ******************************************************************/
Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Sun Jan 25 10:13:16
2009
@@ -1,6 +1,5 @@
#include <ntifs.h>
#include <ntdddisk.h>
-#include <reactos/helper.h>
#include <debug.h>
#ifdef __GNUC__
@@ -13,6 +12,12 @@
#define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
#define ROUND_UP(N, S) ROUND_DOWN((N) + (S) - 1, (S))
#endif
+
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
#include <pshpack1.h>
struct _BootSector
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] Sun Jan 25
10:13:16 2009
@@ -1,6 +1,5 @@
#include <ntifs.h>
#include <ntdddisk.h>
-#include <reactos/helper.h>
#include <debug.h>
#ifndef TAG
Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramd…
==============================================================================
--- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] Sun Jan 25 10:13:16
2009
@@ -17,7 +17,6 @@
#include <ntddvol.h>
#include <mountdev.h>
#include <mountmgr.h>
-#include <helper.h>
#include <ketypes.h>
#include <iotypes.h>
#include <rtlfuncs.h>
Modified: trunk/reactos/drivers/video/videoprt/videoprt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/vid…
==============================================================================
--- trunk/reactos/drivers/video/videoprt/videoprt.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/videoprt/videoprt.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -31,7 +31,6 @@
#include <ntagp.h>
#include <ntifs.h>
#include <ndk/ntndk.h>
-#include <reactos/helper.h>
#include <dderror.h>
#include <windef.h>
Modified: trunk/reactos/hal/halarm/include/hal.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/include/hal.h?r…
==============================================================================
--- trunk/reactos/hal/halarm/include/hal.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halarm/include/hal.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -37,7 +37,4 @@
/* Internal HAL Headers */
#include "halp.h"
-/* Helper Header */
-#include <reactos/helper.h>
-
/* EOF */
Modified: trunk/reactos/hal/halppc/include/hal.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halppc/include/hal.h?r…
==============================================================================
--- trunk/reactos/hal/halppc/include/hal.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halppc/include/hal.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -47,7 +47,4 @@
#include "mps.h"
#include "ioapic.h"
-/* Helper Header */
-#include <reactos/helper.h>
-
/* EOF */
Modified: trunk/reactos/hal/halx86/include/hal.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/hal.h?r…
==============================================================================
--- trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -46,7 +46,4 @@
#include "mps.h"
#include "ioapic.h"
-/* Helper Header */
-#include <reactos/helper.h>
-
/* EOF */
Removed: trunk/reactos/include/reactos/helper.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/helper.h?r…
==============================================================================
--- trunk/reactos/include/reactos/helper.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/helper.h (removed)
@@ -1,145 +1,0 @@
-#ifndef _HELPER_H
-#define _HELPER_H
-
-#ifndef ROUND_UP
-#define ROUND_UP(n, align) \
- ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
-#endif
-
-#ifndef ROUND_DOWN
-#define ROUND_DOWN(n, align) \
- (((ULONG)n) & ~((align) - 1l))
-#endif
-
-#ifndef ROUNDUP
-#define ROUNDUP ROUND_UP
-#endif
-
-#ifndef ROUNDDOWN
-#define ROUNDDOWN ROUND_DOWN
-#endif
-
-#ifndef PAGE_ROUND_DOWN
-#define PAGE_ROUND_DOWN(x) (((ULONG_PTR)(x))&(~(PAGE_SIZE-1)))
-#endif
-
-#ifndef PAGE_ROUND_UP
-#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)) )
-#endif
-
-/* iterate through the list using a list entry.
- * elem is set to NULL if the list is run thru without breaking out or if list is empty.
- */
-#define LIST_FOR_EACH(elem, list, type, field) \
- for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
- &(elem)->field != (list) || (elem == NULL); \
- (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
-
-/* iterate through the list using a list entry, with safety against removal
- * elem is set to NULL if the list is run thru without breaking out or if list is empty.
- */
-#define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \
- for ((cursor) = CONTAINING_RECORD((list)->Flink, type, field), \
- (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field); \
- &(cursor)->field != (list) || (cursor == NULL); \
- (cursor) = (cursor2), \
- (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field))
-
-#define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a + \
- ((PIMAGE_DOS_HEADER)a)->e_lfanew + \
- sizeof (IMAGE_NT_SIGNATURE) + \
- sizeof (IMAGE_FILE_HEADER)))
-#ifndef TAG
-#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
-#endif
-#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
-#define NTSTAT_SEVERITY_SHIFT 30
-#define NTSTAT_SEVERITY_MASK 0x00000003
-#define NTSTAT_FACILITY_SHIFT 16
-#define NTSTAT_FACILITY_MASK 0x00000FFF
-#define NTSTAT_CUSTOMER_MASK 0x20000000
-#define NT_SEVERITY(StatCode) (((StatCode) >> NTSTAT_SEVERITY_SHIFT) &
NTSTAT_SEVERITY_MASK)
-#define NT_FACILITY(StatCode) (((StatCode) >> NTSTAT_FACILITY_SHIFT) &
NTSTAT_FACILITY_MASK)
-#define NT_CUSTOMER(StatCode) ((StatCode) & NTSTAT_CUSTOMER_MASK)
-#define RELATIVE_TIME(wait) (-(wait))
-#define NANOS_TO_100NS(nanos) (((LONGLONG)(nanos)) / 100)
-#define MICROS_TO_100NS(micros) (((LONGLONG)(micros)) * NANOS_TO_100NS(1000))
-#define MILLIS_TO_100NS(milli) (((LONGLONG)(milli)) * MICROS_TO_100NS(1000))
-#define SECONDS_TO_100NS(seconds) (((LONGLONG)(seconds)) * MILLIS_TO_100NS(1000))
-#define MINUTES_TO_100NS(minutes) (((LONGLONG)(minutes)) * SECONDS_TO_100NS(60))
-#define HOURS_TO_100NS(hours) (((LONGLONG)(hours)) * MINUTES_TO_100NS(60))
-#define UNICODIZE1(x) L##x
-#define UNICODIZE(x) UNICODIZE1(x)
-#define InsertAscendingListFIFO(ListHead, NewEntry, Type, ListEntryField, SortField)\
-{\
- PLIST_ENTRY current;\
-\
- current = (ListHead)->Flink;\
- while (current != (ListHead))\
- {\
- if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >\
- (NewEntry)->SortField)\
- {\
- break;\
- }\
- current = current->Flink;\
- }\
-\
- InsertTailList(current, &((NewEntry)->ListEntryField));\
-}
-
-#define InsertDescendingListFIFO(ListHead, NewEntry, Type, ListEntryField, SortField)\
-{\
- PLIST_ENTRY current;\
-\
- current = (ListHead)->Flink;\
- while (current != (ListHead))\
- {\
- if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <\
- (NewEntry)->SortField)\
- {\
- break;\
- }\
- current = current->Flink;\
- }\
-\
- InsertTailList(current, &((NewEntry)->ListEntryField));\
-}
-
-#define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\
-{\
- PLIST_ENTRY current;\
-\
- current = (ListHead)->Flink;\
- while (current != (ListHead))\
- {\
- if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
- (NewEntry)->SortField)\
- {\
- break;\
- }\
- current = current->Flink;\
- }\
-\
- InsertTailList(current, &((NewEntry)->ListEntryField));\
-}
-
-#define InsertDescendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\
-{\
- PLIST_ENTRY current;\
-\
- current = (ListHead)->Flink;\
- while (current != (ListHead))\
- {\
- if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <=\
- (NewEntry)->SortField)\
- {\
- break;\
- }\
- current = current->Flink;\
- }\
-\
- InsertTailList(current, &((NewEntry)->ListEntryField));\
-}
-
-#endif
Modified: trunk/reactos/lib/fslib/vfatlib/check/vfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/vf…
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/vfat.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/vfat.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -3,7 +3,6 @@
#include <ddk/ntifs.h>
#include <ddk/ntdddisk.h>
#include <ndk/ntndk.h>
-#include <reactos/helper.h>
#include <ccros.h>
#include <limits.h>
#include <debug.h>
Modified: trunk/reactos/lib/ppcmmu/mmuobject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/ppcmmu/mmuobject.c?rev…
==============================================================================
--- trunk/reactos/lib/ppcmmu/mmuobject.c [iso-8859-1] (original)
+++ trunk/reactos/lib/ppcmmu/mmuobject.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -2,7 +2,6 @@
#include "ppcmmu/mmu.h"
#include "ppcmmu/mmuutil.h"
#include "mmuobject.h"
-#include "helper.h"
typedef unsigned long ULONG;
Modified: trunk/reactos/lib/rtl/env.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/env.c?rev=39092&am…
==============================================================================
--- trunk/reactos/lib/rtl/env.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/env.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -368,7 +368,7 @@
/* enlarge environment size */
/* check the size of available memory */
new_size += (env_len - hole_len) * sizeof(WCHAR);
- new_size = ROUNDUP(new_size, PAGE_SIZE);
+ new_size = ROUND_UP(new_size, PAGE_SIZE);
mbi.RegionSize = 0;
DPRINT("new_size %lu\n", new_size);
Modified: trunk/reactos/lib/rtl/image.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/image.c?rev=39092&…
==============================================================================
--- trunk/reactos/lib/rtl/image.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/image.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -15,6 +15,8 @@
#define NDEBUG
#include <debug.h>
+
+#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
/* FUNCTIONS *****************************************************************/
Modified: trunk/reactos/lib/rtl/ppb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/ppb.c?rev=39092&am…
==============================================================================
--- trunk/reactos/lib/rtl/ppb.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/ppb.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -121,7 +121,7 @@
Length += ALIGN(RuntimeData->MaximumLength, sizeof(ULONG));
/* Calculate the required block size */
- RegionSize = ROUNDUP(Length, PAGE_SIZE);
+ RegionSize = ROUND_UP(Length, PAGE_SIZE);
Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
(PVOID*)&Param,
Modified: trunk/reactos/lib/rtl/rtl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.h?rev=39092&am…
==============================================================================
--- trunk/reactos/lib/rtl/rtl.h [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/rtl.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -28,7 +28,6 @@
#include "rtlp.h"
/* PSEH Support */
-#include <reactos/helper.h>
#include <pseh/pseh2.h>
#include <intrin.h>
Modified: trunk/reactos/lib/rtl/rtlp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtlp.h?rev=39092&a…
==============================================================================
--- trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -23,6 +23,12 @@
#define SWAPD(x) x
#define SWAPW(x) x
#endif
+
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
VOID
NTAPI
Modified: trunk/reactos/lib/sdk/crt/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/precomp.h?rev=…
==============================================================================
--- trunk/reactos/lib/sdk/crt/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/precomp.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -28,7 +28,6 @@
#define WIN32_NO_STATUS
#include <windows.h>
#include <ndk/ntndk.h>
-#include <reactos/helper.h>
#if !defined(_MSC_VER)
#include <stdint.h>
Modified: trunk/reactos/lib/sdk/crt/stdlib/malloc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/malloc.…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdlib/malloc.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdlib/malloc.c [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -25,6 +25,11 @@
#include <stdlib.h>
#include <malloc.h>
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
/* round to 16 bytes + alloc at minimum 16 bytes */
#define ROUND_SIZE(size) (max(16, ROUND_UP(size, 16)))
Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Sun Jan 25 10:13:16
2009
@@ -23,6 +23,8 @@
#endif
#undef PsGetCurrentProcess
#define PsGetCurrentProcess _PsGetCurrentProcess
+
+#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
//
// We are very lazy on ARM -- we just import intrinsics
Modified: trunk/reactos/ntoskrnl/include/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/precomp.h…
==============================================================================
--- trunk/reactos/ntoskrnl/include/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/precomp.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -63,9 +63,6 @@
/* PNP GUIDs */
#include <umpnpmgr/sysguid.h>
-/* Helper Header */
-#include <reactos/helper.h>
-
/* Internal Headers */
#include "internal/ntoskrnl.h"
#include "config.h"
Modified: trunk/reactos/subsystems/win32/win32k/pch.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/pc…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] Sun Jan 25 10:13:16 2009
@@ -42,9 +42,6 @@
/* CSRSS Header */
#include <csrss/csrss.h>
-
-/* Helper Header */
-#include <reactos/helper.h>
/* Public Win32K Headers */
#include <win32k/callback.h>
@@ -139,4 +136,22 @@
(ULONG_PTR)W32Process->HeapMappings.UserMapping);
}
+#define ROUND_DOWN(n, align) \
+ (((ULONG)n) & ~((align) - 1l))
+
+#define ROUND_UP(n, align) \
+ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
+
+#define LIST_FOR_EACH(elem, list, type, field) \
+ for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
+ &(elem)->field != (list) || (elem == NULL); \
+ (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
+
+#define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \
+ for ((cursor) = CONTAINING_RECORD((list)->Flink, type, field), \
+ (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field); \
+ &(cursor)->field != (list) || (cursor == NULL); \
+ (cursor) = (cursor2), \
+ (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field))
+
#endif /* __W32K_H */